Operating System Fundamentals: System Calls, Processes, Files

Classified in Computers

Written on in English with a size of 3.37 KB

System Calls: Core OS Interaction

A system call is the mechanism used by an application program to request a service from the operating system.

How a System Call is Made

When a call is made, it involves placing a set of parameters in a specific memory location and then executing a machine language instruction for the processor.

Common POSIX System Calls

In operating systems, common POSIX system calls include: open, read, write, close, wait, exec, fork, exit, and kill.

Understanding Processes

A process is an abstraction of a running program, also referred to as a task.

Process Model Properties

  1. All software executables are organized into several sequential processes.
  2. A process includes the running program, the current values of the program counter, registers, and its variables.
  3. Each process has its own virtual CPU.

Process Hierarchies

The operating system must have a mechanism to create and destroy processes as required during its operation.

Process States and Interactions

  1. Each process is an independent entity but often must interact with other processes.
  2. Processes can be temporarily halted in their execution because:
    • Expected data is not yet available.
    • The OS has assigned the CPU to another process.
  3. The common states a process can have are:
    • Running
    • Ready
    • Blocked

Signal Handling and Interrupts

Signal Handling with System Calls

After a system call, if it generates a relevant signal (e.g., an interrupt), the state of the process is logged onto its stack, followed by a call to the signal handler. When the signal handling procedure terminates, the system simply returns to the original process state.

Understanding Interruptions

An interruption (or interrupt) is an event that alters the sequence in which the processor executes instructions.

OS Actions During an Interrupt

  1. The operating system gains control.
  2. It saves the state of the interrupted process, usually in its Process Control Block (PCB).
  3. It analyzes the interruption.
  4. It transfers control to the appropriate routine for handling the interruption.

File Management in Operating Systems

What is a File?

A file is a collection of data stored in a physical environment, assigned a name, and typically grouped within directories.

Importance of File Systems

One of the main functions of an operating system is information storage management, which necessitates a robust "File System".

Defining the File System

A File System refers to the mechanisms and structures that the OS uses to organize information on physical storage media.

Key File Management Functions

  • Identify and locate a selected file.
  • Utilize a directory to describe the location of all files and their attributes.
  • Apply access control for users in shared systems.
  • Manage file blocks.
  • Allocate files to free blocks.
  • Manage free space.

Related entries: