commonalities
1. multiprogramming
without mutiprogramming single user will keep CPU and I/O devices busy all the times because once cpu takes users job it won't be able to take any other job until it finishes.
with mutiprogramming CPU util will increase by organizing jobs so that CPU always has one to execute
with mutiprogramming if job1 tries to use I/O devices CPU doesn't wait for job1 it execute other like job2 unti job1 finish I/O operation. CPU doesn't remain idle.
but don't provide user interaction with the computer system.
2. time sharing (multitasking)
CPU executes mutiple jobs by switching among them. providing direct communication between the user and system.
uses CPU scheduling and mutiprogamming to provide each user with a small portion of a time-shared computer.
each user has at least one separate program in memory(virtual). program loaded into memory and executing is called a "process"
1. User Interface = CLI ,GUI
Command Interpreter = shell (bash ,zsh..)
- codes are contained in the command interpreter itself.
- codes are contained in certain program and command interpreter calls the program.
2. Program Execution
3. I/O operations
4. File System manipulation
5. communications
6. Error detection
7. Resource Allocation
8. Accounting = which user use how much resource? , statistic log
9. Protection Security
System calls
User mode Program might needs to access memory or other resource than it mode shifting happens and program becomes kernel mode and use resource and come back to usermode.
System calls made by program when it needs to access some resources. usually written in C and C++.
Types of System call
1. Process Control
- end, abort(hold when encounters error)
- load, execute
- create,terminate process
- get, set process attributes
- wait for time
- wait event, signal event
- allocate and free memory
2. File Manipulation
- create, delete file
- open, close
- read, write, reposition
- get , set file attributes
3. Device Management
- request , release device
- read , write , reposition
- get , set device attributes
- logically attach , detach devices
4. Information Maintenance
- get , set time or date
- get ,set system data
- get , set process , file , device attributes
5. Communications
- create, delete communication conncetion
- send , receive messages
- trasfer status information
- attach or detach remote devices