0% found this document useful (0 votes)
2 views9 pages

Operating System Notes

The document provides an overview of operating systems, detailing their functions such as memory management, resource management, and user interface. It describes various types of operating systems, including distributed, embedded, multitasking, multi-user, and real-time systems, along with their specific roles and characteristics. Additionally, it covers BIOS, device drivers, virtual machines, and the concept of intermediate code in programming.

Uploaded by

shaambavy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Operating System Notes

The document provides an overview of operating systems, detailing their functions such as memory management, resource management, and user interface. It describes various types of operating systems, including distributed, embedded, multitasking, multi-user, and real-time systems, along with their specific roles and characteristics. Additionally, it covers BIOS, device drivers, virtual machines, and the concept of intermediate code in programming.

Uploaded by

shaambavy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

OPERATING SYSTEM NOTES

Operating system-a collection of programs that work together to provide


an interface between a user and the computer it’s a software that controls
the computer’s hardware and software resources ( Allows the software to
interact with hardware)

Some well-known desktop ones include windows, macOS

Or phone ones such as iOS and android

NEEDS:

-it allows multiple applications to be written more easily to work on ONE


common operating system than on individual computers(before the
programs made had to have ALL the code to run the computer)

It handles operations common to many types of software, so EACH


SOFTWARE does not need to have it already programmed into it -this
allows more flexibility to run a variety of applications .

- Memory management (paging, segmentation, virtual memory)

- Resource management (scheduling)

- File management (moving, editing, deleting files and folders)

– Input/ Output management (device drivers)

- Interrupt management

- Utility software (disk defragmenter, backup, formatting etc.)

- Security (firewall)

- User interface

Mother Rathy Fails IQ Interrogations Until Sara Understands

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

The data is PHYSICALLY DIVIDED

SEGMENTATION

-the memory is split into logically sized divisions known as segments


which can vary in size.

-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

The data is LOGICALLY DIVIDED

Both ways of partitioning / splitting up memory


Use virtual memory / backing store to swap parts of
programs
Allow programs larger than memory to run / insufficient
memory
Allows programs to be stored in memory
noncontiguously

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)

As a result more time is spent transferring and switching between these


pages than actually spent processing and running them .this gets worse
as virtual memory is filled up.

Organise the use of (main) memory… …by converting


logical addresses to physical addresses
Ie the programs you run do not need to directly interact with the actual
RAM ADDRESS instead the virtual memory system(modifies the address )
maps the location of them in either RAM or the hard disk

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

Allows programs to share memory / allocate memory… …


& protect programs / data from each other
It creates boundaries between each program preventing access between
them

Allows programs larger than main memory to run

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.

Interrupts are stored in a priority queue with an interrupt register

Examples are a peripheral device indicating a power failure/completion of


a print job

INTERRUPT SERVICE ROUTINE

-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 processor responds to the interrupt by loading the appropriate ISR


into RAM and changing the program counter to indicate this

The ISR contains code needed to handle the interrupt eg saving the
current state of the CPU ,handling the interrupt, restoring the CPU state

-a flag is set to signal the ISR has begun


-once the interrupt has been services the flag is reset the interrupt queue
is checked again for further interrupts of a higher priority to the process
that was ORIGINALLY being executed

-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

-using various scheduling algorithms can allow this

THESE ALGORITHIMS CAN BE PRE-EMPTIVE OR NON-PRE-EMPTIVE

Pre-emptivejobs are actively made to stop and start by the


operating system to move onto the next task

Non-pre-emptiveonce a job is started it is left alone until it is


completed

WHY IS SCHEDULING NEEDED

Process as many jobs as possible… …in least possible time /


quicker Ensure all jobs are processed (fairly)
Maximise number of interactive users… …with fast response
times / real time
Efficient use of resources / processor time
ROUND ROBIN
-each job is given a section of processor time (a time slice) within which it
is allowed to execute

-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

-DOES NOT take into account job priority

FIRST COME FIRST SERVED


