[SOLVED]Question on OS dev wiki kernel Tutorial
Posted: Tue Jan 11, 2011 1:52 pm
Hi all,
I wanted to know the internals of the computer arch and OS. So I've been reading stuff online, books (in fact only one book modern operating systems). I came across OS dev wiki. I found the material that has been put together very useful. I decided to test few programs in the tutorials.
So I used the asm kernel code (http://wiki.osdev.org/Real_mode_assembly_bare_bones), on qemu.
assembled it using nasm
Then, as mentioned here http://wiki.osdev.org/Bare_bones#Using_ ... Bootloader, I used qemu's built-in bootloader
It just aborted! (just printed Aborted!)
But when I used with out the -kernel option (qemu kernel.bin) it launched the VM with the kernel running (figure attached).
1. Can someone please tell me what could the problem be when the -kernel option is used.
At the end of the code it had the following lines:
I read that bios needs the signature "0xAA55" at the end. Why do we need this in the kernel code here. does this mean that the kernel is itself a bootloader here. But aren't we using the qemu built-in bootloader. I expected the qemu built-in bootloader to load the kernel. I removed the above part in the code (removed signature) and tried qemu kernel.bin it could not load the kernel. It ended up as shown in the attached figure kernelLoadError.png.
2. Can someone explain what exactly is happening here. Why are we using the above code when we are using the qemu built-in bootloader. And why is the code not working when I remove the signature part from the code.
Hope the question is clear.
Thanks.
I wanted to know the internals of the computer arch and OS. So I've been reading stuff online, books (in fact only one book modern operating systems). I came across OS dev wiki. I found the material that has been put together very useful. I decided to test few programs in the tutorials.
So I used the asm kernel code (http://wiki.osdev.org/Real_mode_assembly_bare_bones), on qemu.
assembled it using nasm
Code: Select all
nasm kernel.asm -f bin -o kernel.bin
Code: Select all
qemu -kernel kernel.bin
But when I used with out the -kernel option (qemu kernel.bin) it launched the VM with the kernel running (figure attached).
1. Can someone please tell me what could the problem be when the -kernel option is used.
At the end of the code it had the following lines:
Code: Select all
times 510-($-$$) db 0
db 0x55
db 0xAA
2. Can someone explain what exactly is happening here. Why are we using the above code when we are using the qemu built-in bootloader. And why is the code not working when I remove the signature part from the code.
Hope the question is clear.
Thanks.