SIO for Linux  v0.01


First of all, thanks to Michael Munoz for posting his
program for DOS that reads Atari disk drives through the PC
parallel port.  That gave me the idea to try this (I had
thought of it before, but didn't think it would actually
work since I could never get it to work through the
serial port before)

So, I built his cable, booted DOS instead of Linux, and found
that the executable locked up (and I only have an ancient
version of Turbo C, since I don't use DOS, and it didn't
support inline assembly so I couldn't recompile it)

At this point I decided to write my own program to talk to
it, that runs under Linux.  This involves turning off all
interrupts while talking to the SIO devices, so be
prepared to lose a few seconds on your clock.

Also, note that this program supports single, enhanced
and true double density disks (if your drive supports them).
If there are any problems, let me know.

Read the beginning of the source code to build the cable
(or use the same one from Mike's program) and just type 'make sio'
to build it.  
If you don't have a 'setsuid' program, just 'su' to root after
building it, and type:	chown root sio; chmod 4755 sio


To run it:
	sio -i		interactive mode
	sio <filename>	copy an entire disk to <filename> (ESIO2PC format)

Options:
	-b bps		set the baud rate (default 19320)
	-d drive	set the drive (default 1)


I'm sorry these docs are so short, but I want to get this program
out to the net now before it becomes like my Atari Emulator (I always
keep improving it and never get it ready to release-- hopefully
that will change soon)

ESIO2PC format:
	This should be compatable with SIO2PC, but it adds extra
	records at the end for keeping track of bad sectors and
	the error codes given by the drive.
	I'm going to be using those error codes in my emulator
	to properly simulate disks with bad sectors.

	I'll probably also write a reverse version of this
	that acts like the old SIO2PC program, but runs under
	Linux, so that the PC can be a fileserver for the Atari.

	Basically, the new header looks like:

	WORD	IDCODE		0296h
	WORD	SIZELO		low byte of NUMSEC*SECSIZE/16
	WORD	SECSIZE		128 or 256
	WORD	SIZEHI		high byte of NUMSEC*SECSIZE/16
	WORD	RESV1		reserved
	WORD	RESV2		reserved
	WORD	RESV3		reserved
	WORD	NUMERR		number of bad sectors + 1
	(all data is low byte first)

	This is then followed by NUMSEC sectors of SECSIZE bytes,
	and then immediately followed by a table of size
	NUMERR of the following "bad sector" records:

	WORD	SECTOR		sector number
	BYTE	CSTAT		communication status 
	BYTE	HSTAT		hardware status	
	WORD	RESV1		reserved
	WORD	RESV2		reserved

	The communication and hardware status values are the
	first and second bytes returned by the drive when
	doing a 'get status' request after reading the bad
	sector.  If there is additional information that
	can be determined about bad sectors, please let me know,
	and I will add it.

	Note:	all reserved fields should be cleared when
	creating an image file, so that future versions can
	assume 0 in those fields means an older version.
	(0 for NUMERR means bad sectors were not supported
	by the program that created the file, while 1
	for NUMERR means that there were no bad sectors
	but the format was supported)

If you have any questions, feel free to email me at:
	feb6399@ultb.isc.rit.edu

	Frank "Shaggy" Barrus

