OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 12:20 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Error in wiki page
PostPosted: Fri Aug 24, 2007 6:00 pm 
Offline
Member
Member

Joined: Fri Aug 24, 2007 5:56 pm
Posts: 71
Location: CA, USA
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;

}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 24, 2007 7:29 pm 
Offline
Member
Member

Joined: Sat Dec 30, 2006 2:31 pm
Posts: 729
Location: East Coast, USA
Is that better? Note where = 0xB8000 + (y * 80 + x); is correct because we are working with words.

_________________
My OS: Fuzzy Logic


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group