Import backup from 2004-03-09

This commit is contained in:
josh committed 2017-07-25 22:23:46 -04:00
1 parent 8d0e6de040
commit 7f886e44e1
12 files changed
+211 -119

No files matched your search

+4 -4
View File
@@ -17,14 +17,14 @@ void vmm_init()
pageTables[0x3FF] = 0x104000|0x03; //the last page directory entry points to the page directory itself
pageTables[0] = 0;
invlpg(0);
if (videoMode) //we are in a graphical mode
if (video_Mode()) //we are in a graphical mode
{
unsigned int vidPages = video_mode.XResolution * video_mode.YResolution * (video_mode.BitsPerPixel >> 3);
unsigned int vidPages = video_getWidth() * video_getHeight() * (video_getBitsPerPixel() >> 3);
if (vidPages % 4096)
vidPages = (vidPages >> 12) + 1;
else
vidPages = (vidPages >> 12);
vmm_mapn(0xF0000000, video_mode.PhysBasePtr, vidPages);
vmm_mapn(0xF0000000, video_getPhysBasePtr(), vidPages);
}
unsigned int firstHeapEntryBlock = (unsigned int)mm_palloc();
vmm_map1((unsigned int)firstHeapEntry, firstHeapEntryBlock);
@@ -62,7 +62,7 @@ void vmm_map1(unsigned int virt, unsigned int physical)
unsigned int *pageTables = (unsigned int *)0xC0104000; //this is the location of the page directory
if (!(pageTables[pde] & 0x01)) //the page directory entry does not exist, we must allocate a page for it
{
unsigned int *newpagetable = mm_palloc();
unsigned int *newpagetable = (dword *)mm_palloc();
pageTables[pde] = ((unsigned int)newpagetable) | 0x03;
invlpg(virt);
unsigned int *newpteptr = (unsigned int *)(0xFFC00000 | (pde << 12)); //points to first unsigned int of newly allocated page table