Hello guys,
I have a simple kernel that boots and switches to protected mode. I test it on a real Pentium 4 system, where I boot from the 2nd hard drive. The thing is .. when I set the BIOS to first boot from this hard drive, the kernel seems to load but behaves strange - it has to print some welcome text, but actually prints some blinking squares. This comes for a second, after which the system resets.
When I choose the hard drive as a temporary boot device, the kernel loads fine, without any problems.
From three PCs I tested on, only this one makes this strange problem.
Can it be that the BIOS somehow returns wrong data and thus my 1st stage bootloader does not completely load my 2nd stage bootloader?
The kernel loads fine in Bochs too.
Booting problem
Re: Booting problem
I forced the bss section to be initialized with zeros and now it seems to work okay on all machines.
Obviously, variables initialized with 0, do not come in the .data section, but in .bss.
Conclusion: If your flat binary does not explicitly contain the .bss section, then do no assume that the memory will be initialized with zeros.
Obviously, variables initialized with 0, do not come in the .data section, but in .bss.
Conclusion: If your flat binary does not explicitly contain the .bss section, then do no assume that the memory will be initialized with zeros.