Bare Bones page has wrong VGA_HEIGHT

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
The6P4C
Posts: 2
Joined: Sun May 11, 2014 1:11 am

Bare Bones page has wrong VGA_HEIGHT

Post by The6P4C »

On the Bare Bones (http://wiki.osdev.org/Bare_Bones) page, the variable

Code: Select all

VGA_HEIGHT
is set to 24.
On this Wikipedia (http://en.wikipedia.org/wiki/VGA-compat ... text_modes) page, however, it is stated that the height is 25.
I've also seen this is true in a VM.

(Tell me if I'm wrong, and also if I've posted in the wrong place as I obviously don't have edit permission in the wiki)
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Bare Bones page has wrong VGA_HEIGHT

Post by sortie »

Hmm. That is a bug.

Please fix it. You do have permission to edit the wiki. Add yourself to the wiki group via the forum options for your user to enable wiki editing.
User avatar
hometue
Member
Member
Posts: 100
Joined: Thu Dec 19, 2013 1:40 am
Location: Asia, Singapore

Re: Bare Bones page has wrong VGA_HEIGHT

Post by hometue »

Um...I thought the stuff had zero-based indexing so technically it is 25 characters isn't it?
CookieOS. Want a cookie? Its only black and white for now though, probably as bad as my baking skills.
The6P4C
Posts: 2
Joined: Sun May 11, 2014 1:11 am

Re: Bare Bones page has wrong VGA_HEIGHT

Post by The6P4C »

hometue wrote:Um...I thought the stuff had zero-based indexing so technically it is 25 characters isn't it?
According to the width, the sizes are not zero indexed.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Bare Bones page has wrong VGA_HEIGHT

Post by sortie »

Sizes and offsets are fundamentally different things. For instance, an array of size 1 has an entry at offset/index 0, while an array of size 0 has no entries. The value 25 is correct here as the variable measures the number of rows (a size). This is basic programming and need little discussion. I wrote the buggy code in question and it indeed is a bug.
no92
Member
Member
Posts: 307
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: Bare Bones page has wrong VGA_HEIGHT

Post by no92 »

The D Bare Bones also sets the internal height constant to 24 (I'm fixing it) :D
Post Reply