PageManager usable 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
skandalOS
Posts: 15
Joined: Mon Sep 05, 2011 12:05 pm

PageManager usable Memory

Post by skandalOS »

Hello, I've questions about the Pagemanager/Paging!
I know the concept of Paging and also understand the translating from virtual addresses and physical addresses....and mapping
But there are some things which I couldnt understand from the framework where I'm currently working on, it is so
complicated that I couldnt get any idea what here is happening.

Here are some debugging statements at the beginning of kernel:
[PM ]++++++:start:0x0, end: 0x0:
[PM ]Ctor: usable memory region from physical 0x0 to 0x9f400 of type 1
[PM ]Ctor: usable memory region from physical 0x9f400 to 0xa0000 of type 2

>>>>Question: here f.example is a large space between f0000 and a0000, which isn't handled or not detected, what is the reason?

[PM ]Ctor: usable memory region from physical 0xf0000 to 0x100000 of type 2
[PM ]Ctor: usable memory region from physical 0x100000 to 0x7fd000 of type 1
[PM ]Ctor: usable memory region from physical 0x7fd000 to 0x800000 of type 2
[PM ]Ctor: usable memory region from physical 0xfffc0000 to 0x0 of type 2
[PM ]Ctor: Number of physical pages: 2045
[PM ]Ctor: Pages used by Grub Modules 0
[PM ]Ctor: Initializing page_usage_table_ with all pages reserved
[PM ]Ctor: usable memory region: start_page: 0, end_page: 159, type: 1
[PM ]Ctor: usable memory region: start_page: 159, end_page: 160, type: 2
[PM ]Ctor: usable memory region: start_page: 240, end_page: 256, type: 2
[PM ]Ctor: usable memory region: start_page: 256, end_page: 2045, type: 1
[PM ]Ctor: usable memory region: start_page: 2045, end_page: 2048, type: 2
[PM ]Ctor: usable memory region: start_page: 1048512, end_page: 0, type: 2
[PM ]Ctor: Marking stuff mapped in above 2 and < 3 gig as used
[PM ]Ctor: Marking GRUB loaded modules as reserved
[PM ]Ctor: find lowest unreserved page
[PM ]Ctor: lowest_unreserved_page_=1280
[PM ]Ctor done

First: What means type1 and type 2?
I guess that one type1 means that areas of physical memory of such type is usable and mapable.
And type2 memory means that it is usable but not able for mapping because it is not suitability for mapping because
of 4kb boundary/size for paging.

for example:
[PM ]Ctor: usable memory region from physical 0x0 to 0x9f400 of type 1
is equivalent to
[PM ]Ctor: usable memory region: start_page: 0, end_page: 159, type: 1
but 9f400 is 159*4096 + 1024, there is a little space which is I think unusable, isn't it true?
How is this 1024 Byte handled or to be handled?

please help me, thanks for your comments...
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: PageManager usable Memory

Post by gerryg400 »

I have no idea about your framework. But did you read this wiki page ? http://wiki.osdev.org/Detecting_Memory_%28x86%29 ?

It talks about memory types.
If a trainstation is where trains stop, what is a workstation ?
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: PageManager usable Memory

Post by egos »

skandalOS wrote:>>>>Question: here f.example is a large space between f0000 and a0000, which isn't handled or not detected, what is the reason?
Video buffer, ROM Scan, shadow memory (ROM BIOS)?
First: What means type1 and type 2?
Look in ACPI Spec.
If you have seen bad English in my words, tell me what's wrong, please.
megatron23
Posts: 19
Joined: Sat Oct 22, 2011 3:03 pm

Re: PageManager usable Memory

Post by megatron23 »

skandalOS wrote:>>>>Question: here f.example is a large space between f0000 and a0000, which isn't handled or not detected, what is the reason?
This applies to the OS / "Framework" you are using:
Memory from 0x0000 0000 to 0x0010 0000 is mapped anyway to linear 0xC000 0000 to 0xC010 0000.
Video memory that lies between 0x00A0 0000 and 0x00F0 0000 (actually from 0xB8000 to 0xB8780) is used definitely for all I know.

skandalOS wrote:First: What means type1 and type 2?
Type 1 means that the region can be used where Type 2 is reserved and cannot be.

skandalOS wrote:usable memory region from physical 0x100000 to 0x7fd000 of type 1
Thats because the emulator is set to use only 8MiB of memory.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: PageManager usable Memory

Post by Combuster »

here f.example is a large space between f0000 and a0000, which isn't handled or not detected, what is the reason?
Because it isn't memory, its ROM and devices.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply