From: Dan A. <da...@gm...> - 2004-02-02 22:48:13
|
On Mon, Feb 02, 2004 at 04:35:36PM -0600, Richard Goodwin wrote: > I think it works! :) So far no crash!! What did you change? Cool. This might take care of those BSODs for now. --- colinux-20040131/src/colinux/kernel/monitor.c 2004-01-31 18:57:06.000000000 +0200 +++ colinux-20040131-patch/src/colinux/kernel/monitor.c 2004-02-03 00:19:25.000000000 +0200 @@ -114,9 +114,9 @@ co_rc_t rc; cmon->page_tables_size = cmon->physical_frames * sizeof(unsigned long *); - cmon->page_tables_pages = (cmon->page_tables_size + PAGE_SHIFT-1) >> PAGE_SHIFT; + cmon->page_tables_pages = (cmon->page_tables_size + PAGE_SIZE-1) >> PAGE_SHIFT; cmon->pa_maps_size = cmon->manager->host_memory_pages * sizeof(unsigned long); - cmon->pa_maps_pages = (cmon->pa_maps_size + PAGE_SHIFT-1) >> PAGE_SHIFT; + cmon->pa_maps_pages = (cmon->pa_maps_size + PAGE_SIZE-1) >> PAGE_SHIFT; rc = co_monitor_alloc_pages(cmon, cmon->page_tables_pages, (void **)&cmon->page_tables); if (!CO_OK(rc)) { An obvious bug-o. But I don't think it's the end of the fix. The problem is that the amount of physical RAM reported from userspace is not divided by 16MB, which means that something went wrong in its calculation. Look at this: unsigned long co_os_get_physical_ram_size() { MEMORYSTATUS memstat; GlobalMemoryStatus(&memstat); /* Round up in MBs: */ return (memstat.dwTotalPhys + 0xFFFFF) & 0xFFF00000; } It's BAD. Does anyone know a better way to get this information? -- Dan Aloni da...@gm... |