UNIX Operating System

  Home  Operating System  UNIX Operating System


“UNIX operating system will cover all the areas of UNIX such as hardware and software settings in UNIX etc. to build your interview questioning skills. UNIX OS is an important Operating System for getting JOB in any computer based company so this category will help you and unlock your UNIX skills to get a better job.”



23 UNIX Operating System Questions And Answers

21⟩ What are the process states in Unix?

As a process executes it changes state according to its circumstances. Unix processes have the following states:

Running : The process is either running or it is ready to run .

Waiting : The process is waiting for an event or for a resource.

Stopped : The process has been stopped, usually by receiving a signal.

Zombie : The process is dead but have not been removed from the process table.

 117 views

22⟩ What Happens when you execute a program?

When you execute a program on your UNIX system, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system. Each process has process context, which is everything that is unique about the state of the program you are currently running. Every time you execute a program the UNIX system does a fork, which performs a series of operations to create a process context and then execute your program in that context. The steps include the following:

Allocate a slot in the process table, a list of currently running programs kept by UNIX.

Assign a unique process identifier (PID) to the process.

iCopy the context of the parent, the process that requested the spawning of the new process.

Return the new PID to the parent process. This enables the parent process to examine or control the process directly. After the fork is complete, UNIX runs your program.

 116 views

23⟩ What Happens when you execute a command in UNIX OS?

When you enter 'ls' command to look at the contents of your current working directory, UNIX does a series of things to create an environment for ls and the run it: The shell has UNIX perform a fork. This creates a new process that the shell will use to run the ls program. The shell has UNIX perform an exec of the ls program. This replaces the shell program and data with the program and data for ls and then starts running that new program. The ls program is loaded into the new process context, replacing the text and data of the shell. The ls program performs its task, listing the contents of the current directory.

 108 views