OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 10:40 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Don't know how to map a memory address with paging
PostPosted: Sat Mar 02, 2019 12:29 pm 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
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!


Top
 Profile  
 
 Post subject: Re: Don't know how to map a memory address with paging
PostPosted: Sat Mar 02, 2019 12:41 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
alberinfo wrote:
what can i do?
Tell us what you've tried so far and where you failed

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: Don't know how to map a memory address with paging
PostPosted: Sat Mar 02, 2019 12:47 pm 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
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.


Top
 Profile  
 
 Post subject: Re: Don't know how to map a memory address with paging
PostPosted: Wed Mar 06, 2019 4:27 am 
Offline
Member
Member
User avatar

Joined: Sun Feb 20, 2011 2:01 pm
Posts: 110
Based off https://github.com/alberinfo/Slidoor-OS/blob/master/include/memory/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.

_________________
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS


Top
 Profile  
 
 Post subject: Re: Don't know how to map a memory address with paging
PostPosted: Wed Mar 06, 2019 12:47 pm 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
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 #-o


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 228 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group