[CLOSED] Physical allocator and the heap.
Posted: Sat Oct 11, 2014 9:55 am
Hi,
During the past few days I'm trying to understand one confusing problem.
From what I know, the physical allocator allocates physical pages ("frames"). Each frame is a block of 4 KB.
The virtual allocator allocates pages. The size of a page is 4 KB too.
Since amount of the physical address space often (in emulators) is not exactly 4 GB, it is logical to assume that it has less free pages than the virtual address space.
Also, the virtual allocator requests a physical page when it needs a page for a page directory or for a page table (if it is not the full list, please finish it). Here I'm confused:
User (actually a programmer) can map a virtual page to a used physical one (read the whole post). This may cause crash (e.g. the physical page may contain a page directory or page table, etc.).
As I guess, there should be a thing called heap and it needs to be in the physical address space. The heap itself is (again, as I guess) a big region of physical memory (e.g. 4 MB, or more, 128 MB?). It contains free and used physical pages. There should be a bitmap (or something else, doesn't matter for me now) for the heap. Is my imagine of the purpose of the heap true?
During the past few days I'm trying to understand one confusing problem.
From what I know, the physical allocator allocates physical pages ("frames"). Each frame is a block of 4 KB.
The virtual allocator allocates pages. The size of a page is 4 KB too.
Since amount of the physical address space often (in emulators) is not exactly 4 GB, it is logical to assume that it has less free pages than the virtual address space.
Also, the virtual allocator requests a physical page when it needs a page for a page directory or for a page table (if it is not the full list, please finish it). Here I'm confused:
User (actually a programmer) can map a virtual page to a used physical one (read the whole post). This may cause crash (e.g. the physical page may contain a page directory or page table, etc.).
As I guess, there should be a thing called heap and it needs to be in the physical address space. The heap itself is (again, as I guess) a big region of physical memory (e.g. 4 MB, or more, 128 MB?). It contains free and used physical pages. There should be a bitmap (or something else, doesn't matter for me now) for the heap. Is my imagine of the purpose of the heap true?