Operating System Notes
Operating System Notes
NEEDS:
- Interrupt management
- Security (firewall)
- User interface
MEMORY MANAGEMENT
-computer RAM must be shared fairly between multiple programs and
applications that are being used at a certain point (often main memory
isn’t large enough to store ALL the applications currently being run.
One role the operating system has is to determine and allocate the length
of processor time each task receives using the THREE FOLLOWING
METHODS.
PAGING
-memory is split into equally sized sections known as pages each program
is made up of a certain number of them and swapped between the main
memory and hard disk as needed
SEGMENTATION
-they represent the structure and logical flow of the program with
segments being allocated to certain BLOCKS of code such as loops or
conditional statements
VIRTUAL MEMORY
-this uses a section of the hard drive to act as RAM when the space in RAM
is insufficient to store the programs currently being used
-section of the program that are not CURRENTLY in use are stored virtually
in the hard disk via paging freeing up some space in RAM for other
processes that need to be there
Issue: disk thrashing (when the computer freezes as a result of the pages
being swapped too frequently between the hard disk and main memory)
This mapping allows each program to remain isolated from each other and
allows efficient memory management
The virtual addresses are decoded by the MMU and then can be accessed
INTERRUPT MANAGEMENT
An interrupt is a signal generated from a software or hardware to indicate
that there is a process that needs some attention from the processor.
There are varying priorities and urgencies the operating system takes into
account when allocating processor time.
-at the end of EACH FETCH DECODE EXECUTE CYCLE the processor checks
the contents of the interrupt register
-if an interrupt is there with higher priority to the process being executed
the current contents of the special purpose registers in the CPU are
temporarily transferred to a stack to take care of the interrupt
The ISR contains code needed to handle the interrupt eg saving the
current state of the CPU ,handling the interrupt, restoring the CPU state
-if so the process above is repeated until all higher priority interrupts have
been serviced, then all contents in the stack are transferred back to the
special purpose registers
RESOURCE MANAGEMENT
It ensures all sections of programs being run receive a fair amount of
processing time each
-one slice is given to each task alternating between them UNTIL all of
them are done
-although round robin ensures all are seen to longer jobs will take much
longer for completion due to inefficient splits into multiple cycles
-this is most suited to BATCH systems where shorter jobs are given
preference to minimise waiting time
-however does require pre knowledge on how long each job will take which
is not always possible or accurate
UTILITY SOFTWARE
Most OS’ come pre built with utility programs users can
add additional ones if wanted
Eg deleting data, disk defragmentation, user accounts
and security, anti-virus software, updates, system
cleanup ,encryption , formatting
TYPES OF OPERATING SYSTEMS
-DISTRIBUTED:
Its like a regular operating system but tis designed to manage MULTIPLE
computers that are connected to one another in a network ,it makes them
work together like a single system
It allows the load to be spread over multiple processors when a task is run
and allows easy resource sharing and communication
-EMBEDDED:
-MULTI-TASKING:
-MULTI-USER:
Eg linux it allows each user to log in and access their own information and
keeps each user isolated
-REAL TIME:
BIOS
Stands for the Basic Input Output System it’s the first program that runs
when a computer system is turned on
Its stored on a small memory chip on the motherboard its flash memory
so can be changed
The PC register points to the location of the BIOS upon each start up of
the computer its responsible for running various test and processes before
the OS can be loaded into memory
2)to load the bootloader program from the hard disk (this has the ordered
steps that lead up to downloading the OS into main memory)
STEP ONE: the power button is turned on and the computer receives
power.at this point ROM is the only memory that can be used as it is non
volatile and it will contain a small set of instructions including the
BIOS .This is used to carry out the next processes
STEP TWO: the POST is run first it checks If all hardware is connected (if
everything needed is available for usage)
STEP THREE: clears anything that might still be in the registers of the CPU
(safety step done regardless of the fact that it is volatile)
STEP FIVE: control is passed over to the boot program it carries out its own
hardware checks
STEP SIX: it checks for any other parts of the BIOS stored on the hard
drives/solid state drives/the CMOS chip and pulls any information needed
from it. For example the CMOS has system settings stored on it (eg
system time, hardware settings etc)
DEVICE DRIVERS
Piece of software that allows an operating system to communicate with
and control hardware devices eg printers ,keyboards etc
Each hardware device needs different outputs from the computer (made
from different manufacturers with different standards)
FOR EXAMPLE
The driver is also specific to the operating system installed on the device
VIRTUAL MACHINES
A software implementation that has the same functionality as a physical
computer system , it is when a single physical computer can have many
OS running on the machine at the same time each one performs as if it
were an independent computer system itself
Say there’s a laptop with the Windows operating system to use the Linux
operating system for example wed normally need a separate physical
computer to do this
Virtualization is that NO SEPARATE HARDWARE IS NEEDED you can install
the operating system on top of another one you can achieve this using a
hyper visor
It allows you to host multiple types of operating systems onto one physical
machine
You can only give the OS the resources the physical machine has ie the
set number of cores and capacity of RAM
Each virtual machines are completely isolated each one acts as if it’s they
are an independent computer.
INTERMEDIATE CODE
Java is a good example it is designed to run on many different platforms
WITH traditional old-fashioned programming you would have to use
specific language of each device or a suitable compiler for that device
JAVA GETS AROUND THIS by compiling its code into halfway code known
as intermediate code .it is halfway between machine code and object
code(the programming language)