Operating systems course Class 2 Machine hardware CPU

  • Slides: 13
Download presentation
Operating systems course Class 2

Operating systems course Class 2

Machine hardware • CPU – Special purpose registers – ALU – Control logic –

Machine hardware • CPU – Special purpose registers – ALU – Control logic – See example on You. Tube at http: //www. youtube. com/watch? v=k. St. K 089 WDj 4 • Bus 2

Loop of any operation in CPU • Program counter • Instruction register • Program

Loop of any operation in CPU • Program counter • Instruction register • Program counter incrementing – For the next operation • Opcode (operation code) 3

Opcode • Operation specified in opcode is performed • There are five categories of

Opcode • Operation specified in opcode is performed • There are five categories of operations – Movement – Computation – Conditional branch – Procedure calls – Input/Output 4

Traps • Are abnormal conditions detected by the CPU that usually are indicatives of

Traps • Are abnormal conditions detected by the CPU that usually are indicatives of errors – Such as • Dividing by zero • Trying to access a memory location that does not exist 5

Interrupts • An interrupt is a signal sent to the CPU by n external

Interrupts • An interrupt is a signal sent to the CPU by n external device typically an I/O device • CPU responds to traps and interrupts by saving the current value of the program counter and resetting the program counter to a new address • Interrupt vector – Each trap and interrupt is associated with an index into this vector • Program status word (PSW) 6

Multimode execution • A system can enter kernel mode from user mode in one

Multimode execution • A system can enter kernel mode from user mode in one of three ways – Supervisor call or a system call sets the system’s state to kernel mode – Traps and interrupts are other two mechanisms for switching to kernel mode 7

Areas of operating system • • Process management Memory management File system management Device

Areas of operating system • • Process management Memory management File system management Device management 8

Operating systems types • • • Batch Multiprogrammed batch Time-shared Real-time Distributed operating system

Operating systems types • • • Batch Multiprogrammed batch Time-shared Real-time Distributed operating system 9

Operating system kernel • Kernel is a subroutine library • Types of kernels –

Operating system kernel • Kernel is a subroutine library • Types of kernels – Monolithic kernels – Microkernels • Minimal functionality – – Control of memory Management of hardware Interprocess communication facilities Interrupt and trap handling • Linux- kernel video http: //www. youtube. com/watch? v=XAo 1 QCQXOD o 10

Example from America 11

Example from America 11

Boot process • Stage-0 boot program – The program checks for the presence of

Boot process • Stage-0 boot program – The program checks for the presence of one or more boot devices • Boot sector – Stage-0 founds the boot sector – This should contain a stage-1 boot program • Partition table • Stage-1 boot program reads the partition table and copies into memory the first sector of partition – The first sector of active partition contains a stage-2 boot program designed to work with the operating system contained in that partition 12

Group exercises based from this lesson 1. Explain the fundamental difference between interactive, batch,

Group exercises based from this lesson 1. Explain the fundamental difference between interactive, batch, and real-time systems 2. List three situations that might demand a real-time operating system and explain why 3. Give an example of an organization that might find batch-mode processing useful and why 4. Draw a system flowchart (http: //en. wikipedia. org/wiki/Flowchart) illustrating the steps performed by an operating system when it starts • Use google or other search engine in the first three questions to find information – As described before the best first item in your key sentence should example and then your concepts • • • This exercise’s source: http: //reocities. com/College. Park/pool/7747/chapter_1_exercises. htm Write a word document Put your exercise result (your word document) to your exercise wiki after your last result The deadline for exercise is Feb. 19 We also discuss the results orally, if our session time allows this 13