3 System Calls

Embed Size (px)

Citation preview

  • 8/4/2019 3 System Calls

    1/9

    System Calls

  • 8/4/2019 3 System Calls

    2/9

    System Calls

    In computing, a system call is how a program requestsa service from an operating system's kernel that it doesnot normally have permission to run.

    System calls provide the interface between a processand the operating system.

    Most operations interacting with the system requirepermissions not available to a user level process, e.g.

    I/O performed with a device present on the system, orany form of communication with other processesrequires the use of system calls.

  • 8/4/2019 3 System Calls

    3/9

    Privileges

    The design of the microprocessor architecture practically on

    all modern systems (except some embedded systems) offers aseries ofCPU modes

    The (low) privilege level in which normal applications execute

    limits the address space of the program so that it cannot

    access or modify other running applications nor the operating

    system itself.

    It also prevents the application from directly using devices

    (e.g. the frame buffer or network devices). But obviously

    many normal applications need these abilities; therefore, pre-

    defined system calls are made available by the operating

    system.

    The operating system executes at the highest level of

    privilege, and allows applications to request services via

    system calls, which are often implemented through interrupts.

  • 8/4/2019 3 System Calls

    4/9

    Privileges

    If allowed, the system enters a higher privilege level,executes a specific set of instructions over which theinterrupting program has no direct control, returns tothe calling application's privilege level, then returns

    control to the calling application. This concept alsoserves as a way to implement security.

    With the development of separate operating modeswith varying levels of privilege, a mechanism was

    needed for transferring control safely from lesserprivileged modes to higher privileged modes.

  • 8/4/2019 3 System Calls

    5/9

    Library as an Intermediary

    Generally, systems provide a library or API that sitsbetween normal programs and the operating system,that provides functions for the system calls,

    The library's wrapper functions expose an ordinaryfunction calling convention (a subroutine call onthe assembly level) for using the system call, as well asmaking the use of the system call more modular.

    In this way the library, which exists between the OS

    and the application, increases portability.

  • 8/4/2019 3 System Calls

    6/9

    Groups of System Calls

    Process Control.

    load

    execute

    create process

    terminate process

    get/set process attributes

    Wait for time, wait event, signal event

    allocate, free memory

  • 8/4/2019 3 System Calls

    7/9

    Groups of System Calls

    File management.

    create file, delete file

    open, close

    read, write, reposition

    get/set file attributes

  • 8/4/2019 3 System Calls

    8/9

    Groups of System Calls

    Device Management.

    request device, release device

    read, write, reposition

    get/set device attributes

    logically attach or detach devices

  • 8/4/2019 3 System Calls

    9/9

    Groups of System Calls

    Information Maintenance.

    get/set time or date

    get/set system data

    get/set process, file, or device attributes

    Communication.

    create, delete communication connection

    send, receive messages transfer status information

    attach or detach remote devices