chap01

6
What is an O.S.? • Not always a clear definition as to what constitutes an O.S. and what is an application – CD-Rom Driver – Scandisk – Internet Explorer • Intermediary between the hardware and the users – Allocate resources (CPU, Memory, disk space, etc.) between programs and users efficiently – Allow the user to conveniently access data and programs – Protect the system from incorrect or malicious programs and users

Upload: mbadubai

Post on 08-Nov-2015

212 views

Category:

Documents


0 download

DESCRIPTION

OS SLIDES

TRANSCRIPT

  • What is an O.S.?Not always a clear definition as to what constitutes an O.S. and what is an applicationCD-Rom DriverScandiskInternet ExplorerIntermediary between the hardware and the usersAllocate resources (CPU, Memory, disk space, etc.) between programs and users efficientlyAllow the user to conveniently access data and programsProtect the system from incorrect or malicious programs and users

  • Hardware ReviewElements of a systemProcessorRegisters (address, data, control)Instruction cycle (fetch, decode, execute)InterruptsUsually includes hardware and special instructions to help the O.S. manage memory, devices, etc.MemoryDifferent levels (cache, main memory, disk)Operating system will generally manage memory (both RAM and disk), and move data back and forth as requiredI/OUsually use Interrupts, DMAOperating system usually controls use of I/O devices

  • RegistersUsed for frequently accessed itemsUser-Visible registers Available to the programmer and compilerData RegistersAddress RegistersIndex, Segment, Stack PointerCondition code/flagsControl and Status registers Used to control the processorProgram Counter/Instruction PointerMemory address/dataProcessor Status WordDebugging registersTemp registersMemory Management registers

  • Instruction ExecutionSimple Form: Fetch, ExecuteSee Figure 1.2, (pg 14)Instructions moves data, performs an operation, or controls CPUInterruptsAllow I/O devices to get the CPUs attention at regular intervalsProgram, Timer, I/O, Hardware failureHelps the O.S. by reducing the time spent monitoring I/O devicesSee Figures 1.5, (pg 18), 1.8 (pg 21), and 1.9 (pg 22)CPU checks for interrupts after each instruction, starts the handler if neededFigures 1.6 (pg 19) and 1.7, (pg 20)May allow nested interrupts

  • Interrupts and I/OHandling and Interrupts:Figure 1.10 (pg 23)Device sends interrupt request to CPUCPU finishes current instructionCPU acknowledges requestCPU saves PC and PSWCPU loads PC with the address of the first instruction in the interrupt handler (may get help from interrupt request)Interrupt handler starts, often saves other CPU registers and key valuesInterrupt handler responds to the deviceInterrupt handler restores CPU registers and key valuesCPU restores PC and PSW and resumes previous programI/O techniquesProgrammed I/OInterrupt-Driven I/ODirect Memory Access

  • MemoryVarying types of memoryRegisters, Cache, RAM, Disk, CDVary in speed, size, costCPU and O.S. try to keep frequently used data in faster memoryCache Use a small high-speed memory to improve the apparent speed of a larger low-speed memoryKeep track of what is currently being used, load into high-speed memoryReplacement Algorithm What do we get rid of when we run out of memory?Write Policy How do we respond to modifications?