Bootstrap: read out comport on x86 from BDA area

With this patch the comport are tried to read out from the BIOS Data Area
on x86 machines. The BDA Area are part of the first physical page and may
contain the non-default io ports of the comport.

When used together with 'bender' from the 'morbo' toolchain, even serial PCI
cards (also Intel's AMT Serial Over Line adapter) are detected automatically.
This commit is contained in:
Alexander Boettcher
2013-06-10 10:30:49 +02:00
committed by Stefan Kalkowski
parent 55e70a3e3e
commit 2cf8f6f608

View File

@@ -957,7 +957,11 @@ public:
}
else if (comport == -1)
{
legacy_uart(1, comirq, &board);
/* try to read Bios Data Area (BDA) to get comport information */
unsigned short comport_count = (*((unsigned short *)0x410) >> 9) & 0x7;
if (comport_count) comport = *((unsigned short *)0x400), comirq, &board;
else comport = 1;
legacy_uart(comport, comirq, &board);
comport = 0;
}
else