Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting started in creating simple bootable C program

Tags:

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.

like image 778
Shawn Mclean Avatar asked Feb 03 '10 18:02

Shawn Mclean


People also ask

Can you write a bootloader in C?

As far as I know, you cannot write bootloader in C. That is because, C needs you to work in a 32-bit protected mode while in bootloader some portions are in 16-bit mode. There are C compilers that will generate 16-bit code. Openwatcom, SmallerC, Bruce's C compiler.


1 Answers

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.

like image 93
sud03r Avatar answered Sep 22 '22 16:09

sud03r