Subject: mac68k IDE driver, second try
To: None <port-mac68k@netbsd.org>
From: Ken Nakata <kenn@synap.ne.jp>
List: port-mac68k
Date: 08/14/1998 20:01:17
Hi,

I've uploaded two new IDETEST kernels with slightly modified "wdc"
(NetBSD's name for the IDE controller chip) driver.  Also there is a
diff to /dev/MAKEDEV so that you can say "cd /dev; ./MAKEDEV wd0" as
root to create the necessary device files.  It will create wd0a
through wd0h and rwd0a through rwd0h.

The files are available at ftp://ftp.macbsd.com/private/kenn/IDE.
Make sure you cd directly to /private/kenn after logging in to
ftp.macbsd.com, as /private is world unreadable.  The kernels are
netbsd.IDETEST{,SBC}.1.tar.gz, and the MAKEDEV diff is MAKEDEV.diff
in that directory.  These test kernels are compiled with HWDIRECT adb
drivers, and ncrscsi (IDETEST) or sbc (IDETESTSBC) SCSI driver.

Much thanks to Michael Schmitz, a Linux-m68k Mac developer for
providing the information on the Mac IDE hardware, and to Yasuhiro
Endoh for his test results on the earlier test kernel.  Now I'm a bit
more confident than before that it won't damage your disk drive
hardware.

If you own a Mac with an IDE disk drive (i.e. PowerBook 150, Performa
580s, and Quadra/LC/Performa 630s, according to the latest Apple Spec;
if I'm leaving out anything else, please let me know), I'd appreciate
if you could try the following tests and give me any feedback:

TEST 1. Boot one of the test kernels and see if there are some lines
in the boot message like these:

wdc0 at obio0
wd0 at wdc0 drive 0: <QUANTUM MAVERICK 540A >
wd0: using 16-sector 16-bit pio transfers, chs mode
wd0: 516MB, 1049 cyl, 16 head, 63 sec, 512 bytes/sec

You can do TEST 1 without installing NetBSD on to your SCSI drives.
In that case, follow the instruction in the NetBSD/mac68k FAQ section
3.1.

OTOH, tests described below are not possible if you haven't already
installed NetBSD on your SCSI drives.  AFAIK, you cannot yet use Mkfs,
Installer, or Booter on an IDE drive, so you need at least a SCSI
drive to build a usable NetBSD/mac68k system for now.

TEST 2. Patch /dev/MAKEDEV as root:
	cd /dev
	patch </path/to/your/copy/of/MAKEDEV.diff
and make the device files:
	./MAKEDEV wd0
and finally do:
	disklabel wd0
If you get a similar output to what you'd get with "disklabel sd0",
it's a good sign.

TEST 3. If you can and feel like, do one or more of the following tests:

	3a. If you have hfsutils or hfs installed on your NetBSD
system, try to read your HFS partition on the drive.  E.g.:
	hmount /dev/wd0b
	hls

	3b. Make an A/UX Root&User partition on the drive with your
favorite disk partitioning tool, make filesystem on it as:
	newfs /dev/rwd0a
and try to mount it as:
	mount /dev/wd0a /mnt

WARNING: Do not perform TESTS 3a or 3b unless you are sure that TEST 2
was performed successfully on your system.  As newfs tries to WRITE to
your IDE drive, there is a chance that it will damage your data on the
drive (normally only the data, not the drive hardware itself).

I am also uploading the source and diff in a gzipped tar archive at
the same URL.  If for any reason you need a kernel built from older
source, you should be able to use it (the diff may not apply cleanly
to older source tree; you'll have to hand-apply it if that's the
case).

As usual, the standard NO-WARRANTY disclaimer applies, so you cannot
hold me responsible for whatever happens to your Mac or anything else
by doing any of these tests described herein.

Enjoy and TIA for any feedback,

Ken