Import backup from 2003-09-07
This commit is contained in:
parent
e147635333
commit
02d7fc9a69
2
kernel.c
2
kernel.c
@ -31,7 +31,7 @@ void k_init()
|
||||
outportb(0x43, 0x34);
|
||||
outportb(0x40, 0x9c); //lsb
|
||||
outportb(0x40, 0x2e); //msb
|
||||
// video_init((ModeInfoBlock *) 0x90306);
|
||||
video_init((ModeInfoBlock *) 0x90306);
|
||||
mm_init();
|
||||
int a;
|
||||
for (a=0; a<512; a++)
|
||||
|
5
mm.c
5
mm.c
@ -26,7 +26,7 @@ void mm_init()
|
||||
}
|
||||
if (first_pageblock == 0) //no pageblock page set up yet, so set it up here
|
||||
{
|
||||
first_pageblock = (pageblock *) maps[a].base.lowdword;
|
||||
first_pageblock = (pageblock *) maps[a].base.lowdword ;
|
||||
maps[a].base.lowdword += 4096;
|
||||
maps[a].limit.lowdword -= 4096;
|
||||
mm_init_pageblockpage(first_pageblock);
|
||||
@ -162,6 +162,8 @@ int mm_pfree(void *ptr)
|
||||
pb->flags = MM_PB_AVAIL; //found block, mark available / coalesce it
|
||||
pageblock *pbc = first_pageblock;
|
||||
for (;;)
|
||||
{
|
||||
if (pbc->flags == MM_PB_AVAIL)
|
||||
{
|
||||
if ((pbc->base + (pbc->length * 4096)) == pb->base) //pbc ends where pb starts
|
||||
{
|
||||
@ -175,6 +177,7 @@ int mm_pfree(void *ptr)
|
||||
pbc->flags = MM_PB_NP;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (pbc->link == 0) //no entry found to consolidate...
|
||||
return 0;
|
||||
pbc = (pageblock *) pbc->link; //next entry to test
|
||||
|
Loading…
x
Reference in New Issue
Block a user