Make the panic just a wee bit more informative.
authorRonald G. Minnich <rminnich@google.com>
Thu, 9 Jan 2014 20:09:13 +0000 (12:09 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 17 Jan 2014 22:35:30 +0000 (14:35 -0800)
I know I'm a fool, but you need to tell me why :-)

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
kern/src/pmap.c

index 4645704..94ee546 100644 (file)
@@ -151,8 +151,13 @@ void *boot_alloc(size_t amt, size_t align)
                boot_alloc_init();
        boot_freemem = ROUNDUP(boot_freemem, align);
        retval = boot_freemem;
-       if (boot_freemem + amt > boot_freelimit)
+       if (boot_freemem + amt > boot_freelimit){
+               printk("boot_alloc: boot_freemem is 0x%x\n", boot_freemem);
+               printk("boot_alloc: amt is %d\n", amt);
+               printk("boot_freelimit is 0x%x\n", boot_freelimit);
+               printk("boot_freemem + amt is > boot_freelimit\n");
                panic("Out of memory in boot alloc, you fool!\n");
+       }
        boot_freemem += amt;
        printd("boot alloc from %p to %p\n", retval, boot_freemem);
        /* multiboot info probably won't ever conflict with our boot alloc */