Operating Systems Flashcards
Operating Systems
Definition: Software that handles the interface to the hardware and manages resources.
Features of OS
Provide and manage hardware resources. Provide an interface between the user and the machine e.g. CLI, GUI. Provide an interface between applications software and the machine e.g. saving to disk. Provide security for the data on the system e.g. passwords, access rights, encryption. Provide utility software to allow maintenance to be done e.g. housekeeping, anti-virus.
Manage HW Resources
Management of memory – partitioning, allocating memory, virtual memory. Scheduling of Jobs including interrupt handling.
Interrupt
An interrupt/signal sent to the processor. Request for processing time. Allows important tasks to be processed. Interrupts may cause a break in execution of the current routine so it can be resumed later.
Reasons for interrupts
To obtain processor time…for a higher priority task. To avoid delays. To avoid loss of data. As an indicator to the processor… that a device needs to be serviced.
Sources of interrupt
User e.g. new user logon request, power failure e.g. to allow orderly shut-down (prevent data loss), system failure, peripheral e.g. printer buffer empty, Clock, software e.g. divide by zero error.
HW Interrupt
A hardware interrupt is an electronic alerting signal sent to the processor from an external device, either a part of the computer itself such as a disk controller or an external peripheral. E.g. imminent power failure.
SW Interrupt
Software interrupt is an interrupt generated within a processor by executing an instruction. E.g. Divide by zero.
Processing interrupts
After each cycle is completed (execute instruction) the processor checks the interrupt register by comparing priority of the current task with the highest priority interrupt. If interrupt is of higher priority the contents of registers put on stack …PC set to start address of interrupt service routine…interrupt is processed…check for further interrupts…contents of registers restored from stack and original task continues. If the interrupt was not of a higher priority than the current task then it starts the fetch-execute cycle again (the address of next instruction is copied from the PC to MAR).
Resuming after interrupt
Reset interrupt request flag so shows interrupt has been serviced. Check interrupt register for further interrupts and service them if they are of higher priority than task to be resumed. If there are no higher priority interrupts then restore the contents of the registers from the stack and resume task.
Interrupt priority
Interrupts have priorities: To decide between interrupt and current task. To choose which interrupt to process if 2 (or more) occur together. To ensure most urgent task is performed first. To ensure most efficient use of the processor. e.g. new user log on can wait… but data must be saved before power fails.
Scheduling
The operating system allocates priorities to jobs. Deciding which job to run next is the job of the scheduler.
Scheduler Purpose
Ensure all jobs are processed changing priorities where necessary. Process as many jobs as possible in the least possible time.
Maximise the number of interactive users receiving fast response times. Maximise throughput by utilising resources and processor time efficiently.
Priority
An order of importance.
Job States
Ready, Running and Blocked.