void io_init(void)
{
log("io_init() - before port initialize.\r\n");
// Initialize port.
regs.x.dx = PORT;
regs.h.ah = 0x04;
int86(SERIAL, ®s, ®s);
log("io_init() - after port initialize, returned %d\r\n",regs.x.ax);
log("io_init() - About to set line characteristics.\r\n");
// Set line characteristics.
regs.h.al = 0x07; // 1200bps
regs.h.al = (regs.h.al < 5) | 0x03; /* 8/N/1 */
regs.x.dx = PORT;
regs.h.ah = 0x00;
int86(SERIAL,®s,®s);
log("io_init() - Set line characteristics.\r\n");
log("io_init() - Set flow control\r\n");
/* // Set RTS/CTS Flow control */
regs.h.ah = 0x0f;
regs.h.al = 0x02;
regs.x.dx = PORT;
int86(SERIAL,®s,®s);
log("io_init() - Set flow control success\r\n");
io_raise_dtr();
}