Wednesday, January 8, 2014

"Hello World" Program!!! (Day 4)

This post is quite late as compared to what I had planned. Developing and writing a tutorial is quite time consuming. You'll realize soon that OS development is quite tough and is not a child's play. You have to handle lot of errors which may or may not be discussed in this tutorials. But the satisfaction that you get once your code runs successfully for the first time is immense.

Before you write OS code you should know that you don't have basic functions like "printf" and "scanf". You have to write your own "printf",  "scanf" and many more functions (which you'll find is very interesting and you will learn a lot in this process). Another interesting thing is your program will directly interact with the hardware and you will have full control over the hardware unlike the programs you wrote for your college assignments.

So lets get started with our "hello world" program.

In this tutorial we are going to use GRUB as the boot loader. You can write your own bootloader but it requires a lot of knowledge of assembly language program. As our aim here is to cover more important concepts of OS, hence we will skip this step. If you wish to develop your own bootloader then you can refer to these websites.
1) GRUB official website.
2) OSDEV

GRUB:
GRUB is an excellent bootloader. It greatly simplifies the loading of operating system. It also provides us with many features which can be used in initializing the operating system. We will discuss about these features when we write the C code (step 2).

Steps that we are going to follow!!!
1) Write assembly code
2)  Write C code.
3) Compile them separately using the compiler we created earlier (refer to previous post).
4) Connect these two executable to create one single OS image.
5) Load this OS image on your virtualbox.
6) If everything is fine then you'll see your OS running.

This is how it will look after following all these steps :P



I hope this motivates you to go ahead with the tutorial :P

No comments:

Post a Comment