Solved

What goes on inside CPU when a process is loaded?

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

Accepted Solution

by:
braveheart earned 50 total points
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now