BrokenThorn Entertainment - View topic - Error in tutorial #10...
It is currently Fri Sep 10, 2010 2:55 pm




Post new topic Reply to topic  [ 3 posts ] 
Error in tutorial #10... 
Author Message

Joined: Sun Jan 24, 2010 2:20 pm
Posts: 23
Post Error in tutorial #10...
This tutorial has an error in it: http://www.brokenthorn.com/Resources/OSDev10.html

Quote:
The attribute byte is a byte that defines certain attributes, and defining both foreground and background colors. The byte follows the format:

* Bits 0 - 2: Foreground color
o Bit 0: Red
o Bit 1: Green
o Bit 2: Blue
* Bit 3: Foreground Intensity
* Bits 4 - 6: Background color
o Bit 4: Red
o Bit 5: Green
o Bit 6: Blue
* Bit 7: Blinking or background intensity


Bits 0 -2 & 4 - 6 are actually backwards for some reason, so it should read as:

Quote:
* Bits 0 - 2: Foreground color
o Bit 0: Blue
o Bit 1: Green
o Bit 2: Red
* Bit 3: Foreground Intensity
* Bits 4 - 6: Background color
o Bit 4: Blue
o Bit 5: Green
o Bit 6: Red
* Bit 7: Blinking or background intensity


Yes, it does seem odd. Until you think of it like the way we read English, right to left. So you'd start from bit 7 and read to bit 0, thus reading the color bits as R,G,B! :)

0x9A or 10011010b -- You get blinking green text with blue background.
Then try...
0xCA or 10001010b -- Same thing, but red background.
0x11 or 00010001b -- Totally blue, can't even see it if you have blue BG! ;)

Not so weird when you think about it, is it? :lol: But definitely a bit counter-intuitive when you read the bits as a number (sorta Little-Endian-ish, lol), rather than the way we read English words. This doesn't mean there's anything wrong with the author, it means there's something wrong with INTEL! :lol:


Thu Feb 04, 2010 5:39 pm
Profile E-mail
Site Admin
User avatar

Joined: Sat Oct 20, 2007 7:58 pm
Posts: 359
Post Re: Error in tutorial #10...
Hello,

I believe you are correct, sorry for the error. It will be corrected :)

_________________
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com


Sat Feb 06, 2010 12:23 am
Profile E-mail WWW

Joined: Sun Jan 24, 2010 2:20 pm
Posts: 23
Post Re: Error in tutorial #10...
Ah, no need to apologize, my friend! :D With such a huge series, this sort of thing will happen to any writer. ;) We thank you for the series!


Sat Feb 06, 2010 3:10 am
Profile E-mail
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron

Powered by phpBB © phpBB Group.
Original Design by Vjacheslav Trushkin for Free Forums/DivisionCore.
Theme and forum modified by BrokenThorn Entertainment, Co.