[comp.sys.atari.st] HD disks & reading IBMPC disks

pinkas@cadev2.intel.com (Israel Pinkas ~) (10/07/89)

This has probably been asked before, butI haven't been reading this group
for long.

1) Is there any way to get a 1040ST (TOS 1.4) to use HD (1.4M) disks?  I
   tried to format one and the machine refused.  (Gave the same error as
   when you try to format a write-protected disk.

2) Does somebody know how to get a 1040ST to read floppies written by an
   IBM PC?  I have a Sun386i at work that can write IBM-compatible disks,
   and I would love to bypass the download.

Send replies to me, I will summarize to this group.

Thanks,

-Israel
--
--------------------------------------
Disclaimer: The above are my personal opinions, and in no way represent
the opinions of Intel Corporation.  In no way should the above be taken
to be a statement of Intel.

UUCP:	{amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!cadev4!pinkas
ARPA:	pinkas%cadev4.intel.com@relay.cs.net
CSNET:	pinkas@cadev4.intel.com

silvert@cs.dal.ca (Bill Silvert) (10/07/89)

In article <PINKAS.89Oct6115615@cadev2.intel.com> pinkas@cadev2.intel.com (Israel Pinkas ~) writes:
>This has probably been asked before, butI haven't been reading this group
>for long.
...
>2) Does somebody know how to get a 1040ST to read floppies written by an
>   IBM PC?  I have a Sun386i at work that can write IBM-compatible disks,
>   and I would love to bypass the download.

The ST reads IBM floppies (720K) without difficulty.  I routinely
transfer files to my ST by writing them to a 3-1/2" PC drive and taking
the disk home.  But the IBM systems will not read disks formatted on the
ST unless you use a special formatting program.


-- 
Bill Silvert, Habitat Ecology Division.
Bedford Institute of Oceanography, Dartmouth, NS, Canada B2Y 4A2
	UUCP: ...!{uunet,watmath}!dalcs!biomel!bill
	Internet: biomel@cs.dal.CA	BITNET: bs%dalcs@dalac.BITNET

larserio@IFI.UIO.NO (LarsErikOsterud) (10/08/89)

A small correction.  IBM's will read TOS 1.4 formatted disks as TOS 1.4
uses the right IBM boot-sector.  IBM can read old disks too, but then you
need Avant-Garde's PC_DDRVR.SYS installed on the IBM i CONFIG.SYS...

 Lars-Erik  /  ABK-BBS +47 2132659  /   ____ ______ ________________________
  Osterud  /  larserio@ifi.uio.no  /   /___    /            The norwegian ST
__________/ ______________________/   ____/   /   Klubben,  user association

Matthew_Eric_Seitz@cup.portal.com (10/08/89)

"But the IBM systems will not read disks formatted on the
"ST unless you use a special formatting program.
-- 
Bill Silvert, Habitat Ecology Division.

	IBM systems will read double-sided diskettes formatted on an Atari
ST using TOS 1.4, without any special formatting programs.

				Matt Seitz

hase@netmbx.UUCP (Hartmut Semken) (10/08/89)

