Page 1 of 1

Bare Bones page has wrong VGA_HEIGHT

Posted: Sun May 11, 2014 1:17 am
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)

Re: Bare Bones page has wrong VGA_HEIGHT

Posted: Sun May 11, 2014 1:46 am
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.

Re: Bare Bones page has wrong VGA_HEIGHT

Posted: Sun May 11, 2014 2:52 am
by hometue
Um...I thought the stuff had zero-based indexing so technically it is 25 characters isn't it?

Re: Bare Bones page has wrong VGA_HEIGHT

Posted: Sun May 11, 2014 5:06 am
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.

Re: Bare Bones page has wrong VGA_HEIGHT

Posted: Sun May 11, 2014 7:41 am
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.

Re: Bare Bones page has wrong VGA_HEIGHT

Posted: Fri Jun 06, 2014 10:09 am
by no92
The D Bare Bones also sets the internal height constant to 24 (I'm fixing it) :D