bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: oskit-mach won't boot


From: Jeroen Dekkers
Subject: Re: oskit-mach won't boot
Date: Thu, 31 May 2001 19:52:53 +0200
User-agent: Mutt/1.3.15i

On Tue, May 29, 2001 at 05:02:29PM -0400, Roland McGrath wrote:
> This probably the first time interrupts have been enabled since early in
> the boot process.  There will immediately be a clock interrupt, since one
> surely fired a little bit earlier and was blocked until the "sti" insn.
> There may be other interrupts pending too.  So, not surprisingly, this
> suggests that the interrupt handler is not set up properly.  If the setup
> of the interrupt/trap table, and all the various x86 hoo-ha that's
> necessary for it to be properly arranged to run in protected mode, is
> futzed somehow then many of those errors will cause the CPU to reset.  I
> don't think any of that stuff has really changed, so it's hopefully just
> the case that the interrupt is jumping to the handler but the
> oskit/oskit-mach interrupt handler code itself is somehow broken.
> If that's the case, you might be able to catch the code at all_intrs 
> (locore.S)
> and see how far it gets from there.

The problem interrupt stack is only allocated with smp, when switching to the
interrupt stack in all_intrs the stack pointer was set to a bogus value which
caused the crash. Oskit-mach still doesn't work, I got a dump of trap_state,
but I don't what useful information I can get from that dump and how.

The patch(I included a patch to fix a build problem too):

diff -urN oskit-mach/Makefile.in oskit-mach-new/Makefile.in
--- oskit-mach/Makefile.in      Fri May  4 17:13:04 2001
+++ oskit-mach-new/Makefile.in  Sun May 27 23:00:39 2001
@@ -294,14 +294,14 @@
              -o $@ \
              `sed 's/^/-Wl,-u,/' $<` -x c /dev/null -lc
 
-oskit-kern%.o: kern%.o clib-routines.o
+oskit-kernel.o: kernel.o clib-routines.o
        $(CC) $(CFLAGS) -nostdlib -nostartfiles $(LDFLAGS) -r -o $@ \
              -Wl,-\( $^ -loskit_clientos -loskit_c $(OSKIT_LIBS) -Wl,-\) -lgcc
 
 %-undef-bad: %-undef Makefile
        sed '$(foreach r,$(clib-routines) $(magic-symbols),/^$r$$/d;)' $< > $@
 
-kern%: oskit-kern%.o $(OSKIT_LIBDIR)/crtn.o
+kernel: oskit-kernel.o $(OSKIT_LIBDIR)/crtn.o
        $(LD) $(LDFLAGS) $(KERN_LDFLAGS) -o $@ $^
 
 # This combined with the other pattern rules let you ask
diff -urN oskit-mach/i386/i386/mp_desc.c oskit-mach-new/i386/i386/mp_desc.c
--- oskit-mach/i386/i386/mp_desc.c      Wed May  2 23:37:38 2001
+++ oskit-mach-new/i386/i386/mp_desc.c  Thu May 31 18:55:08 2001
@@ -30,12 +30,8 @@
 #include <vm/vm_kern.h>
 
 #include <i386/mp_desc.h>
+#include <oskit/x86/base_stack.h>
 
-/*
- * Addresses of bottom and top of interrupt stacks.
- */
-vm_offset_t    interrupt_stack[NCPUS];
-vm_offset_t    int_stack_top[NCPUS];
 
 /*
  * Barrier address.
@@ -44,13 +40,18 @@
 
 #if    NCPUS > 1
 
+/*
+ * Addresses of bottom and top of interrupt stacks.
+ */
+vm_offset_t    interrupt_stack[NCPUS];
+vm_offset_t    int_stack_top[NCPUS];
+
 #include <i386/lock.h>
 #include "vm_param.h"
 
 #include <oskit/x86/base_idt.h>
 #include "gdt.h"
 #include <oskit/x86/base_tss.h>
-#include <oskit/x86/base_stack.h>
 
 
 /*
@@ -267,6 +268,21 @@
 
        for (i = 0; i < simple_lock_pause_loop; i++)
            dummy++;    /* keep the compiler from optimizing the loop away */
+}
+
+#else
+
+/*
+ * Addresses of bottom and top of interrupt stacks.
+ */
+vm_offset_t    interrupt_stack;
+vm_offset_t    int_stack_top;
+
+void
+interrupt_stack_alloc()
+{
+                interrupt_stack = (vm_offset_t) base_stack_start;
+                int_stack_top  = (vm_offset_t) base_stack_end;
 }
 
 #endif /* NCPUS > 1 */
diff -urN oskit-mach/i386/i386/mp_desc.h oskit-mach-new/i386/i386/mp_desc.h
--- oskit-mach/i386/i386/mp_desc.h      Wed May  2 23:37:38 2001
+++ oskit-mach-new/i386/i386/mp_desc.h  Thu May 31 17:40:07 2001
@@ -90,8 +90,14 @@
 /*
  * Addresses of bottom and top of interrupt stacks.
  */
-extern vm_offset_t     interrupt_stack[NCPUS];
-extern vm_offset_t     int_stack_top[NCPUS];
+
+#if     NCPUS > 1
+extern vm_offset_t      interrupt_stack[NCPUS];
+extern vm_offset_t      int_stack_top[NCPUS];
+#else
+extern vm_offset_t      interrupt_stack;
+extern vm_offset_t      int_stack_top;
+#endif
 
 /*
  * Barrier address.

diff -urN oskit-mach/oskit/x86/main.c oskit-mach-new/oskit/x86/main.c
--- oskit-mach/oskit/x86/main.c Fri Dec 22 07:17:04 2000
+++ oskit-mach-new/oskit/x86/main.c     Thu May 31 18:45:18 2001
@@ -185,8 +185,9 @@
       intpri[SMP_IPI_VECTOR] = SPL1;
       mp_desc_init (master_cpu);
     }
-  interrupt_stack_alloc ();
 #endif
+
+  interrupt_stack_alloc ();
 
   setup_machine_slot (master_cpu);
   machine_slot[master_cpu].running = TRUE;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]