Discussion:
A3 Load elf is weird
(too old to reply)
Sungyoul Kim
2011-07-23 06:08:54 UTC
Permalink
Somehow,

when I get the elf information,

it is not page-aligned nor seems right.


The following is some examples:

for sort:

load_elf: vaddr (400000) memsz(1ac4) poffset(0) pfilesz(1ac4)
load_elf: vaddr (441ad0) memsz(1200b0) poffset(1ad0) pfilesz(a0)


for forktest:

load_elf: vaddr (400000) memsz(1674) poffset(0) pfilesz(1674)
load_elf: vaddr (441674) memsz(c) poffset(1674) pfilesz(0)



Is it natural to have the second segment like that?

Why is this happening?




Thank you
Sungyoul Kim
2011-07-23 07:21:15 UTC
Permalink
Just one more question,

In the load_segment function, it zero-fills a memory chunk with
uiomovezeros function.

Would calling this function be treated as Page Faults (Disk)?

or just Page Faults (Zeroed)?


Thank you
Post by Sungyoul Kim
Somehow,
when I get the elf information,
it is not page-aligned nor seems right.
load_elf: vaddr (400000) memsz(1ac4) poffset(0) pfilesz(1ac4)
load_elf: vaddr (441ad0) memsz(1200b0) poffset(1ad0) pfilesz(a0)
load_elf: vaddr (400000) memsz(1674) poffset(0) pfilesz(1674)
load_elf: vaddr (441674) memsz(c) poffset(1674) pfilesz(0)
Is it natural to have the second segment like that?
Why is this happening?
Thank you
cs350
2011-07-23 08:12:05 UTC
Permalink
This was answered already. It doesn't matter how you count it.
Post by Sungyoul Kim
Just one more question,
In the load_segment function, it zero-fills a memory chunk with uiomovezeros
function.
Would calling this function be treated as Page Faults (Disk)?
or just Page Faults (Zeroed)?
Thank you
Post by Sungyoul Kim
Somehow,
when I get the elf information,
it is not page-aligned nor seems right.
load_elf: vaddr (400000) memsz(1ac4) poffset(0) pfilesz(1ac4)
load_elf: vaddr (441ad0) memsz(1200b0) poffset(1ad0) pfilesz(a0)
load_elf: vaddr (400000) memsz(1674) poffset(0) pfilesz(1674)
load_elf: vaddr (441674) memsz(c) poffset(1674) pfilesz(0)
Is it natural to have the second segment like that?
Why is this happening?
Thank you
cs350
2011-07-23 08:14:40 UTC
Permalink
It depends on where you are getting this information from. Load_elf calls
as_define_region which does something like floor of all vbases to the
nearest page boundary and ceiling of all memory sizes.

-Alex
Post by Sungyoul Kim
Somehow,
when I get the elf information,
it is not page-aligned nor seems right.
load_elf: vaddr (400000) memsz(1ac4) poffset(0) pfilesz(1ac4)
load_elf: vaddr (441ad0) memsz(1200b0) poffset(1ad0) pfilesz(a0)
load_elf: vaddr (400000) memsz(1674) poffset(0) pfilesz(1674)
load_elf: vaddr (441674) memsz(c) poffset(1674) pfilesz(0)
Is it natural to have the second segment like that?
Why is this happening?
Thank you
Loading...