Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-09-2009, 04:03 PM   #1
Solid State Member
 
Join Date: Oct 2008
Posts: 19
Default Beginner OS development in C

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");
}
__________________

Gulshan Singh is offline   Reply With Quote
Old 06-28-2009, 08:54 PM   #2
Baseband Member
 
Join Date: Jun 2009
Posts: 36
Default Re: Beginner OS development in C

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
dmarciano is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:34 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0