1 / 41

OPERATING SYSTEM OVERVIEW

OPERATING SYSTEM OVERVIEW. Contents. Basic hardware elements. Interrupts. Most I/O devices are much slower than the processor. Active waiting cycle (polling). Interrupt request signal. Interrupt mechanism. An interrupt cycle is added to the instruction cycle (fecth and execute).

sage
Télécharger la présentation

OPERATING SYSTEM OVERVIEW

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 SYSTEMOVERVIEW

  2. Contents Basic hardware elements

  3. Interrupts • Most I/O devices are much slower than the processor • Active waiting cycle (polling) • Interrupt request signal

  4. Interrupt mechanism • An interrupt cycle is added to the instruction cycle (fecth and execute). • The processor checks to see if an interrupt has occured (interrupt signal)

  5. Interrupt mechanism • interrupt vector • interrupt handler

  6. Interrupt processing • CPU saves PS and PC (push) into the control stack • CPU loads into PC and PS the corresponding values from the interrupt vector

  7. Interrupt processing • interrupt handler execution • iret

  8. Interrupt mechanism Interrupt enable/disable bit (PS register) • STI (Set Interrupt) CLI (Clear Interrupt) • Hardware priority

  9. Interrupt processing main memory main memory 1OO i 1OO 2 inth 149 i+1 PS inth iret 15O interrupt vector 1OOO 1 3 interrupt prog 12OO 12O1

  10. Interrupt processing main memory PS PS prog 3824 PC 12O1 stack 39OO 3824 SP CPU completes execution of the current instruction

  11. Interrupt processing main memory PS PS inth 3822 PS prog 3823 12O1 PC 1OO 3824 stack 39OO 3822 SP interrupt signal has been accepted

  12. Interrupt processing main memory PS PS inth 3822 PS prog 3823 12O1 PC 151 3824 stack 39OO 3822 SP iret execution

  13. Interrupt processing main memory PS PS prog 3824 PC 12O1 stack 39OO 3824 SP iret completed

  14. Contents O.S.Components

  15. O.S. COMPONENTS • Process Management • Main-Memory Management • Secondary-Memory Management

  16. O.S. COMPONENTS • I/O-System Management • File Management

  17. Process management • Creating and deleting processes • Suspending and resuming processes • Provide mechanisms for process interaction

  18. Main memory management Keeping track of which parts of memory are currently being used and by whom

  19. Main memory management Deciding which processes are to be loaded when memory becomes available

  20. Main memory management Allocating and deallocating memory space as needed

  21. Secondary memory management • Free space management • Storage allocation • Disk scheduling

  22. I/O SYSTEM MANAGEMENT The I/O subsystem consists of • A memory-management component that includes buffering and spooling

  23. I/O SYSTEM MANAGEMENT The I/O subsystem consists of • A general device driver interface • Drivers for specific hardware devices

  24. File management • Creating and deleting files and directories • Supporting primitives for manipulating file and directory

  25. File management • Mapping files onto storage • Backing up files on stable storage media

  26. Protection systems • Mechanism for controlling the access of processes to system resources

  27. Protection systems • The mechanism must provide means for specifying the controls to be imposed and means for enforcement

  28. Comand-Interpreter System • The interface between users and O.S. • A program that reads and interpretes control statements

  29. Comand-Interpreter System • Its main function:to get next command statement and execute it (shell)

  30. Contents System calls

  31. System Calls Processes communicate with the O.S. and request services to it by making system calls

  32. System Calls System calls provide the interface between any process and O.S.

  33. Examples of System Call • Process control • File manipulation • Device manipulation • Information management • Communications

  34. Corresponding to each system call there is a library procedure

  35. Example:readsystem call C program count=read (file, buffer, nbytes) countreturns the numberofbytesactuallyread

  36. register x x  call parameters system call READ load x INT 2 3 1 system call READ returnfrom INT Libraryread procedure operating system

  37. The library procedure • Puts the parameters of the system call in machine registers • Issues a INT instruction to start the O.S. • The control is returned to the caller by returning the statuscode as a result

  38. Methods to pass parameters to operating system • directly via registers • in a memory block whose address is passed as a parameter in a registry • into the stack (push, pop)

  39. user int. users libraryinterface utility programs (shell, compiler, …) user mode system call interf. standard library (open, close, read, write, ..) UNIX O.S. (process management, memory management, file system, I/O, ...) kernel mode hardware (CPU, memory, disks, terminals, …)

  40. Dual mode of operations user mode • Used for normal execution of user programs • Hardware control does not allow the execution of privilegedinstructions

  41. Dual mode of operations supervisor mode (kernel mode) • Used for the execution of O.S. functions as required by system calls • All instructions can be executed

More Related