Improve company productivity with a Business Account.Sign Up

x
?
Solved

What goes on inside CPU when a process is loaded?

Posted on 1998-09-28
2
Medium Priority
?
236 Views
Last Modified: 2010-04-21
null
0
Comment
Question by:ashfawad
2 Comments
 
LVL 3

Accepted Solution

by:
braveheart earned 150 total points
ID: 2007108
The operating system does not necessarily know how much space to allocate to a program beforehand. It knows how much code space and data space because these contain the instructions and constants that make up the program. The stack segment grows and shrinks according to the run time requirements of the program.

For instance, when a subroutine or function is called, the context of the calling routine has to be saved by pushing values of variables on to the stack. Similarly some call might allocate a block of memory to the program - the operating system can not know this until run time, so the stack grows and shrinks as necessary.

Different strategies are used by different systems: some might allocate a fixed maximum to the size of the stack, while others will include the stack in virtual memory so that it can grow and shrink without limit and so that it any memory not used is available to other processes.

If you execute vi on any file, the data segment contains the constants in the vi program, not any data associated with the file. The file remains stored on disk, although some of its contents may be cached in local memory and, almost certainly, things like file descriptors may be stored in the stack segment of the process, if the vi program requires it.

An I/O wait is as long as it takes. The scheduler will judge whether the file reading process is waiting for I/O and, if the I/O transfer is not yet complete, it will go on to the next process. The length of wait depends on the speed of your disks, or network, the speed of your CPU... you name it.

Why not read "Fundamentals of Operating Systems" by A.M.Lister, published by Macmillan. It is a bit old but is very UNIX oriented.
0
 

Author Comment

by:ashfawad
ID: 2007109
Thanks for the answer and also the  book. I I hope thsi book does not confuse me further. None of the books give detailed explaination. They miss out a lot of things.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question