virtualbox – How can I use VESA to write more than 64 thousand bytes to my screen?

I want to paint over my entire screen with a resolution of 800×600 and 16 BPP. As a result, it will take 960 thousand bytes, when only 64 thousand are available at 0xA0000.

I read about it and found out about VESA, and that I can write more than 64 thousand bytes. But I didn’t understand exactly how to do it.
According to my guesses, you can put 64,000 bytes in 0xA000:0000, another 64,000 bytes in 0xA000:0001, and so on. Most likely, the address 0xA000:0001 is 0xA0000001. But I’m pretty sure that my guesses are not very correct.

I created a set_pixel function that outputs a pixel page by page.

void set_pixel(uint32_t x, uint32_t y, uint16_t color) {
    uint8_t* screen = (uint8_t*)0xA0000000 + (y / 40);
    uint32_t index = (y % 40) * SCREEN_WIDTH + x;
    screen[index] = color;
}

But after I tried to output a pixel, my VirtualBox crashed.

Read more here: Source link