Technical information
Serial Solutions Cterm
case ’s’: inregs.h.bh = 4; /* Parity space */
break;
default: return FALSE; /* Bad parity specification. */
};
if( stop < 1 || stop > 2 )
return FALSE; /* Bad stop bits specification. */
else
inregs.h.bl = (char)(stop-1);
if( data < 5 || data > 8 )
return FALSE; /* Bad databits specification. */
else
inregs.h.ch = (char)(data - 5);
if(
( inregs.h.cl = (char)prefer_baud(&baud) ) == -1
)
return FALSE; /* Bad Baud rate. */
inregs.h.ah = 0x04; /* Service 4, extended initialise. */
int86(0x14, &inregs, &outregs); /* Async services. */
return TRUE; /* Done */
}
Bios_x_init() uses the extended initialise service supplied
as part of NewBIOS to set the port up. It works its way though
the function parameters, checking that each has a valid value and
translating them into values that the BIOS will understand. The
chapter "NewBIOS Reference", sets out the parameters that
service 4, the extended initialise, requires. The parameters are
store in the REGS variable inregs, which is used to specify the
parameters to int86(). See the chapter "Using NewBIOS" for an
explanation of the use of int86() in C.
The parameters taken by bios_x_init() are:
Port Numbers 1..16 for COM1 to COM16
respectively
Brk Break, if non-zero then set serial output line to
space.
Par Parity, a single character, one of ’n’, ’o’, ’e’,
’m’ or ’s’ for none, odd, even, mark or space.
Stop Number stop bits. 1 or 2, though if 5 data bits
Page 124 Chapter 7