UNIX
What is process?
Process is program in execution. A program is an passive entity where as process is an active entity.
Process step:
New: When a process is being created.
Ready: The process is waiting to be assigned to a processor.
Runing Step:Instruction are being execution.
Suspend: The process is waiting for sum event to take place.
Terminal: The process has finished execution.
Sheduler: Shedule are of there types:1) Long term scheduler(job scheduler)
2) mid term scheduler(medium term)2) sort term scheduler(cpu scheduler)
Query diagram representation of process scheduling:-
Define type of scheduling algorithms:-first come first.
Shortest job first scheduling:-
Priority best scheduling:-
Multi level queses with fid back scheduling:-
Round Robin scheduling:-
Unix architecture:- Unix has a layer architecture with major separable parts the karnel as system program.
The components of unix webs are:1) karnel 2) shell 3)command. Utilities at for the one is application.
Karnel: karnel is the heart of the operating system. All the components request the karnel for the required service when the system is booted. The karnel is read into memory. It resides in the memory as long as the system is running.
The function and services of the karnel:
1) File management and security2) I/O services 3) process scheduling and management.4) System accounting. 5) memory management 6) Interupt an error handling 7)data and ti,e services.
2) SHELL: SHELL is the command interpreter. The interface between the provide a while to separate user all task from is another why the karnel maintains an unified over all control.
Directory structure:-
Directory:-
/ Slace: It is called the root directory. It is the superb login directory.
Purpose:
/ bin: It contents essential unix utilities that the user can use. It is usually contents binery files. A binary file is the product of a compile sees code source program.
Directory:
/dev: It is device directory where all device files are store. It contents a file for each device attach on the network.
Purpose:-
/etc:This directory contents various administration utilities which other special system file that as used by the system at the booting time.
Directory:-
/tmp:- It is the dustbin of the unix system. Files with sort light span are usually store or redirected here.
Purpose:
/usr:- This directory store home directory from all user.
What is the job of unix command:-1) Navigated with the file system.
2)all ordinary file operation 3) delling with file attributes
Different switch of LS:-
Option Meaning
-X:- It display multi column instead of a long system.
LS-F:- It marks executable which * and directories with slace(/).
-r:- sorts the file in revers order.
-R:- Provides recursive listing of all subdirectories and files in a
directory,
-a:- This list all files including dot(double) and those file beginning
with a dot(.).
-l:- It provides long listing by showing seven attributes of each file.
LS-d:- It force listing of directories.
-t:- sorts on modification time.
-u:- sorts on last access time.
-i shows I node number along with file name.
pwd- display present working directory.
Command:- first and four most from requires two sorted file as its argument. It return lines commons in both file, lines unix in second file, lines unix in the first file.
What is process management?
Process management:- a program is an executable file and a process is an instant of the program in execution karnel recognized of process by a number which is called process identification.
Process identification:-
Job of karnel:- management of processes is the responsibility of the karnel. The karnel thus scheduling called the processes.
The karnel frequently requires to store active processes in the swap of the disk before calling them again for running. The karnel uses to major data structure to mentain all information related with the process. These are called process table; U- area(details of subsequent section). The pid is allocated by the karnel automatically when a process is born.
Process identification:-
1) Process ID(pid):- Every process has a every no assign by the karnel called pid. It is an integer in the range(0 to 30,000). This is the no. of entire done is process table.
The pid of the process can be listed by unix command like’ps’ and also by using the system called get pid: There are usually 31 special process in almost all variance of unix system. These are called swapper paged man enit. The process with pid 0 is spall day swapper or scheduler which is the first process for any unix system. It is the only process not created the fort system called. The pid of init process is ‘1’. This is the parent of all ‘processes’. In virtual memory implementation of unix a process with pid’2’ is called the page deaman. 2) Parent process ID:- Every process has a parent process and a ‘ppid’ no. corresponding to the process all the processes share of parent child relationship. The karnel assign this parent process ‘ID’. When a new process is created. We can of tain the value of ‘ppid’ using a unix command ps.F. or by a system called’get ppid’. (int get ppid) 3) Real user ID:- Each process is assigned an owner or user an each user belongs to a group. A positive int. called user. This is usually done through shell script which is written for adding a new user and executed by the system administrator. A process can obtain the real user id of a user by a system called ‘get pid’. [ un sign short get id]. The file /etc/psswd. Maintain the mapping between login names and numeric user ID. Login name:- Which user find esier to identify a particular user through its login name. User ID:- By which unix system uses to recognized a user. Real group ID:- Each user belongs to a group. There fore it is assigned a group ID the system called by which we can find the real group (ID is unsigned short get pid); all the group ID are placed in of fine called /etc / group. This file mentain the mapping between name and numeric group ID. Process operation:-1) process creation 2) process termination 3)process group 1)process creation:- A running process executes a system called ‘fork’ to create new process. The newly created process is called ‘child process’. It get’s a’ O’ return value from a fork system call and its pid is returned to its parent. 2)process termination:- A unix process may terminate by using a system called exit of make waited for some time by a system called wait or can be fully terminated by a system called init. 3)Process group:- Process an a unix system are identified by a unique id no. though some times the system identifies processes by group. The ‘set grp’ is the system called to get the value of the group process ID ‘intset grp’. Login process:- A login process involved several program whose action are control by configuration files like /etc / tty tab or /etc /ttys, for diff. version of unix. The system login process is depited as follows:- Booting process:- 1) The init process initiated all system stater. It is responsible for the birth of all subsequent process it is also responsible fror spawning a process ‘get tty’ on every terminal port that ios switch on in the /etc /ttys. It is ‘get tty’ that sets the ports of initial characteristics like speed parity and provides a login prompt on the screen. 2) A user entire login name at ‘getttys’ prompt. 3) Gettty then proceeds to execute the login program usually in /bin/ login. With user login name as argument. 4) Login then print the msg of the day from usually prompt in from /etc /motd (msg oriented text document) file. After validating the password. 5) Login then executes a shell program and set spawn shell and initialized the environment variable. The shell executes the appropriate stater file (in bourn shell profile) 6) The shell prints the unix prompt and waits for the input. 7) Suppose a user entire a grep command executes shell forks its copy at exact the gerp program if it is available of find on the specified ‘PATH’. 8) When the user logs out control return to init which waits up and spawn a new getty on the terminal port. The init process forks a copy of it self and then each ‘child processes’ exacts the /etc / getty prg.


0 comments:
Post a Comment