English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 20 February 2021, 01:04   #1
madcap
Registered User
 
madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 61
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, 02:37   #2
Tomislav
Registered User
 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 302
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, 09:20   #3
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
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, 09:26   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
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, 09:31   #5
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 49
Posts: 2,942
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, 09:37   #6
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
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, 13:13   #7
White
Registered User
 
White's Avatar
 
Join Date: Sep 2016
Location: italy
Posts: 1,480
@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, 13:27   #8
Tomislav
Registered User
 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 302
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, 14:07   #9
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
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, 17:34   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
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, 18:20   #11
madcap
Registered User
 
madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 61
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, 18:25   #12
madcap
Registered User
 
madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 61
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, 11:10   #13
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
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, 17:20   #14
madcap
Registered User
 
madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 61
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  
Old 25 February 2021, 12:35   #15
madcap
Registered User
 
madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 61
If anyone is still interested (@White ?), here's the script:


https://framagit.org/epifanio/hdfcreate


It would be nice to have some feedback if anyone tests it.
madcap is offline  
Old 25 February 2021, 20:20   #16
White
Registered User
 
White's Avatar
 
Join Date: Sep 2016
Location: italy
Posts: 1,480
@madcap

Thank you,
i wanted to ask besides satisfying dependencies on win 10 (python) for personal use in this case as my host system.
If there can be a way to somehow make it an executable for windows and then include it together with a package that installs winuae and then immediately asks for the creation of the .hdf

In this case I can get help from someone,
do you think it is possible to do it somehow?
Thank you.
White is offline  
Old 26 February 2021, 13:19   #17
madcap
Registered User
 
madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 61
@White

I'm not sure I understand your question. Maybe you could try to explain why you need to do that (run winuae and immediately ask for the creation of the .hdf).

The thing you seem to want to do is probably much more complicated than my script

I know there are ways to compile Python to static binaries, but I've never done that.

Cheers.
madcap is offline  
Old 26 February 2021, 16:04   #18
White
Registered User
 
White's Avatar
 
Join Date: Sep 2016
Location: italy
Posts: 1,480
@madcap
Thanks for answering me,
some time ago I made a script that works on amigaos 4.1FE.
once installed, the base system fetches files from the internet via wget, unpacks them, installs them in their relative positions, configuring them to be compatible with winuae and deletes them once installed. (the packages to download are public domain on the osdepot site)
The only missing step is the creation of an .hdf in the system pre-installation phase.
The script is made up of two parts: the first downloads all the necessary software, the second installs and configures it for use with winuae.

here you can see an example:

first part:
[ Show youtube player ]

second part:
[ Show youtube player ]
White is offline  
Old 26 February 2021, 16:38   #19
madcap
Registered User
 
madcap's Avatar
 
Join Date: May 2014
Location: Lisbon / Portugal
Posts: 61
@White
If your windows executable can call the python script, I think you can do that. Where would you set the parameters (size of the hdf, etc). Will the user enter that info in some kind of UI ou shell?
madcap is offline  
Old 26 February 2021, 16:55   #20
White
Registered User
 
White's Avatar
 
Join Date: Sep 2016
Location: italy
Posts: 1,480
@madcap
From the command line I have no idea.
Probably Toni can answer this.
But two predefined .hdfs would be enough, for example of 8 or 16 gigabytes to be chosen during installation.
But even one would be more than enough :-)
White 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 19:48
HDF File in WinUAE... Stl75 support.WinUAE 7 25 May 2018 19:30
Why format HDF file in Workbench ? amiga_Forever support.FS-UAE 11 17 February 2017 11:50
Format hdf larger than 1GB Bigby support.WinUAE 10 06 March 2009 01:45
hdf file is full, what to do? lostfriend New to Emulation or Amiga scene 2 04 August 2005 13: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 18:04.

Top

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