cnvogelg / amitools

Various tools for using AmigaOS programs on other platforms
264 stars 71 forks source link

should xdftool / xdfscan be able to handle adf files created from HD floppies (1760kb)? #141

Closed tingox closed 4 years ago

tingox commented 4 years ago

xdftool (and xdfscan works great on adf files created for DD floppies (880 kb). Example:

tingo@kg-core1$ xdfscan 35_amiga_dd_Filer_9.adf
                scan  35_amiga_dd_Filer_9.adf  
                 ok   35_amiga_dd_Filer_9.adf  
tingo@kg-core1$ xfdtool 35_amiga_dd_Filer_9.adf info
-sh: xfdtool: not found
tingo@kg-core1$ xdftool 35_amiga_dd_Filer_9.adf info
total:        1760  880Ki        901120
used:         1037  518Ki        530944  58.92%
free:          723  361Ki        370176  41.08%
tingo@kg-core1$ xdftool 35_amiga_dd_Filer_9.adf list
Filer_9                                          VOLUME  --------  06.03.1994 19:13:08.46  DOS1:ffs #512
  ADSPE.Lha                                       53237  ----rw-d  08.02.1994 23:46:51.08  
  Du10.lha                                         9302  ----rw-d  16.01.1994 10:40:01.33  
  MegmnBnk.lzh                                   308994  ----rw-d  17.02.1994 21:25:04.09  
  MegmnBnk.readme                                  7079  ----rw-d  17.02.1994 21:20:03.20  
  Reorg.lha                                       55695  ----rw-d  20.02.1994 18:42:52.19  
  rhcslip37_7.lha                                 65070  ----rw-d  15.02.1994 18:20:33.20  
  socket_lib10.lha                                17763  ----rw-d  24.02.1994 22:52:52.28  
  socket_lib10.readme                               481  ----rw-d  22.02.1994 22:29:08.41  
sum:          1034  517Ki        529408
data:         1014  507Ki        519168  98.07%
fs:             20   10Ki         10240   1.93%

but if I try to use xdftool on a adf file created from a HD floppy (1760 kb), it barfs:

tingo@kg-core1$ xdftool 35_amiga_hd_Filer_11.adf info
'info' FSError: Invalid Root Block(2):block=RootBlock:@880
Traceback (most recent call last):
  File "/home/tingo/.local/bin/xdftool", line 10, in <module>
    sys.exit(main())
  File "/home/tingo/.local/lib/python3.7/site-packages/amitools/tools/xdftool.py", line 840, in main
    code = queue.run()
  File "/home/tingo/.local/lib/python3.7/site-packages/amitools/tools/xdftool.py", line 113, in run
    self.volume.close()
  File "/home/tingo/.local/lib/python3.7/site-packages/amitools/fs/ADFSVolume.py", line 117, in close
    self.bitmap.write()
AttributeError: 'NoneType' object has no attribute 'write'

xdfscan claims that this is a image with "nofs":

tingo@kg-core1$ xdfscan 35_amiga_hd_Filer_11.adf
                scan  35_amiga_hd_Filer_11.adf  
                nofs  35_amiga_hd_Filer_11.adf  

note: this is a normal disk with a normal Amiga filesystem on it. unadf manages fine

tingo@kg-core1$ unadf -l 35_amiga_hd_Filer_11.adf
unADF v1.0 : a unzip like for .ADF files, powered by ADFlib (v0.7.11a - January 20th, 2007)

Device : Floppy HD. Cylinders = 80, Heads = 2, Sectors = 22. Volumes = 1
Volume : Floppy 1760 KBytes, "Filer_11" between sectors [0-3519]. FFS . Filled at 99.5%.

 340027  1994/03/11  23:31:23  AGA-KLOND2-3.LHA
   3144  1994/03/12  21:05:15  History.lha
 460456  1994/03/11  23:37:02  AGA-KLOND3-3.LHA
 393564  1994/03/10  20:34:12  AGA-KLOND1-3.LHA
    486  1994/03/09  23:17:19  AGA-KLOND1-3.readme
 565730  1994/03/12  21:05:11  HajimeCards.lha

Details: amitools was installed with

tingo@kg-core1$ pip install --user amitools
Collecting amitools
Requirement already satisfied: lhafile in /usr/local/lib/python3.7/site-packages (from amitools) (0.2.2)
Installing collected packages: amitools
  WARNING: The scripts fdtool, geotool, hunktool, rdbtool, romtool, typetool, vamos, vamospath, vamostool, xdfscan and xdftool are installed in '/home/tingo/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed amitools-0.4.0

after all prerequisites was installed. This is running on FreeBSD:

tingo@kg-core1$ freebsd-version -ku
11.3-STABLE
11.3-STABLE
tingo@kg-core1$ uname -a
FreeBSD kg-core1.kg4.no 11.3-STABLE FreeBSD 11.3-STABLE #2 r352605: Sun Sep 22 22:53:27 CEST 2019     root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64

any more information I can provide?

cnvogelg commented 4 years ago

You are right, HD disk image support was totally missing (I never needed it...) But now they are supported on current HEAD... Please give it a try!

tingox commented 4 years ago

That was a very fast fix - thanks! Testing, using the same file as previously:

tingo@kg-core1$ ~/work/amiga/amitools/bin/xdfscan 35_amiga_hd_Filer_11.adf
                 ok   35_amiga_hd_Filer_11.adf  

and xdftool

tingo@kg-core1$ ~/work/amiga/amitools/bin/xdftool 35_amiga_hd_Filer_11.adf info
total:        3520  1.7Mi       1802240
used:         3503  1.7Mi       1793536  99.52%
free:           17  8.5Ki          8704   0.48%
tingo@kg-core1$ ~/work/amiga/amitools/bin/xdftool 35_amiga_hd_Filer_11.adf list
Filer_11                                         VOLUME  --------  12.03.1994 21:12:51.39  DOS1:ffs #512
  AGA-KLOND1-3.LHA                               393564  ----rw-d  10.03.1994 20:34:12.24  
  AGA-KLOND1-3.readme                               486  ----rw-d  09.03.1994 23:17:19.30  
  AGA-KLOND2-3.LHA                               340027  ----rw-d  11.03.1994 23:31:23.31  
  AGA-KLOND3-3.LHA                               460456  ----rw-d  11.03.1994 23:37:02.42  
  HajimeCards.lha                                565730  ----rw-d  12.03.1994 21:05:11.15  
  History.lha                                      3144  ----rw-d  12.03.1994 21:05:15.03  
sum:          3500  1.7Mi       1792000
data:         3447  1.7Mi       1764864  98.49%
fs:             53   26Ki         27136   1.51%

I also tested the other HD images I have made - they all work.

tingox commented 4 years ago

Is there a procedure / standard for closing this (or any) issue? Like: the project owner / the one who opened the issue / the one who committed a fix?

cnvogelg commented 4 years ago

No no real defined process... I'd prefer that the creator of the issue, who also confirms that my fix is working closes the ticket.