I've just completed the bare bones tutorial to confirm my system will compile code with the cross compiler and run. Most of the code is very simple to understand, but I had some questions in the terminal_initialize function.
I have a primitive understanding of pointers, but I'm not exactly sure what this is doing:
Code: Select all
terminal_buffer = (uint16_t*) 0xB8000;
I understand 0xB8000 is the VGA address for text mode, and that uint16_t is an unsigned 16 bit number, and that terminal_buffer is an unsigned 16 bit variable. Are we just converting that hex number to 16 bit?
terminal_buffer is setup as an array within the inner x loop; but doesn't C require we specify the bounds of an array when we set it up?
Code: Select all
terminal_buffer[index] = vga_entry(' ', terminal_color);
Lastly (for now), I wanted to confirm what terminal_buffer is doing. It is effectively, using the VGA_WIDTH, VGA_HEIGHT to create the "area" of our terminal. The two loops are creating our rows and columns that are the terminal bounds.
--Edit: My apologies, I just saw the wiki portion of the forum at the bottom. I will ensure any future questions are posted there.