L1- Functions of an operating system (Chapter 7)

studied byStudied by 0 people
0.0(0)
Get a hint
Hint

What does the OS do?

1 / 14

flashcard set

Earn XP

15 Terms

1

What does the OS do?

The OS manages the hardware and provides an interface for the user and the application software

New cards
2

Memory management- paging

-A page is a fixed-sized division of physical memory.

-Memory manager gives each page a number and records the location in a ‘page table’.

-A process currently in use may be held in non-contiguous pages.

-A page table uses mapping to store a link between the physical memory address and the logical address space of each process.

New cards
3

Memory management- segmentation

-Segments are differently-sized complete logical sections of programs

-They are logical divisions

-E.g., if there are two free spaces but a program is too big to fit all of it in either space then the program will be split up LOGICALLY so a subroutine could be stored in one free space and the main program is stored in the other space

-WHEREAS, if it were paging, the program would fill up the first free space and then the rest of the program would be stored in the remaining free space.

New cards
4

Memory management- virtual memory

-When the RAM runs out of space, programs that aren’t being used currently are moved to the virtual memory on the hard disk.

-When the programs are needed again, they can be swapped out for another program in the main memory.

-However, the disadvantage of using virtual memory is that it is slower since fetching programs from virtual memory takes longer than fetching from RAM.

New cards
5

What is an interrupt?

An interrupt is a way for other devices and applications to signal to the processor that they require attention during a FDE cycle- they always have higher priority than normal programs.

New cards
6

Interrupt Service Routine

-When there is an interrupt, the processor needs to stop executing its current program to run code for the interrupt so there is an interrupt service routine (a program with a set of instructions that need to be fetched, decoded, and executed to carry out operations of the interrupt).

-When an interrupt is received, the values held in the registers (PC, MAR, MDR, CIR, ACC) are pushed onto a stack in a stack frame, saving them for later retrieval.

-The interrupt is executed.

-Once the interrupt is complete, the frame is popped off the top of the stack and the processor carries on executing the original program.

-IF an interrupt is interrupted, the interrupt service routine is suspended, its registers’ contents are pushed onto a stack and the second interrupt service routine is executed.

-Interrupt examples: screen recording application, power supply failure, etc.

New cards
7

Peripheral Management

-The OS has software called device drivers which enables it to control and interact with peripheral devices e.g., printers, graphics cards, network cards, etc.

-Many external devices have embedded system software, so a driver bridges the gap between a major operating system and a tiny hardware OS.

-Device drivers allow the OS to perform specific operations on the hardware e.g. a printer driver enables the OS to send print commands and manage print jobs

-Most hardware manufacturers write their own device driver software, meaning a single operating system may have several printer drivers installed

-When data is sent to a printer, the OS will communicate with the printer to ensure it’s switched on, check that it is a printer, etc. and then the data to be printed will be transferred to an area of memory called a buffer, so the CPU can carry on with another task- the buffer compensates for the difference in speed between the CPU and the printer/output device.

New cards
8

Backing Store Management

-When files/applications are loaded, they are transferred from backing storage into main memory.

-The OS keeps a directory of where files are stored so they can be accessed quickly.

-The OS also needs to know which areas of storage are empty so new files/applications can be stored there.

-The file management system that comes with a desktop OS enables us to move/delete files and folders and protect others from unauthorised access.

New cards
9

What is preemptive scheduling?

  • Allocates the CPU for a specific time quantum to a process

  • Allows interruption of processes currently being handled

  • It can result in low-priority processes being neglected if high-priority processes arrive frequently

  • Example algorithms include Round Robin and Shortest Remaining Time First

New cards
10

What is non-preemptive scheduling?

  • Once the CPU is allocated to a process, the process holds it until it completes its burst time or switches to a 'waiting' state

  • A process cannot be interrupted unless it completes or its burst time is reached

  • If a process with a long burst time is running, shorter processes will be neglected

  • Example algorithms include First Come First Served and Shortest Job First

New cards
11

Processor scheduling- round robin

-Pre-emptive program

-Each job is allocated a time slice during which it can use the CPU’s resources.

-If the job has not completed by the end of its time slice, the next job is given a time slice.

-The allocation of time slices continues until the jobs are finished.

New cards
12

Processor scheduling- first come, first served

-Non-pre-emptive algorithm

-The first job to arrive is executed to completion (similar to a supermarket queue)

New cards
13

Processor scheduling- shortest job first

-Non-pre-emptive algorithm

-All programs are continuously sorted by burst time from shortest to longest

-When new processes arrive on the queue, they are prioritised based on their burst time in the next cycle

-Shorter jobs are placed at the front of the priority queue

-Longer jobs have lower priority, so they are placed at the back

New cards
14

Processor scheduling- shortest remaining time

-Pre-emptive algorithm

-The job with the shortest estimated time to completion is run until a new job with a shorter estimated completion time arrives

-This can cause “job starvation”, which is said to occur when long jobs are held off indefinitely as new, shorter jobs continually join the queue.

New cards
15

Processor scheduling- multi-level feedback queues

-Pre-emptive algorithm

-Multiple queues with different priority levels are created

-If a job uses too much CPU time it is moved to a lower priority queue

-Processes can also be moved to a higher priority queue if they have waited a long time

New cards

Explore top notes

note Note
studied byStudied by 20 people
... ago
5.0(2)
note Note
studied byStudied by 9 people
... ago
5.0(1)
note Note
studied byStudied by 27 people
... ago
5.0(1)
note Note
studied byStudied by 17 people
... ago
5.0(1)
note Note
studied byStudied by 17 people
... ago
5.0(1)
note Note
studied byStudied by 48 people
... ago
4.5(2)
note Note
studied byStudied by 11 people
... ago
5.0(1)
note Note
studied byStudied by 585 people
... ago
4.0(5)

Explore top flashcards

flashcards Flashcard (60)
studied byStudied by 53 people
... ago
5.0(1)
flashcards Flashcard (26)
studied byStudied by 27 people
... ago
5.0(2)
flashcards Flashcard (150)
studied byStudied by 22 people
... ago
5.0(2)
flashcards Flashcard (57)
studied byStudied by 3 people
... ago
5.0(1)
flashcards Flashcard (46)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (37)
studied byStudied by 3 people
... ago
5.0(1)
flashcards Flashcard (163)
studied byStudied by 7 people
... ago
5.0(2)
flashcards Flashcard (30)
studied byStudied by 55 people
... ago
5.0(1)
robot