From c4cc10da7ef6d65f0f654445e0af35b8309f16c2 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 6 Aug 2010 11:12:18 -0400 Subject: fix corner cases in exec of ELF put an invalid page below the stack have fork() handle invalid pages --- kalloc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'kalloc.c') diff --git a/kalloc.c b/kalloc.c index 5661105..7695006 100644 --- a/kalloc.c +++ b/kalloc.c @@ -1,9 +1,8 @@ // Physical memory allocator, intended to allocate -// memory for user processes. Allocates in 4096-byte "pages". +// memory for user processes. Allocates in 4096-byte pages. // Free list is kept sorted and combines adjacent pages into // long runs, to make it easier to allocate big segments. -// One reason the page size is 4k is that the x86 segment size -// granularity is 4k. +// This combining is not useful now that xv6 uses paging. #include "types.h" #include "defs.h" -- cgit v1.2.3 From 789b508d538e6faf635e49f268a4f1f9e9b65f05 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Wed, 11 Aug 2010 14:34:45 -0400 Subject: uptime() sys call for benchmarking increase PHYSTOP --- kalloc.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'kalloc.c') diff --git a/kalloc.c b/kalloc.c index 7695006..ca87018 100644 --- a/kalloc.c +++ b/kalloc.c @@ -23,14 +23,10 @@ struct { int nfreemem; // Initialize free list of physical pages. -// This code cheats by just considering one megabyte of -// pages after end. Real systems would determine the -// amount of memory available in the system and use it all. void kinit(char *p, uint len) { initlock(&kmem.lock, "kmem"); - cprintf("end 0x%x free = %d(0x%x)\n", p, len); nfreemem = 0; kfree(p, len); } -- cgit v1.2.3