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
Networks and operating systems have a lot of overlap. In this course, however,we are not going to discuss networking in detail, but rather focus on the networking abstractions prov

What is a Process Control Block? Every process in the operating system is represented by a process control block as well called a task control block. It contains several pieces

Show the search tree generated by Hill-Climbing search (text figure 4.2, page 122; or Local Search lecture, slide 6) for each of the two heuristics (a) and (b) applied to the follo

linked allocation using i node


Give a brief introduction about the operation of your program and show that you understand the idea behind threads and mutual exclusion variable. Why do we need to use mutual exclu

Direct memory access Many computers avoid burdening the main CPU with programmed I/O by offloading sine if this work to a special-purpose processor known as a direct memory add

Explain about deadlock detection? In deadlock situation, the system must provide An algorithm that verifies the state of the system to verify whether a deadlock has occu

LRU page replacement In slightest recently used page replacement algorithm we will replace that page that hasn't been used for the longest period of time. This is similar as an

Q. Is there any way to execute truly stable storage? Describe your answer. Answer: Truly steady storage would never lose data. The fundamental technique for steady storage is