Topic C Flashcards
What is multiprogramming?
- Loading several programs into memory simultaneously, all sharing a single CPU
- when the running program can’t continue (waiting for I/O) switch to another program
What is Multi-Access Time Sharing?
Each program has time slices. The program will run for a specified amount of time that’s dictated by the operating system then switch into waiting after it’s time slice is up
How long are time slices?
milliseconds long
what does the CPU switching rapidly between processes do?
It gives the illusion of uninterrupted execution in parallel
- makes it seem like multiple programs are running at once
What is the idea of a time slice?
the OS will split process time into a fixed quantum. At the end of a time slice the CPU sends an interrupt to the OS which puts a bit of its own OS code onto the CPU this code swaps out the running process and puts a new process onto the CPU, sets up the instruction pointer to wherever it needs to go and that program runs on the CPU
What is an interrupt
an automatic call of a sequence of instructions to deal with an event occurring outside normal program execution
what is the ISR
The sequence of instructions stored in that reserved area of memory
What is the interrupt service routine also known as?
the interrupt routine or interrupt handler
How do we protect the register values of the program that was running when an interrupt happened?
- we save them all in the process control block
- this is a table of descriptors one for each process maintained by the OS
What happens during a context switch?
The state of the current program gets stored in its process control block.
What is the difference between programs and processes
- A program is a static thing that the programmer writes, it could be source code or object code
- the process is the running version of a program
- A single program can have multiple processes
What does an OS structure consist of?
- A central kernel
- A set of processes
- system calls
What does the kernel do?
performs low level, frequently needed activity. Performs 4 processes in particular that help to keep the computer under control
What does the system calls do?
allows a particular process wants to spawn another process to do something.
What is the bootstrap program
it reads from the OS from disk and puts it into memory. It loads the IP and points it to the first instruction of the OS itself
What is the command interpreter or shell?
It’s a normal user level process that might have some built in commands but usually it waits for the user to request to run a program/series of programs and it will trigger the processes that are needed to make that happen.
how do we request the command interpreter’s services?
Via System calls
What are the 5 major components of the OS
The processor manager The memory manager The file manager The device manager The user command interface
What are the 4 managers inside an OS?
The processor manager The memory manager The file manager The device manager (the network manager is the 5th which is part of more modern systems)
What tasks must each subsystem manager must perform?
- monitoring of resources
- enforcement of policies that determine who gets what resources
- allocation of resources
- de-allocation of resources
What does the memory manager do?
- preserves/protects space in memory occupied by the OS
- checks validity of each request for memory space
- allocates memory for legal requests
- keeps track of which users are using which sections of memory
- de allocates memory that’s no longer needed
What does the processor manager do?
- creates processes when necessary to carry out tasks
- performs initialisation of new processes
- keeps track of processes’ status
- assigns processes to the CPU
- changes state of a process
- Handles termination of processes
- handles inter-process communication
- manages prioritisation of processes
What does the device manager do?
- allocates the system’s devices
- deals with multiple requests for the same device
- communicates with devices during operation
- deallocates devices when no longer needed
What does the file manager do?
f
What does the network manager do?
- provides facilities for users to share resources while controlling access to them
- has a network stack that holds all of the protocols in TCP/IP and retrieving an IP address, making sure you have an IP address, making sure you know what your DNS are.
What does each process have as part of it’s process descriptor?
- they all have a different ID so that the OS can identify them programmatically
What does the device manager do?
- allocates the system’s devices
- deals with multiple requests for the same device
- communicates with devices during operation
- deallocates devices when no longer needed
What are the three main states?
running, ready, blocked (waiting)
What does the network manager do?
- provides facilities for users to share resources while controlling access to them
- has a network stack that holds all of the protocols in TCP/IP and retrieving an IP address, making sure you have an IP address, making sure you know what your DNS are.
What does each process have as part of it’s process descriptor?
- ## they all have a different ID so that the OS can identify them programmatically
What does the Process Control Block contain?
- unique process ID
- process state
- position in memory
- accounting stats (time used)
- resources allocated
- register values?
What are the three main states?
running, ready, blocked (waiting)
How many processes are in each state?
Only 1 in the running state, many in the ready state and many in the blocked/running state
How do interrupts effect processes in each state
- a process in the running state will receive an interrupt saying its time slice is up and to move into the blocked(waiting) state
- a process in the blocked state will receive an interrupt telling it it has received what it was waiting for and to move into the ready state