Flop raw.xdd

From SpareMiNT Wiki

Jump to: navigation, search

Basically, what this driver does is to install a character special device called /dev/fd0 (the name is adjustable) which can be manipulated almost like a normal file, but whose contents reflect the contents of the floppy disk in drive A: (also adjustable).

There are a few things you can't do with /dev/ps0 that you can with a real file:

  • delete it (well, you can, but then the device driver is lost and must be reloaded)
  • alter it's length (this is fixed at the length of the disk; attempts to seek further will silently fail)
  • stat it (again, you can, but you don't get anything useful out)

By default, it read double sided, 9 sector/track, 80 track disks in drive A:, but you can alter all these things in the source and recompile.

This is the modernized version of the floppy device driver. It lock now the drive with Dlock.

The devices got fd0 (ex-ps0.. fd0 seems more logical to me), fh0 for HD 1.44meg and fx0, a fat HD format (1.6meg = 20 sectors/track). If you wish to add others devices (other drive, different density..), you just have to put their description in the array "drivers", and recompile! Then you got a ready-to-work nice XDD driver!

static RAWDEV drivers [] =
{
 
        { "device_name", drive, tracks/sides, sides, sectors/track, bytes/sector }
};
device_name
:
ex: "fd0", "fh0", "ps0"... Note that all the devices will be in /dev
drive
:
0 for drive A:
1 for drive B:
(no harddisk!)
tracks/side
:
80 is the standard
sides
:
1 (single-sided) or 2 (double-sided)
sectors/track
:
9 is for DD MS-DOS disks
18 for HD MS-DOS disks
36 for ED disks.
Of course don't surestimate your drive... If you put a greater value than standard it might be unreliable and slower!
bytes/sector
:
512 is the standard
adviced values for sectors/track (values between braces are standard values)
DD 3'5
:
[9] 10 11
HD 5'25
:
[15] 16 17
HD 3'25
:
[18] 19 20 21 22
ED
:
[36] 37 38 39 40
beware of higher values!
Personal tools
Resources