+/* 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 <minilib.h>
#include <io.h>
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);
}