[EdCert previous] [EdCert next] [EdCert top]

The System

Kernel

As the name implies, the kernel is the core of the operating system. A kernel consists of a small collection of software that makes it feasible for the operating system to provide other services. The kernel facilitates four basic types of services:

Kernel functions are of two broad types: autonomous and responsive. Kernel functions, such as allocation of memory and CPU, are performed without being explicitly requested by user processes. Other functions of the kernel, such as resource allocation and process creation and management, are initiated by requests from processes.

These requests from processes come in the form of system calls. A system call can be thought of as a low level request to the operating system. Examples of system calls include:

For more essential information on the kernel see The UNIX System Kernel.

Processes

A process is the execution of a program. Some operating systems call the basic unit of execution a "job," some call it a "task." In Unix it's called a process. In the Unix kernel, anything that's done, other than autonomous operations, is done by a process issuing system calls.

Processes often spawn other processes (using the fork system call) that run in parallel with them, accomplish subtasks and, when they're finished, terminate themselves.

1.What is the process that another process starts called?

All processes have "owners." Typically the human owner of a process is the owner of the account whose login process spawned the process in question. When a process creates or spawns another process the original process is known as the parent while the process it creates is called a child process. The child process inherits the file access and execution privileges belonging to the parent.

Signals

One way that processes communicate with each other and with the kernel is through signals. Signals are used to inform processes of unexpected external events such as a time out or forced termination of a process. A signal consists of prescribed message with a default action embedded in it. Each signal has a unique number associated with it. An example is SEGV, segmentation violation. This signal is sent by the kernel if a user attempts to access illegal memory. The kernel sends this message to a process. If the process takes the default action upon receiving the message it will terminate.

For more essential information on processes and signals see Processes and Signals.

Virtual memory, swapping and paging

Physical memory refers to all the writable memory locations in the computer.

"Virtual memory is memory that appears to be allocated to application programs. The operating system uses a portion of the hard disk as virtual memory, and swaps data between the hard disk and physical memory. Virtual memory enables multitasking. If your computer needs to run several programs simultaneously, and the memory that all these programs require exceeds the amount of physical memory available, the operating system allocates virtual memory to meet the total memory requirements of each program, and then manages the available physical memory to meet the actual memory requirements at each point in time. Therefore, the amount of virtual memory that is allocated can be much greater than the amount of physical memory that is installed in the computer."

--Physical memory and virtual memory TechNote.

Utilizing virtual memory involves paging and swapping.

Paging occurs when an active process requires more memory than what is accessible in physical memory. Portions of the process are moved to disk so the physical memory can be used for something else.

Swapping is done by the kernel. When memory space is running low the kernel looks for a process that isn't likely to run in the near future. That process is written entirely to disk, and the newly-freed memory is reassigned to another process or job.

For more optional information on virtual memory, swapping, and paging see Lecture-Virtual Memory.

Shell

The human user of a Unix system accesses the services of the kernel through a user interface called a shell. The shell is a command interpreter that allows the user to initiate processes to perform a nearly infinite variety of tasks.

2. When a command is entered what executes the corresponding program?

There are several "standard" Unix shells, including the C-shell, Bourne shell, Korn shell, and others. In addition to these command-line oriented shells, many vendors supply graphical user interfaces (GUIs) that simplify or automate the functions of the underlying shell. The X Window System is a GUI.

Different shells have different uses. For example, the C-shell is generally acknowledged as being superior for interactive Unix work, while the Bourne shell has features that make it preferable for programming. Shell choice is often a "religious" matter with experienced Unix users, and is the subject of frequent debate.

In general, shells enable the following activities:

For optional information on shells see Shells and commands. For recommended information on different types of shells see Description of different types of shells.

Job control

Job control is facilitated by the shell. In Unix a group of processes constitutes a job. Unix allows users to control jobs from the terminal. The foreground job is the job in control of the terminal. Whatever is typed in on the keyboard is sent to standard input of that program. Only one job at a time may be in the foreground. However, multiple jobs may run in the background. A job running in the background is effectively cut off from the keyboard. A job may be sent to the background when it is created by placing an ampersand (&) after the command.

3. How can a job be brought up to the foreground after it has been placed in the background?

Jobs may be moved from foreground to background and vice versa. It is also possible to stop jobs and restart them. Once a job is stopped it remains inactive until it is restarted.

In the X Window System, job control is enabled by making each window a pseudo terminal. Each window acts as a terminal and can run a separate job. Multiple jobs can be run in the same window by sending them to the background.

For more recommended information on job control see Job Control.

Utilities

Utilities are programs that perform system functions. Utility can also refer to a command that is used to do work of some sort, such as mv to move files or directories. Unlike the utilities in many other operating systems, including MS-DOS, most Unix utilities are separate from the operating system. This means that they are not loaded with the operating system kernel. They are executed as needed by the user or by processes the user process spawns.

Unix provides utilities in many categories, including:


Terms used: kernel, process, system call, CPU, child process, parent process, virtual memory, swap, paging, shell, GUI, I/O, signal, virtual memory, spawn, pseudo terminal, job control, X Window System.




[EdCert previous] [EdCert next] [EdCert top]