CS 439: Putting it all Together (Lec. 27)
Terms in this set (22)
Name 4 ways OS code can be entered.
3) System calls
Name the two modes of execution.
Privileged (aka kernel, supervisor)
What is the first thing that the CPU loads upon booting?
Boot program from ROM, e.g. BIOS
List 3 responsibilities of the boot program.
1) Examine machine configuration (# CPUs, amount of memory, etc)
2) Builds configuration structure describing the hardware
3) Loads the OS and gives it the config. structure
List the 3 things the OS initializes upon boot.
1) Kernel data structures
2) State of all hardware devices
3) Creates the necessary start processes (e.g. systemd, initd)
After the start processes are running, the OS enters the...
What is done within the
2) System management and profiling
3) Halt processor & enter low power mode
4) Wakes up on interrupt from hardware devices
Every command typed into the shell is a ___ of the shell, created through the system call ___()
When _fork()_ is called, what happens? Be specific about what's copied.
new child process is born from the parents (process who called fork())
Outline a new process start in 3 steps.
1) Initialized by creating PCB
2) Entering ready queue
3) Scheduled to run
Name (or draw) the life cycle of a process
What happens when IO is requested through a system call?
Control returns to OS
Describe the process for a file system read of /usr/asr/mbox/
Look at root directory '/'
Find 'usr' inode -> inode 6
Get block number of usr directory from inode 6 (block 132)
Go to block 132
Look at usr directory '/usr'
Find 'asr' inode -> inode 45
Get block number of asr directory from inode 45 (block 340)
Go to block 340
Look at asr directory '/usr/asr'
Find 'mbox' inode -> inode 91
Get block number of mbox from inode 93 (block 731)
Don't forget about permission checks!!
Describe the process for a file system write.
Same as read, but with a write to the last inode.
Describe a context switch in 4 steps.
1) OS chooses process to run
2) Loads register contents
3) Might flush TLB (translation lookaside buffer, a cache)
4) Updates MMU with page table of that process
What is a process' context? What does it contain?
Its virtual address space.
4) Registers, etc (also stored in PCB)
Where are the code pages of a process stored?
In a user's file on DISK
Where are data and stack pages stored?
In a file (only exists when a program is executing)
When data from read is ready, what happens, in 6 steps?
1) If not polling, interrupt is issued
2) OS regains control (kernel mode), checks register to determine which interrupt service routine to run
3) Handles interrupt
4) Copies data to requesting process' memory
5) Runs scheduler
6) Returns control to user process though RTI instruction
What trends are we seeing in computing?
More parallelism (multi-core, distributed systems), cheaper memory, network speed > disk speed
To speed things up, add...
You can solve any problem by adding a...
level of indirection