1 / 14

Operating Systems

Operating Systems. CSC 2001. Abstract view of computer system components. User. User. User. Application programs. Operating System. Hardware. Operating systems. Controls overall operation of computer

idola-barry
Download Presentation

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. Operating Systems CSC 2001

  2. Abstract view of computer system components User User User Application programs Operating System Hardware

  3. Operating systems • Controls overall operation of computer • An OS is a program that acts as an intermediary between a user of a computer and the computer hardware. Its purpose is to provide an environment in which a user can execute programs. • Goals • convenience • efficiency

  4. OS components/services • Process management • Main-memory management • File management • I/O system management • Secondary storage management • Networking • Protection system • Command-interpreter system

  5. Overview • Earlier, what is an OS and, at a high level, what does it do. • Now, look in more details at… • Coordinating machine activities • Managing competition for machine resources

  6. Coordinating the Machine’s Activities • Section 3.3 • Program vs. Process • Process has a status • Where it is in the program (program counter) • CPU registers • Associated memory cells • snapshot of process

  7. Managing processes • scheduler • maintains list of processes • adds, deletes • process table • process id, priority, memory area, ready or waiting

  8. Managing processes • dispatcher • manages execution of processes • decides who gets next chunk of time on CPU • switches CPUs attention from one process to another • changes out process states (snapshots) • process switch (context switch)

  9. Process switching • Process execution begins along with interrupt timer • Process runs for a time slice • Interrupt is generated • Process state is saved • Control returned to dispatcher • Process state is swapped with another one • Timer starts and new process is executed

  10. Context switching • A context switch is not a free operation. • Just like you and me, the system must work to make a context switch. • However, since much time is wasted waiting for external devices, being able to do something else while a process is waiting for something else to occur, overall efficiency is generally improved.

  11. Handling competition for resources • Section 3.4 • Managing access to machine resources • Often multiple processes want to access the same resource at the same time • Examples?

  12. Ideas?

  13. Semaphores • A flag for whether or not the resource is available • Problem of an interrupt in the middle of setting the flag • Test-and-set instruction (single step)

  14. Deadlock • Process 1: has printer, waiting for the tape drive • Process 2: has tape drive, waiting for printer • What’s wrong here? • Solutions • Try to avoid a deadlock • Force a process to release a held resource

More Related