Article View: comp.sys.atari.st
Article #18127Re: ST Disks & Sparcstation Drives
From: Schultz
Date: Thu, 21 Mar 1991 04:54
Date: Thu, 21 Mar 1991 04:54
118 lines
4198 bytes
4198 bytes
>
> A few months ago, some people were talking about reading Atari
> ST disks from a Sparcstation. Does anyone know how to go about
> this?
>
> Specifically, I want to read files from a double sided disk onto
> my Sparc and then transfer them to my ST hard disk via modem (I
> only have a single-sided floppy).
From Mtools 2.03, patch #3:
# Mtools was posted to the unix-pc.sources news group (and mailed to the
# moderator of comp.sources.unix) on the 17th of September 1990. Since
# then, patch #1 and #2 have been posted to unix-pc.sources,
# comp.sources.bugs, and emailed to Rich Salz.
#
# In addition, the current version of Mtools and all the patches are
# available via anonymous ftp from cerl.cecer.army.mil (129.229.1.101).
#
# Emmet P. Gray US Army, HQ III Corps & Fort Hood
# ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV
# fthood!egray@uxc.cso.uiuc.edu Directorate of Engineering & Housing
# Environmental Management Office
# Fort Hood, TX 76544-5057
Just a few days ago, I modified Mtools so that they can read
and (be careful!) write single sided 3.5" floppies and e.g.
floppies with 10 sec/track:
---------------------------- < cut here > -------------------------
*** devices.c_as_distrubuted Mon Mar 11 17:39:48 1991
--- devices.c Mon Mar 11 17:41:34 1991
***************
*** 27,37 ****
#endif /* MASSCOMP */
#ifdef SPARC
struct device devices[] = {
! {'A', "/dev/rfd0c", 0L, 12, 0, (int (*) ()) 0, 80, 2, 18},
! {'A', "/dev/rfd0c", 0L, 12, 0, (int (*) ()) 0, 80, 2, 9},
{'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
};
#endif /* SPARC */
#ifdef UNIXPC
--- 27,94 ----
#endif /* MASSCOMP */
#ifdef SPARC
+ #include <sys/types.h>
+ #include <sun/dkio.h>
+ #include <fcntl.h>
+
+ int init_sparc_fd();
+
struct device devices[] = {
! {'A', "/dev/rfd0c", 0L, 12, 0, init_sparc_fd, 80, 2, 0},
{'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
};
+
+ /*
+ * Stuffing back the floppy parameters into the driver
+ * allows for gems like 10 sector or single sided floppies
+ * from Atari ST systems.
+ * Also the table needs only one entry (SunOS already tries
+ * for HD and DD floppies).
+ * Note that it is necessary to set the partition info,
+ * since otherwise e.g. a 800k floppy (80 tr., 2 heads, 10 sectors)
+ * would only be read and writeable up to 720k.
+ *
+ * Martin Schulz, Universite de Moncton, March 11, 1991.
+ */
+ int
+ init_sparc_fd(fd, ntracks, nheads, nsect)
+ int fd, ntracks, nheads, nsect;
+ {
+ struct fdk_char dkbuf;
+ struct dk_map dkmap;
+
+ if (ioctl(fd, FDKIOGCHAR, &dkbuf) != 0) {
+ ioctl(fd, FDKEJECT, NULL);
+ return(1);
+ }
+
+ if (ioctl(fd, DKIOCGPART, &dkmap) != 0) {
+ ioctl(fd, FDKEJECT, NULL);
+ return(1);
+ }
+
+ if ( ntracks && nheads )
+ dkbuf.ncyl = ntracks * nheads;
+ if ( nheads )
+ dkbuf.nhead = nheads;
+ if ( nsect )
+ dkbuf.secptrack = nsect;
+
+ if ( ntracks && nheads && nsect )
+ dkmap.dkl_nblk = ntracks * nheads * nsect;
+
+ if (ioctl(fd, FDKIOSCHAR, &dkbuf) != 0) {
+ ioctl(fd, FDKEJECT, NULL);
+ return(1);
+ }
+
+ if (ioctl(fd, DKIOCSPART, &dkmap) != 0) {
+ ioctl(fd, FDKEJECT, NULL);
+ return(1);
+ }
+
+ return(0);
+ }
#endif /* SPARC */
#ifdef UNIXPC
---------------------------- < cut here > -------------------------
Replies to: Martin Schulz
martin@atlantic.cs.unb.ca
Technical Details
Message-ID:
<1991Mar21.045427.5970@jupiter.sun.csd.unb.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!garfield!jupiter!r90pReferences:
<1991Mar20.193859.11943@m.cs.uiuc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!garfield!jupiter!r90p From: r90p@jupiter.sun.csd.unb.ca (Schultz) Newsgroups: comp.sys.atari.st,comp.sys.atari.st.tech Subject: Re: ST Disks & Sparcstation Drives Message-ID: <1991Mar21.045427.5970@jupiter.sun.csd.unb.ca> Date: 21 Mar 91 04:54:27 GMT Article-I.D.: jupiter.1991Mar21.045427.5970 References: <1991Mar20.193859.11943@m.cs.uiuc.edu> Organization: University of New Brunswick, Fredericton Lines: 118