Beginner OS development in C

Gulshan Singh

Solid State Member
Messages
19
Hi, I'm new to OS programming but I do know the C language. I have this code that compiles, links, and turns into a floppy image without a problem. Then I run it with the emulator BOCHS. I type kernel 200+9 into the grub prompt, then boot. The problem is nothing displays on the screen. I think this is a really beginner question, but does anyone know why it's not working?

Code:
volatile unsigned char* videoram = (volatile unsigned char *) 0xb8000;

void printstr(char string[])
{
   int i = 0;
   for (i = 0, i < 2, i++)
   {
      videoram[2*i] = string[i];
      videoram[1+(2*i)] = 0x07;
   }
}

void kmain( void* mbd, unsigned int magic )
{
   printstr("Hi");
}
 
I haven't programmed in C in years, and have never done OS programming, however shouldn't the second function be
Code:
 void main
instead of
Code:
 void kmain
 
Back
Top Bottom