X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/c07c6eba644d5b947f38a6fb79489ff3584196cf..3c4e084de9ed00171748c20de1251d347fc33c1c:/lib/serial.c diff --git a/lib/serial.c b/lib/serial.c index 0cbb495..95d8300 100644 --- a/lib/serial.c +++ b/lib/serial.c @@ -1,3 +1,13 @@ +/* serial.c + * Serial output routines. + * NetWatch system management mode administration console + * + * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved. + * This program is free software; you can redistribute and/or modify it under + * the terms found in the file LICENSE in the root of this source tree. + * + */ + #include #include @@ -44,7 +54,9 @@ void serial_init() void serial_tx(unsigned char c) { - while (!(_inb(SER_LSR) & SER_LSR_THR_EMPTY)) + int i = 100000; + + while (!(_inb(SER_LSR) & SER_LSR_THR_EMPTY) && (i--)) ; _outb(SER_THR, c); }