1
0
mirror of synced 2026-01-31 22:13:05 +00:00

Many fixes and improvements to the BIOS Extension ROM. (#33)

* Revert "Uploaded_2_9_2025"

This reverts commit ec79bbdbc9.

* Fixing DEBUG_IO builds.

* Make the IO port base a define.

* Fix CPU test to properly handle 808x vs V20.

* Improve timeout management logic.

* Improve SD Card initialization logic.

* Implement INT18h bootstrapping.

* Implementing a different test for processor type.

* Allow use with another fixed drive (eg: ESDI drive).

* Allow swapping driver ID between the BIOS disk and XTMax.

* Fix address of the ROM segment.

* Fixing missing STI at the top of the handler.

* Major rework of IO to use MOVSW.

* More code reorg and auto-detecting second drive.

* Update XTSD to use MOVSW.

* Add diagnostics program.

* Workaround for MS-DOS strange handling of interrupts.

* Use a lookup table for the memory map.

* Make the BootROM relocatable.

* Some more refactor of the Teensy code.
This commit is contained in:
Matthieu Bucchianeri
2025-02-17 15:11:37 -08:00
committed by GitHub
parent ec79bbdbc9
commit fe8385da08
15 changed files with 1199 additions and 456 deletions

View File

@@ -27,8 +27,9 @@
/* Platform dependent macros and functions needed to be modified */
/*-------------------------------------------------------------------------*/
DWORD VIRT_BUFFER=0xCE000000+2048;
WORD DATAPORT=0x280;
WORD CONTROLPORT=0x282;
WORD CONTROLPORT=0x280+1;
#if 1
#define TOUTCHR(x)
@@ -177,30 +178,17 @@ void xmit_mmc (
// NOTE: Callers always use buffer sizes multiple of two.
bc >>= 1;
#ifndef USE186
_asm {
mov cx,bc
mov dx,DATAPORT
push ds
push es
les di,VIRT_BUFFER
lds si,dword ptr buff
}
repeat:
_asm {
lodsw
out dx, ax
loop repeat
cld
rep movsw
pop es
pop ds
}
#else
_asm {
mov cx,bc
mov dx,DATAPORT
push ds
lds si,dword ptr buff
rep outsw
pop ds
}
#endif
}
@@ -218,30 +206,17 @@ void rcvr_mmc (
// NOTE: Callers always use buffer sizes multiple of two.
bc >>= 1;
#ifndef USE186
_asm {
mov cx,bc
mov dx,DATAPORT
push ds
push es
les di,dword ptr buff
}
repeat:
_asm {
in ax, dx
stosw
loop repeat
lds si,VIRT_BUFFER
cld
rep movsw
pop es
pop ds
}
#else
_asm {
mov cx,bc
mov dx,DATAPORT
push es
les di,dword ptr buff
rep insw
pop es
}
#endif
}
/*-----------------------------------------------------------------------*/
@@ -254,14 +229,13 @@ int wait_ready (void) /* 1:OK, 0:Timeout */
BYTE d;
UINT tmr;
for (tmr = 5000; tmr; tmr--) { /* Wait for ready in timeout of 500ms */
outp(DATAPORT+7, 50);
do { /* Wait for ready in timeout of 500ms */
d = inp(DATAPORT);
if (d == 0xFF) break;
dly_us(100);
}
} while(!inp(DATAPORT+7));
return tmr ? 1 : 0;
return d == 0xFF;
}
@@ -310,11 +284,11 @@ int rcvr_datablock ( /* 1:OK, 0:Failed */
UINT tmr;
for (tmr = 1000; tmr; tmr--) { /* Wait for data packet in timeout of 100ms */
outp(DATAPORT+7, 10);
do { /* Wait for data packet in timeout of 100ms */
d = inp(DATAPORT);
if (d != 0xFF) break;
dly_us(100);
}
} while(!inp(DATAPORT+7));
if (d != 0xFE) {
return 0; /* If not valid data token, return with error */
}