Operating Systems Flashcards
Purpose(s) of Operating System
- To provide a user-friendly interface between the user and the hardware.
- To manage memory, and processor to ensure they are used efficiently.
- To manage peripheral devices, such as printers and keyboards.
- To protect the hardware and software from incompetence and inexperience.
- To provide similar environment on different machines. This should make programs more transportable.
- To avoid duplication by incorporating commonly used routines.
- Monitor the user and protect data on the computer from unauthorized access.
Batch Processing: Define
The data is collected together before processing which is then carried out without human interaction e.g. Payroll
Single User
A mode operation where the operating system deals with just a single user.
Multi User
A mode of operation where the computer can deal with number of users at the same time. E.g. scales system in a supermaket.
Multi Tasking
The ability of the operating system to have several programs loaded and the user can switch between them.
Multi Programming
That ability of the operating system to have several programs loaded and the operating system can rapidly switch between them giving the impression they are all running at the same time.
Interrupt
A signal sent from a peripheral device to the processor requesting attentions.
Typical causes of interrupt
(Hardware)
- Mouse movement.
- Keyboard key press
- Printer running out of paper.
(Software)
- Program run time error.
- Clock reaching specified time.
Process of Interrupt
(1) –The current state of the processor is stored (on a stack).
(2) –A jump is then made to a subroutine that deals with the interrupts.
(3) –The interrupt is processed.
(4) –The previous state of the processor is retrieved (from the stack).
Priority of Interrupt
Where data loss will result a high level of interrupt is allocated.
Where the user is waiting for a response a medium level of interrupt is allocated.
Other cases a low level of interrupt is allocated.
Polling
Polling is the checking by the OS of a number of devices, in turn, to see if they need attention.
Buffers
A buffer is a portion of RAM allocated as a temporary storage while data is being transferred to and from a peripheral. It deals with speed difference between the devices.
Buffer is used when
- There is a speed difference between the computer and the peripheral device.
- Where data needs to be sent in batches rather than one bit/byte at a time.
Example of Buffer
Keyboard Buffer. When a key is pressed on a keyboard an interrupt is generated that places the character into a buffer. Applications take characters from the keyboard buffer when they require input.
A word processor can send data very rapidly to a printer. A printer, since it is mechanical, can only use the data slowly. To free up the word processor a print buffer may be used.
Double Buffering
A single buffer can suffer from buffer underflow which results in pauses. There is also a problem in allowing the memory to be written to whilst it is being read. To avoid this two buffers are used.
By using double buffering a continuous flow of data from the buffer is possible.
Device Driver
Software that converts OS instructions into the actual commands needed by a piece of hardware such as a printer.
Logical device
The way in which a device e.g. hard disc is referred to, it may or may not match the physical hardware. E.g. one physical disc can be partitioned to appear as several discs.
Security
The process of protecting data from unauthorized access or damage.
Weakness of username/password security
- Can be forgotten.
- Obvious password, guessable.
- Using same password on multiple systems
- Can be observed - key logger.
Alternatives to username/password security.
Biometric (additional hardware):
- Retina scan.
- Finger print.
- voice pattern.
Smart card.
Administrator
A user who has full rights on a multi-user computer. They can create and modify other user accounts.
File Protection
Methods of stopping deliberate and accidental access to or damage of a file. It is achieved by access rights.
File encryption
Scrambling the contents of a file in order to make it unreadable by anyone who does not know how to unscramble it.
Access log
A record of what each user has done on a computer. Maintained by OS.
Record locking
Restricting access to a record whilst it is being updated.
High-level scheduler*
With a batch processing system this is responsible for deciding the order in which jobs are to be started
Based on: -
- Resources needed.
- Processor.
- Print etc..
- Estimated running time.
- Priority (set by user).
Low-level scheduler
Maintains a queue of all of the currently active jobs and decides which task is to currently have access to the processor. The order might depend upon the priority, the required resources and the available resources, also the closeness to complete of a job.
Time slices may be fixed in length or variable (last as long as a task can use it, or longer for more import tasks).
Time slices may be allocated more of often to more important tasks.
Time slice
In a multi programming system the time slice is the amount of processor time given to a task before the processing moves to another task.
Scheduler Strategies - Round robin
Each job is given an equal time slice of the processor, provided it can be executed i.e. is not waiting for input/output. The time slice may be 10ms.
Scheduler Strategies - Run time method
A task is executed until completion or processing comes to a halt (awaiting I/O) or a previous request for I/O has been answered.
Scheduler Strategies - Job Priorities
Some Operating Systems allow jobs to be given different priorities. A high priority job might be be given more processor time by ‘Bigger time slice’ or ‘More frequent time slices.’
Five state Process Model
A model that shows the possible states of a program on a multi-tasking computer.
- New.
- Ready.
- Running.
- Blocked.
- Exit.
Five state Process Model - Stage: New
A process has been created but has not yet been admitted to the pool of executable processes.
Five state Process Model - Stage: Ready
Processes that are prepared to run if given an opportunity. That is, they are not waiting on anything except the CPU availability.
Five state Process Model - Stage: Running
Process that is currently being executed.
Five state Process Model - Stage: Blocked
A process that cannot execute until a specified event such as user input or reading a record from a file completes.
Five state Process Model - Stage: Exit
A process that has been released by OS either after normal termination or after abnormal termination (error).
Memory structure
The main store of the computer consists of RAM (used for holding most running programs and data that is being processed) and ROM (holding at least the instructions to start the computer). On a hand held computer without a hard disc the whole of the operating system and some applications will be on ROM.
Partitioning
On a multitasking computer partitioning refers to dividing up the main store so that each of the current programs can have part of it. The OS must ensure that one program cannot corrupt another program.
Variable/memory Partitioning
Each task is allocated a variable sized section of memory depending on how much memory the task needs.
The task has exclusive use of the partition.
This process allows more than one program to be in the memory at a time.
After many programs start and end memory may become fragmented.
Paging
The dividing of memory into blocks for management purpose.
The main store is often divided into pages. Each task will be given a number of pages. They may in practice not be next to each other but the operating systems memory management system will make it appear to the application that the pages are consecutive. When a task accesses memory the memory manager intercepts the request and routes it to the correct page.
Swapping
The process of exchanging the contents of two storage locations.
In order to allow more programs to be in main memory than the capacity of the main store a very high speed swapping disc may be used to swap out currently suspended tasks (between time slices). In practice only the programs varaibles need to be saved each time since the program will not be changed during execution. When execution is resumed the program and variables are recalled from the swapping disc. (The program must be saved once on the swapping disc).
Virtual Memory (Virtual storage)
Temporary transfer of part of the main store (RAM) onto hard disc to free space in RAM. The contents are then bought back when needed.