Why isn't bootstrap_stack .bss?
Posted: Tue Apr 29, 2014 4:42 am
While reading http://wiki.osdev.org/C%2B%2B_Bare_Bones, I found a strange thing. ld gives me this error.
(Please notice I'm using NASM.)
When I test this, there's no problem. Then, why "C++ Bare Bones" code isn't like this? Is there any reason?
I figured out what it is, and I fixed like this (because stack doesn't need to be initialized zero, and it's better for kernel to be more small-size.)ld: warning: section `.bss' type changed to PROGBITS
(Please notice I'm using NASM.)
Code: Select all
; boot.asm
section .bss ; changed from .bootstrap_stack
align 4
stack_bottom:
resb 16384 ; changed from times 16384 db 0
stack_top:
/* linker.ld */
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
/* *(.bootstrap_stack) */ /* removed */
}