From 21bdfb9cf9e0f4766d56424f4785ba38ca78c97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 2 Feb 2005 02:59:04 +0000 Subject: [PATCH] Moved the "random spots" for the first two page tables to 0x91000 and 0x92000 respectively; the area from 0x9f000-0x100000 is not really usable anyway, so we can safely cut down the maximum size of the boot loader to around 500 kB. Therefore, the first free physical page is now at 0x100000 straight. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11194 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/platform/bios_ia32/mmu.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/kernel/boot/platform/bios_ia32/mmu.cpp b/src/kernel/boot/platform/bios_ia32/mmu.cpp index ea43d66829..f363b714eb 100644 --- a/src/kernel/boot/platform/bios_ia32/mmu.cpp +++ b/src/kernel/boot/platform/bios_ia32/mmu.cpp @@ -24,11 +24,12 @@ /** The (physical) memory layout of the boot loader is currently as follows: * 0x0500 - 0x10000 protected mode stack * 0x0500 - 0x09000 real mode stack - * 0x10000 - ? code - * 0x101000 1st temporary page table (identity maps 0-4 MB) - * 0x102000 2nd (4-8 MB) - * 0x110000 boot loader heap (32 kB) - * 0x118000 - free physical memory + * 0x10000 - ? code (up to ~500 kB) + * 0x91000 1st temporary page table (identity maps 0-4 MB) + * 0x92000 2nd (4-8 MB) + * 0x100000 page directory + * ... boot loader heap (32 kB) + * ... free physical memory * * The first 8 MB are identity mapped (0x0 - 0x0800000); paging is turned * on. The kernel is mapped at 0x80000000, all other stuff mapped by the @@ -64,7 +65,7 @@ static uint32 *sPageDirectory = 0; static uint32 *sPageTable = 0; // this points to the most recently added kernel page table -static addr_t sNextPhysicalAddress = 0x110000; +static addr_t sNextPhysicalAddress = 0x100000; static addr_t sNextVirtualAddress = KERNEL_BASE + kMaxKernelSize; static addr_t sMaxVirtualAddress = KERNEL_BASE + 0x400000; @@ -218,7 +219,7 @@ get_memory_map(extended_memory **_extendedMemory) static void -init_page_directory() +init_page_directory(void) { // allocate a new pgdir sPageDirectory = (uint32 *)get_next_physical_page(); @@ -233,7 +234,7 @@ init_page_directory() // These page tables won't be taken over into the kernel. // make a pagetable at this random spot - uint32 *pgtable = (uint32 *)0x101000; + uint32 *pgtable = (uint32 *)0x91000; for (int32 i = 0; i < 1024; i++) { pgtable[i] = (i * 0x1000) | kDefaultPageFlags; @@ -242,7 +243,7 @@ init_page_directory() sPageDirectory[0] = (uint32)pgtable | kDefaultPageFlags; // make another pagetable at this random spot - pgtable = (uint32 *)0x102000; + pgtable = (uint32 *)0x92000; for (int32 i = 0; i < 1024; i++) { pgtable[i] = (i * 0x1000 + 0x400000) | kDefaultPageFlags;