I am learning NASM as I write bootloaders. So far I have a hello world bootloader. I want to know how to link a c program to it and have the bootloader load it into memory and start executing it's entry point function. I need NASM code as I am a NASM n00b. Thank you very much for you help.
EDIT: Basically I need to know how to link the c program and I need NASM code to tsrat it's entry point function. Any gotchas I should know about?
Boot loaders load kernel images into memory and hand control of the CPU over to the newly loaded kernel. To make your new kernel work, you must tell the boot loader about the kernel. If you have never worked with a boot loader before, you need to know how a PC boots from the hard disk.
A boot loader is a small program which is started from the Master Boot Record (MBR) of a hard disk, floppy disk, CD/DVD or other storage device. It is loaded by the computer's BIOS after the BIOS has initialized a small portion of the system's hardware.
Although this tutorial is for C++, its the exact same procedure (the tutorial lists the parts that are C++ specific, which are just the static ctors & dtors).
when ever your are having problems in this area, osdev.org generally has the answer or a tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With