Page 1 of 1

Error in wiki page

Posted: Fri Aug 24, 2007 6:00 pm
by vhg119
The page: http://www.osdev.org/mediawiki/index.php?title=Text_UI
has an error in the sample code.

It should be something like:

void kprintc(int x, int y, unsigned char bc, unsigned char fc, unsigned char c)

{

unsigned short attrib = ((bc << 4) | (fc & 0x0F)) << 8;

volatile unsigned short *where;



where = 0XB8000 + ((y*160) + (x*2));

*where = c | attrib;

}

Posted: Fri Aug 24, 2007 7:29 pm
by frank
Is that better? Note where = 0xB8000 + (y * 80 + x); is correct because we are working with words.