'Cool!', I thought. 'Now I'll write a function to write a string to the screen!'
I did that, and I even imposed some structure in the way my files are organized.
Code: Select all
- src
|
+ --- kernel
| |
| + --- kernel.c
|
+ --- lib
| |
| + --- frontio.h
| |
| -- frontio.c
1) Does this look right? I'm not highly aware of the standards for source/file structure in kernel development
2) I'm using qemu to boot my OS.
- I followed http://wiki.osdev.org/Bare_bones#Booting_the_kernel
- Created loader.s, kernel.c, and linker.ld
- assembled, compiled, and linked
- ran cat stage1 stage2 pad kernel.bin > floppy.img
- ran qemu to boot floppy.img and loaded my OS from GRUB issuing it the commands kernel 200+18 and boot
It says in the tutorial that 'The file kernel.bin is now your kernel (all other files are no longer needed).' but I'm assuming that is just meant within the scope of the article - I have to re-link loader.o with linker.ld (along with the other files besides kernel.o) to get kernel.bin, correct?
So this is where a Makefile comes in I think. The Makefile would automate the process of compiling the source and linking it into kernel.bin (and bash scripting would take care of the rest).
Does this sound right? Do you even use a Makefile? How should I go about creating one. I read http://wiki.osdev.org/Makefile but to be honest, it was not very helpful.
Thanks!!