English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 01 February 2014, 22:45   #1
mark_k
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.
mark_k is online now  
Old 02 February 2014, 10:03   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Need example file before I can reply
Toni Wilen is offline  
Old 02 February 2014, 13:07   #3
mark_k
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)
Attached Files
File Type: zip PackDev_PC_images.tar.xz.remove.zip (9.5 KB, 244 views)
mark_k is online now  
Old 02 February 2014, 13:39   #4
Toni Wilen
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..
Toni Wilen is offline  
Old 02 February 2014, 14:34   #5
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,335
Quote:
Originally Posted by Toni Wilen View Post
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.
Could those smaller images have been related to only storing used blocks in the .pkd/dsq file? I never used that feature myself, always using PackDev's ALL option.

Quote:
Originally Posted by Toni Wilen View Post
btw, your images are interesting, they have surfaces==1 and sectors==2*real value. I guess there was no standard..
Do you mean that's what is specified in the DOS boot sector, or the PackDev image header?

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
Edit to add: the 50 4B 44 13 is PKD in ASCII, followed by the minimum version of PackDev able to unpack the file, seemingly in BCD. So $13 means version 1.3 or later needed here.

Last edited by mark_k; 02 February 2014 at 19:22.
mark_k is online now  
Old 02 February 2014, 15:14   #6
Toni Wilen
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..
Toni Wilen is offline  
Old 03 February 2014, 12:05   #7
mark_k
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???
Attached Files
File Type: zip PackDevSectorLabelTest.zip (28.9 KB, 231 views)
mark_k is online now  
Old 03 February 2014, 12:27   #8
Toni Wilen
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.
Toni Wilen is offline  
Old 03 February 2014, 12:37   #9
mark_k
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.
mark_k is online now  
Old 03 February 2014, 15:50   #10
Toni Wilen
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".
Toni Wilen is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.14452 seconds with 14 queries