Trying to compile code from OS Dev tutorial

This is a difficult question because I am sure that I will be deceived by haters, commenting “if I can’t write an operating system already, I can never write an operating system”. Well, I read Modern OS from Tanembaum, Linux Kernel Development, understanding the Linux kernel and others, I still don’t know if I can write an operating system, and only by promoting it I will understand that I don’t know, I know . In addition, none of the books I read even described a loading / compiling sequence.

In any case, I hate to be negative, but I just wanted to build a sample code from the bkerndev tutorial below and have an absolutely minimal operating system:

http://www.osdever.net/bkerndev/index.php?the_id=90

You can download the associated zip source code from here:

http://www.osdever.net/bkerndev/bkerndev.zip

When you try to compile this kernel, you run all kinds of errors caused by the fact that some of them are damaged. Another user was looking for help here for here:

compiling my own kernel (not from linux-kernel source)

Although this did not help. I addressed these errors by adding the gcc fleading-underscores flag and changing some data types. Here you can see my code:

http://github.com/PhillipTaylor/farmix

The code will compile and leave me with the kernel.bin executable, but when I download it from grub, I get:

Error 13: Unrecognized or unsupported format (or something like that)

kernel.bin zip eeepc, , , . , -, Windows-, Fedora 10 i386 GNU GCC 4.3, , , , , ? ?

, - " "

+3
2

, , , "aout", , , , . barebones " , , , . " nasm -felf", .

, bkerndev ( ) , .

make 32- Linux.

http://github.com/PhillipTaylor/farmix/tree/bkerndev_tutorial_working

+1

. , , - " " " kernel.bin ?". . , grub. start.asm "mboot". , .

nasm handy, , .bin .

+2

Source: https://habr.com/ru/post/1726388/


All Articles