progman32 n00b
Joined: 16 Aug 2006 Posts: 50
|
Posted: Thu Sep 20, 2012 8:02 am Post subject: Kernel hang in setup_idt (early boot) |
|
|
Hi folks, I'm trying to get a modern kernel running on an old Pentium 75 with 16mb of ram. I've actually gotten as new as 2.6.24 to run, but I'm running into pretty severe issues with newer versions. I hang right at boot, just before entering protected mode. See this snippet from pm.c:
Code: |
92 /*
93 * Set up the IDT
94 */
95 static void setup_idt(void)
96 {
97 static const struct gdt_ptr null_idt = {0, 0};
98 asm volatile("lidtl %0" : : "m" (null_idt));
99 }
100
101 /*
102 * Actual invocation sequence
103 */
104 void go_to_protected_mode(void)
105 {
106 /* Hook before leaving real mode, also disables interrupts */
107 realmode_switch_hook();
108
109 /* Enable the A20 gate */
110 if (enable_a20()) {
111 puts("A20 gate not responding, unable to boot...\n");
112 die();
113 }
114
115 /* Reset coprocessor (IGNNE#) */
116 reset_coprocessor();
117
118 /* Mask all interrupts in the PIC */
119 mask_all_interrupts();
120
121 /* Actual transition to protected mode... */
122 setup_idt();
123 setup_gdt();
124 protected_mode_jump(boot_params.hdr.code32_start,
125 (u32)&boot_params + (ds() << 4));
126 }
|
The kernel calls go_to_protected_mode just fine, we get into setup_idt, but we hang on the lidtl opcode. If I comment the asm volatile line out, the kernel continues (but dies later on, obviously). Has anyone got any clue here? This is very odd indeed. I don't think there is anything wrong with the CPU - like I said, I ran a specific 2.6.24 kernel from Debian Etch for a week straight without any problems at all. One more data point - I tried to build the same 2.6.24 kernel using the same exact config, but when I tried to boot it - same problem. Could be a compiler issue...? I'd really appreciate some help here, if only just a pointer to an appropriate kernel mailing list
EDIT: Just tried recompiling the kernel with gcc 4.1.2 and 3.4.6-r2. Same exact issue. Kernel won't compile with earlier gcc versions. |
|