From ed2fd81927e179b23e5fecf2296b4b5b629bdf20 Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Mon, 5 Aug 2024 20:37:25 -0400 Subject: [PATCH] add initial support for DRIVER.SYS currently only skeleton logic and implementation of install check & get drive data table list [returns ddt* which allows mapping DOS drive # to BIOS drive # for drives handled by default DOS block driver] --- kernel/inthndlr.c | 25 +++++++++++++++++++++++++ kernel/main.c | 3 +++ 2 files changed, 28 insertions(+) diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 7a3f76c..2cfdb5a 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -1922,6 +1922,7 @@ extern intvec FAR ASM BIOSInt19; /* WARNING: modifications in `r' are used outside of int2F_12_handler() * On input r.AX==0x12xx, 0x4A01 or 0x4A02 * also handle Windows' DOS notification hooks, r.AH==0x16 and r.AH==0x13 + * along with DRIVER.SYS/DRIVPARAM r.AH=0x08 calls */ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr) { @@ -2203,6 +2204,30 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr) #endif return; } + else if (r.AH == 0x08) /* DRIVER.SYS / DRIVPARAM */ + { + switch (r.AL) + { + case 0x00: /* installation check */ + r.AL = 0xff; /* installed, 0=not installed */ + break; + + case 0x01: /* add new block device */ + /* TODO, see push_ddt() */ + break; + + case 0x02: /* execute device driver request */ + /* TODO */ + break; + + case 0x03: /* get drive data table */ + r.DS = FP_SEG(&nul_dev); + r.DI = FP_OFF(getddt(0)); + break; + } + + return; + } /* else (r.AH == 0x12) */ switch (r.AL) diff --git a/kernel/main.c b/kernel/main.c index dc7a1c5..6abab31 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -340,6 +340,9 @@ STATIC void init_kernel(void) LoL->lastdrive = 26; /* init_device((struct dhdr FAR *)&blk_dev, NULL, 0, &ram_top); */ + /* WARNING: dsk_init() must be called prior to update_dcb() to ensure + _Dyn (start of Dynamic memory block) is the start of drive data table (see getddt() in dsk.c) + */ blk_dev.dh_name[0] = dsk_init(); PreConfig();