diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/kalloc.c | 2 | ||||
-rw-r--r-- | kern/printf.h | 9 | ||||
-rw-r--r-- | kern/startup.c | 24 |
3 files changed, 34 insertions, 1 deletions
diff --git a/kern/kalloc.c b/kern/kalloc.c index 4460d597..8256305b 100644 --- a/kern/kalloc.c +++ b/kern/kalloc.c @@ -48,7 +48,7 @@ vm_map_t kalloc_map; -vm_size_t kalloc_map_size = 8 * 1024 * 1024; +vm_size_t kalloc_map_size = 64 * 1024 * 1024; vm_size_t kalloc_max; /* diff --git a/kern/printf.h b/kern/printf.h index 13831986..c5effe5d 100644 --- a/kern/printf.h +++ b/kern/printf.h @@ -43,6 +43,15 @@ extern int sprintf (char *buf, const char *fmt, ...); extern int printf (const char *fmt, ...); +#define printf_once(fmt, ...) \ + MACRO_BEGIN \ + static int __once = 0; \ + if (!__once) { \ + printf(fmt, ##__VA_ARGS__); \ + __once = 1; \ + } \ + MACRO_END + extern int indent; extern void iprintf (const char *fmt, ...); diff --git a/kern/startup.c b/kern/startup.c index 81626dbf..75a05b0e 100644 --- a/kern/startup.c +++ b/kern/startup.c @@ -27,6 +27,8 @@ * Mach kernel startup. */ +#include <string.h> + #include <mach/boolean.h> #include <mach/machine.h> #include <mach/task_special_ports.h> @@ -76,6 +78,10 @@ extern void device_service_create(); void cpu_launch_first_thread(); /* forward */ void start_kernel_threads(); /* forward */ +#if ! MACH_KBD +boolean_t reboot_on_panic = 1; +#endif + #if NCPUS > 1 extern void start_other_cpus(); extern void action_thread(); @@ -83,6 +89,7 @@ extern void action_thread(); /* XX */ extern vm_offset_t phys_first_addr, phys_last_addr; +extern char *kernel_cmdline; /* * Running in virtual memory, on the interrupt stack. @@ -94,6 +101,23 @@ void setup_main() { thread_t startup_thread; +#if MACH_KDB + /* + * Cause a breakpoint trap to the debugger before proceeding + * any further if the proper option flag was specified + * on the kernel's command line. + * XXX check for surrounding spaces. + */ + if (strstr(kernel_cmdline, "-d ")) { + cninit(); /* need console for debugger */ + SoftDebugger("init"); + } +#else /* MACH_KDB */ + if (strstr (kernel_cmdline, "-H ")) { + reboot_on_panic = 0; + } +#endif /* MACH_KDB */ + panic_init(); printf_init(); |