SSD File Format

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
polomint
Posts: 45
Joined: Sun Dec 12, 2021 7:16 pm
Contact:

SSD File Format

Post by polomint »

Hi all,

Not sure if this is the correct place for this, but would anyone have the file format for SSD/DSD files laying about? I think I heard that DSD is just two SSD concatenated but I cannot seem to find the SSD file format (must be blind heh).
I am writing an MMB editor and would like to get some information from SSD' before writing them into the BEEB.MMB file for my ElkSD64.

Thank you!
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: SSD File Format

Post by lurkio »

The .SSD disc-image format is basically the "FM" single-density Acorn DFS format as documented in Colin Pharo's book The Advanced Disk User Guide For The BBC Microcomputer:

http://archive.retro-kit.co.uk/bbcdocs. ... DiskUG.pdf

The most common DSD format basically consists of two .SSDs interleaved, track by track. (However, Jonathan Harston's DSDs are sequential (all the tracks from the first side of the disc, uninterrupted, followed by all the tracks from the second side) rather than interleaved.)

:idea:

EDIT: See also MMBExplorer (caveat).
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: SSD File Format

Post by jgharston »

polomint wrote: Tue Mar 29, 2022 6:57 pm Hi all,

Not sure if this is the correct place for this, but would anyone have the file format for SSD/DSD files laying about? I think I heard that DSD is just two SSD concatenated but I cannot seem to find the SSD file format (must be blind heh).
I am writing an MMB editor and would like to get some information from SSD' before writing them into the BEEB.MMB file for my ElkSD64.

Thank you!
https://mdfs.net/Docs/Comp/Disk/Format/DFS

DSD is two SSD images interleaved into each other:
first 2560 bytes: first image's first 2560 bytes
second 2560 bytes: second image's first 2560 bytes
third 2560 bytes: first image's second 2560 bytes
fourth 2560 bytes: second image's second 2560 bytes
and so on

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: SSD File Format

Post by jgharston »

And, as in all cases, you should never use the filename to tell you what a file's content is, you should use the file's content to tell you what the file's content is, unless over-ridden by the user.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: SSD File Format

Post by sweh »

You might also find the "Disk Format" section of https://sweh.spuddy.org/Beeb/mmb_utils.html helpful.
Rgds
Stephen
User avatar
geraldholdsworth
Posts: 1401
Joined: Tue Nov 04, 2014 9:42 pm
Location: Inverness, Scotland
Contact:

Re: SSD File Format

Post by geraldholdsworth »

There's always my Guide to Disc Formats.
Gerald Holdsworth, CTS-D
Extron Authorised Programmer
https://www.geraldholdsworth.co.uk
https://www.reptonresourcepage.co.uk
Twitter @radiogezza
polomint
Posts: 45
Joined: Sun Dec 12, 2021 7:16 pm
Contact:

Re: SSD File Format

Post by polomint »

Excellent ! Thank you all.

I had a browse in a text editor and can create/load/save .mmbs, and can load/extract/copy/move .ssd' between .mmb slots, so I am half way there at least.

Image

Ignore the list, it's just a debug thing, I still haven't decided on the best way to display all the disks :)
Coeus
Posts: 3557
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: SSD File Format

Post by Coeus »

That book is a great read but having read about ID fields and gaps, SSD files contain none of that, just the data from the sectors concerned in order. Because there is no metadata stored in the file an SSD file it can't hold an image of any other kind of disc, for example an ADFS disc or one from the many third-party double-density DFSes, without causing confusion.

DSDs are a double sided version and normally have the tracks of the two sides interleaved. Interestingly JGH says that they should be interleaved despite Lurkio saying JGH's DSDs are not. There are some CP/M discs from the Z80 second processor that are on JGH's website, mdfs.net, that are DSDs and not interleaved, but I would not assume that for other DSDs elsewhere on the site.
jgharston wrote: Tue Mar 29, 2022 11:16 pm And, as in all cases, you should never use the filename to tell you what a file's content is, you should use the file's content to tell you what the file's content is, unless over-ridden by the user.
And I agree that binary files should have metadata in them to say what kind of file they are, but as SSDs don't have any such metadata it is hard to detect them reliably rather than trust the filename. There are things that will be true of the DFS catalogue, for example a sensible total sector count and the start sector numbers in the 2nd sector on track 0 being sorted in descending order such that it is possible to conclude that a DFS catalogue probably starts at a particular place on the disc and this can sometimes be used to determine that a disc is actually double-sided and either interleaved or sequential, but it is not reliable. Sometimes other things will look like a DFS catalogue and give false results.

There are better formats that do contain a proper header, with a magic number at the start to identify the format. Some of these are also sector dumps like SSD but with metadata about the set of tracks and sectors within the file and thus able to cope with non-standard sector numbering or the various DD and ADFS formats as well as discs from various other types of computer. Others simply represent the bitstream that would actually be read from disc and thus can also represent such strange things as weak bits and things with odd timing etc.
polomint
Posts: 45
Joined: Sun Dec 12, 2021 7:16 pm
Contact:

Re: SSD File Format

Post by polomint »

Thankfully I don't need to really go to deep into SSDs, I'm just packing them in a .mmb file for using on the ElkSD. I was more looking at name length of the disk and protection etc. I think I have that sorted out now :) Just need to work out a sensible UI for the MMB Editor heh
User avatar
hoglet
Posts: 12663
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: SSD File Format

Post by hoglet »

You might want to read about some recent developments in this thread:
- Extending the MMB format beyond 511 disks

Extended MMB support is available in the latest version of MMFS (1.50), and in several of the MMB manager tools also support it (for example Stephen's MMB Utilities).

Dave
polomint
Posts: 45
Joined: Sun Dec 12, 2021 7:16 pm
Contact:

Re: SSD File Format

Post by polomint »

hoglet wrote: Fri Apr 01, 2022 8:17 am You might want to read about some recent developments in this thread:
- Extending the MMB format beyond 511 disks

Extended MMB support is available in the latest version of MMFS (1.50), and in several of the MMB manager tools also support it (for example Stephen's MMB Utilities).

Dave
Yeah, I had been looking at that, might implement it too although I am not sure how much call there is for it? It should be simple enough to implement though so will be worth it just in case :)
james
Posts: 330
Joined: Tue Aug 15, 2023 8:41 pm
Location: NE Hampshire
Contact:

Re: SSD File Format

Post by james »

sweh wrote: Tue Mar 29, 2022 11:54 pm You might also find the "Disk Format" section of https://sweh.spuddy.org/Beeb/mmb_utils.html helpful.
Oh, these perl utils are fab - thank you!
Post Reply

Return to “programming”