From Lucho with some help from Tom: initialize serial ports and retry

serial reads on timeout.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@725 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2003-11-14 21:55:25 +00:00
parent 09dca9d224
commit 9f2208943c
2 changed files with 21 additions and 0 deletions

View File

@ -53,6 +53,7 @@ STATIC VOID signon(VOID);
STATIC VOID kernel(VOID);
STATIC VOID FsConfig(VOID);
STATIC VOID InitPrinters(VOID);
STATIC VOID InitSerialPorts(VOID);
STATIC void CheckContinueBootFromHarddisk(void);
#ifdef _MSC_VER
@ -202,6 +203,7 @@ STATIC void init_kernel(void)
/* Initialize IO subsystem */
InitIO();
InitPrinters();
InitSerialPorts();
/* set interrupt vectors */
setvec(0x1b, got_cbreak);
@ -616,6 +618,23 @@ STATIC VOID InitPrinters(VOID)
}
}
STATIC VOID InitSerialPorts(VOID)
{
iregs r;
int serial_ports, i;
init_call_intr(0x11, &r); /* get equipment list */
serial_ports = (r.a.x >> 9) & 7; /* bits 11-9 */
for (i = 0; i < serial_ports; i++)
{
r.a.x = 0xA3; /* initialize serial port to 2400,n,8,1 */
r.d.x = i;
init_call_intr(0x14, &r);
}
}
/*****************************************************************
if kernel.config.BootHarddiskSeconds is set,
the default is to boot from harddisk, because

View File

@ -61,6 +61,8 @@ ComRead:
jnz ComRd2
ComRd1:
call BiosRdCom
or ah,ah ; timeout?
js ComRd1 ; yes, try again
ComRd2:
stosb
loop ComRd1