In article <PINKAS.89Oct6115615@cadev2.intel.com> pinkas@cadev2.intel.com (Israel Pinkas ~) writes:
>1) Is there any way to get a 1040ST (TOS 1.4) to use HD (1.4M) disks?  I
>   tried to format one and the machine refused.  (Gave the same error as
>   when you try to format a write-protected disk.

Yes. It is possible; it requires hacking the hardware:

1.4 Megabyte drives use 300 rounds per minute rotation speed and a 500
kBit per second data rate; twice the data rate/density as the regular
drives do.

If You get a HD drive (TEAC FD135 HFN for example) and wire it up to the
ST, it will work just as a 720 k-drive, cause the controller chip is
still fixed to 250 kBit per second.

We have to speed up the controller; looks easy: the controller manual
says all time constants of the controller are take from its 8 MHz clock. 
If we would just switch it to 16 MHz?

That is, what I have done to my ST. I use the 16 MHz output of the
SHIFTER as clock source and switch the controller clock between 16 and 8
MHz based on the High-Denity-Enable output of my TEAC FD 135HFN (Shugard
BUS pin 2).

It works fine, if the step-rate (the time between 2 consecutive Step
pulses sent to the drive) is set to 6 milliseconds. The controller will
now step every 3 milliseconds (since we doubled the his clock) in HD
mode, and every 6 milliseconds in DD mode; this does not hurt the drive
or performance too much.

I have some problems with it: no program will load from HD disks and
access to folders does not seem to work too well from DESKTOP.
Everything works fine from msh, as far as I can tell. Even copying files
from HD to DD disks (DD disk in drive B; not tested for single drive
copy) works fine.

All we still need is the software to set the step rate to 6 milliseconds
and to format a drive with 18 Sectors per track.

Here ist goes:

seek6.s: set seek rate for all (both) drives to 6 milliseconds
/	module name seek6

	.shri

	.globl main_
main_:
	clr.l	-(sp)
	move.w	$0x20,-(sp)
	trap	$1
	addq.l	$6,a7
	move.l	d0,_save_ssp
	move.w	$0,0x440 / 0 => 6 ms, 1 => 12 ms, 2 => 2 ms, 3 => 3 ms
	lea	0x46a,a0
	move.l	(a0),d0
	movea.l	d0,a0
	jsr	(a0)
	move.l	_save_ssp,-(sp)
	move.w	$0x20,-(sp)
	trap	$1
	addq.l	$6,a7
	.even
_save_ssp:
	.blkl	1
-----------------------
formath.c: format high density disk
/* formath.c Formatter fuer High Density Disketten */
/* nur fuer angepasste Hardware! Floppycontroller und Laufwerk */
/* muessen High-Density tauglich sein! */
/* Hartmut Semken, Lupsteiner Weg 67 1000 Berlin 37 */
/* hase@netmbx.UUCP */
/* 03-SEP-89 */
/*formath.c: format High Density disks on modified ST (controller clock
switcheble to 16 MHz) using HD disks and drive.
Quickly hacked in from example given in Mark Williams C documentation */

#include <stdio.h>
#include <osbind.h>
#include <time.h>

#define SLEEPTIME 1	/* 1: Zeitschleife, 0: Taste */
#define BLANK (0xE5E5)
#define MAGIC (0x87654321L)
#define BUFSIZE (20*1024) /* Platz fuer mehr als 18 Sektoren... */

#define DEVICE 0	/* 0 = Floppy A, 1 = Floppy B	*/
#define SIDES 2		/* je  				*/
#define SECTORS 18	/* nach				*/
#define TRACKS 80	/*Belieben			*/

#define TOTSEC (TRACKS * SIDES * SECTORS)

extern int errno;

main(){
	int track;
	int side;
	int status;
	short *bf;
	register char reply;
	short *middle;
	char buffer[512];
		
	printf("\033E\n");
	printf("Public Domain High Density Mini Formatter\n");
	printf("von H. Semken\nDer Autor garantiert in keiner Weise fr die Funktion\nDieses Programmes.\nBenutzung auf eigene Gefahr.\n");
	printf("\n\n\n");
	printf("\007\033pFormatiere Diskette in Drive %c\033q\n%d Seiten\n%d Sektoren pro Spur\n%d Spuren\n\n", (65+DEVICE), SIDES, SECTORS, TRACKS);
	printf("Wirklich formatieren? ");
	fflush(stdout);
	if ((reply = Crawcin()) != 'y' && reply != 'Y' && reply != 'j' && reply != 'J') {
		printf("Nein. Floppy nicht formatiert.\n");
		sleep(1);
		Pterm0();
	}
	printf("Ja.\n");
	printf("Diskette einlegen; Taste drcken...");
	fflush(stdout);
	Crawcin();
	printf("\n");
	bf = malloc(BUFSIZE);
	for (track = TRACKS-1; track >= 0; track--) {
		for (side = 0; side < SIDES; side++) {
			printf("Formatiere Spur %d, Seite %d", track, side);
			fflush(stdout);
			status = Flopfmt(bf, 0L, DEVICE, SECTORS, track, side, 1, MAGIC, BLANK);
			if (status) {
				middle = bf;
				printf("\t%d\n", status);
				while (*middle) {
					printf("\tDefekter Sektor %d\n", *middle++);
				}
			} else {
				printf("\tokay\r");
			}
		}
	}
	printf("\n\nAlle Spuren formatiert\n");
	printf("Initialisiere Directory\n");
	for (track = 0; track < (BUFSIZE>>1); bf[track++] = 0);
	for (track = 0; track < 2;track++) {
		for (side = 0; side < SIDES; side++){
		if (status = Flopwr(bf, 0L, DEVICE, 1, track, side, SECTORS)) {
			errno = -status;
			perror("Write Error");
		}
		}
	}
	Protobt(buffer, (long)Random(),3,0); /* Prototyp Bootsector fr 
	                                      * 80 * 2 * 9 Sektoren */
	/* Prototyp Bootsektor fr das neue Format anpassen */
	/* Bytes 19 und 20 enthalten die Sektoren pro Disk */

	/* unteres Byte von TOTSEC */
	buffer[19] = (char)(((TOTSEC>>8)<<8)^TOTSEC);
	/* oberes Byte von TOTSEC; es lebe das Intel int-Format */
	buffer[20] = (char)(TOTSEC>>8);
	buffer[24] = (char)SECTORS; /* Sektoren pro Spur */
	status = Flopwr(buffer, 0L, DEVICE, 1, 0, 0, 1);
	if (status) {
		errno = -status;
		perror("Write Error (Bootsector)");
	}
	status = Flopver(buffer, 0L, DEVICE, 1, 0, 0, 1);
	if (status) {
		errno = -status;
		perror("Verify Error (Bootsector)");
	}
	printf("Diskette in Laufwerk %c formatiert\n", (65+DEVICE));
	sleep(1);
	Pterm0();
}

sleep(seconds)
int seconds;
#if SLEEPTIME
{
	clock_t t;
	for(t = clock();clock() < (t + CLK_TCK*seconds););
}
#else
{
	printf("Taste druecken\n");
	fflush(stdout);
	Crawcin();
}
#endif
/* end of formath.c */

-- 
Hartmut Semken, Lupsteiner Weg 67, 1000 Berlin 37 hase@netmbx.UUCP
Dennis had stepped up into the top seat whet its founder had died of a
lethal overdose of brick wall, taken while under the influence of a
Ferrari and a bottle of tequila. (Douglas Adams; the long dark teatime...)