Monday, February 10, 2014

"Hello World" Program!!! (Writing C code!! Day 6)

Finally something which we will understand clearly.... "C code". In the previous tutorial we wrote assembly code in which at the end there was a call kernel_main. This assembly code calls the kernel_main() function in the C program. This is where your c code starts executing.

As we had discussed earlier there will be no in built printf function or scanf function. You have to implement everything on your own. So before you get started you may want to have some tool to debug your code. Normally common people use printf to do that. But we don't have a printf function. So let us build a printf function first.

Few questions that may come up and they should actually:-

  1. What things we need to print hello world on the screen?
  2. What part of memory should we write the text to?
  3. How to choose color?
  4. What should we write?
  5. OS which I am using right now has better looks what should I do to make my screen display content better?
We will go through these one by one!!! It would nice if you try to find answers to these questions on your own. Don't worry if you get answers. Answer to last question is an advanced topic which will be covered some time later.

No comments:

Post a Comment