From: Robert Morris Date: Tue, 31 Aug 2010 23:21:52 +0000 (-0400) Subject: Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6 X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=23c3e52c2fb5f1709bf5053a8e93161931b56bf9;p=cs3210-lab0.git Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6 --- 23c3e52c2fb5f1709bf5053a8e93161931b56bf9 diff --cc kalloc.c index 43e80e8,7653242..5f690f5 --- a/kalloc.c +++ b/kalloc.c @@@ -24,11 -24,13 +24,12 @@@ kinit(void extern char end[]; initlock(&kmem.lock, "kmem"); - char *p1 = (char*)PGROUNDUP((uint)end); - char *p2 = PGROUNDDOWN(PHYSTOP); - for( ; p1 < p2; p1 += 4096) - kfree(p1); + char *p = (char*)PGROUNDUP((uint)end); + for( ; p + PGSIZE - 1 < (char*) PHYSTOP; p += PGSIZE) + kfree(p); } + //PAGEBREAK: 21 // Free the page of physical memory pointed at by v, // which normally should have been returned by a // call to kalloc(). (The exception is when