English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 20 February 2021, 02:04   #1
madcap
Registered User

madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 53
HDF file format

Hi,

I'm looking for the specification of the HDF file format, because I want to develop a tool to create new empy HDF's of a given size.

I would also like to know if there are any such tools out there (not WinUAE/FS-UAE).

I've done a little reverse engineering in the past and I came to the conclusion that an HDF file is just the string "rdsk" followed by the disk data. So if I want to create a 32GB HDF, I can run these 2 instructions in a bash shell:

Code:
$ printf "rdsk" >> 32gb.hdf 
$ dd if=/dev/zero bs=1000000000 count=32 >> 32gb.hdf
It seemed to work very well. I was able to install AmigaOS 3.9 in there.

But I'm afraid there's something more I should take into account. That's why I want to take a peek at the documentation.

Thanks.
madcap is offline  
Old 20 February 2021, 03:37   #2
Tomislav
Registered User

 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 256
HDF can be at least 2 formats. One is RDB RDSK and second is as like a big floppy disk format with boot block. RDB is like MBR but different than MBR. Search for Amiga RDB.
Tomislav is offline  
Old 20 February 2021, 10:20   #3
FrodeSolheim
FS-UAE Developer

FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 40
Posts: 3,750
Quote:
Originally Posted by madcap View Post
I've done a little reverse engineering in the past and I came to the conclusion that an HDF file is just the string "rdsk" followed by the disk data.
Not quite right, the "RDSK" bytes are actually part of the disk drive. These bytes (along with more partition data) will be written to the disk when formatting the disk in AmigaOS.

Additionally, when using a. hdf file in FS-UAE/WinUAE, if the disk contains these 4 bytes at the start of the file, it will be used as a full RDB disk image, instead of a single partition image (like Tomislav mentioned, there are two kinds of .hdf files, really).
FrodeSolheim is offline  
Old 20 February 2021, 10:26   #4
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,183
HDF is like ADF, it has no format. It's just the raw data as read from or written to disk. Whatever is on the disk is also in the HDF. There is no header or footer. And no documentation.
thomas is offline  
Old 20 February 2021, 10:31   #5
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 46
Posts: 2,348
From what i know the header for ADF files exist instead

It is always the text string "DOS"
chip is offline  
Old 20 February 2021, 10:37   #6
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,183
Quote:
Originally Posted by chip View Post
It is always the text string "DOS"
Only by chance because the file system writes the DOS type into the first sector of the disk. It's not a file format header.

If you format a floppy disk with FloppyPFS you'll read PFS there.
thomas is offline  
Old 20 February 2021, 14:13   #7
White
Registered User
 
Join Date: Sep 2016
Location: italy
Posts: 1,045
@madcap

Can this tool you are creating can be run inside an .exe installer?
or can it be run directly from windows to prepare an .hdf without using winuae?

Thanks for more information.
White is offline  
Old 20 February 2021, 14:27   #8
Tomislav
Registered User

 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 256
I saw HDFs which starts with PC MBR (512B), then had 512B zeroed and after that had Amiga RDB.
Tomislav is offline  
Old 20 February 2021, 15:07   #9
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,183
The Amiga RDSK block can be in any of the first 16 sectors of the HDD. So you can have an MBR in sector 0 and an RDB in sector 1. This way you can make PC partitions visible on the Amiga automatically. The Boot95 utility which comes with FAT95 does this, for example.
thomas is offline  
Old 20 February 2021, 18:34   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,625
Also nothing forces HDF to have anything to do with Amiga. It is simply image file of harddrive-like device (for example memory card or USB stick).
Toni Wilen is offline  
Old 20 February 2021, 19:20   #11
madcap
Registered User

madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 53
Wow, guys. Thanks a lot for your help.


From what you told me, I made a few searches and I think that now I'm on the right track.
madcap is offline  
Old 20 February 2021, 19:25   #12
madcap
Registered User

madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 53
Quote:
Originally Posted by White View Post
Can this tool you are creating can be run inside an .exe installer?
or can it be run directly from windows to prepare an .hdf without using winuae?
@White
I don't use windows, but I will probably develop it in Python, so it will be cross-platform (it will be just a few lines, really). So I guess the answer to your question is yes, as long as you have python on your machine.
I will keep you posted. Just watch this thread.
madcap is offline  
Old 21 February 2021, 12:10   #13
FrodeSolheim
FS-UAE Developer

FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 40
Posts: 3,750
Btw, there is already a python tool / library for working with HDF and ADF files: https://amitools.readthedocs.io/en/l...s/xdftool.html

Quote:
The xdftool is a tool from the amitools tool set that allows to read disk images intended for Amiga emulators like ADF or HDF files and display or extract their contents. Furthermore, you can

create new ADF or HDF images
copy files from the image
copy your own files to it
master own images
repack existing images
work on partitions inside RDISK/RDB hdf images or on real disks
FrodeSolheim is offline  
Old 22 February 2021, 18:20   #14
madcap
Registered User

madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 53
Quote:
Originally Posted by FrodeSolheim View Post
Btw, there is already a python tool / library for working with HDF and ADF files: https://amitools.readthedocs.io/en/l...s/xdftool.html

Thanks @FrodeSolheim. I also just found that tool when I started researching for the options already available. That's a very good tool and it does so much more that I could have asked for.


I will finish my own tool anyway, mainly for educational purposes, but also because it will be so much simpler (limited) and probably easier to use.
madcap 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
Make HDF (or other format) image of real Amiga CompactFlash HD? ProdigalAmigan support.Other 2 23 July 2019 20:48
HDF File in WinUAE... Stl75 support.WinUAE 7 25 May 2018 20:30
Why format HDF file in Workbench ? amiga_Forever support.FS-UAE 11 17 February 2017 12:50
Format hdf larger than 1GB Bigby support.WinUAE 10 06 March 2009 02:45
hdf file is full, what to do? lostfriend New to Emulation or Amiga scene 2 04 August 2005 14:09

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 05:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.09581 seconds with 13 queries