Nemiga (LSI-11 USSR) MD Disk

HxC Floppy emulator support for all others computers...
Post Reply
kapitan-u
Posts: 33
Joined: Fri Mar 07, 2014 6:08 am

Nemiga (LSI-11 USSR) MD Disk

Post by kapitan-u »

Nemiga DSK to hfe conversion utility.

Nemiga MD Floppy format

FM, 300 RPM, 125 000 bps un-formatted track capacity 3125 bytes

Logical Volume:
80 tracks, 1 side , Sector 128 bytes, 23 sectors per track, 235 520 bytes

FDD is double sided and can access logical volume on other side of the floppy.

Bit order of 8 bit byte on disk is 7,6,5,4,3,2,1,0
Byte order LSB, MSB

Track layout:

1. GAP1 Synchro sequence 8 bytes 0x00
2. Track Header
2.1. Synchro marker one byte 0xF3
2.2. One byte track number (counting from zero)
2.3. One word number of sectors per track. Maximum and default is 23 (0x17)
2.4. One word global sector number for the first sector on the track (counting from zero, see note below)
2.5. One word status. Details unknown, appears always to be 0xFFFF
2.6. One word Track header CRC. Sum od 8 bytes 2.1-2.5 (see note below)
3. Data Sectors of 128 bytes + One word CRC
4. GAP4 117 Bytes

Note on Global Sector Numbering

First sector on Track 0 contain information about number of sectors on each track.
First 80 bytes contain number of sectors on corresponding track,
following by word with total number of sectors on the disk.

CRC Computation as per Nemiga ROM

ROM:163462 mov #8., R0 ; track header length without CRC
ROM:163466
ROM:163466 Next_CRC: ; CODE XREF: FDC_Read+104j
ROM:163466 clr R2
ROM:163470
ROM:163470 CRC_Loop: ; CODE XREF: FDC_Read+72j
ROM:163470 movb (R3)+, R1
ROM:163472 add R1, R2
ROM:163474 sob R0, CRC_Loop
ROM:163476 mov #128., R0 ; sector length
ROM:163502 cmp R2, (R3)+
ROM:163504 bne FDC_Read_Failed ; CRC error
ROM:163506 sob R4, Next_CRC
ROM:163510 return
ROM:163510 ; End of function FDC_Read

same in Perl

$crc = 0;

for ($count = 128; $count >= 1; $count--) {
$data_byte = $dsk[$track][$dsk_byte++];
$data_byte = 0xFF00 | $data_byte if $data_byte & 0x80;

$crc = ( $crc + $data_byte ) & 0xFFFF;

push $dsk_track, ( $data_byte );
}

# CRC
#
$MSB = $crc >> 8;
$LSB = $crc & 0xFF;
Attachments
nemiga-dsk-to-hfe.zip
(2.54 KiB) Downloaded 494 times

Post Reply