1 / 36

Topic 6 : Introduction to Operating Systems

Topic 6 : Introduction to Operating Systems. Book Details:. We will use two different books for this course. “Fundamentals of Operating Systems”, A. M. Lister and R. D. Eager, Fifth Edition, Macmillan Computer Science Series, ISBN. 0-333-59848-2, £13.99.

aiden
Télécharger la présentation

Topic 6 : Introduction to Operating Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Topic 6 : Introduction to Operating Systems

  2. Book Details: • We will use two different books for this course. • “Fundamentals of Operating Systems”, A. M. Lister and R. D. Eager, Fifth Edition, Macmillan Computer Science Series, ISBN. 0-333-59848-2, £13.99. • “Operating Systems Design and Implementation”, A. S. Tanenbaum, Prentice-Hall International, ISBN. 0-13-630195-9, about £29.99.

  3. Introduction to Operating Systems L & E: Pages 1-19 Tanenbaum: Pages 1-5, 15-17

  4. Operating SystemsProvide a Virtual Machine Machine Specific Interface Hardware

  5. Operating SystemsProvide a Virtual Machine Operating System Specific Interface O/S Hardware

  6. Operating Systems Also Manage Resources • Share resources between multiple programs and multiple users. • Orderly and controlled allocation of resources • E.g. coordination of printing • Protection • Ensure use of resources is optimised. • E.g Performing useful work when performing slow I/O based tasks.

  7. Applications Software (e.g. packages) System Software (e.g. operating systems) Computer Hardware (e.g. CPU, memory, I/O devices) Operating Systems in Context

  8. Remember the G&L Machine? • Minimal computer built from scratch using logic gates and busses. • Controlled using microcode. • Could run machine code by writing an interpreter in microcode. • E.g interpreting an ADD instruction

  9. A Simple Machine Code Program • This program calculates x*x where x is initially in location 5. Main Memory Address Machine Language Instruction LOAD 5 1 0 0 5 1 MULT 5 0 0 5 2 5 2 0 0 5 5 STORE 3 F F F F 4 STOP 0 0 0 3 5

  10. A Quick Recap on Addressing ... • Four main addressing modes. Load Immediate 1000 Address Contents Load Direct 1000 1000 1234 1050 8765 Load Indexed 1000 1234 5432 Load Indirect 1000 assume index register contains 50

  11. Base and Limit Registers • Effective address is calculated by:- eff. address = address specified + contents of base register • Following assertion must hold for address to be valid:- eff. address < contents of limit register

  12. Shortcomings of Our Machine • Very machine specific code. • No I/O support for programs or data. • No support for multiple users. • No support for multiple programs.

  13. Adding Operating System Support Operating System Specific Interface O/S Hardware

  14. Tackling the Problem of Loading Programs – the Dispatcher • Basic idea is to load the program from disk and start it executing. • When its finished start executing another one. • During its period of execution the program is called a process.

  15. Basic Approach • Sit in a loop waiting for a program to be ready to run. • Load the specified program from disk into memory. • Use base and limit registers to make sure program addresses work. • When the program has finished go back to the loop and wait for another to be ready.

  16. 0 1 2 3 4 5 6 7 8 Program to Start Processes JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  17. Supporting Data Structures BASETABLE: 100 200 300 LIMITTABLE: 199 299 330

  18. Application Programs Main Memory Address Machine Language Instruction NULL 0 #0 LDBASE 1 LOAD 6 2 MULT 6 3 6 4 STORE 5 1 JUMP 6 10

  19. 0 1 2 3 4 5 6 7 8 PTE = 0 Base = 0 Limit = 9999 Index = 0 Demo Acc = 0 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  20. 0 1 2 3 4 5 6 7 8 PTE = 0 Base = 0 Limit = 9999 Index = 0 Demo Acc = 0 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  21. 0 1 2 3 4 5 6 7 8 PTE = 0 Base = 0 Limit = 9999 Index = 0 Demo Acc = 0 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  22. 0 1 2 3 4 5 6 7 8 PTE = 0 Base = 0 Limit = 9999 Index = 0 Demo Acc = 0 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  23. 0 1 2 3 4 5 6 7 8 PTE = 1 Base = 0 Limit = 9999 Index = 0 Demo Acc = 1 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  24. 0 1 2 3 4 5 6 7 8 PTE = 1 Base = 0 Limit = 9999 Index = 0 Demo Acc = 1 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  25. 0 1 2 3 4 5 6 7 8 PTE = 1 Base = 0 Limit = 9999 Index = 1 Demo Acc = 1 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  26. 0 1 2 3 4 5 6 7 8 PTE = 1 Base = 0 Limit = 9999 Index = 1 Demo Acc = 1 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  27. 0 1 2 3 4 5 6 7 8 PTE = 1 Base = 0 Limit = 299 Index = 1 Demo Acc = 1 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  28. 0 1 2 3 4 5 6 7 8 PTE = 1 Base = 0 Limit = 299 Index = 1 Demo Acc = 1 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  29. 0 1 2 3 4 5 6 7 8 PTE = 1 Base = 200 Limit = 299 Index = 1 Demo Acc = 1 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  30. Base = 200 Limit = 299 Index = 1 Demo Acc = 10 Main Memory Address Machine Language Instruction NULL 200 #0 LDBASE 201 LOAD 6 202 MULT 6 203 6 204 STORE 205 1 JUMP 206 10

  31. Base = 200 Limit = 299 Index = 1 Demo Acc = 100 Main Memory Address Machine Language Instruction NULL 200 #0 LDBASE 201 LOAD 6 202 MULT 6 203 6 204 STORE 205 1 JUMP 206 10

  32. Base = 200 Limit = 299 Index = 1 Demo Acc = 100 Main Memory Address Machine Language Instruction NULL 200 #0 LDBASE 201 LOAD 6 202 MULT 6 203 6 204 STORE 205 1 JUMP 206 100

  33. Base = 200 Limit = 299 Index = 1 Demo Acc = 100 Main Memory Address Machine Language Instruction NULL 200 #0 LDBASE 201 LOAD 6 202 MULT 6 203 6 204 STORE 205 1 JUMP 206 100

  34. Base = 0 Limit = 299 Index = 1 Demo Acc = 100 Main Memory Address Machine Language Instruction NULL 200 #0 LDBASE 201 LOAD 6 202 MULT 6 203 6 204 STORE 205 1 JUMP 206 100

  35. 0 1 2 3 4 5 6 7 8 Base = 0 Limit = 299 Index = 1 Demo Acc = 100 JUMP IDLE STARTIT: LDBASE BASETABLE+ IDLE: LDA PTE JNZ DISPATCH JUMP IDLE DISPATCH: STI JUMPSUB LOADIT LDLIMIT LIMITTABLE+ JUMP STARTIT

  36. Summary • It is possible to write a simple program to load programs and start them running as processes. • This forms part of a machine’s operating system which aims to provide abstraction over the basic machine hardware.

More Related