Will the boot-loader code be of any use later on after it loads the secondary/kernel. If not then why do most people say that the bootloader code should be relocated in memory to prevent overwriting?
Any insights on this will be appreciated.Also why does evrybody use a JUMP instruction followed by a NOP at the start of the bootloader? is the NOP required?
some booting questions
RE:some booting questions
It depends on how you write it. There is no reason it has to stay in memory.
The jmp followed by a nop is required by some bioses. Basiscally when a bios looks for a valid boot device some just check to see if a sector can be read, some look for dw 0xAA55 at the end of the sector and some look for the jmp/nop combo.
-Chase
The jmp followed by a nop is required by some bioses. Basiscally when a bios looks for a valid boot device some just check to see if a sector can be read, some look for dw 0xAA55 at the end of the sector and some look for the jmp/nop combo.
-Chase
RE:some booting questions
The reason it is often relocated is to prevent the kernel or next stage of a bootloader from overwritting it while it is still running. The BIOS load address is 0x7c00, and a lot of kernels like to be at address 0, so if the kernel is larger than 0x7c00 bytes, it would overwrite the bootloader.
A better solution for many people is probably to load the kernel above 1mb (or anywhere above the bootloader).
A better solution for many people is probably to load the kernel above 1mb (or anywhere above the bootloader).
RE:some booting questions
Yes, a had this problem when I tried to load my kernel at 0x1000. First, all worked very well, then my kernel grew and one day my OS failed. I spent many hours to discover the problem, and was this!
pepito
pepito