Improvements to the SDPP driver. (#30)
* Mask unimplemented IOCTL message. * Add build for 286+. * Optimized IO for 8086. * Adding pre-build drivers.
This commit is contained in:
committed by
GitHub
parent
374a343198
commit
53caec7569
Binary file not shown.
BIN
XTMax/Drivers/SD286.SYS
Normal file
BIN
XTMax/Drivers/SD286.SYS
Normal file
Binary file not shown.
1
XTMax/Drivers/SDPP/.gitignore
vendored
1
XTMax/Drivers/SDPP/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
*.obj
|
*.obj
|
||||||
*.map
|
*.map
|
||||||
|
*.sys
|
||||||
log.txt
|
log.txt
|
||||||
|
|||||||
2
XTMax/Drivers/SDPP/.vscode/tasks.json
vendored
2
XTMax/Drivers/SDPP/.vscode/tasks.json
vendored
@@ -6,7 +6,7 @@
|
|||||||
{
|
{
|
||||||
"label": "Build in DOSBox",
|
"label": "Build in DOSBox",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "..\\Driver_Build_Tools\\DOSBox\\DOSBox.exe -conf Build.conf",
|
"command": "..\\Driver_Build_Tools\\DOSBox\\DOSBox.exe -conf Build.conf && copy *.sys ..\\",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -256,13 +256,13 @@ PUBLIC void GenericIOCTL (rh_generic_ioctl_t far *rh)
|
|||||||
case GET_ACCESS: ((access_flag_t far *) (rh->packet))->allowed = 1;
|
case GET_ACCESS: ((access_flag_t far *) (rh->packet))->allowed = 1;
|
||||||
rh->rh.status = DONE;
|
rh->rh.status = DONE;
|
||||||
return;
|
return;
|
||||||
|
case GET_MEDIA_ID:
|
||||||
case SET_MEDIA_ID:
|
case SET_MEDIA_ID:
|
||||||
case SET_ACCESS:
|
case SET_ACCESS:
|
||||||
case SET_PARAMETERS:
|
case SET_PARAMETERS:
|
||||||
case FORMAT_TRACK:
|
case FORMAT_TRACK:
|
||||||
rh->rh.status = DONE;
|
rh->rh.status = DONE;
|
||||||
return;
|
return;
|
||||||
case GET_MEDIA_ID:
|
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
cdprintf("SD: unimplemented IOCTL - unit=%d, major=0x%2x, minor=0x%2x\n",
|
cdprintf("SD: unimplemented IOCTL - unit=%d, major=0x%2x, minor=0x%2x\n",
|
||||||
@@ -367,8 +367,14 @@ PUBLIC void Initialize (rh_init_t far *rh)
|
|||||||
WORD brkadr, reboot[2]; int status, i;
|
WORD brkadr, reboot[2]; int status, i;
|
||||||
|
|
||||||
/* The version number is sneakily stored in the device header! */
|
/* The version number is sneakily stored in the device header! */
|
||||||
cdprintf("SD Card driver for XTMax\n based on SD pport device driver V%c.%c (C) 2014 by Dan Marks\n based on TU58 by Robert Armstrong\n",
|
cdprintf("SD Card driver V%c.%c for XTMax (%s)\n based on SD pport device driver (C) 2014 by Dan Marks\n based on TU58 by Robert Armstrong\n",
|
||||||
header.name[6], header.name[7]);
|
header.name[6], header.name[7],
|
||||||
|
#ifdef USE286
|
||||||
|
"80286+"
|
||||||
|
#else
|
||||||
|
"8086"
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
/* Parse the options from the CONFIG.SYS file, if any... */
|
/* Parse the options from the CONFIG.SYS file, if any... */
|
||||||
if (!parse_options((char far *) rh->bpbtbl)) {
|
if (!parse_options((char far *) rh->bpbtbl)) {
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ _header DD -1 ; link to the next device
|
|||||||
DW DGROUP:STRATEGY ; address of the strategy routine
|
DW DGROUP:STRATEGY ; address of the strategy routine
|
||||||
DW DGROUP:INTERRUPT; " " " interrupt "
|
DW DGROUP:INTERRUPT; " " " interrupt "
|
||||||
DB 1 ; number of drives
|
DB 1 ; number of drives
|
||||||
DB 'SDCDv11' ; DOS doesn't really use these bytes
|
DB 'SDCDv12' ; DOS doesn't really use these bytes
|
||||||
|
|
||||||
; The geometry (sectors/track, tracks/cylinder) defined in the BPB is rather
|
; The geometry (sectors/track, tracks/cylinder) defined in the BPB is rather
|
||||||
; arbitrary in the case of the TU58, but there are things to watch out for.
|
; arbitrary in the case of the TU58, but there are things to watch out for.
|
||||||
|
|||||||
@@ -3,24 +3,30 @@
|
|||||||
CC=bcc -c -ms -Z -O -Ol -Oe
|
CC=bcc -c -ms -Z -O -Ol -Oe
|
||||||
ASM=tasm -mx
|
ASM=tasm -mx
|
||||||
|
|
||||||
.c.obj:
|
DEPS=cprint.c driver.c sd.c sdmm.c cprint.h diskio.h driver.h integer.h sd.h standard.h
|
||||||
$(CC) $<
|
|
||||||
|
all: sd.sys sd286.sys
|
||||||
|
|
||||||
.asm.obj:
|
.asm.obj:
|
||||||
$(ASM) $*
|
$(ASM) $*
|
||||||
|
|
||||||
sd.sys: header.obj cprint.obj sd.obj sdmm.obj driver.obj
|
sd.sys: header.obj $(DEPS)
|
||||||
tlink -t -m -s -n header cprint sd sdmm driver, sd.sys
|
$(CC) cprint.c
|
||||||
|
$(CC) sd.c
|
||||||
|
$(CC) sdmm.c
|
||||||
|
$(CC) driver.c
|
||||||
|
tlink -t -m -s -n header cprint sd sdmm driver, $@
|
||||||
|
|
||||||
sd.com: header.obj cprint.obj sd.obj sdmm.obj driver.obj
|
sd286.sys: header.obj $(DEPS)
|
||||||
tlink -t -m -s -n header cprint sd sdmm driver, sd.sys
|
$(CC) -1 -DUSE286 cprint.c
|
||||||
rename sd.sys sd.com
|
$(CC) -1 -DUSE286 sd.c
|
||||||
|
$(CC) -1 -DUSE286 sdmm.c
|
||||||
|
$(CC) -1 -DUSE286 driver.c
|
||||||
|
tlink -t -m -s -n header cprint sd sdmm driver, $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del *.obj
|
del *.obj
|
||||||
del sd.sys
|
del *.map
|
||||||
|
del *.sys
|
||||||
|
|
||||||
driver.obj: cprint.c sdmm.c driver.c cprint.c cprint.h standard.h driver.h sd.h
|
|
||||||
sd.obj: sd.c sd.h standard.h driver.h
|
|
||||||
sdmm.obj: sdmm.c diskio.h integer.h
|
|
||||||
header.obj: header.asm
|
header.obj: header.asm
|
||||||
|
|||||||
Binary file not shown.
@@ -187,14 +187,21 @@ void xmit_mmc (
|
|||||||
UINT bc /* Number of bytes to send */
|
UINT bc /* Number of bytes to send */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if 1
|
#ifndef USE286
|
||||||
BYTE d;
|
_asm {
|
||||||
do {
|
mov cx,bc
|
||||||
d = *buff++; /* Get a byte to be sent */
|
mov dx,DATAPORT
|
||||||
outp(DATAPORT, d);
|
push ds
|
||||||
} while (--bc);
|
lds si,dword ptr buff
|
||||||
|
}
|
||||||
|
repeat:
|
||||||
|
_asm {
|
||||||
|
lodsb
|
||||||
|
out dx, al
|
||||||
|
loop repeat
|
||||||
|
pop ds
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
// Requires to add `-2' in the CC command line in the Makefile.
|
|
||||||
_asm {
|
_asm {
|
||||||
mov cx,bc
|
mov cx,bc
|
||||||
mov dx,DATAPORT
|
mov dx,DATAPORT
|
||||||
@@ -218,15 +225,21 @@ void rcvr_mmc (
|
|||||||
UINT bc /* Number of bytes to receive */
|
UINT bc /* Number of bytes to receive */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if 1
|
#ifndef USE286
|
||||||
BYTE r;
|
_asm {
|
||||||
|
mov cx,bc
|
||||||
do {
|
mov dx,DATAPORT
|
||||||
r = inp(DATAPORT);
|
push es
|
||||||
*buff++ = r; /* Store a received byte */
|
les di,dword ptr buff
|
||||||
} while (--bc);
|
}
|
||||||
|
repeat:
|
||||||
|
_asm {
|
||||||
|
in al, dx
|
||||||
|
stosb
|
||||||
|
loop repeat
|
||||||
|
pop es
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
// Requires to add `-2' in the CC command line in the Makefile.
|
|
||||||
_asm {
|
_asm {
|
||||||
mov cx,bc
|
mov cx,bc
|
||||||
mov dx,DATAPORT
|
mov dx,DATAPORT
|
||||||
@@ -268,9 +281,6 @@ static
|
|||||||
void deselect (void)
|
void deselect (void)
|
||||||
{
|
{
|
||||||
outp(CONTROLPORT, 1); // CS high
|
outp(CONTROLPORT, 1); // CS high
|
||||||
#if 0
|
|
||||||
outp(DATAPORT, 0xFF); /* Dummy clock (force DO hi-z for multiple slave SPI) */
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -285,9 +295,6 @@ int select (void) /* 1:OK, 0:Timeout */
|
|||||||
BYTE d;
|
BYTE d;
|
||||||
|
|
||||||
outp(CONTROLPORT, 0); // CS low
|
outp(CONTROLPORT, 0); // CS low
|
||||||
#if 0
|
|
||||||
(void)inp(DATAPORT); /* Dummy clock (force DO enabled) */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (wait_ready()) return 1; /* OK */
|
if (wait_ready()) return 1; /* OK */
|
||||||
deselect();
|
deselect();
|
||||||
|
|||||||
Reference in New Issue
Block a user