Re: How to map vbe buffer
Posted: Sun Aug 14, 2016 11:41 pm
@sleephacker, Does this code work correctly?
The Place to Start for Operating System Developers
http://f.osdev.org/
Code: Select all
uint32_t vbe_buff_size = vbe_height * vbe_width * (vbe_bpp / 8) * vbe_pitch;
Code: Select all
uint32_t vbe_buff_size = vbe_height * vbe_pitch;
VBE works even without:sleephacker wrote:The vbe page entries look a bit weird...
Also I just noticed that you used:to calculate the framebuffer size, but you should do it like this:Code: Select all
uint32_t vbe_buff_size = vbe_height * vbe_width * (vbe_bpp / 8) * vbe_pitch;
because vbe_pitch is a replacement for width * bbp / 8.Code: Select all
uint32_t vbe_buff_size = vbe_height * vbe_pitch;
Code: Select all
for(uint32_t i = vbe_first_page; i < vbe_first_page + vbe_page_count; i++)
page_table[0][i] = i * PAGE_SIZE | PAGE_PRESENT | PAGE_RW | PAGE_USER;