On Sat, 13 May 2000 17:35:45 -0600,
Dave Caswell <davec@asylum.apocalypse.org> wrote:
>I've only been able to get pre8 to boot on my Toshiba 445 laptop by
>turning off all the config options. I'm still working on finding
>which config option is bringing things to a sudden halt.
>
>Lilo starts the kernel, and the computer immediately locks up, before
>it can print anything on the screen.
This quick and dirty patch might help debug the problem. It writes
characters to characters 0, 1 and 2 of the top line of the video as the
kernel is booting. When it hangs the pattern of letters tells you how
far the boot process got. Against 2.3.99-pre8.
VIDEO_CHAR only works until mem_init() is called. I use this method to
debug early boot problems, before printk can do any output. Once you
find out which routine is hanging, add VIDEO_CHAR statements to that
routine to write to characters 5 onwards, keep digging into lower level
routines until you localize the problem.
Index: 99-pre8.1/init/main.c
--- 99-pre8.1/init/main.c Sat, 13 May 2000 10:34:21 +1000 kaos (linux-2.3/F/b/51_main.c 1.18.1.12.2.3 644)
+++ 99-pre8.1(w)/init/main.c Mon, 15 May 2000 02:10:29 +1000 kaos (linux-2.3/F/b/51_main.c 1.18.1.12.2.3 644)
@@ -77,6 +77,8 @@
#error sorry, your GCC is too old. It builds incorrect kernels.
#endif
+#define VIDEO_CHAR(c, v) (*((volatile char *)(0xb8000 + 2*(c))) = (v))
+
extern char _stext, _etext;
extern char *linux_banner;
@@ -423,12 +425,14 @@
char *next,*quote;
int args, envs;
+ VIDEO_CHAR(1, 'A');
if (!*line)
return;
args = 0;
envs = 1; /* TERM is set to 'linux' by default */
next = line;
while ((line = next) != NULL) {
+ VIDEO_CHAR(2, 'A');
quote = strchr(line,'"');
next = strchr(line, ' ');
while (next != NULL && quote != NULL && quote < next) {
@@ -441,9 +445,11 @@
next = strchr(next+1, ' ');
}
}
+ VIDEO_CHAR(2, 'B');
if (next != NULL)
*next++ = 0;
if (!strncmp(line,"init=",5)) {
+ VIDEO_CHAR(3, 'A');
line += 5;
execute_command = line;
/* In case LILO is going to boot us with default command line,
@@ -454,8 +460,10 @@
args = 0;
continue;
}
+ VIDEO_CHAR(2, 'C');
if (checksetup(line))
continue;
+ VIDEO_CHAR(2, 'D');
/*
* Then check if it's an environment variable or
@@ -471,9 +479,12 @@
if(*line)
argv_init[++args] = line;
}
+ VIDEO_CHAR(2, 'E');
}
+ VIDEO_CHAR(1, 'B');
argv_init[args+1] = NULL;
envp_init[envs+1] = NULL;
+ VIDEO_CHAR(1, 'C');
}
@@ -516,24 +527,36 @@
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/
+ VIDEO_CHAR(0, 'A');
lock_kernel();
+ VIDEO_CHAR(0, 'B');
printk(linux_banner);
+ VIDEO_CHAR(0, 'C');
setup_arch(&command_line);
+ VIDEO_CHAR(0, 'D');
trap_init();
+ VIDEO_CHAR(0, 'E');
init_IRQ();
+ VIDEO_CHAR(0, 'F');
sched_init();
+ VIDEO_CHAR(0, 'G');
time_init();
+ VIDEO_CHAR(0, 'H');
softirq_init();
+ VIDEO_CHAR(0, 'I');
parse_options(command_line);
+ VIDEO_CHAR(0, 'J');
/*
* HACK ALERT! This is early. We're enabling the console before
* we've done PCI setups etc, and console_init() must be aware of
* this. But we do want output early, in case something goes wrong.
*/
console_init();
+ VIDEO_CHAR(0, 'K');
#ifdef CONFIG_MODULES
init_modules();
+ VIDEO_CHAR(0, 'L');
#endif
if (prof_shift) {
unsigned int size;
@@ -544,10 +567,14 @@
size = prof_len * sizeof(unsigned int) + PAGE_SIZE-1;
prof_buffer = (unsigned int *) alloc_bootmem(size);
}
+ VIDEO_CHAR(0, 'M');
kmem_cache_init();
+ VIDEO_CHAR(0, 'N');
sti();
+ VIDEO_CHAR(0, 'O');
calibrate_delay();
+ VIDEO_CHAR(0, 'P');
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
initrd_start < min_low_pfn << PAGE_SHIFT) {
@@ -555,6 +582,7 @@
"disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
initrd_start = 0;
}
+ VIDEO_CHAR(0, 'Q');
#endif
mem_init();
kmem_cache_sizes_init();
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:24 EST