OS Module1 Unit2
OS Module1 Unit2
Department of AIML
Semester /
Course Code : BCS303 III / II
Year :
Academic
Course Title : Operating Systems 2024-25
Year :
Module 1
2
Operating System Services
Operating Systems Interface
System Calls
Types of System Calls
System Programs
Operating-System Design and Implementation
OS Structure
Virtual Machine
OS Debugging
System Boot
3
Operating System Services
Operating System Services
How system calls are used: writing a simple program to read data from one file and copy
them to another file.
The first input that the program will need is the names of the two files: the input file and the
output file. This sequence requires many I/0 system calls.
Once the two file names are obtained, the program must open the input file and create the
output file. Each of these operations requires another system call.
There are also possible error conditions for each operation. In these cases, the program
should print a message on the console (another sequence of system calls) and then terminate
abnormally (another system call).
If the input file exists, then we must create a new output file. We may find that there is
already an output file with the same name. This situation may cause the program to abort (a
system call), or we may delete the existing file (another system call) and create a new one
(another system call).
System Calls
Now that both files are set up, we enter a loop that reads from the input file (a system call)
and writes to the output file (another system call). Each read and write must return status
information regarding various possible error conditions.
On input, the program may find that the end of the file has been reached or that there was a
hardware failure in the read (such as a parity error).
The write operation may encounter various errors, depending on the output device (no more
disk space, printer out of paper, and so on).
Finally, after the entire file is copied, the program may close both files (another system
call), write a message to the console or window (more system calls), and finally terminate
normally (the final system call).
System Calls
File management - Create, delete, copy, rename, print, list, and generally
manipulate files and directories
Status information
Some ask the system for info - date, time, amount of available memory,
disk space, number of users
Others provide detailed performance, logging, and debugging
information
Typically, these programs format and print the output to the terminal or
other output devices
Some systems implement a registry - used to store and retrieve
configuration information
System Programs (Cont.)
File modification
Text editors to create and modify files
Special commands to search contents of files or perform
transformations of the text
Programming-language support - Compilers, assemblers, debuggers
and interpreters sometimes provided
Program loading and execution- Absolute loaders, relocatable
loaders, linkage editors, and overlay-loaders, debugging systems for
higher-level and machine language
Communications - Provide the mechanism for creating virtual
connections among processes, users, and computer systems
Allow users to send messages to one another’s screens, browse web
pages, send electronic-mail messages, log in remotely, transfer files
from one machine to another
System Programs (Cont.)
Background Services
Launch at boot time
Some for system startup, then terminate
Some from system boot to shutdown
Provide facilities like disk checking, process scheduling, error logging,
printing
Run in user context not kernel context
Known as services, subsystems, daemons
Application programs
Don’t pertain to system
Run by users
Not typically considered part of OS
Launched by command line, mouse click, finger poke
Operating System Design and
Implementation
Design and Implementation of OS not “solvable”, but some approaches
have proven successful