Import backup from 2003-09-07

This commit is contained in:
Josh Holtrop 2003-09-07 22:00:00 -04:00
parent e147635333
commit 02d7fc9a69
3 changed files with 17 additions and 14 deletions

View File

@ -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++)

3
mm.c
View File

@ -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

View File