I hope that this explanations can give you some hints. By analyzing the code functions you should be able to figure out the rest.
VGA_WIDTH
– width of the screen;
VGA_HEIGHT
– height of the screen
x
– horizontal position of the character on the screen
y
– vertical position of the character on the screen
Since VGA card keeps all characters in a linear memory it has to use x
, y
,
VGA_WIDTH
and VGA_WIDTH
to calculate an index for its internal buffer to store a character at the proper memory location.
void terminal_initialize
– this function initializes your terminal. It just puts spaces on the entire screen.
void terminal_putentryat(char c, uint8_t color, size_t x, size_t y)
puts a character c
, on the screen at the location (x
,y
).
void terminal_putchar(char c)
– it puts a character c
, at the screen.
This function has terminal_column
and terminal_row
variables to track the current terminal column and row.
solved Explain how the following program works?