dosemu2 / fdpp

FreeDOS plus-plus, 64bit DOS
GNU General Public License v3.0
195 stars 17 forks source link

Installed block device unavailable under FDPP #85

Closed andrewbird closed 5 years ago

andrewbird commented 5 years ago

After installing a block device driver with device=emudsk.sys the drive is unavailable under FDPP, but is fine under FreeDOS

$ cat test-imagedir/dosemu.conf
$_lpt1 = ""
$_hdimage = "dXXXXs/c:hdtype1 +1"
$_floppy_a = ""

Current FDPP

Based on FreeDOS sources (C) Pasquale J. Villani and The FreeDOS Project.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

C: HD1, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=    10 MB
D: HD2, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
E: HD3, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
F: HD4, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
EMUFS host file and print access available
Dosemu EMUDSK installed as drive G:
Process 0 starting: C:\command.com /P /E:256

FreeCom version 0.84-pre2 XMS_Swap [Aug 28 2006 00:29:00]
C:\>prompt $P$G
C:\>path c:\bin;c:\gnu;c:\dosemu
C:\>unix -s DOSEMU_VERSION
UNIX: option -s is deprecated, use system.com instead
C:\>unix -e
UNIX: option -e is deprecated, use system.com instead
C:\>g:
Invalid drive G:.

You can see that the driver is loaded as G:

dosdebug> devs
dosdebug> 
DOS Devices

0000:0dd8 Char 'NUL     '
  Attributes: 0x8004 (Char, NULDEV)
  Routines: Strategy(0000:0e78), Interrupt(0000:0e7d)

02a8:0000 Block (1 Units)
  Attributes: 0x0000 (Block)
  Routines: Strategy(02a8:006b), Interrupt(02a8:0084)

029f:0000 Char 'EMUFS$  '
  Attributes: 0x8000 (Char)
  Routines: Strategy(029f:0036), Interrupt(029f:0041)

<snip>

Device driver was loaded okay and remains resident in memory

dosdebug> mcbs
dosdebug> 

ADDR(LOW) PARAS  OWNER
0290:0000 0x04db [DOS]
  => ADDR      PARAS TYPE USAGE
     0291:0000 0x000c [F] Files
     029e:0000 0x0008 [D] Driver (EMUFS)
     02a7:0000 0x000d [D] Driver (EMUDSK)
     02b5:0000 0x0004 [E] Driver Extension
     02ba:0000 0x0020 [B] Buffers
     02db:0000 0x029e [B] Buffers
     057a:0000 0x00cf [F] Files
     064a:0000 0x008f [L] CDS Array
     06da:0000 0x0080 [S] Stacks
     075b:0000 0x0010 [B] Buffers
076c:0000 ------ [LINK]
0817:0000 0x0006 [FREE]
081e:0000 0x12c1 [COMMAND]
1ae0:0000 0x7e63 [FREE]
9944:0000 0x0619 [COMMAND]
9f5e:0000 0x0090 [COMMAND]
9fef:0000 0x0010 [COMMAND] (END)

CDS entry seems to have the flags zeroed

064b:0210 47 3A 5C 00 00 00 00 00 00 00 00 00 00 00 00 00  G:\.............
064b:0220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
064b:0230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
064b:0240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
064b:0250 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF 02  ..........
064b:0260 00 00 00 00 00 00 00 00

And DPB for drive G: is missing

Now FreeDOS

$ mv test-imagedir/dXXXXs/c/fdppconf.sys test-imagedir/dXXXXs/c/config.sys
$ cp /tmp/kernel.sys test-imagedir/dXXXXs/c/.
Ask for help in mail list: linux-msdos@vger.kernel.org

FreeDOS kernel build 2036 cvs [version Aug 18 2006 compiled Aug 18 2006]
Kernel compatibility 7.10 - WATCOMC - 80386 CPU required - FAT32 support

(C) Copyright 1995-2006 Pasquale J. Villani and The FreeDOS Project.
All Rights Reserved. This is free software and comes with ABSOLUTELY NO
WARRANTY; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation;
either version 2, or (at your option) any later version.

C: HD1, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=    10 MB
D: HD2, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
E: HD3, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
F: HD4, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
EMUFS host file and print access available
Dosemu EMUDSK installed as drive G:

FreeCom version 0.84-pre2 XMS_Swap [Aug 28 2006 00:29:00]
C:\>prompt $P$G
C:\>path c:\bin;c:\gnu;c:\dosemu
C:\>unix -s DOSEMU_VERSION
UNIX: option -s is deprecated, use system.com instead
C:\>unix -e
UNIX: option -e is deprecated, use system.com instead
C:\>g:
G:\>copy c:\autoexec.bat
c:\autoexec.bat => .\autoexec.bat
G:\>dir
 Volume in drive G has no label
 Directory of G:\

AUTOEXEC BAT            76  06-29-19  1:00a
         1 file(s)             76 bytes
         0 dir(s)     134,066,176 bytes free
G:\>              
stsp commented 5 years ago

OK, you are a true hero of debugging! Thanks!

stsp commented 5 years ago

I was thinking more in terms of MK_FAR_STR_OBJ() tidy up after use.

I tried to add the checks for that, but failed. It appears easier to review those few cases and make sure they are safe, rather than put that duty to the runtime or compiler.