Unix System Architecture
- Unix system follows a layered approach . It has 4 Layers
- The inner most layer is the hardware layer.
- In the second layer , the KERNEL is placed.
- The utilities and other application programs form 3rd
- Fourth layer is the one with which the user actually interacts.
- Kernel is that part of OS which directly makes interface with the hardware system.
- Provides mechanism for creating and deleting processes.
- Provides processor scheduling, memory & I/0 management
- Provides inter – process communication
Features of shell are :
- A utility program that comes with the UNIX system
- Interactive processing
- Back ground processing
- I/ O Redirection
- Shell Scripts
- Shell Variables
- Programming constructs
- A process is a program in execution
- Several processes can be executed simultaneously a UNIX system.
- A process is generally created using the “fork ()”.system call
- The process that invokes the “fork ()” system call is the parent process, and the newly created process is called the child process
- UNIX uses round – ration scheduling to support its multi-user and time – sharing feature.
- Round – robin fashion of scheduling is considered to be the oldest, simplest and widely used algorithm.
- Every process is given a time slice.
- Virtual memory
- Swap area
- Demand paging
Types of UNIX users
- UNIX uses a hierarchical file system with ‘1’ as its root
- Every non – leaf node of the tree is called as directory file
- Every leaf node can either be a file, or an empty directory.
- Broad classification of users
- Unix allows user ID’s to be grouped
- A single user ID can be member of multiple groups
- Differentiating users with respect to file access
Working with UNIX
- User logs in with a valid user ID.
- User logs out to terminate the login session.
Excel, Excel p, Excel e, Excel v, Excel vp – executes a file
# include <Unistd. h>
Extern char ** en viron;
Int excel (const char * path , const char * arg,……………);
Int excel p (const char * file , const char * arg,……………);
Int excel e (const char * path , const char * avg,…, char * const envp  ) ;
If any of the exec () functions returns , an error will have occurred. The return value is -1, and the global variable err no will be set to indicate the error.
System - executes a shell command
# include <stdlib.h>
Int system (const char * command;)
System () executes a command specified in command by calling /bin/sh – c command, and returns after the command has been completed. Using execution of the command , SIGCHLD will be blocked and SIGINT and SIGQUIT will be ignored.
‘- 1’ on error
If the value of command is NULL, sys n () returns non – Zero if the shell is available and if not system () does not effect wait status of at other children .
$ bash // opened bash for your own
$ Ps – l: