summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2005-12-19 09:26:42 +0000
committersobomax <sobomax@FreeBSD.org>2005-12-19 09:26:42 +0000
commit239343cecc20abf2855c9c85f2ecf7fae8884031 (patch)
treeb739aa7e1c9b972dcafd819444fdfd2f0ed47a5a /sys/boot
parent85788ffcca906e7e6e886631b334ba779bff98e4 (diff)
downloadFreeBSD-src-239343cecc20abf2855c9c85f2ecf7fae8884031.zip
FreeBSD-src-239343cecc20abf2855c9c85f2ecf7fae8884031.tar.gz
If LOADER_BZIP2_SUPPORT is defined allocate heap in the 1MB-4MB range to
provide enough room for decompression (up to 2.5MB is necessary). This should be safe to do since we load i386 kernels after 8MB mark now, so that 16MB is the minimum amount of RAM necessary to even boot FreeBSD. This makes bzip2-support practically useable.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/loader/main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/boot/i386/loader/main.c b/sys/boot/i386/loader/main.c
index ac31fd7..85d574b 100644
--- a/sys/boot/i386/loader/main.c
+++ b/sys/boot/i386/loader/main.c
@@ -72,6 +72,9 @@ extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[];
/* XXX debugging */
extern char end[];
+static void *heap_top;
+static void *heap_bottom;
+
int
main(void)
{
@@ -88,7 +91,14 @@ main(void)
*/
bios_getmem();
- setheap((void *)end, (void *)bios_basemem);
+#ifdef LOADER_BZIP2_SUPPORT
+ heap_top = PTOV(0x400000);
+ heap_bottom = PTOV(0x100000);
+#else
+ heap_top = (void *)bios_basemem;
+ heap_bottom = (void *)end;
+#endif
+ setheap(heap_bottom, heap_top);
/*
* XXX Chicken-and-egg problem; we want to have console output early, but some
@@ -269,7 +279,8 @@ static int
command_heap(int argc, char *argv[])
{
mallocstats();
- printf("heap base at %p, top at %p\n", end, sbrk(0));
+ printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom,
+ sbrk(0), heap_top);
return(CMD_OK);
}
OpenPOWER on IntegriCloud