[HELP] mm code

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
Askodem
Posts: 12
Joined: Thu Aug 11, 2016 8:31 am

[HELP] mm code

Post by Askodem »

Hi! I'm looking for a memory manager code/tutorial without bugs.
I found a mirror for JamesM fixed tutorials(code.google.com/p/jamesm-tutorials):
pmm.c: https://github.com/berkus/jamesm-tutori ... /src/pmm.c
vmm.c: https://github.com/berkus/jamesm-tutori ... /src/vmm.c
Is this tutorial easy to understand? How many bugs in it?
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

Re: [HELP] mm code

Post by max »

Hello Askodem!
Askodem wrote:How many bugs in it?
Exactly 7.


Just joking, no one here takes the time to check that stuff. :mrgreen:

What exactly do you want to implement? If you want to implement proper kernel memory management, you must first understand the basic concepts. Take a look at the respective wiki pages. Start out by writing a physical memory manager, and then work your way up to paging.

Writing a physical memory manager mostly depends on you being creative to make something that works out. There are many ways how to do it, and there is no real "right way" You will probably rewrite this a hundred times anyway, so just try to build something that works at first :P

Greets
szhou42
Member
Member
Posts: 67
Joined: Thu Apr 28, 2016 12:40 pm
Contact:

Re: [HELP] mm code

Post by szhou42 »

People, stop using tutorial's code directly(espically JamesM's paging code). Understand what the code does and write your own, otherwise you would have a
HARD time debugging. Debugging os is hard, debugging other's os code is even even harder.

I've been writing other parts of my os for 2 month based on my paging/kheap allocator code, with no significant bugs, you can take a look if you want. It's well commented too, I think.

https://github.com/szhou42/osdev/blob/m ... m/paging.c
Askodem
Posts: 12
Joined: Thu Aug 11, 2016 8:31 am

Re: [HELP] mm code

Post by Askodem »

Thanks for replies.
OK. I will try to implement my own mm.
szhou42 wrote:espically JamesM's paging code
This is the new JamesM's code(2010 year). It contains not only paging.
I gave links to vmm.c and pmm.c files in the first post of this thread.
Post Reply