Messages in this thread | | | From | Daniel Blakeley <> | Subject | KDMKTONE feature or bug? | Date | Wed, 27 Mar 1996 12:49:11 -0500 (EST) |
| |
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
| |