An operating system is an essential piece of software that is loaded when a computer boots up.
An operating system (OS) is a piece of system software which controls the hardware within a computer.
Operating systems provide an application programming interface (API).
This is a set of code libraries that software developers can use to write applications for that operating system.
The operating system is responsible for many pieces of hardware, each of which is controlled by a dedicated 'manager':
The user interface (UI) manager provides the user interface which allows users to control the computer.
The device manager allocates resources to external hardware devices and allows them to be used by applications.
The memory manager controls the allocation of memory between applications.
The user manager authenticates and separates users of the computer.
The process manager controls the allocation of central processing unit (CPU) cycles to multiple running applications.
The file manager controls the opening, reading and writing of files in secondary storage.
An application programming interface (API) is a set of code libraries
An operating system is a piece of system software which controls the hardware within a computer.
Purpose of memory manager:
The memory manager controls the allocation of random access memory (RAM) to each running process.
If the memory manager fails to manage memory well, then the computer will slow down and might crash.
Purpose of process manager:
Modern operating systems allow users to run multiple programs at once.
In reality, a CPU can only execute one process at a time. So the CPU must switch between processes so quickly that it seems that they are running simultaneously.
Multitasking:
Modern operating systems allow multiple applications to run at once. This is known as multitasking.
For this to work, the operating system must manage how memory and CPU time is allocated to each running process.
The process manager is responsible for central processing unit allocation and multitasking
The memory manager controls the allocation of random access memory to each running process.
Operating systems are responsible for managing memory for the user. Managing memory can be done by paging or by segmentation.
Paging:
Paging splits the main memory (RAM) into 4 kb sections known as pages.
When programs run they are allocated a set number of pages to run in.
Programs can be split across lots of pages that are non-contiguous (not all together).
This is managed by a table map.
Performance: (paging)
Performance is not affected by having non-contiguous pages for your program.
Any pages being used that are not active can be sent to virtual memory to free pages up for other tasks.
Performance may be affected if some programs are split (e.g. when parts of a looping function are split across pages)
Pages being used that are not active can be sent to virtualmemory to free pages up for other tasks.
Segmentation:
There is no physical split in segmentation like in paging.
Each program is given a logical division of memory to operate in.
Segmentation process:
When a program loads, it is given enough memory for the parts it is currently trying to load.
The rest of the program is kept in storage until needed, but the logical section given to the program will need to be made bigger.
Programs that are split across logical splits (non-contiguous) suffer greatly for not being together.
Virtual memory: (segmentation)
Segmentation can also use virtual memory to store unused parts of programs in virtual memory to free space for something else.
logical division of memory is used in segmentation
In paging, programs are split across lots of pages that are non-contiguous.