01 February 2014, 22:45 | #1 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
PackDev (.pkd) image support for PC disks?
Is WinUAE supposed to support PackDev images of PC format disks? Because selecting a .pkd file of a DD or HD PC format disk in the WinUAE floppy drives page doesn't seem to work.
|
02 February 2014, 10:03 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Need example file before I can reply
|
02 February 2014, 13:07 | #3 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
Attached is an archive with example PC/MS-DOS 3.5" DD (720KB), 3.5" HD (1440KB) and 5.25" DD (360KB, 40 cylinders) PackDev images. (Remove the ".remove.zip" from the filename, it's an XZ-compressed tar archive, but the EAB forum doesn't allow attaching files which end in .xz)
|
02 February 2014, 13:39 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
There was 2 problems, pkd always unpacked to Amiga DD size (There are Amiga .dsq images that are smaller than DD for some reason), now it only pads size to 880k if header information has surfaces==2 and sectors==11.
Second problem was name of image, only known extensions use size based heuristics to detect the type (if size is 720K = DOS disk and so on). Now it also checks "internal" generated name (PC_3.5_DD.pkd unpacked memory "file" is named as PC_3.5_DD.pkd.adf) if it has known extension. btw, your images are interesting, they have surfaces==1 and sectors==2*real value. I guess there was no standard.. |
02 February 2014, 14:34 | #5 | ||
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
Quote:
Quote:
I created the example images by mounting PC0: (CrossDOS, mount file has Reserved=1), formatting it then copying a file to the disk. Then PackDev FROM PC0: to filename.pkd ALL The reserved value in the header of the example images was set to 1. However in some other .pkd files I created from PC disks, the reserved value is 2. For PC disks probably 1 makes more sense. Maybe I was using a different mount file with Reserved=2 back when I created those other .pkd images??? The .pkd format header seems to contain the number of sectors, sector size, number of reserved sectors and track size. It doesn't specify the number of surfaces. PackDev source code is on Aminet. Without looking at that though, just using a hex editor, the .pkd header seems to consist of: Code:
Offset What ------ ---- 00 50 4B 44 13 04 Total number of sectors, longword 08 Sector size in bytes (e.g. $00000200) 0C Number of reserved sectors, e.g. 1 or 2. 10 Size of each track in bytes, e.g. $00001200 = 9*512 for PC 5.25" DD Last edited by mark_k; 02 February 2014 at 19:22. |
||
02 February 2014, 15:14 | #6 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
I thought reserved sectors field was number of heads field. I didn't have any documentation when I added .pkd support, I simply guessed how it works.
It could explain size problem too.. |
03 February 2014, 12:05 | #7 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
On the subject of PackDev...
PackDev is supposed to support trackdisk sector label data. [In the Amiga trackdisk floppy disk format, each sector has an associated 16-byte "label area". Thus the total amount of data that can be put on a disk using normal trackdisk device commands (not TD_RAWREAD) is (512+16)×1760 = 929280 bytes. Most programs don't use sector label data, and of course it can't be recorded in a normal 901120-byte ADF file.] On creating a .pkd image file from a floppy disk, the sector label data is supposed to be recorded in the image file. When writing a .pkd file back to floppy disk, you can tell PackDev to write the sector label data by using the ETDFORMAT or TDFLABEL options. I don't know of any programs which write to the sector label area. So I experimented using PackDev by creating a .pkd image of a formatted floppy disk (AllZeroSectorLabels.pkd). Then I used a hex editor to change some of the sector label data to non-zero bytes, calling the modified file SomeSectorLabelData.pkd. (See from offset $1634 in SomeSectorLabelData.pkd.) In WinUAE I created an extended ADF file and put that in DF0:. Then I used PackDev to write SomeSectorLabelData.pkd to that disk with ETDFORMAT. Finally I used PackDev again to create an image file from the just-written-to disk. In theory the new image file should be identical to SomeSectorLabelData.pkd. But in fact the new image file is identical to AllZeroSectorLabels.pkd. Am I doing something wrong or is PackDev's support for sector label data broken? I don't think it would be a WinUAE problem, unless for some reason WinUAE detects a trackdisk-format track is being written and zeros out all the sector label data??? |
03 February 2014, 12:27 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
I think I simply made it to ignore sector headers, I didn't see any reason to have internal pkd to ext adf converter ("not worth the trouble"). I have never seen any programs that use sectors headers.
|
03 February 2014, 12:37 | #9 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
Yes I figured that WinUAE's .pkd file support probably ignored sector label data. However I wasn't using WinUAE's .pkd file support for the testing above. An extended ADF was in DF0:. In the emulated Amiga, I did
PackDev FROM SomeSectorLabelData.pkd TO DF0: ETDF then read that back with PackDev FROM DF0: to read_from_df0.pkd ALL And after that, read_from_df0.pkd had all its sector label data zero. |
03 February 2014, 15:50 | #10 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Check log, it wanted to write non-zero sector header(s) if it says "Disk decode: sector X header: A B C D".
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PC Image to Amiga Image? | AF2013 | Coders. AMOS | 6 | 21 December 2013 22:36 |
Anyone know where this image came from, what is it? | StoneOakvalley | request.Other | 4 | 05 September 2012 09:42 |
HD 2 Disks Installing (SPLITTING APPS 4 DISKS) | 03stevensmi | request.Apps | 1 | 29 August 2012 17:33 |
Portaudio support (was: WinUAE support for ASIO drivers) | Amiga1992 | support.WinUAE | 57 | 28 March 2009 21:15 |
Tip: Long filename support for zip disks... | Echo | support.Hardware | 0 | 01 March 2003 20:32 |
|
|