Page fault when accessing the GRUB framebuffer
Posted: Tue May 18, 2021 4:58 am
Hello,
In my OS (x86_64), I am supporting multiboot2. I've done the normal procedure of parsing the multiboot structure and retrieving a framebuffer and various information. But here's the part that bugs me, if I try the following demo, a page fault will occur
but if I use Limine the code runs fine without any problems.
I'm not exactly sure what's causing this issue. I thought that maybe it has something to do about being in long mode
https://github.com/ackOS-project/ackOS
In my OS (x86_64), I am supporting multiboot2. I've done the normal procedure of parsing the multiboot structure and retrieving a framebuffer and various information. But here's the part that bugs me, if I try the following demo, a page fault will occur
Code: Select all
uint32_t* fb_addr = (uint32_t*)uheader.framebuffer_addr;
for(size_t i = 0; i < uheader.framebuffer_width; i++)
{
fb_addr[i] = 0x34eb7d;
fb_addr[i + uheader.framebuffer_width] = 0x34eb7d;
fb_addr[i + (uheader.framebuffer_width * 2)] = 0x34eb7d;
fb_addr[i + (uheader.framebuffer_width * 3)] = 0x34eb7d;
fb_addr[i + (uheader.framebuffer_width * 4)] = 0x34eb7d;
for(int i = 0; i < 1000000; i++); // latency test
}
Code: Select all
bootloader_name: GRUB 2.04-1ubuntu26.8
command_line:
framebuffer: addr=0xfd000000; width=800; height=600
int_num=0xe; error=0x2
kernel panic!
occurred in file arch/x86_64/features/interrupts.cpp:69:0 in the function 'page_fault_handler()'
page fault
I'm not exactly sure what's causing this issue. I thought that maybe it has something to do about being in long mode
https://github.com/ackOS-project/ackOS