scharfshutze009
2[H]4U
- Joined
- May 22, 2010
- Messages
- 2,079
I've always wondered what it would be like to write my own Kernel and beyond. I'm just a Network Admin major with a minor in programming though and I just recently finished writing the sample code in the Modern Assembly book by Daniel Kussworm, which includes the C++ and Assembly sample code for whatever purpose. I wrote the sample code to help me become familiar with writing Assembly optimized C++ programs and read the book, but even though I know how to run both the Assembly and C++ I still don't understand completely what the code is doing yet if I ever will. Also, self teaching yourself the rest of C++ from Tony Gaddis's book is tough and so is doing the same for Assembly optimized C++ programs in Daniel Kussworms books too. You could say this effort might be to ambitious as well.
Anyway I found this guide I how to write a simple sample Kernel here:
http://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel
However, even after successfully debugging the code for all the files needed, like the kernel.asm, kernel.c, and link.ld I still can't get the kernel to display "My First Kernel" on boot or in terminal by using qemu and the following is all I get from the output, which flickers this over and over instead of "My First Kernel". Also, grub will not let me edit it on boot if i try to boot to the kernel on the hard disk I saved the files needed to create a kernel to, which just brings up grub rescue mode anyway or either way:
I used the following command to run it as follows and found out how to run a 64-bit Kernel that will follow the previous:
sudo qemu-system-i386 -kernel /mnt/rootpart/kernel
and to run a 64-bit kernel do similar to the following, which also works for a 32-bit kernel:
sudo qemu-system-x86_64 -kernel /mnt/rootpart/kernel
Anyway I found this guide I how to write a simple sample Kernel here:
http://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel
However, even after successfully debugging the code for all the files needed, like the kernel.asm, kernel.c, and link.ld I still can't get the kernel to display "My First Kernel" on boot or in terminal by using qemu and the following is all I get from the output, which flickers this over and over instead of "My First Kernel". Also, grub will not let me edit it on boot if i try to boot to the kernel on the hard disk I saved the files needed to create a kernel to, which just brings up grub rescue mode anyway or either way:

I used the following command to run it as follows and found out how to run a 64-bit Kernel that will follow the previous:
sudo qemu-system-i386 -kernel /mnt/rootpart/kernel
and to run a 64-bit kernel do similar to the following, which also works for a 32-bit kernel:
sudo qemu-system-x86_64 -kernel /mnt/rootpart/kernel
Last edited: