VMM/Paging
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
VMM/Paging
So ive been wanting to implement paging using limine but i have no idea where to start and looking at this https://wiki.osdev.org/Paging only confuses me even more if i could get help on where to get started that would be really nice
here is my repo if you would like to look at it https://github.com/GhostedGaming/eucalypt-dos
here is my repo if you would like to look at it https://github.com/GhostedGaming/eucalypt-dos
Re: VMM/Paging
There’s a good introduction to paging here: https://os.phil-opp.com/paging-introduction/ It’s written with Rust in mind, so you can’t just cut and paste the code (which is a good thing), but it’s a good explanation of the concepts involved.
- h3tR
- Posts: 9
- Joined: Fri Mar 21, 2025 10:23 am
- GitHub: https://github.com/h3tR
Re: VMM/Paging
What I got from the limine specs when I looked into it for my own implementation is that Limine maps the entire memorymap to the offset found in the hhdm response. Most of it would have the present and writable flags which really isn’t ideal in the long run. Only exception on this iirc is the kernel executable which is mapped at the virtual base found in the executable address response.
This makes it easy to set up initial structures for your frame, virtual page and heap allocators but you most likely should unmap everything that you aren’t using and change the flags to something appropriate on the things you do want to keep. Another thing to keep in mind is that from my experience limine maps huge pages which isn’t ideal everywhere. If you’d want to use other page sizes instead you’re gonna need to remap that as well.
This makes it easy to set up initial structures for your frame, virtual page and heap allocators but you most likely should unmap everything that you aren’t using and change the flags to something appropriate on the things you do want to keep. Another thing to keep in mind is that from my experience limine maps huge pages which isn’t ideal everywhere. If you’d want to use other page sizes instead you’re gonna need to remap that as well.
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: VMM/Paging
Would it be ok to just have every page 4kb or would i have to vary the size depending on what its for?
Re: VMM/Paging
It's fine to design your system to use only 4k pages. After all, it's normal and expected that larger allocations would be built by mapping pages next to each other, where the pages are all the system size.
Linux used to do it, and it worked fine. Staying focused on the minimal features required to get your page table implemented will help you get to a working os fast.
Linux used to do it, and it worked fine. Staying focused on the minimal features required to get your page table implemented will help you get to a working os fast.
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: VMM/Paging
Will i be able to use it with x86_64 i know there are a few differences when it comes to paging on both but i dont know how big the differences areiansjack wrote: ↑Wed Dec 24, 2025 12:32 am There’s a good introduction to paging here: https://os.phil-opp.com/paging-introduction/ It’s written with Rust in mind, so you can’t just cut and paste the code (which is a good thing), but it’s a good explanation of the concepts involved.
Re: VMM/Paging
My link references the x86_64. In addition you should look at the Intel (and/or AMD) programmer’s reference manuals.
Re: VMM/Paging
Did you get the info you needed to keep going with paging? Im not nearly as smart as some of these other posters but I have been able to get past paging, and fairly recently too, so I might be able to offer tips that helped me. Also might I plug my own OS professor's lecture notes, paging is near the bottom, but if you like OS dev then you should honestly read everything he has (again Im biased lol) https://sites.cs.ucsb.edu/~rich/class/c ... index.html
happy os-dev-ing! <3
happy os-dev-ing! <3
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: VMM/Paging
a little bit I still don't understand even though memory is just a bitmap arraybunny wrote: ↑Sun Jan 04, 2026 10:35 am Did you get the info you needed to keep going with paging? Im not nearly as smart as some of these other posters but I have been able to get past paging, and fairly recently too, so I might be able to offer tips that helped me. Also might I plug my own OS professor's lecture notes, paging is near the bottom, but if you like OS dev then you should honestly read everything he has (again Im biased lol) https://sites.cs.ucsb.edu/~rich/class/c ... index.html
happy os-dev-ing! <3
Re: VMM/Paging
I mean, its a bitmap array in the sense that you can think of it as a single logically contiguous region of storage but my intuition says the way you're thinking of it might be confusing you. Physical memory is a bunch of hardware single bit storage devices strung together and a physical address is how the memory controllers etc know where to find your data. When building an OS, aside from being able to allocate physical memory, we dont really want to mess around with physical addresses and so we have this layer of abstraction, virtual addresses, to help. Paging plays into this and solves some specific problems with using virtual addresses and honestly with memory in general. While there are loads of great resources out there if you would like to ask any specific questions I'll happily do my best to help you. In my humble opinion virtual memory is one of, if not the, most important things to fully understand for OS Dev, so its definitely worth pausing now to really figure it out before you get too far and have major problems.GhostedGaming wrote: ↑Tue Jan 06, 2026 10:01 am a little bit I still don't understand even though memory is just a bitmap array
~ Bunny <3
~ she/her
~ she/her

