bug-hurd
[Top][All Lists]
Advanced

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

Re: Kernel Divide error trap


From: Piotr Krukowiecki
Subject: Re: Kernel Divide error trap
Date: Tue, 25 Sep 2001 21:57:23 +0200
User-agent: Mutt/1.2.5i

On Sun, 23 Sep 2001, Marcus Brinkmann wrote:

> 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 */
here
>         leftover = inb(pitctr0_port);   /* most significant */
here
>         leftover = (leftover<<8) + byte ;
and here i have added printk's
>         /* 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.

hmm adding printk must changed something because i can't reproduce
it now.

Anyway, first leftover is f3, second f3ff, so i'ts close to ffff

Now, should i left that printk or maybe better would be to add sth. like 
if (leftover == 0xffff) leftover -= 1;
?


And another bug, maybe know already:
[...]
cleaning up left over files...panic: choose_pset_thread
Kernel Breakpoint trap, eip 0x10d3d8
Stopped ad 0x10d3d8:    int     $3



-- 
Piotrek
irc: #Debian.pl
Mors Drosophilis melanogastribus!



reply via email to

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