functions of OS Flashcards
operating system
manages the hardware and provides an interface for the user and application software
boot loader
stored in ROM, loads the OS into RAM when t he computer is turned on
OS functions
user interface, memory management, interrupt handling, processor scheduling
memory management
the allocation and management of memory between programs in use
paging
memory is divided into fixed sized pages, process may be held in several non-contiguous ones
page table
maps between the physical and logical memory locations
segmentation
the logical division of memory into varying length segments
virtual memory
an area of the hard disk designated to supplement RAM
interrupt
signal sent from hardware, software or clock to alert the CPU that it needs instruction
software interrupt
occurs when an application program terminates or requests a certain service from the OS
hardware interrupt
occurs when an I/O operation completes, error occurs (ie printer out of paper)
dealing with interrupts
when an interrupt signal is received, execution of the running program/process is suspended and all lower priority interrupts are disabled, the values in the registered are then put onto the system stack and the ISR routine handles the interrupt, once it’s been serviced the original values of the registers are retrieved from the stack and the original process resumes
low priority interrupt - examples
an I/O device sends a signal requesting service or signalling end of I/O
medium priority interrupt - examples
clock interrupt
high priority interrupt - examples
power-fail interrupt
multi-tasking
carrying out small parts of multiple larger tasks in turn giving the appearing of carrying out several tasks simultaneously
scheduler
the operating system module responsible for making sure that processor time is used as efficiently as possible
scheduler - objectives
maximise throughput, be fair to all users on a multi-user system, provide acceptable response time to all users, provide acceptable response time to all users, ensure hardware resources are kept as busy as possible
round robin
each process is given an equal time slice, if it doesn’t finish within it’s slice it joins the end of the queue
first come first served
processes are dealt with in the order they arrive
shortest remaining time
picks the process with the shortest estimated time remaining time to finish, the scheduler will switch to a new process with a shorter
shortest job first
picks the process with the shortest estimated running time and runs it until it finishes
multi-level feedback queues
multiple queues with different priorities are used
disk thrashing
excessive swapping of pages between RAM and virtual memory which noticeably slow down the computer
round robin - advantages
guarantees a reasonable time for all processes to be executedin
round robin - disadvantages
doesn’t consider priority
first come first served - advantages
simple/easy to implement
first come first served - disadvantages
doesn’t consider priority
shortest remaining time - advantages
higher throughput
shortest remaining time - disadvantages
starvation, user has to estimate the job time
shortest job first - advantages
higher throughput
shortest job first - disadvantages
starvation
multi-level feedback queues
uses multiple queues with different priority levels giving preference to short jobs and I/O bound processes
distributed OS
a parallel processing system which distributes work load over multiple computers
multi-tasking OS
a single processor can appear to do multiple tasks simultaneously by scheduling processor time
multi-user, multi-tasking systems
a single mainframe is connected to dozens/hundreds of terminals all using the mainframe CPU, each gets a slice of processor time according to a scheduling algorithm
mobile OS
the main OS manages the UI and application software, a low-level proprietary real-time OS which operates the radio and other hardware
embedded OS
has minimal features and UI, accept sensor input and output to control devices, applications stored in ROM, limited RAM
real-time OS
must respond very quickly to inputs or sensors, must be able to deal with many simultaneous inputs, must have failsafe mechanisms and hardware redundancy
basic input output system (bios)
stored in EPROM, initialises and tests the system hardware and loads the OS Into RAM
device driver
hardware dependent and OS specific computer program that provides an interface to a particular hardware enabling the OS to access hardware functions
virtual machines
software used to emulate a machine (used for running one OS on another or executing intermediate code)
systems software
software needed to run the computer’s hardware and application programs
utility programs
software designed to optimise the performance of the computer
disk defragmentater
a program that reorganises a magnetic hard disk so files which have been split are recombined making reading faster
defragmentation - SSD
data is accessed randomly thus fragmentation doesn’t affect access speed additionally this shortens the lifetime
automatic backup
users may forget to backup files, this can be automated by specifying the destination (where), the sources (what) whether it’s compressed (how), and when
automatic updates
detects software update releases and automatically installs them
virus checker
scans permanent storage for viruses by comparing files to known virus definitions, sometimes uses heuristics (looks for types of behaviour likely to be used by a virus) to guess which programs are viruses
compression software
reduces the size of files so they can be transmitted or stored
application software
software that performs a task to benefit the user
general-purpose software
word-processor, spreadsheet, graphics package
special-purpose software
payroll and accounts packages, hotel booking systems, fingerprint scanning systems
off the shelf software
ready made software available to anyone to purchase
bespoke software
software that is custom created for a specific user
off the shelf - properties
less expensive due to wider customer base, may contain unwanted features, ready to be installed immediately, well documented, well tested, error free
bespoke software - properties
more costly, customised features, potentially long development time, may contain errors which don’t surface immediately
open source software
allows anyone to access its source code, licensed but free to use, anyone may modify the software and sell it if the software is also open source
closed source/proprietary software
does not allow access to source code, users must pay copyright owner for a licence, potentially restrictions on how the software can be used
freeware
software is free but source code isn’t available
selecting an applciation
functionality, hardware compatibility, availability, cost, reliability
assembly code
a low level language where each instruction is a TLA and almost always equivalent to one machine code instruction
assembler
translates assembly code to machine code
compiler
translates a high level language to machine code in one go
interpreter
translate and execute code line-by-line stopping if the line contains an error
compiled langages
C++ visual basic
interpreted languages
python, javascript
bytecode
source code (java) is compiled into bytecode, an intermediate step between source code and machine code, which is then converted by an interpreter
compilers advantages
produce an executable file (no need to recompile), hide source code from end user
compilers disadvantages
must be reinterpreted if code is changed, can only be executed on a certain device
interpreters - advantages
can be run on any machine with the appropriate interpreter, useful for program development (no need to recompile everytime error occurs)
interpreters - disadvantages
slower to run
stages of compilation
lexical analysis, syntax analysis, code generation, code optimsation
lexical analysis
white spaces and comments are removed, compiler will create tokens of keywords, constants and identifiers and keywords are assembled into a symbol table
symbol table
entries in the table show the identifier/keyword, the kind of item, the data type of the item, the run-time address/value
syntax and semantic analysis
tokenized code i s compared to the syntax rules and errors are generated if rules are broken, checks for semantic errors
code generation
object code is generated
code optimsiation
code is optimised for efficiency, aims to remove redundant instructions and replace inefficient code
libraries
pre-written, compiled and tested programs that offer shortcuts
linkers
put the appropriate machine addresses in all the external call and return instructions so modules are linked correctly
libraries - advantages
they are tested and error-free, save time
loaders
copies the program and any linked subroutines into main memory to run