Chapter 16 System Software Flashcards
Operating System - Definition
A software that manages hardware resources and provides user interface
Purpose of OS (theres 7)
- Provide interface
- CPU management
- Memory management
- Manages peripherals
- Organise file system
- Security
- Utilities
OS Multitasking
More than one program can be stored in memory, but only one can have CPU access at any given time.
The rest of programs remain ready
3 Memory Process States
Ready: A new process arrived at the memory, and the PCB is created
Running: Has CPU access
Blocked: Cannot progress until some event has occurred
Scheduling
Ensures that the computer system can serve all requests and obtain a certain quality of service.
4 Scheduling Algorithms
- Round Robin
- Shortest Job First
- First Come First Serve
- Shortest Time Remaining.
Explain what Round Robin is
List the Advantage/ Disadvantages
- Allocates a fixed time slice to each process
- Preemptive
- Does not prioritize
Advantage
- Starvation does not occur
Disadvantages
- The processing resources could be used up on schedulling rather than processing
Shortest Job First, Define and give disadvantage
A scheduling process that selects the waiting process with the shortest execution time.
Disadvantages:
1. Hard to predict execution time
2. Can cause starvation of resource - long execution programs may have to wait an indefinite amount of time
Purpose of a User Interface
- hides the complexities of the computer/ hardware/ OS from the user
- Provides access systems for users with differing needs
- Avoids complex commands involving memory location
- for example a graphical user interfaces which uses icons for navigation
First Come First Served
- No complex logic - each process is executed one after the other
- Received processes are queued
Advantage
- Starvation doesnt occur - all processes will get a chance to run… eventually
Virtual Memory - what is it
- Secondary storage is used to simulate additional main memory
- Its created temporarily
- Extends RAM - CPU appears to be able to access more memory that the actual available RAM
Why would you use Virtual memory
It can be used when RAM is running low - computer processing many things at once
For more efficient use of RAM - any programs not running can be moved to virtual memory
Paging
Reading/ writing blocks of data from/to secondary storage when required
- memory is divided into fixed size blocks
- dividing of memory into pages done by the operating system
- faster access times than segmentation
Segmentation
- Divides memory into variable sized blocks
- segment size is calculated by the compiler
- slower access time than paging
Disk Thrashing
- occurs when frequent transfers between main and secondary memory take place (when virtual memory is being used)
—> as main memory fills up, more pages need to be swapped in and out of secondary memory
—> this swapping leads to a very high rate of hard disk head movements
—> eventually, more time is spent swapping the pages/ data than processing it.
2 types of Translation Software
Interpreter and Compiler
Explain the process of Interpreter
- examines code one line at a time
- checks each statement for errors
—> if no error is found then statement/ line is executed
—> if found the error is flagged anbd reported, interpreter is halted - interpretation is repeated for every iteration in loops
- interpretation has to be repeated every time the program is run
Compiler: State the 4 Compilation stages
- Lexical Analysis
- Syntax Analysis
- Code Generation
- Optimisation
Explain the 4 stages of Compilation
Lexical Analysis
- Converting a sequence of characters into a sequence of tokens
Syntax Analysis
- Uses parsing algorithms to interpret the meaning of a sequence of tokens
- checks if code matches the grammar of the language
- syntax errors are reported
- parse tree is produced
Code Generation
- Converting intermediate representation of source code into executable code
Optimisation
- Minimising a programs execution time and memory requirement
Why is RPN used
RPN or Reverse Polish Notation is used to carry out evaluation of expressions
- Provides an unambiguous method of representing an expression
- reads from left to right
- doesnt require brackets or rules of BODMAS