Link to home
Start Free TrialLog in
Avatar of arut
arut

asked on

Process related question

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
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of arut
arut

ASKER

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
Hi Arut,

The link I posted gives all those details. pls check the link
Any actions that execve() system call does.... (man execve to find out more), described in (2) and not in the checkable link
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