1.2.1

Cards (48)

  • Operating systems are essential for managing the hardware and software resources of a computer system. They provide an interface between the user and the hardware, allowing the user to interact with the system and run applications
  • Operating systems are essential to a computer system as they provide features: memory management, resource management, file management, Input/Output management, Interrupt management, Utility software, Security and User Interface
  • Memory management - Computer memory must be shared fairly between multiple programs and applications being used. One of the roles of the operating system is to determine and allocate the length of processor time each task receives through the use of paging, segmentation and virtual memory
  • Paging is when memory is split up into equal-sized sections known as pages, with programs being made up of a certain number of equally-sized pages. These can then be swapped between main memory and the hard disk as needed.
  • Segmentation is the splitting up of memory into logical-sized divisions known as segments, which vary in size. These segments are representative of the structure and logical flow of the program, with segments being allocated to blocks of code such as conditional statements or loops
  • Advantages of paging: No need for external fragmentation, swapping is easy between equal-sized pages and page frames
  • Disadvantages of paging: Page tables consume additional memory, may cause internal fragmentation
  • Advantages of segmentation: segment tables use lesser memory than paging, you can achieve sharing by segments referencing multiple processes
  • Disadvantages of segmentation: In segmentation, processes are loaded/removed from the main memory. Therefore, the free memory space is separated into small pieces which may create a problem of external fragmentation, Costly memory management algorithm
  • Similarities: Both pages and segments are stored on a disk, both allow programs to run despite insufficient memory
  • Differences: Pages are physical divisions and segments are logical divisions, pages are fixed size and segments are different sizes
  • Virtual memory uses a section of the HDD to act as RAM when the space in main memory is insufficient to store programs being used. Sections of programs that are not currently in use are temporarily moved into virtual memory through paging, freeing up memory for other programs in RAM.
  • The result of paging, segmentation and virtual memory is disk thrashing. This is when the computer 'freezes' and occurs as a result of pages being swapped too frequently between the hard disk and main memory. As a result, more time is spent transferring these pages between main memory and the hard disk then is spent actually running the program. This issue becomes progressively worse as virtual memory is filled up.
  • Interrupts are signals generated by software or hardware to indicate to the processor that a process needs attention. Different types of interrupts have different priorities and how urgent they are must be taken into account by the OS when allocating processor time. Interrupts are stored in order of their priority within an abstract data structure called a priority queue in a special register known as an interrupt register. It is the job of the OS to ensure interrupts are serviced fairly by the processor through the ISR
  • The FDE cycle happens and checks the interrupt register if an interrupt with a high priority is present. If present the relevant ISR is loaded by loading the relevant value into the program counter. The values of the previous FDE cycles are copied and 'pushed' into a data structure called a stack, so the registers are cleared. The PC gets the address of the interrupt and the FDE cycle of that interrupt happens. Once the interrupt has been serviced/processed. The interrupt registers are checked if no more interrupts are present the values in the stack are 'popped' and the FDE cycle resumes
  • A stack is a LIFO (Last in First out)
  • Scheduling is a function of the OS to ensure all sections of programs being run (job) receive a fair amount of processing time. This is done by scheduling algorithms
  • Scheduling programs can be either pre-emptive or non pre-emptive
  • Pre-emptive - jobs are actively made to start and stop by the OS like Shortest Remaining Time, Round Robin
  • Non pre-emptive - Once a job is started; it is left alone until it is completed like First Come First Served, Shortest Job first
  • The scheduling algorithm used depends on the task at hand like Shortest remaining time is used where the completion of shorter tasks before other tasks
  • Round Robin: Each job is given a section of processor time, which is known as a time slice, within which it is allowed to execute. Once each job has used first time slice, the OS grants each job an equal time slice of processor time. This continues until a job has completed. Round Robin ensures each job is seen to, longer jobs will take a much longer time for completion due to their execution being inefficiently split up into multiple cycles. This does not account for job priority.
  • FCFS - Jobs are processed in chronologic order by which they enter the queue. This is very straightforward but FCFS does not allocate processor time based on priority
  • Multilevel feedback queues: This makes use of multiple queues each which is ordered based on different priority. This can be difficult to implement due to deciding which job to prioritise based on combination of priorities
  • Shortest Job first - The queue storing jobs to be processed is ordered according to the time required for completion, with the longest jobs being serviced at the end. It requires the processor to know or calculate how long each job will take and this is not always possible. There is a risk of process starvation
  • Process starvation - When a particular processor doesn't receive enough processor time in order to execute and be completed
  • Shortest Remaining time - This queue storing jobs to be processed. They are ordered according to the time left for completion, with jobs least time to complete being serviced first. This introduces process starvation for longer jobs if short jobs are added to the job queue.
  • Distributed OS - This is a type of OS when is run across multiple devices, allowing the load to be spread across multiple computer processors when a task is run
  • Embedded OS - Built to perform a small range of specific tasks. There is limited functionality and hard to update but they consume less power than other types of OS
  • Multi-tasking - It enables the user to carry out tasks simultaneously. This is done by time slicing to switch quickly between programs and applications in memory
  • Multi-user - Multiple users make use of one computer. So, a scheduling algorithm must be used to ensure processor time is shared fairly between jobs. Without scheduling algorithms, it would cause process starvation
  • Real-time - Used in time-critical computer systems, used to perform a task with a guaranteed time frame
  • BIOS is the first program that runs when a computer system is switched on. The PC register points to the location of the BIOS as the BIOS is responsible for running various key tests before OS is loaded into memory like: POST (Power On-self test) which ensures that all hardware is correctly connected and functional. It checks the CPU clock, memory, and processor is operational. It does testing for external memory devices connected to the computer.
  • Bootstrap is name given to the program that loads the OS from the hard disk into main memory
  • Device drivers are computer programs which are provided by the OS and allow OS to interact with hardware. When a piece of hardware is used like a keyboard it is the device driver that communicates their request to the OS which produces the relevant output. Device drivers are specific to the computer architecture so different drivers must be used to different device types. As devices interact with the OS, they are specific to the OS installed on the device
  • Virtual machines are a theoretical computer is that it is a software implementation of a computer system. It provides an environment with a translator for intermediate code to run.
  • Intermediate code - Code that is halfway between machine code and object code. This is independent of the processor architecture, so can be used across different machines and OS
  • VM saves both time and money but running intermediate code is slower. Examples are protection from malware, running incompatible software
  • Advantages of Round Robin: All processes get a fair share of the CPU, Good for time-sharing systems
  • Disadvantages of Round Robin: Choosing the right time quantum can be difficult, this can lead to a high turnaround time and waiting time for long processes