Question

Could someone guide me on what path/steps to take to create a simple bootable hello world program? I have the basic knowledge of C/C++.

My aim is to create a very simple OS.

I would like as much relevant links to references and samples as possible.

Was it helpful?

Solution

See this. It's a tutorial for a very basic boot loader. It doesn't have much to do with C/C++, but it has some really good information on the basic building blocks of a bootloader.

If you're really curious about the building blocks, there are more in-depth resources in the form of textbooks. This tutorial, for instance, doesn't explain why the boot loader must end with 55 AA. In addition, it's relatively narrow.

OTHER TIPS

You want to build a statically linked binary (no ld.so involved), and you start it by jumping to its entry point. The entry point is usually the start of the .text section. Maye run objdump --section-headers image on it to find out its adress.

If you're trying to run on an embedded device, check out how the kernel of an embedded OS is built and booted. For example, see how U-Boot brings up an Ångström linux based system.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top