src/dev/serial/uart8250.cc
/* The linux serial driver (8250.c about line 1182) loops reading from
 * the device until the device reports it has no more data to
 * read. After a maximum of 255 iterations the code prints "serial8250
 * too much work for irq X," and breaks out of the loop. Since the
 * simulated system is so much slower than the actual system, if a
 * user is typing on the keyboard it is very easy for them to provide
 * input at a fast enough rate to not allow the loop to exit and thus
 * the error to be printed. This magic number provides a delay between
 * the time the UART receives a character to send to the simulated
 * system and the time it actually notifies the system it has a
 * character to send to alleviate this problem. --Ali
 */
The linux serial driver (8250.c about line 1182) loops reading from
the device until the device reports it has no more data to
read. After a maximum of 255 iterations the code prints "serial8250
too much work for irq X," and breaks out of the loop. Since the
simulated system is so much slower than the actual system, if a
user is typing on the keyboard it is very easy for them to provide
input at a fast enough rate to not allow the loop to exit and thus
the error to be printed. This magic number provides a delay between
the time the UART receives a character to send to the simulated
system and the time it actually notifies the system it has a
character to send to alleviate this problem. --Ali
The linux serial driver ( 8250 . c about line 1182 ) loops reading from the device until the device reports it has no more data to read . After a maximum of 255 iterations the code prints " serial8250 too much work for irq X " and breaks out of the loop . Since the simulated system is so much slower than the actual system if a user is typing on the keyboard it is very easy for them to provide input at a fast enough rate to not allow the loop to exit and thus the error to be printed . This magic number provides a delay between the time the UART receives a character to send to the simulated system and the time it actually notifies the system it has a character to send to alleviate this problem . -- Ali
void
Uart8250::scheduleIntr(Event *event)
{
    static const Tick interval = 225 * sim_clock::as_int::ns;
    DPRINTF(Uart, "Scheduling IER interrupt for %s, at cycle %lld\n",
            event->name(), curTick() + interval);
    if (!event->scheduled())
        schedule(event, curTick() + interval);
    else
        reschedule(event, curTick() + interval);
}
void Uart8250 :: scheduleIntr ( Event * event ) { static const Tick interval = 225 * sim_clock :: as_int :: ns ; DPRINTF ( Uart , " \n " , event -> name ( ) , curTick ( ) + interval ) ; if ( ! event -> scheduled ( ) ) schedule ( event , curTick ( ) + interval ) ; else reschedule ( event , curTick ( ) + interval ) ; }
The linux serial driver (8250.c about line 1182) loops reading from
 the device until the device reports it has no more data to
 read.
The linux serial driver ( 8250 . c about line 1182 ) loops reading from the device until the device reports it has no more data to read .