mfm_emu emulates a MFM disk drive. It can use a data file created from a real drive by mfm_read or can create a empty emulation file.

 

--file -f filename[,filename]

            Emulation filename. First filename corresponds to first drive number specified.

--drive  -d #[,#]

Drive number to emulate 1-4 or 0 for drive to always be selected (radial select). One or two drive numbers may be specified to emulate one or two drives. Only one may be specified if drive number is 0.

--heads  -h #

            The number of heads.

--cylinders  -c #

            The number of cylinders.

--initialize -i

            If given create/overwrite specified file with empty data. Heads and cylinders must be specified

--quiet  -q #h

Bit mask to select which messages don't print. 0 prints all messages. Default is 1 (no debug messages). Higher bits are more important messages in general.

--version -v

            Print program version number.

 

Long options can be abbreviated to the shortest unique name. Long option values can't have spaces.

 

# is a number. #h is a number which may be decimal, octal if starts with a 0, or hex starting with 0x.

 

Example:

   mfm_emu –drive 1 –file disk_file

This used file disk_file to emulate a drive on select line 1.

 

   mfm_emu –drive 1 –file disk_file –initialize –cylinders 306 -heads 4

This creates/overwrites file disk_file with empty data for a disk with 306 cylinders and 4 heads. It then  emulates a drive on select line 1. You will need to use the host computer low level format program to write the sector headers before the emulated drive can be read or written normally.

 

Currently the program prints various stuff to see what it's doing. This will change as testing goes on.

bad pattern count 0

Read queue underrun 0

Write queue overrun 0

Ecapture overrun 0

glitch count 0

glitch value 0

0:test 0 0

0:test 1 0

0:test 2 0

0:test 3 0

0:test 4 0

1:test 0 0

1:test 1 0

1:test 2 0

1:test 3 0

1:test 4 0

    The named values are various errors/unexpected conditions. The test values are used to show internal variables from the PRU's. See the source for current purpose.

 

select 0 head 0

   Current select and head line state

 

Waiting, seek time 3.9 ms max 3.9

   IARM is waiting for PRU. The values are the last and maximum time from PRU requesting the next cylinder to the data being returned. If seek time is zero you are using a buggy version of am335x_pru_package and data is likely to be corrupted.

 

Cyl 0,400 select 1, head 4 dirty 0

   Last and next requested cylinder, select and head lines. Dirty 1 indicates the sector data was written to.