hi,
i've been trying to map the vbe lfb given by grub, so i can use it with paging enabled, but no matter what i do, the mapping doesnt work.what can i do?
Thanks!
Don't know how to map a memory address with paging
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Don't know how to map a memory address with paging
Tell us what you've tried so far and where you failedalberinfo wrote:what can i do?
Re: Don't know how to map a memory address with paging
first of all, the map you actually see in my code, which just plots pixels in random colors, and later it crashes and comes back to grub. i've tried to map the memory after paging is enabled, and then flush the tlb with invlpg instruction, it just shows the first area of the memory(probably the first 4kb) corrupt, and then some other things that the OS didn't even boot.
- bellezzasolo
- Member
- Posts: 110
- Joined: Sun Feb 20, 2011 2:01 pm
Re: Don't know how to map a memory address with paging
Based off https://github.com/alberinfo/Slidoor-OS ... y/paging.c
You're not updating the framebuffer address. All you're doing is mapping the first 4096 bytes of the LFB repeatedly. You increment it in id_map - but that's a local copy.
Secondly, you really should calculate the length, rather than just mapping 4MB. It shouldn't cause problems, but it's good form.
Finally, I suggest moving the LFB mapping code out of paging.c, it should really be in your video driver.
You're not updating the framebuffer address. All you're doing is mapping the first 4096 bytes of the LFB repeatedly. You increment it in id_map - but that's a local copy.
Secondly, you really should calculate the length, rather than just mapping 4MB. It shouldn't cause problems, but it's good form.
Finally, I suggest moving the LFB mapping code out of paging.c, it should really be in your video driver.
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
https://github.com/ChaiSoft/ChaiOS
Re: Don't know how to map a memory address with paging
i think i didn't understand. what do you mean by updating the framebuffer addr?
PD: i after i map, when i enable paging, it will crash and come back to grub, even if i just do 1 map, or 1024 times in a for loop
PD: i after i map, when i enable paging, it will crash and come back to grub, even if i just do 1 map, or 1024 times in a for loop