?
Solved

Process related question

Posted on 2004-08-25
8
Medium Priority
?
252 Views
Last Modified: 2010-04-21
Hi all,

Consider the foll. piece of code:

char *p = (1MB) of storage

main()
{

  *p = 200;
  printf(" val = %d", *p)
}

Lets say I get a file a.out which needs to be run.

Please help me understand certain things:
1) how this file would be laid out in memory.
2) Since this would be a file, what filesystem
   related activities would be done (inode ?)
3) Stack allocation and virtual addr. space (conceptual).

In essence I would like to understand the various OS
related actions with reference to a simple program like the above sttored on disk.

Regards,
ASM
0
Comment
Question by:arut
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 11891312
0
 
LVL 62

Assisted Solution

by:gheist
gheist earned 500 total points
ID: 11894670
1) any assumptions about memory layout other than using pointers to access various allocations are at least non-portable, just as you cannot assume that all small allocations are one page in size etc.
2) most systems use rtld (runtime loader, in linux - ld.so) which mmap() s files and libraries into memory, but it does not
3) read (1), stack layout depends on processor
0
 

Author Comment

by:arut
ID: 11899623
Hi All,

I am not making any assumptions, but rather want to understand the concepts. I have a a.out and run it.

What are the actions that the kernel would take?

Regards,
Arut
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 45

Expert Comment

by:sunnycoder
ID: 11900078
Hi Arut,

The link I posted gives all those details. pls check the link
0
 
LVL 62

Expert Comment

by:gheist
ID: 11903144
Any actions that execve() system call does.... (man execve to find out more), described in (2) and not in the checkable link
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 11911015
ghiest
execve(2) hardly gives any information about memory layout and internals of memory management.

The link does talk about loading code into memory, different segments and paging
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…
Suggested Courses

801 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