stack and the bin file

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
njmarshal

stack and the bin file

Post 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.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:stack and the bin file

Post 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.
njmarshal

Re:stack and the bin file

Post 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
paulbarker

Re:stack and the bin file

Post by paulbarker »

NASM manual?

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