Free2Code
 
Time: 2010-09-06, 11:10pm
Nothing showing up on screen
Subject: Nothing showing up on screen  ·  Posted: 2009-03-08, 03:32pm
Rank: ? (1)
Member #: 29843
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:
  1. volatile unsigned char* videoram = (volatile unsigned char *) 0xb8000;
  2. void printstr(char string[])
  3. {
  4. int i = 0;
  5. for (i = 0, i < 2, i++)
  6. {
  7. videoram[2*i] = string[i];
  8. videoram[1+(2*i)] = 0x07;
  9. }
  10. }
  11. void kmain( void* mbd, unsigned int magic )
  12. {
  13. printstr("Hi");
  14. }


 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

Penguino AVR

Want to learn about robotics or microcontrollers?
Check out the Penguino AVR from our friends at
Icy Labs