-chronological order by which they entered the queue
-NO priority considered and once a job starts if it is slow it wastes
processor time

MULTILEVEL FEEDBACK QUEUES


-makes use of MULTIPLE queues each which is ordered based on a
different priority

-can be difficult to implement due to deciding which job to prioritise based


on the many combinations possible

SHORTEST JOB FIRST


-the queue storing the jobs is ordered according to time required for
completion with the longest jobs being serviced at the end

-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

-risk of processor starvation if short jobs continue being added to the


queue(when a particular task doesn’t not receive enough time to execute
and be completed)

SHORTEST REMAINING TIME


-the queue is to be ordered according to the time left for completion with
the jobs with the least time to completion being serviced FIRST

-again risk for processor starvation

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:

Built to perform a small range of specific tasks its catered towards a


specific device and catered towards a specific device

They are LIMITED in functionality and hard to update although it consumes


significantly less power(fewer processing demands, limited connectivity
no need for power intensive network communications, optimised hardware
DESIGNED for the tasks compared to more general purpose hardware)

-MULTI-TASKING:

Enable the user to carry out tasks SEEMINGLY simultaneously by using


time slicing to switch between applications and programs in memory

Ensures fair share of CPU resources and allows simultaneous applications


to run without disruption

Eg Microsoft windows switching between tabs and browsers all at the


same time

-MULTI-USER:

Multiple users make use of ONE COMPUTER typically a supercomputer


within this system

A scheduling algorithm must be used to ensure fair processor resource


sharing between jobs

Without it there’s a risk of processor starvation

Ensures privacy and separation for each user

Eg linux it allows each user to log in and access their own information and
keeps each user isolated

-REAL TIME:

Commonly used in time critical computer systems a real time OS is


designed to perform a task and give a response within a guaranteed time
frame

Eg within self-driving cars or any situations where a response is needed in


a certain period of time
Often rely heavily on interrupt handling as it responds to time sensitive
events

They are optimised for response times rather than throughput

BIOS
Stands for the Basic Input Output System it’s the first program that runs
when a computer system is turned on

It’s a piece of firmware a form of microcode embedded into hardware


devices to help them operate

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

1)the POST to ensure all hardware is connected and functional

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)

3)to check if the CPU clock, memory and processor is operational

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 FOUR: the address of the FIRST INSTRUCTION in the bootloader


program is loaded into the PC the bootloader has a variety of tasks it
carries out

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)

STEP SEVEN: it combines all the BIOS information(IE FROM THE


RAM,CMOS,HDD) and sends it to RAM all this information sent together is
known as the boot file.

STEP EIGHT: the computer is now ready to load up the OS which is


normally found on the hard disk and the OS is in control now.

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)

Eg documents from hundreds of printer should look the same despite


technology between them

The device driver translates the operating systems instructions into a


series of instructions that a specific piece of hardware will understand

FOR EXAMPLE

When a keyboard is used the device driver communicates this request


with the operating system (eg identifies the keyboard ,notifies the OS of
its presence, monitoring for keyboard presses and communicating errors
etc)

Each device driver is also specific to the computers architecture so


different drivers must be used for different device types such as phones,
game consols and desktop PCs.

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

It enables the user to isolate and run different software environments on


the same hardware.

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.

This separation is good as if something breaks inside/uses malware the


virtual machine it won’t affect the host machine .if this happens you can
delete that VM and create another one

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)

A java virtual machine converts it on a target device it converts the


intermediate code into machine code. This makes the code highly portable
between devices

Advantages of virtual machines disadvantages


-saves money and time for testing -running intermediate code in a
code on different operating virtual machine can be slower
systems as you do not need compared to running the normal
separate devices for this it can all low level code on the designed
be done on one machine device(on virtual machines shared
-IN SOME cases it can protect the resources between OS,
main physical machine from interpretation of code can take
malware as they are typically long as well)
isolated from each other and the
host system HOWEVER there are
scenarios where it can still be
affected

You might also like