System Calls

By Danny Kalev, ITworld |  How-to Add a new comment

Every piece of code can run in one of two contexts: user mode and
kernel mode. A user's program normally runs in user mode. By contrast,
device drivers and file systems run in kernel mode. In user mode, the
code executes in a protected environment and thus can't damage the
system's other processes. Code that executes in kernel mode has full
access to the hardware and low-level system resources.

Consider a device driver. In order to operate, it must have
unrestricted access to the device it controls. Therefore, it must
execute in kernel mode. It provides services to processes running in
user mode, which cannot access the device directly. The technical
details of calling through user/kernel mode are usually hidden from the
programmer. A user typically invokes a system call (syscall for short)
that interacts with the hardware and returns a value. Superficially,
syscalls look like ordinary C functions. However, they differ from
ordinary functions in two important aspects:

* Argument passing

    Add a comment

    Post a comment using one of these accounts
    Or join now
    At least 6 characters

    Note: Comment will appear soon after you have activated your account.
    Obscene/spam comments will be removed and accounts suspended.
    The information you submit is subject to our Privacy Policy and Terms of Service.

    ITworld LIVE

    Ask a question

    Ask a Question