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.
stack and the bin file
Re:stack and the bin file
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.
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
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
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
NASM manual?
For stuff about .bss segment, try the ld manual and look at a few examples of linker scripts.
For stuff about .bss segment, try the ld manual and look at a few examples of linker scripts.