Skip to content

Commit

Permalink
add initial support for DRIVER.SYS
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
PerditionC committed Aug 6, 2024
1 parent 8bdb2db commit ed2fd81
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions kernel/inthndlr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ed2fd81

Please sign in to comment.