Re: Dumping /dev/zero to the console

Marek Michalkiewicz (marekm@i17linuxb.ists.pwr.wroc.pl)
Tue, 23 Jul 1996 06:22:12 +0200 (MET DST)


Systemkennung Linux:
> The problem is *not* dumping /dev/zero to the console but the bs=1024k
> argument to dd. Therefore the kernel will print more than one million
> chars with one single syscall to the screen. The Linux kernel isn't
> preemptible and therefore the write operation to the console will be
> completed - no matter how long it takes. Fixing is trivial, something
> like the following untested patch to console.c should do the job.
>
> disable_bh(CONSOLE_BH);
> while (!tty->stopped && count) {
> + if(need_resched)
> + schedule();
> enable_bh(CONSOLE_BH);
> c = from_user ? get_user(buf) : *buf;
> buf++; n++; count--;

It must be slightly less trivial :) - the above patch causes some
problems. The console driver seems to hang sometimes (no more
output, and can't switch consoles) - pressing Scroll Lock twice
wakes it up again. Also, I got "Aiee scheduling in interrupt"
(with EIP value in con_write) once.

Marek