Skip to contentSkip to conversation

Query regarding current macro

DISCUSSION Jagadeesh Bhaskar P 2 participants 3 messages Dec 1, 2004

lore
Share & tools
lore
#0 lore raw

Hi all,
I was going through the explanation of the current macro, and found out
that it was got by masking 13-bits LSB the esp register. So is it that always the process descriptor will start at a location with the last 13 bits are 0??

I have read that both the kernel stack and process descriptor of a
process is stored in together in an 8KB page. Now the offsets in the page should start from all bits 0, rite? So then why masking only the 13 bits LSB?? What is the significance of keeping that length at 13??

Please do help!!

TIA

Signature · 3 lines
With regards,

Jagadeesh Bhaskar P
#1 lore raw
Quoted 4 lines · Jagadeesh Bhaskar P

I have read that both the kernel stack and process descriptor of a
process is stored in together in an 8KB page. Now the offsets in the page should start from all bits 0, rite? So then why masking only the 13 bits LSB?? What is the significance of keeping that length at 13??

The stack grows downwards on x86. Thus the lowermost stack entry has all bits set. The length is 13 because 13 corresponds to 8K.

HTH
Oliver

#2 lore raw

So the rest of the bits in esp means garbage values?

Quoted 10 lines · Jagadeesh Bhaskar P
Quoted 4 lines

I have read that both the kernel stack and process descriptor of a process is stored in together in an 8KB page. Now the offsets in the page should start from all bits 0, rite? So then why masking only the 13 bits LSB?? What is the significance of keeping that length at 13??

The stack grows downwards on x86. Thus the lowermost stack entry has all bits set. The length is 13 because 13 corresponds to 8K.

HTH
Oliver

--
Regards,

Jagadeesh Bhaskar P