comp 3713 operating systems slides part 1
play

COMP 3713 Operating Systems Slides Part 1 Jim Diamond CAR 409 - PowerPoint PPT Presentation

COMP 3713 Operating Systems Slides Part 1 Jim Diamond CAR 409 Jodrey School of Computer Science Acadia University Acknowledgements These slides borrow from those prepared for Operating System Concepts (eighth edition) by


  1. COMP 3713 — Operating Systems Slides Part 1 Jim Diamond CAR 409 Jodrey School of Computer Science Acadia University

  2. Acknowledgements These slides borrow from those prepared for “Operating System Concepts” (eighth edition) by Silberschatz, Galvin and Gagne. These slides borrow lightly from those prepared for COMP 3713 by Dr. Darcy Benoit.

  3. Chapter 0 Preliminaries Jim Diamond, Jodrey School of Computer Science, Acadia University

  4. Chapter 0 1 General Information Read course outline at • http://cs.acadiau.ca/~jdiamond/comp3713/comp3713.pdf Getting help • – ask questions in class! – my office hours (CAR 409): MWF 8:30–9:30, other times TBA and/or by appointment – these are subject to change! I’ll let you know if they do. – if you need to see me at other times, e-mail or phone me and we can set up a meeting time – the TA contact hours (if desired!) shall be announced RSN ANYTHING discussed in class is fair game for assignments and exams • Even if it is not in these slides! – in other words, these slides are not the be-all and end-all of mankind’s knowledge of operating systems – the fine art of taking notes will likely prove profitable Jim Diamond, Jodrey School of Computer Science, Acadia University

  5. Chapter 0 2 Reference Materials Main text: Operating System Concepts by Silberschatz, Galvin and • Gagne (2012, 9th edition) – see also http://codex.cs.yale.edu/avi/os-book/OS9/ errata-dir/os9c-errata.pdf Reference: UNIX Systems Programming , by Haviland, Gray and Salama • (1999, 2nd edition) – this should be on reserve in the library RSN To refresh your memory of computer architecture: Principles of • Computer Hardware by Alan Clements – or any of the many computer architecture books in the library Jim Diamond, Jodrey School of Computer Science, Acadia University

  6. Chapter 0 3 Background Knowledge Writing, compiling and running C programs under Linux • – how to do I/O using printf() , putchar() , getchar() , and so on – how to use command-line arguments Basic Linux/Unix information • – using a shell common useful commands (e.g., ls , cp , mv , rm , ln , diff , man , – grep , mkdir , less , cat , head , tail , . . . ) – knowing how to use a real editor will be useful Computer architecture • – cache memory (VERY important) – interrupts – buses (not “busses”) and I/O structures Jim Diamond, Jodrey School of Computer Science, Acadia University

  7. Chapter 0 4 Course Overview Overall structure and purposes of operating systems • Relationship between OS and hardware • – memory management: real and virtual memory device management (I/O devices, CPU scheduling, . . . ) – – I/O – interrupts Relationship between OS and software • – process management; threads; synchronization – system calls – I/O – files and file systems – pipes and other inter-process communication Jim Diamond, Jodrey School of Computer Science, Acadia University

  8. Chapter 1 Introduction Jim Diamond, Jodrey School of Computer Science, Acadia University

  9. Chapter 1 5 What (exactly) is an OS? A traffic cop? • – direct traffic in an safe, orderly way A government? • – provide basic services, but otherwise try to stay out of the way There are different view points • – user view – what can the OS do for me? – system view – how can the system hardware be controlled? There are different goals • – user: make my life as wonderful as possible, at all costs – system: use system resources efficiently – computer systems used to cost tens of millions of dollars – in such a scenario, you did not want to waste the computer’s precious time Jim Diamond, Jodrey School of Computer Science, Acadia University

  10. Chapter 1 6 Abstract View #1 of an OS Note that, in general, multiple users may be using the computer • concurrently Q: what system(s) do you use which are shared (concurrently) with • other users? Jim Diamond, Jodrey School of Computer Science, Acadia University

  11. Chapter 1 7 Exactly What Makes Up the OS? There is no universal agreement • – is the GUI in MS-widnoze part of the OS? – should it be? – how about MS-IE? – should it be? – Not according to the U.S. Dept. of Justice! The program which is always running is called the kernel • – many people say this is the OS But many OS’s use auxiliary programs called daemons to perform • various functions – these daemons appear and disappear as required – so are they part of the OS? Jim Diamond, Jodrey School of Computer Science, Acadia University

  12. Chapter 1 8 Types of OS’s, Now and Then: 1 Originally, computers ran one (batch) program at a time • – wasteful of a hugely expensive resource: the CPU sits idle 70% of the time waiting for I/O according to studies Multiprogramming: allow multiple programs to run concurrently • – while program 1 is waiting for I/O, the CPU may be able to execute program 2 Time sharing: allow users to directly interact with the computer via • computer terminals Workstations, personal computers: (relatively) inexpensive computers • could be allocated for the use of a single person – an OS for such a system might be different than for a mainframe shared by many users (how? why?) Parallel systems: have more than one CPU (or ALU!) inside a system to • increase performance AND utilization of the rest of the system – symmetric vs. asymmetric (master-slave) multiprocessing Jim Diamond, Jodrey School of Computer Science, Acadia University

  13. Chapter 1 9 Types of OS’s, Now and Then: 2 Distributed systems: systems made up computers which are not • necessarily co-located Real-time systems • – used where a response to an event should/must be completed by a certain time – (sub)types: soft real-time and hard real-time – soft: if response is not in time, the results are not catastrophic – airline reservation system (annoyed customers) – digital audio recording (drop-outs) – hard: Bad Things may happen if results are not performed in time – airliner auto-land system – self-defence systems on military platforms medical devices (read safety-critical.html ) – – (some) robotic systems (e.g., surgery assistant robots) – hard real-time systems are usually not “general-purpose” systems Jim Diamond, Jodrey School of Computer Science, Acadia University

  14. Chapter 1 10 System Boot Operating system must be made available to hardware so hardware can • start it – a small piece of code, the bootstrap loader , locates the kernel, loads it into memory, and starts it – sometimes it is a two-step process, where the boot block , at some fixed location, has the code to load a bootstrap loader – when power is initialized on the system, execution starts at a fixed memory location – firmware is used to hold initial boot code Jim Diamond, Jodrey School of Computer Science, Acadia University

  15. Chapter 1 11 The OS as a Resource Manager For a single-program batch system, the OS had little to do • – load a program and start it – “talk” to I/O devices – clean up when a program finishes Time-sharing: much more complex • – divide the memory amongst competing programs – enforce protection: one program shouldn’t be able to clobber another (really the “traffic cop” duty) – share the resources fairly allow all tasks to receive some CPU time, but . . . – – give higher CPU priority to interactive tasks than to batch tasks – enforce limits on mass storage devices – provide facilities to allow multiple tasks to use devices which are inherently single-user at a time (e.g., printers) . . . – Jim Diamond, Jodrey School of Computer Science, Acadia University

  16. Chapter 1 12 The OS as a Traffic Cop The computer system should prevent a rogue program from • – crashing the system or other programs, or – accessing resources it shouldn’t access How? • – the hardware prevents a program from accessing memory outside its address space or so we thought (meltdown, spectre) – the hardware prevents ordinary programs from doing I/O But how? • – hardware protections + dual mode operation: Jim Diamond, Jodrey School of Computer Science, Acadia University

  17. Chapter 1 13 Programs and Processes: Terminology A program is a passive entity: data in memory or on a storage device • A process is an active entity • – resources (CPU, memory, I/O, . . . ) are being used – – resources are released when the process terminates A single-threaded process has (only) one associated program counter • which points to the next instruction to execute A multi-threaded process has one program counter per thread • A running system usually has many processes running at one time • – The OS runs processes concurrently by time slicing the CPU’s (or • CPUs’!) attention amongst runnable processes Jim Diamond, Jodrey School of Computer Science, Acadia University

Recommend


More recommend