What happens when you execute a program in unix, Operating System

 

When you run a program on your UNIX system, the system prepares a special environment for that program. This environment owns everything needed for the system to execute the program as if no other process were running on the system. Each and every process has process context, which is everything that is simple about the state of the program you are currently running. Every time you run a program the UNIX system does a fork, which acts a series of operations to make a process context and then execute your program in that context. The steps add the following:

 

  • Locate a slot in the process table, a list of currently running process kept by UNIX.
  • Give a unique process identifier (PID) to the program.
  • Copy the text of the process, the parent that requested the spawning of the new program.
  • Give the new PID to the parent process. This active the parent process to control or examine the process directly.
  • After the fork is complete, UNIX executes your program.

 

 

Posted Date: 7/28/2012 8:42:46 AM | Location : United States







Related Discussions:- What happens when you execute a program in unix, Assignment Help, Ask Question on What happens when you execute a program in unix, Get Answer, Expert's Help, What happens when you execute a program in unix Discussions

Write discussion on What happens when you execute a program in unix
Your posts are moderated
Related Questions
Before proceeding with its execution, every process must obtain all the resources it needs is called Hold and wait

Explain the Network protocols There are a wide variety of network protocols to choose from traditionally client - server developers were required to choose a communications pro

draw a state diagram showing the transissions of a process from creation to termination

Indexed allocation Indexed allocation bringing all the pointers together into one location: the index block. Every file has its own index block, which is an array of disk-block

Question 3: (a) Fincorp Ltd is an insurance company wishing to change over to a better business system using an improved version of a financial information system (FIS). The direc

The procedure for handling the page fault is as follows 1. We check the internal table to verify whether the reference was valid or invalid. 2. If the reference was invalid,

People arrive at a barber shop at the rate of one every 4.5 minutes. If the shop is full (it can hold five people altogether), 30% of the potential customers leave and come back i

The dynamic memory allocator is a layer between the application and the OS, managing heap objects. When a program requests memory from the allocator (via malloc(), for instance), t

Contiguous allocation The contiguous-allocation method needs each file to occupy a set of contiguous blocks of the disk. Disk addresses explain a linear ordering on the disk. T

Discuss the high barriers to entry in the market for PL operating systems