OSDev.org
https://forum.osdev.org/

Error in wiki page
https://forum.osdev.org/viewtopic.php?f=8&t=14789
Page 1 of 1

Author:  vhg119 [ Fri Aug 24, 2007 6:00 pm ]
Post subject:  Error in wiki page

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;

}

Author:  frank [ Fri Aug 24, 2007 7:29 pm ]
Post subject: 

Is that better? Note where = 0xB8000 + (y * 80 + x); is correct because we are working with words.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/