X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fmem.c;h=6b3263d307a73ce26ff1e1eca489dd409dfc04e6;hb=d35c92b5c9c5aef7b1e7b5ed500b2beae504ea4e;hp=5267ee139b1f1c5feb9f1a2f635544c2f17d5791;hpb=190b2ef9470c23c275754b74745933d973f8c439;p=palacios-OLD.git diff --git a/palacios/src/geekos/mem.c b/palacios/src/geekos/mem.c index 5267ee1..6b3263d 100644 --- a/palacios/src/geekos/mem.c +++ b/palacios/src/geekos/mem.c @@ -1,8 +1,8 @@ -/* + /* * Physical memory allocation * Copyright (c) 2001,2003,2004 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth - * $Revision: 1.4 $ + * $Revision: 1.8 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -22,6 +22,7 @@ #include #include + /* ---------------------------------------------------------------------- * Global data * ---------------------------------------------------------------------- */ @@ -36,6 +37,18 @@ struct Page* g_pageList; */ uint_t g_freePageCount = 0; + + +/* + * the disgusting way to get at the memory assigned to a VM + */ +extern ulong_t vm_range_start; +extern ulong_t vm_range_end; +extern ulong_t guest_kernel_start; +extern ulong_t guest_kernel_end; + + + /* ---------------------------------------------------------------------- * Private data and functions * ---------------------------------------------------------------------- */ @@ -56,6 +69,9 @@ static struct Page_List s_freeList; */ int unsigned s_numPages; + + + /* * Add a range of pages to the inventory of physical memory. */ @@ -172,7 +188,13 @@ void Init_Mem(struct Boot_Info* bootInfo) vmmMemEnd = Round_Up_To_Page(pageListEnd + VMM_AVAIL_MEM_SIZE); - + /* + * the disgusting way to get at the memory assigned to a VM + */ + vm_range_start = vmmMemEnd; + vm_range_end = endOfMem; + guest_kernel_start = ISA_HOLE_END; + guest_kernel_end = guestEnd; Add_Page_Range(0, PAGE_SIZE, PAGE_UNUSED); // BIOS area Add_Page_Range(PAGE_SIZE, PAGE_SIZE * 3, PAGE_ALLOCATED); // Intial kernel thread obj + stack @@ -184,8 +206,9 @@ void Init_Mem(struct Boot_Info* bootInfo) Add_Page_Range(heapAddr, heapEnd, PAGE_HEAP); // Heap Add_Page_Range(pageListAddr, pageListEnd, PAGE_KERN); // Page List Add_Page_Range(pageListEnd, vmmMemEnd, PAGE_AVAIL); // Available VMM memory - Add_Page_Range(vmmMemEnd, endOfMem, PAGE_VM); // Memory allocated to the VM - + // Add_Page_Range(vmmMemEnd, endOfMem, PAGE_VM); // Memory allocated to the VM + // Until we get a more intelligent memory allocator + Add_Page_Range(vmmMemEnd, endOfMem, PAGE_AVAIL); // Memory allocated to the VM /* Initialize the kernel heap */ @@ -206,7 +229,7 @@ void Init_Mem(struct Boot_Info* bootInfo) PrintBoth("%x to %x - KERNEL HEAP\n", heapAddr, heapEnd - 1); PrintBoth("%lx to %lx - PAGE LIST\n", pageListAddr, pageListEnd - 1); PrintBoth("%lx to %x - FREE\n", pageListEnd, vmmMemEnd - 1); - PrintBoth("%lx to %x - GUEST_MEMORY\n", vmmMemEnd, endOfMem - 1); + PrintBoth("%lx to %x - GUEST_MEMORY (also free)\n", vmmMemEnd, endOfMem - 1); } /* @@ -218,7 +241,8 @@ void Init_BSS(void) /* Fill .bss with zeroes */ memset(&BSS_START, '\0', &BSS_END - &BSS_START); - PrintBoth("BSS Inited, BSS_START=%x, BSS_END=%x\n",BSS_START,BSS_END); + // screen is not inited yet - PAD + // PrintBoth("BSS Inited, BSS_START=%x, BSS_END=%x\n",BSS_START,BSS_END); } /*