this is my current main.c. the main changes are longer delay in shutdown() if #e/*debug is present; one-minute delay at end of shutdown() when a terminal panics; fiddled the computation of kpages, apparently to give kernels on machines >64MB more memory. i now also print the amount of memory at boot, as V6 Unix did, but that's commented out here. Notes: Thu May 5 08:50:36 EDT 2005 rsc I'm not convinced the terminal kernels need yet more memory. As far as the delay is concerned, is this a multiprocessor terminal? If you're on a uniprocessor then it should not reboot on panic -- the if(active.ispanic && m->machno==0) case should trigger, leading into the for(;;)halt(); loop. What am I missing? Thu May 5 12:43:00 EDT 2005 rsc Simplified the code a little - mp terminals should no longer reboot on panic. Reference: /n/sources/patch/applied/dont-clear-the-screen-so-fast Date: Tue May 3 05:42:10 CES 2005 Reviewed-by: rsc --- /sys/src/9/pc/main.c Tue May 3 05:38:28 2005 +++ /sys/src/9/pc/main.c Tue May 3 05:38:25 2005 @@ -346,6 +346,7 @@ char *p; int userpcnt; ulong kpages; + // uvlong kb; if(p = getconf("*kernelpercent")) userpcnt = 100 - strtol(p, 0, 0); @@ -353,6 +354,8 @@ userpcnt = 0; conf.npage = conf.npage0 + conf.npage1; + // kb = (((uvlong)conf.npage * BY2PG)/1024); + // print("mem = %,llud.%3.3lludMB\n", kb/1024, ((kb%1024)*1000)/1024); conf.nproc = 100 + ((conf.npage*BY2PG)/MB)*5; if(cpuserver) @@ -376,7 +379,12 @@ * The patch of nimage is a band-aid, scanning the whole * page list in imagereclaim just takes too long. */ - if(kpages > (64*MB + conf.npage*sizeof(Page))/BY2PG){ + /* 64MB is not always enough with Gbe */ + if(kpages > (96*MB + conf.npage*sizeof(Page))/BY2PG){ + kpages = (96*MB + conf.npage*sizeof(Page))/BY2PG; + conf.nimage = 2000; + kpages += (conf.nproc*KSTACK)/BY2PG; + } else if(kpages > (64*MB + conf.npage*sizeof(Page))/BY2PG){ kpages = (64*MB + conf.npage*sizeof(Page))/BY2PG; conf.nimage = 2000; kpages += (conf.nproc*KSTACK)/BY2PG; @@ -631,6 +639,8 @@ break; } + if (getconf("*debug")) + delay(5*60*1000); if(active.ispanic && m->machno == 0){ if(cpuserver) delay(10000); @@ -640,6 +650,12 @@ } else delay(1000); + /* + * give the poor terminal user a chance to read the crash messages + * before clearing the screen! + */ + if (active.ispanic && !cpuserver) + delay(60*1000); } void