chapter 2 - os structure Flashcards
System Calls are
programming interface to the services provided by the OS
System Calls are accessed
by programs via a high-level api
Methods of passing parameters to OS
- pass the parameters into the registers
- Store parameters in a block, table, or memory and the address of each block is passed into the register
- parameters are pushed onto the stack by a program and then popped off by the OS
Process Control is an OS service that
- Creates, terminates, ends, and aborts processes
- Loads and executes, gets and sets attributes
- Allocates and frees memory, dumps and debugs
File Managements is an OS service that
- Create, delete, open, close, get and set file attributes
Device Management is an OS service that
- request, release, reads, writes, and get/set device attributes
- logically attaches and detaches devices
Information Maintenance is an OS service that
- get/set time or date, system data, process, file or device attributes
Communications is an OS service that
- Create, and delete communication connection
- Send, and receive messages if the message passing model to hostname or process name
- shared-memory model create and gain access to memory regions
- attach and detach remote devices
Protection is an OS service that
- controls access to resources
- get and set permissions
- allow and deny user access
User mode processes:
executes on behalf of the user
Kernel mode processes:
executes on behalf of the kernel
Mode bit:
a bit in the hardware to switch between modes
Transitioning between User/Kernel mode
- user code calls a system call
- OS checks that everything is in order and legal then switch
- OS executes system call which may contain multiple privileged instructions
- mode again set to user mode
What does ‘su’ command perform
switch to super user account
what does ‘sudo’ do
run program on behalf of the superuser
(doesn’t necessarily switch to the kernel mode)
what does strace -c ls do
displays summary info on system calls invoked during the execution of the command ‘ls’
Changing the mode bit of the CPU ___ can only be done by a privileged instruction
from user mode to kernel mode
A supervisor (kernel call) is
- a privileged instruction that automatically transfers execution control to a well-defined location within the OS kernel
- the supervisor calls provide the interface between the OS kernel and the higher level software
T/F: A system call is a kernel function
False
MS-DOS
- written to provide the most functionality in the least space
- not divided into modules
- its interfaces and levels of functionality are not well seperated
Monolithic
- no structure, entire kernel is in a single binary file
- is high performance, with little overhead in the system call interface and fast communication
- difficult to implement and maintain
Layered Approach
- The operating system is divided into a number of layers, each built on top of lower layers
- the bottom layer is the hardware, and the highest is the UI
- easy to develop, debug and update
- less efficient, tricky to define layers