Uninitialized global variables are stored in .bss section of the process
memory and initialised global variables are stored in .data section of the
memory. In the linking stage, they get the actually physical address. But
since x and y are local variables they are just stored in stack while
execution and will get flushed out later from stack after its execution. So
they don't have any physical address for debugging.

On Sat, Jun 12, 2010 at 1:22 AM, amit <[email protected]> wrote:

> OS doubt:
>
> I have read many times that say a 24 KB process enters the Main Memory
> selected by the Long Term Scheduler.
> But I don't understand what it exactly means.
> As far as I know Process consists of ( Code + Data(Static) +
> Stack(Local Data) + Heap)
>
> So doubt1: Is this 24 KB the size of this whole process or just the
> size of the code segment.
>
> doubt2: Now lets say this process starts getting executed by the
> CPU ,Suppose the main() contains
>                main(){
>                        int x;
>                        int y;
>                        x=10;
>                        .......
>                }
>                So x,y will be allocated the memory in the Stack.
>                But when x=10 is encountered , how will the CPU know the
> address of
> x. In short how is x accessed??
>
>
> doubt 3: If x and y are just address of a memory location in the
> stack , can their logical address be determined by the compiler or it
> will be generated by the CPU??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to