How to map vbe buffer
Re: How to map vbe buffer
@sleephacker, Does this code work correctly?
- sleephacker
- Member
- Posts: 97
- Joined: Thu Aug 06, 2015 6:41 am
- Location: Netherlands
Re: How to map vbe buffer
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:because vbe_pitch is a replacement for width * bbp / 8.
Also I just noticed that you used:
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;
Re: How to map vbe buffer
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;