[Top][All Lists]

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

Re: More on oskit-mach booting troubles

From: Igor Khavkine
Subject: Re: More on oskit-mach booting troubles
Date: Sun, 22 Jul 2001 02:53:46 -0400
User-agent: Mutt/1.3.18i

On Sun, Jul 22, 2001 at 01:17:39AM -0400, Roland McGrath wrote:
> > On Sat, Jul 21, 2001 at 09:57:44PM -0400, Roland McGrath wrote:
> > When I was tracing through the code at that place, i wound up in
> > [oskit]/linux/include/asm-i386/semaphore.S::down(), and it looks
> > like this after expanding several #ifdefs:
> > 
> > extern inline void down (struct semaphore *sem)
> > {
> >     asm volatile ("
> >             decl (%0)
> >             js 2f
> >     1:      .section .text.lock,"ax"
> >     2:      call __down_failed
> >             jmp 1b
> >             .previous"
> >     : "c" (sem) : "memory");
> > }
> This is approximately:  while (--*(int*)sem < 0) __down_failed();
> __down_failed blocks until something increments the semaphore.  This gets
> into oskit/linux/shared/s_sched.c:__down, where it goes into the
> osenv_sleep interface I mentioned before.  The `up' call that does this
> should be from some place like ide_end_drive_cmd in
> oskit/linux/src/drivers/block/ide.c (and other places--that's just an
> example), that get called from ide_intr. 
> You don't necessarily need to understand all this Linux driver nonsense.
> This is the glue I was talking about before.  The upshot is that it's
> waiting to get an interrupt, and the interrupt processing isn't happening
> right.

That might be what's happening. I couldn't step through the code
farther then __down_failed (because it's an assembler function). The
debugger ended up somewhere Letext(), but that might be a GDB quirk,
I'll have to check that again.

But there's one thing I don't understand. How can you expect to wake
up if interrupts are disabled? I noticed a couple of cli() calls
(in ide_do_drive_command() and __down()) before osenv_sleep() got
called, but no sti() calls. Does it make sense to do that?


reply via email to

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