What system calls have to be executed by a command interpreter in order to start a new process?
Project 1: The Shell and System Calls Out: Friday, April 9, 2010 Show
Assignment Goals
Background: The ShellAs we'll discuss in class, the OS command interpreter is the program that people interact with in order to launch and control programs. On UNIX systems, the command interpreter is usually called the shell[1]: it is a user-level program that gives people a command-line interface to launching, suspending, and killing other programs. sh, ksh, csh, tcsh, and bash are all examples of UNIX shells. Background: Library RoutinesLibrary routines are just code that is made available to you. They differ from routines you write yourself in two ways, though: The AssignmentThis assignment has four parts: Step 1: Build a new shell (fsh.c) Write a shell program (in C), fsh.c, which has the following features: Step 2: Create a driver routine, and a dummy library routine (getexeccounts.c, getexecounts.h, getcounts.a, getDriver.c) Our goal in this step is to debug the process of creating and linking with a library, as well as debugging a driver routine that will be used to test the library routine. Step 3: Add a new system call, and modify the library routine to use it
Step 4: Implement a utility application (execcnts.c) We want to implement a program, execcnts that is to process creation syscall statistics what time (for info, man time) is to seconds. execcnts takes a command invocation line as arguments, executes the command, and prints out the number of each of the four process creation syscalls made in executing the command line. For intance,execcnts find . -name '*.c'would print the numbers of each of the four syscalls involved in executing that find command. What to Turn InYou should (electronically) turn in the following: Footnotes[1]While we say "the shell," there are many different shell programs (e.g., sh, ksh, csh, tcsh, bash, the shell you're writing, etc.). As well, a single system, and a single user, can be running more than one shell process at a time. Because a shell is just a program, you can launch any shell from any other shell. On Unix systems, a user's login (default) shell is kept as the last data item in the line of information about that user in the /etc/passwd file, e.g.,farnsworth:x:122:119:Ted &,411,35142:/homes/iws/farnsworth:/bin/bashThe command chsh has historically been used to change the login shell entry in your /etc/passwd line; our labs now use kchsh, which is a version of chsh adapted to use Kerberos password authentication. [2]At this point, the text is actually talking about static libraries, those whose code is linked to the application at link time (i.e., at the time the executable file is created). Dynamic (i.e., linked at run time) versions of libraries are available as well. [3]atoi() converts between ASCII representations of integers and ints: man atoi. (Note that it is incapable of indicating that the string argument does not represent an integer. However, sscanf() can do that. Sort of.) What else is a command interpreter call?A command interpreter is the part of a computer operating system that understands and executes commands that are entered interactively by a human being or from a program. In some operating systems, the command interpreter is called the shell.
What is the purpose of the command interpreter why is it usually separate from the kernel quizlet?What is the purpose of the command interpreter? Why is it usually separate from the kernel? and executes them, usually by turning them into one or more system calls. It is usually not part of the kernel since the command interpreter is subject to changes.
Which command functions as command interpreter?A command-line interpreter (command interpreter) is a program responsible for handling and processing text commands. For example, the command-line interpreter for MS-DOS and early versions of Windows is COMMAND.COM. In later versions of Windows, it is cmd.exe (Command Prompt).
What is system calls how they are executed?When a user program invokes a system call, a system call instruction is executed, which causes the processor to begin executing the system call handler in the kernel protection domain. This system call handler performs the following actions: Sets the ut_error field in the uthread structure to 0.
|