- Some OSs include the command interpreter in the kernel. Others, such as Windows XP and UNIX, treat the command interpreter as a special program that is running when a job is initiated or when a user first logs on (on interactive systems).
- On systems with multiple command interpreters to choose from, the interpreters are known as shells. Although it is not part of the OS, it makes heavy use of many OS features and serves as a good example of how the system calls can be used.
- The main function of the command interpreter is to get and execute the next user-specified command. When a command is typed, the shell forks off a new process. This child process must execute the user command.
- A highly simplified shell illustrating the use of fork, waitpid, and execve is shown in Fig. 2.28.
Figure 2.28:
A stripped-down shell.
|
Cem Ozdogan
2011-02-14