Page 1 of 1

stack and the bin file

Posted: Sat Apr 15, 2006 8:54 pm
by njmarshal
Below is my stact code in boot.asm

SECTION   .bss
stack:
   resb   STACTSIZE

In my opinion stack space is in the code ,so it must enlarge the bin file just like the "times xx db 0"does ,right?

but ,if I change the STACTSIZE ,the size of kernel.bin file does not change at all .why ?I am fully confused somewhere ?

Thank you for your attention.

Re:stack and the bin file

Posted: Sun Apr 16, 2006 1:42 am
by Candy
Stuff in .bss isn't stored in your file, since it is uninitialized data.

If you use the binary format, it should change. All the others assume you have a loader that reserves the space and zeroes it for you.

Re:stack and the bin file

Posted: Sun Apr 16, 2006 6:18 am
by njmarshal
Thanks for your explaination.

But how should I control the real address (location )of .bss segment ,except this way mov esp ,xxx.

I think controllabe is important to a kernel.

and I still do not know the exact things the " resb xxx " does.

Thanks all

Re:stack and the bin file

Posted: Sun Apr 16, 2006 10:17 am
by paulbarker
NASM manual?

For stuff about .bss segment, try the ld manual and look at a few examples of linker scripts.