Unit 2: Systems software End of unit assessment

Cards (105)

  • Operating System
    Software to manage communication with computer hardware
  • Booting up a computer
    Boot loader in ROM loads the Operating System (OS) into RAM when the computer is switched on
  • Operating System
    • Manages the hardware
    • Provides an interface for the user and the application software
  • Functions of an Operating System
    • User interface
    • Memory management
    • Interrupt handling
    • Processor scheduling
  • User interface
    The Operating System hides the complexity of the hardware from the user
  • Devices that might have an operating system
    • Desktop computer
    • Other devices
  • Types of OS user interface
    • Windows, Icons, Menus, Pointers
  • Memory management
    • Programs and their data need to be loaded into RAM
    • The Operating System must manage the allocation of RAM to the different programs
    • There may not be sufficient RAM for all desired processes to be completely loaded into RAM at once
  • Paging
    • Available memory is divided into fixed size chunks called pages
    • Each page has an address
    • A process loaded into RAM is allocated sufficient pages, but those pages may not be contiguous in physical terms
  • Page table
    Maps between the logical memory locations and the physical memory locations
  • Segmentation
    • Memory is divided into segments which can be of different lengths
    • Segments can relate to parts of a program, for example a particular function or subroutine may occupy a segment
  • Virtual memory
    • An area of the hard disk can be designated as virtual memory
    • Some of the pages of a current process are stored in virtual memory until they are needed, at which point they are swapped into RAM
    • If many processes are running and the computer has insufficient RAM, lots of time is spent swapping pages in and out of virtual memory
    • Repeatedly swapping pages can noticeably slow down the computer (disk thrashing)
  • Interrupts
    • It is vital that the CPU can be interrupted when necessary
    • Interrupts can be sent to the CPU by software, hardware devices or the CPU's internal clock
  • Interrupt examples
    • An I/O device sends an interrupt signal
    • The printer runs out of paper
    • An error occurs in a program
    • A scheduled interrupt from the internal clock
    • Power failure
  • Interrupt handling
    1. The CPU checks at the end of each clock cycle whether there are any interrupts to be processed
    2. When an interrupt is detected, the processor stops fetching instructions and instead pushes the current contents of its registers onto a stack
    3. The CPU uses an interrupt service routine to process the interrupt
    4. When processing has finished, the values can be popped from the stack and reloaded into the CPU
  • Interrupt priority
    • Interrupts have different priorities, and will be processed in order of priority
    • Interrupts can themselves be interrupted if the new interrupt is of a higher priority
    • If a higher priority interrupt occurs whilst an interrupt is being processed, the original interrupt's registers will be pushed onto the stack as well
    • A stack is a LIFO data structure, so the last data to be pushed on will be the first to be retrieved
  • Processor scheduling
    • A single CPU can only process instructions for one application at a time
    • The Operating System must schedule when each application can use the CPU
    • This gives the illusion of multi-tasking - multiple applications appear to be running simultaneously
  • Aims of scheduling
    • To provide an acceptable response time to all users
    • To maximise the time the CPU is usefully engaged
    • To ensure fairness on a multi-user system
  • Round Robin
    • Each job is allocated (by FIFO) a time slice during which it can use the CPU's resources
    • If the job has not completed by the end of its time slice, the next job is allocated a time slice
  • First come first served
    The first job to arrive is executed until it completes
  • Shortest remaining time
    • The time to completion is estimated as each new job arrives
    • The job with the shortest remaining time to completion is executed, meaning that a shorter new job can take over from the current process
    • Starvation may occur if this algorithm is used to schedule processor time
  • Shortest job first
    • Also known as "shortest process next"
    • The waiting job with the smallest total execution time is executed when the current job completes
    • This algorithm is not pre-emptive
  • Multi level feedback queues
    • Multiple queues are created with different priority levels
    • If a job uses too much CPU time it is moved to a lower priority queue
    • Processes can also be moved to a higher priority queue if they have waited a long time
  • The Operating System (OS) manages memory allocation, CPU time and provides an interface
  • Memory can be allocated in pages
  • Virtual memory allows pages to be swapped in and out of RAM as they are needed
  • The CPU processes jobs according to a scheduling algorithm
  • The CPU can be interrupted if a job with a higher priority arrives
  • Systems software
    Needed by the system to control hardware and run applications
  • Applications software
    Software that performs a task to benefit the user
  • Categories of systems software
    • Operating System
    • Utilities
    • Libraries
    • Translators
  • Operating System
    • Provide a user interface
    • Handle memory management
    • Interrupt handling
    • Processor scheduling to provide 'multi-tasking'
  • Utility programs
    Optimise the performance of the computer and perform useful background tasks
  • Disk defragmenter
    • Large files stored on a magnetic hard drive may be split up across several physical disk locations
    • Disk defragmenter reorganises the hard drive so that files are in sequential blocks where possible
    • The result is that files can be read more quickly
  • Location of file data on a hard disk
    Affects the speed of access
  • Disk defragmenter
    Ensures all parts of file A are contiguous by moving other files as necessary
  • Distributed Operating System
    • Can coordinate the processing of a single job across multiple computers
    • A program can be run by the user that uses data or resources from any other computer
    • Resources could include processor time, memory and I/O facilities
    • The distribution of tasks is coordinated by the OS passing instructions between computers
    • The user can access more computational power with the illusion of working with a single processor
    • The programmer has no control over the task distribution as this is entirely handled by the OS
  • Gaps might be present in the first place due to files being stored in a non-sequential manner
  • Automatic backup
    • Data in permanent storage needs to be regularly backed up
    • The process can be automated, specifying where, when, what, and how
  • Multi-tasking system
    A single processor can appear to do more than one task simultaneously by scheduling processor time