Flashcards
Operating systems
Cards in this deck (38)
- 1What is an operating system?A program or set of programs that manages the operations of the computer and provides a bridge between the user and the computer's hardware
- 2Storage of the OSOS is held in secondary storage
A program called the bootloader is held in ROM and loads up the OS - 3Functions of an operating system5 main functions with subfunctions
1. Memory management
a: Paging and segmentation
b: Virtual memory
2. Interrupt handling
3. Processor scheduling
4. Backing store management
5. I/O management - 4The need for memory managementA user can work on many tasks at once on a PC
Each of these tasks, along with the files they are using, requires space in RAM while the computer is on
The OS is responsible for ensuring RAM is able to store all of this as efficiently as possible
To do this, it often abstracts memory space, creating a logical space above the physical space. The programs reference the logical space, leaving the OS free to move physical data around as required - 5PagingMemory is divided into chunks of a fixed size (approx. 4KB each) known as pages
Programs will occupy a number of pages depending on their size
A page table is used to coordinate logical address space with physical locations - 6Advantages of pagingA fixed page size means a fixed number of pages, which makes organisation easier
Page table will remain a constant size so available space won't change
Possible to load only part of a program or file
Applications can be stored non-contiguously in memory - 7Disadvantages of pagingPages are a fixed size, so redundant and unusable memory may be used if program size is not an integer multiple of the page size (internal fragmentation)
Program is not divided logically, so a function could be stored across multiple pages and result in more of a program being loaded than necessary - 8SegmentationDivision of memory into variable-length blocks known as segments
Segments reflect the logic of the program - they may be organised into functions, loops, objects or statements
Relies heavily on linkers and loaders
Segment table still required to relate physical and logical address space - 9Advantages of segmentationAllows non-contiguous storage of applications and files
Variable length of segments reduces the risk of internal fragmentation because - 10Disadvantages of segmentationDifficult to organise - segment table varies in length depending on how memory is divided
Removing and replacing segments may create unused sections of memory which are too small to add to new segments (external fragmentation) - 11Virtual memoryIn some cases, RAM is too small to store all of the processes running on a PC
To allow for this, the operating system may move pages of idle programs and files to a section of secondary storage known as virtual memory.
If the memory limit is severely exceeded, the OS may spend most of its time swapping pages in and out of RAM, keeping secondary storage engaged and severely reducing performance (known as disk thrashing) - 12Interrupt handlingAn interrupt is a signal from a software program, hardware device or internal clock to the CPU
When the CPU receives and interrupt, it suspends execution of the program, dumps all register values to the call stack and calls an Interrupt Service Routine (also called an Interrupt Handler) to deal with the interrupt
The ISR will be specific to the interrupt type
Once the interrupt has been handled, the original register values are restored from the stack and processing continues as normal - 13Processor schedulingComputers can run multiple processes simultaneously but the CPU can only process one task per core at best
It is the responsibility of the scheduler - a section of the operating system - to ensure that the processor is used as efficiently as possible - 14Objectives of processer scheduling1. Maximise throughput
2. Be fair to all users on a multi-user system
3. Provide acceptable response times to all users
4. Ensure hardware resources are kept as busy as possible - 15Round-robin schedulingEach process is despatched on a first-in-first-out basis (FIFO)
Each process is given a finite amount of processor time - known as a time slice or quantum - to complete
An interval timer is used to generate interrupts at regular intervals to allow this
If the process doesn't complete before its time slice expires, or before a higher-priority interrupt occurs, its state is saved and it moves to the back of the queue - 16Advantages of round-robin schedulingEliminates starvation of processes and guarantees reasonable response times to all users
Does not require process time to be estimated - 17Disadvantages of round-robin schedulingState of each process has to be stored somewhere, using up more memory space
- 18First-come-first-served schedulingJobs are processed in the order in which they arrive
No system of priorities - 19Advantages of first-come-first-served schedulingOnce a process is added to the queue, it is guaranteed to move up that queue until it is processed
Jobs on the processor will run to completion and move off the queue - 20Disadvantages of first-come-first-served schedulingSmall processes may end up waiting behind large jobs, which may increase the queue size
- 21Shortest remaining time schedulingThe process with the shortest estimated time to completion is run next
- 22Advantages of shortest remaining time schedulingReduces number of waiting jobs
Reduces the number of small jobs waiting behind big jobs - 23Disadvantages of shortest remaining time schedulingLarge jobs may be starved of processor time if many small jobs are added
Running time must be estimated - 24Shortest job first schedulingThe process with the smallest estimated running time is run next
Similar advantages and disadvantages to shortest remaining time scheduling - 25Multi-level feedback queuesAlgorithm to organise jobs in a system of queues
Jobs can move between queues depending on factors including priority and estimated running time
Can be used in conjunction with the other scheduling algorithms e.g. Windows kernel uses round-robin with a multi-level feedback queue - 26Aims of multi-level feedback queue algorithm1. Maximise processor use
2. Give preference to short jobs
3. Give preference to I/O bound processes
4. Separate processes into categories based on their need for the processor - 27Backing store managementFiles and applications are stored in backing storage (secondary storage) and transferred into memory when they are needed
The operating system is responsible for creating and maintaining a directory of storage locations for fast access
It also needs to know which areas of storage are free in order to store new files and applications
The file management system gives the user some input over how the directory is organised, but not how physical memory is stored - 28Peripheral managementDifferent applications use different I/O devices throughout their operation
The OS is responsible for providing an interface with these devices
Since I/O devices tend to be slower than the processor, the OS transfers I/O requests to a buffer so that the processor can continue with another task. The I/O device can then deal with a task from the buffer and generate an interrupt when finished. - 29Device DriversA program to provide a software interface to a particular hardware device
Ensures compatibility between the OS and different hardware devices
The OS doesn't have to know the details of the hardware being used
Drivers are hardware and OS-specific - 30Types of operating system1. Distributed
2. Multi-tasking
3. Multi-user
4. Mobile
5. Embedded
6. Real-time (RTOS) - 31Distributed OSForm of parallel processing system
Spreads the load over multiple computer servers
Tasks from a single job may be run on separate computers, but appear to run on the same system to a user
This may be used in an intranet for a school or workplace - 32Multi-tasking OSMay run on a standalone computer
Runs many jobs simultaneously by switching between them so that each one appears to be the only one running - 33Multi-user OSTime-sharing system
A single mainframe or supercomputer is connected to many terminals
Jobs from each terminal get a slice of time on the mainframe according to a scheduling algorithm
This type of OS is also multi-tasking - 34Mobile OSCombine features of a traditional OS with mobile-specific features e.g. cellular and wireless connectivity and alternative user input
Most systems are tied to specific hardware - many smartphones - 35Embedded OSDesigned to run on specific hardware (e.g. a washing machine)
Accept input from buttons and sensors
Provide output through control processes
Limited amount of RAM so a complex memory management system is not required
Often the OS is small and will be stored in ROM, so there will be no permanent storage devices
These will tend to run faster than a more complex OS - 36Real-time OS (RTOS)A real-time OS will respond very quickly to inputs (within a very short time period)
Often used in safety-critical systems such as fly-by-wire airliners or cars
Often incorporate redundancy - 37BIOSBasic Input Output System
Stored and run from ROM (which the CPU loads from after receiving the reset signal after power on)
The BIOS runs a series of checks known as POST (Power On Self Test)
If they all pass, control is passed to the bootloader, which loads the OS kernel into RAM
If any of the checks fail, the BIOS alerts the user through a series of beep codes. - 38POST checks1. System memory OK
2. System clock/timer running
3. Processor OK
4. Keyboard present
5. Screen display memory working
6. BIOS not corrupted
This list is not exhaustive, other checks exist
Information
- Description
- A level OCR A level Computer Science (Topic 2 - Systems Software) Flashcards on Operating systems, created by James Norman on 26/01/2020.
- Created by
- James Norman
- Views
- 0
- Rating