It's all about Memory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
abosohyle
Posts: 2
Joined: Mon Oct 02, 2017 10:36 am

It's all about Memory

Post by abosohyle »

Hello there, this is my first post and I'm so glad to be here. Reading a story is interesting thing, living one is quite another. My post is about some questions that I can not solve since been involved in OS development and I hope that someone could guide me through the road. Although I have successfully built my tool chain as instructed and managed to boot, gdt, irq, timer, keyboard... But I stuck in memory and how to manage it. Simply could not answer these questions:-

1) how big is my kernel.
2) how to know where is my kernel in physical memory (start - end).
3) how to use grub memory map and not just to know it.
4) how to design a flat memory model.
Furthermore...
5) how to start paging.
6) how to create a memory management system using virtual memory.

I know Memory is a complex concept though four months have passed reading all kind of information I could reach but with no progress, my goal is not just a theory I have read enough but could not understand. I need a practical piece of code to start with.

I hope this is enough to express the problem and forgive my English - still in progress. Thanks in advance.
Octocontrabass
Member
Member
Posts: 5586
Joined: Mon Mar 25, 2013 7:01 pm

Re: It's all about Memory

Post by Octocontrabass »

1) Subtract the address of the start of your kernel from the address of the end of your kernel.
2) You can define global symbols in your linker script that point to the start and end of your kernel.
3) Write a function that translates the information from the memory map into something your physical memory manager can use.
4) Set all of the segment base addresses to 0.
5) Build your page tables and then enable paging.
6) This page is a good start. Some of the links on that page will also be useful.
DavidAylaian
Posts: 2
Joined: Thu Aug 17, 2017 9:47 am
Location: United States
Contact:

Re: It's all about Memory

Post by DavidAylaian »

We also have a page on paging: http://wiki.osdev.org/Paging
If you do nothing, nothing happens!
abosohyle
Posts: 2
Joined: Mon Oct 02, 2017 10:36 am

Re: It's all about Memory

Post by abosohyle »

Thanks a lot.
Post Reply