开发者

Getting started in creating simple bootable C program

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 lin开发者_StackOverflow中文版ks to references and samples as possible.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