OS Structure - Chapter 2
Services

Service is a function that is of use to the user
- UI (i.e. command line, GUI)
- Program execution
- IO operations
- File system manipulation
- ...
System calls
System call - makes calls to the OS to run certain services such as make a process
API - application programming interface - can be used to access the system call interface

The open system call is hidden from the programmer.
i indexes a pointer that points to the system call.

Types of System call
Example of a system call

- When you call printf() - note that you are in user mode, this then corresponds to a system call
System Programs/Utilities
Typically provide a user friendly way to invoke system calls, however they can bee more complex.
- File management. These programs create, delete, copy, rename, print, dump, list, and generally manipulate files and directories.
- Status information. Some programs simply ask the system for the date, time, amount of available memory or disk space, number of users, or similar status information. Others are more complex, providing detailed performance, logging, and debugging information. Typically, these programs format and print the output to the terminal or other output devices or files or display it in a window of the GUI. Some systems also support a registry, which is used to store and retrieve configuration information.
- File modification. Several text editors may be available to create and modify the content of files stored on disk or other storage devices. There may also be special commands to search contents of files or perform transformations of the text.
- Programming-language support. Compilers, assemblers, debuggers, and interpreters for common programming languages (such as C, C++, Java, Visual Basic, and PERL) are often provided to the user with the operating system.
- Program loading and execution. Once a program is assembled or compiled, it must be loaded into memory to be executed. The system may provide absolute loaders, relocatable loaders, linkage editors, and overlay loaders. Debugging systems for either higher-level languages or machine language are needed as well.
- Communications. These programs provide the mechanism for creating virtual connections among processes, users, and computer systems. They allow users to send messages to one another’s screens, to browse Web pages, to send electronic-mail messages, to log in remotely, or to transfer files from one machine to another.
Major activities regarding process management
- creation and deletion of user processes
- suspending and resuming processes
- synchronisation of processes
- process communication
- deadlock handling
Major activities regarding memory management
- Keeping track of which parts of memory are being used and by whom
- deciding which processes to be loaded into memory
- allocating and deallocating memory, when space is needed
Major activities for secondary storage
- free-space management
- storage allocation
- disk scheduling
Command interpreter
A tool used to convert human commands, into calling system calls.
Fork and Exec
fork() - creates a new process
exec() - exec replaces the current process with a new process
System programs
Bundles of system calls that are used for common jobs by the user.
Bootmanager
A system program that allows you to choose which OS you want to load.

