bug-hurd
[Top][All Lists]
Advanced

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

Re: Kernel Divide error trap


From: Marcus Brinkmann
Subject: Re: Kernel Divide error trap
Date: Sun, 23 Sep 2001 20:30:05 +0200
User-agent: Mutt/1.3.22i

On Sun, Sep 23, 2001 at 07:26:31PM +0200, Piotr Krukowiecki wrote:
> On Sat, 22 Sep 2001, Marcus Brinkmann wrote:
> 
> > On Sat, Sep 22, 2001 at 03:31:57PM +0200, Piotr Krukowiecki wrote:
> > I assume this is gnumach, not oskit-mach.  Install the gnumach-dbg
> 
> Yes
> 
> > 20010918-1 package, boot with the /boot/gnumach-dbg.gz kernel instead
> > /boot/gnumach.gz (in your GRUB configuration), and wait for the crash
> > to happen.  Write down the dump as above and send it in.  We can then
> > check which line of source code the above eip refers to and maybe get
> > a foot into the problem.
> 
> Kernel Divide error trap, eip 0x15f053
> kernel: Divide error (0), code=0
> Stopped at 0x15f053: idivl %ebx, %eax

Ok, this ath the end of the following code in machine/pit.c:

#define MICROCOUNT      1000    /* keep small to prevent overflow */
microfind()
{
        unsigned int flags;
        unsigned char byte;
        unsigned short leftover;
        int s;


        s = sploff();                 /* disable interrupts */

        /* Put counter in count down mode */
        outb(pitctl_port, PIT_COUNTDOWN);
        /* output a count of -1 to counter 0 */
        outb(pitctr0_port, 0xff);
        outb(pitctr0_port, 0xff);
        microdata=MICROCOUNT;
        tenmicrosec();
        /* Read the value left in the counter */
        byte = inb(pitctr0_port);       /* least siginifcant */
        leftover = inb(pitctr0_port);   /* most significant */
        leftover = (leftover<<8) + byte ;
        /* Formula for delaycount is :
         *  (loopcount * timer clock speed)/ (counter ticks * 1000)
         *  Note also that 1000 is for figuring out milliseconds
         */
        microdata = (MICROCOUNT * CLKNUM) / ((0xffff-leftover)*100000);
        if (!microdata)
                microdata++;

        splon(s);         /* restore interrupt state */
}

Note this line:
        microdata = (MICROCOUNT * CLKNUM) / ((0xffff-leftover)*100000);

This is the failing division.  So ((0xffff-leftover)*100000) is zero in
your system.  You could add printk's before that to print out the value of
leftover, and check why it evaluates to zero.  You seem to have a very
unfortunate combination of cpu speed / clock speed or so.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



reply via email to

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