I'm considering writing my own using INT13h BIOS calls. Shouldn't be reasonably simple to do.
I was writing the comment because I had already the same idea.
This is how my code looks like:
# .COM file loaded into address CS:0x100, assuming DS=ES=CS
start:
.code16
.intel_syntax noprefix
# Create and open the output file
mov ah, 0x3C
xor cx, cx
mov dx, offset (filename - start + 0x100)
int 0x21
jc error
# The "loop":
# bx = File handle
# ax = cylinder number
# dh = head number
# dl = bios drive
mov bx, ax
mov ax, [firstcylinder - start + 0x100]
xor dh, dh
mov dl, [driveno - start + 0x100]
nextLoop:
# Read one track
push ax
push bx
push dx
mov ch, al
mov cl, ah
ror cl, 1
ror cl, 1
inc cl
mov bx, 0x400
mov ah, 2
mov al, [numsectors - start + 0x100]
int 0x13
pop dx
pop bx
pop ax
jc error
# Write the data to the file
push ax
push bx
push dx
mov ah, 0x40
mov ch, [numsectors - start + 0x100]
xor cl, cl
add cx, cx
mov dx, 0x400
int 0x21
pop dx
pop bx
pop ax
# Loop: Go to the next head
inc dh
cmp dh, [numheads - start + 0x100]
jb nextLoop
# Loop: Go into the next cylinder
# (And continue at head 0)
xor dh, dh
inc ax
cmp ax, [lastcylinder - start + 0x100]
jbe nextLoop
# Close the file and finish
mov ah, 0x3E
int 0x21
int 0x20
# Error "handling"
error:
mov ah, 9
mov dx, offset (errorMessage - start + 0x100)
int 0x21
int 0x20
errorMessage:
.ascii "An error occurred.$"
# -------- Configuration area ----------
# Replace this by the BIOS drive number
driveno:
.byte 0x80
# Replace these two bytes by the first
# cylinder to be copied
firstcylinder:
.word 308
# Replace these two bytes by the last
# cylinder to be copied
lastcylinder:
.word 614
# Replace this byte by the number of heads
numheads:
.byte 4
# Replace this byte by the number of
# sectors per track
numsectors:
.byte 26
# Replace this by the file name
filename:
.asciz "d:\\hdfile0.bin"
# .org 0x400
# dataBuffer:
The code supports disks with 512 bytes per sector.
I did a quick test in a virtual machine using DOS 5.0. Unfortunately I'm not sure if it works on a real XT; the virtual machine supports new BIOS features and 80486 instructions.
I also did not check if the disk was really copied correctly!!
Because the file size is limited in old DOS versions (I think the drive size is limited to 33 MB!), you can specify a "start cylinder" and an "end cylinder" in the "configuration area". So you can make a copy of the first half and the second half of the hard disk.
The machine now has a XT_IDE v4 card.
Maybe someone not having such a card but having the same problem is reading this:
The code above can be modified to write to a serial cable instead of a file. However using a serial cable is rather slow: At 9600 bauds (XTs don't support "high" baud rates) it would take about 10 hours to transfer the data.
I was also thinking about a solution that works similar to the "X*1541" type cables:
Such cables are used to connect an old Commodore disk drive to the parallel port of a modern computer; however, the same idea can be used to connect some memory with a similar interface (such as an SD card!) to the parallel port of an old computer.
I think this would allow a much higher speed than a serial cable, but require really much programming effort - even when writing to "raw sectors" of the SD card instead of a (FAT) file system.