mirror of https://github.com/FDOS/kernel.git
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:
parent
09dca9d224
commit
9f2208943c
|
@ -53,6 +53,7 @@ STATIC VOID signon(VOID);
|
||||||
STATIC VOID kernel(VOID);
|
STATIC VOID kernel(VOID);
|
||||||
STATIC VOID FsConfig(VOID);
|
STATIC VOID FsConfig(VOID);
|
||||||
STATIC VOID InitPrinters(VOID);
|
STATIC VOID InitPrinters(VOID);
|
||||||
|
STATIC VOID InitSerialPorts(VOID);
|
||||||
STATIC void CheckContinueBootFromHarddisk(void);
|
STATIC void CheckContinueBootFromHarddisk(void);
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -202,6 +203,7 @@ STATIC void init_kernel(void)
|
||||||
/* Initialize IO subsystem */
|
/* Initialize IO subsystem */
|
||||||
InitIO();
|
InitIO();
|
||||||
InitPrinters();
|
InitPrinters();
|
||||||
|
InitSerialPorts();
|
||||||
|
|
||||||
/* set interrupt vectors */
|
/* set interrupt vectors */
|
||||||
setvec(0x1b, got_cbreak);
|
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,
|
if kernel.config.BootHarddiskSeconds is set,
|
||||||
the default is to boot from harddisk, because
|
the default is to boot from harddisk, because
|
||||||
|
|
|
@ -61,6 +61,8 @@ ComRead:
|
||||||
jnz ComRd2
|
jnz ComRd2
|
||||||
ComRd1:
|
ComRd1:
|
||||||
call BiosRdCom
|
call BiosRdCom
|
||||||
|
or ah,ah ; timeout?
|
||||||
|
js ComRd1 ; yes, try again
|
||||||
ComRd2:
|
ComRd2:
|
||||||
stosb
|
stosb
|
||||||
loop ComRd1
|
loop ComRd1
|
||||||
|
|
Loading…
Reference in New Issue