lkml.org 
[lkml]   [1996]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectKDMKTONE feature or bug?
Date
Hi,

I recently upgraded my kernel and found my morse code program no
longer worked. When run it would give a divide by zero error. I
tracked this to /usr/src/linux/drivers/char/vt.c in the KDMKTONE
area. In kernel 1.3.62 KDMKTONE was changed.

here is the patch from patch-1.3.62.gz

> case KDMKTONE:
> if (!perm)
> return -EPERM;
> {
> - unsigned int ticks = HZ * ((arg >> 16) & 0xffff) /
> 1000;
> -
> + unsigned int ticks, count;
> +
> /*
> * Generate the tone for the appropriate number of
> ticks.
> * If the time is zero, turn off sound ourselves.
> */
> - kd_mksound(arg & 0xffff, ticks);
> - if (ticks == 0)
> - kd_nosound(0);
> + ticks = HZ * ((arg >> 16) & 0xffff) / 1000;
> + count = ticks ? (1193180 / (arg & 0xffff)) : 0;
> + kd_mksound(count, ticks);
> return 0;
> }

I think for KDMKTONE to function the same a before the line
count = ticks ? (1193180 / (arg & 0xffff)) : 0;
needs to change to
count = ticks ? (arg & 0xffff) : 0;


If the functionality of KDMKTONE has changed would someone please tell
me? If not I'd like to see this change in the kernel.

Thanks,
- Daniel

--
Daniel Blakeley (N2YEN) Materials Science Ctr.
blakeley@msc.cornell.edu E20 Clark Hall



\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.036 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site