Discussion:
Bootable disk for OldWorld NuBus PB 5300?
(too old to reply)
Kevin Lamonte
2005-03-16 22:53:49 UTC
Permalink
I'm trying to install ANY linux distro on a PowerBook 5300cs and running
into so many problems it's silly.

Hardware: PB5300cs, 16MB RAM, 500MB IDE, 512K VRAM (640x480x8)
Floppy drive + serial port. No ethernet. No CDROM.

I've got the 500MB drive partitioned as follows: 240MB Linux, 50MB
swap, 210MB MacOS. I currently have 110MB free on the MacOS side and
would like to place the base packages of ANY distro in a folder and have
them installed. Once there I could PPP my way through the serial port
to the rest of what I need.

Experiences:

1) The mkLinux extension will boot the stock "Mach Kernel" and load a
vmlinux+installer. However, the installer can only install via network
or CDROM. It can't mount the MacOS partition, and when I Ctrl-Z out of
it I can't mount a floppy, load modules, or anything else that could
bootstrap the process.

2) The "Mach_Kernel" from
http://www.symsys.com/~ingram/hardware/powermac/Mach_Kernel is the only
other kernel I've found that won't hang on the splash screen of the
mkLinux booter (as in it will emit some kind of output on the screen).
However, after it comes up the keyboard doesn't work.

3) I have no clue if the mach_options= line in lilo.conf is actually
doing anything.

Does anyone have a kernel that I can boot from floppy and land on a
prompt with, that can mount HFS? I'm just getting very agitated that
nothing seems to work.
Kevin Lamonte
2005-03-30 23:29:34 UTC
Permalink
I got it working. For the benefit of all who may come later, here is
most of the procedure:


Installing Debian Woody on a PowerBook 5300
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Introduction

I was helping someone move and noticed that they had a PowerBook
5300cs lying around. They offered it to me for free because no one
had picked it off the last two garage sales, even at only $10. This
one was in really good shape, only needing a new battery (eBay $25)
for production use. I had never had a chance to use MacOS before or
Linux-on-Mac, and I was curious what programming a PowerPC chip would
be like.



Audience

You need to understand a lot about Linux from a user standpoint. This
is not for the faint-of-heart.

This PowerBook is my first Mac EVER. I had used MacOS 8.x
occasionally during university, and knew just enough to fire up a web
browser and ignore it. To get things working, I encountered almost
all of the typical PC-to-OldMac stumbling blocks. This account should
provide a roadmap for others trying in the future.



Why bother?

Don't do this if you need a fast production laptop with lots of RAM
and X running. This procedure took me several days to iron out, and
for the price of that time you can easily find a sub-$100 Intel-based
laptop more than capable of running Linux + X.

Do this if you already know MacOS (and have software for it) or the
physical size of the machine matters a lot. The 5300cs has a very
small desktop footprint and is rather rugged for machines of its day.



Hardware

This PowerBook has NuBus, 16MB RAM, 515MB IDE hard drive, Mac
mini-din8 RS422 serial port, and floppy. No ethernet, no PCMCIA
drivers to put an ethernet card in, and no CDROM. This procedure
should work for most similarly-limited OldWorld Macs.



Part 0: How to transfer files from Linux to Mac

(It took way too long for me to figure this out.)

First, when you download Mac files, DO NOT USE MOZILLA. Use wget
instead. I don't know why exactly, but Mozilla 1.7 ruined the files
as they came down. Find a file, copy the URL, then from a terminal do
'wget URL' and it will come down OK.

Second, install hfsutils for your particular distro.

Third, get a blank 1.44MB floppy. Do the following:

# hformat /dev/fd0
# hmount /dev/fd0 <-- this might not be necessary right after
hformat
# hcopy /path/to/local/file :
# humount

Note that we don't provide hmount or humount a local mount point.
Also, the target filename for hcopy must start with a colon. We
re-use the disk for multiple file transfers:

# hmount /dev/fd0
# hdel Filename\* <-- you CAN use wildcards, escape them so the
shell doesn't expand them
# hcopy /path/to/new/file :
# humount

Finally, you may find on occasion that Linux complains of 'I/O error'
on what WAS a perfectly good floppy. This happened to me when I put a
Debian boot floppy in that wouldn't work and had to remove the floppy
by using a paperclip to press the recessed "floppy eject" button while
the Mac booted. (The Debian floppy was bootable, but I couldn't get
it ejected the normal way. Hence the override.) I suspect the floppy
controller automatically flags the disk as 'bad' so it won't be used
again to boot.

You can get the floppy back in service by booting the Mac, inserting
the floppy, initializing it if necessary, then dragging the floppy to
trash to eject it. I haven't found any way to fix them in Linux.



Part 1: Get MacOS happy

The single most difficult thing to do with a Mac is getting it to boot
when you don't have a Mac on-hand to create boot disks. Fortunately
for me, I did have a set of MacOS 7.5.2 + System Enabler 1.2.1
floppies that came with the machine, so I was able to re-install MacOS
from scratch.

If you don't have boot floppies, you can acquire them at
http://www.info.apple.com/support/oldersoftwarelist.html . Scroll
down to "System Software Downloads", and grab the nineteen files
starting with
Macintosh/System/Older_System/System_7.5_Version_7.5.3/System_7.5.3_01of19.smi.bin
.

I've heard that one can make a Mac bootable simply by booting on a
floppy and dragging all the floppies' files to the hard drive. There
are some copies of bootable floppies out there that a PC can create.
http://infolinux.de/ppc/a_ux_hd_setup.disk contains the Apple SCSI
hard disk setup program. I also have a copy of the PowerBook 5300
Disk Tools diskette at [[ TODO: URL ]]. Hopefully if your PowerBook
has no software one of these disks will get you moving.

While at the Apple Support Site, grab these too:

Macintosh/System/System_7.5.5_Update/Sys_7.5.5_Update-NetInstall.sea.bin
Macintosh/Utilities/Disk_Copy/Disk_Copy_6.3.3.smi.bin
Macintosh/Utilities/Drive_Setup/Drive_Setup_1.6.1.smi.bin

You'll now need Aladdin's Stuffit Expander to extract all the other
Mac files you download. The file you're looking for is
aladdin_exp55.hqx . Google shows numerous places to get it.

With all of this downloaded, follow this sub-procedure:

A. Use either one of the Disk Setup / Disk Tools disks to
re-partition the hard drive. Create three partitions: 240MB,
210MB, and 50+ MB. Note their names. When you install MacOS
later, make sure you install on the 210MB partition.

B. Make your system bootable. I would add more detail here but I
expect this step may require lots of experimentation to work.

C. Copy the Disk_Copy_6.3.3.smi.bin file to a floppy using hcopy.
Put it in the Mac, it should show up as a floppy icon with a
single file in it. Execute the file, and automagically a
second disk icon should appear on the desktop. Copy the files
out of the new disk icon and onto the actual hard drive
partition. Don't put it on the Desktop, that won't copy the
file to the hard drive; put it on the hard drive proper. Put
the "new" disk icon on the trash (unmount the virtual disk).

D. Reboot: select "Special" on the Finder menubar and then
"Restart". The floppy should eject on its own before the
system reboots.

E. Copy each of the MacOS 7.5.3 disks (19 in all) to a floppy
using hcopy and transfer it to the Mac. With each file, use
the Disk Copy program to put it on a new blank floppy.

F. Put the System 7.5.3 disk 1 disk in the floppy. Open it and
run the installer. It will prompt you for each additional
disk. At the end of the install, it should ask to restart and
when you next come up you will have System 7.5.3 on your hard
drive.

G. If you used the Disk Tools disk to partition, you may notice
the Linux partitions on your desktop. If you used the Apple
A/UX setup disk instead, you can skip the Part 2 'pdisk'
section below.

After we get ZTerm up and running you can use ZModem to transfer the
7.5.5 update over and run its installer. MacOS 7.5.5 is reputed to be
the fastest MacOS for this system.



Part 2: pdisk

pdisk is a utility originally written for the MkLinux project to
create A/UX partitions on a Mac hard disk. It can be acquired at
http://www.cfcl.com/~eryk/linux/pdisk/dist/ . Grab the PPC binary,
install it on the Mac.

When you get pdisk up and running: make sure you show the device list
('L' command) and WRITE DOWN the BASE and LENGTH numbers of ALL
partitions. Delete the placeholder Linux partitions and recreate
them, using exactly the same BASE and LENGTH numbers you wrote down.
Write the new partition table and restart immediately. On the next
boot you should see that your Linux partitions no longer appear on the
desktop.



Part 3: ZTerm

OldWorld Macs like the PowerBook 5300 have a strange serial port.
First, the physical plug is a mini-din8 female connector. Second, the
transmission standard is RS-422, not RS-232 like most PCs. You can
easily get a Mac to talk to a PC using a "Mac modem" cable, or make
your own. I actually found a Mac modem cable in the "garbage area" at
work and used that. However instructions for making your own are
available at several places:

http://ccadams.org/se/serial.html
http://www.mayin.org/aragorn/computers/serial.html

[[ TODO: Verify that the cable works ]]

Getting the larger files over from PC to Mac will take a lot of time,
and more importantly a working serial link. Download ZTerm 1.0.1 from
http://homepage.mac.com/dalverson/zterm/ . Install it on the Mac.

When ZTerm comes up, select the "Printer/Modem Port" and set the port
speed to 57600. (This was the fastest I could go without encountering
CRC errors.)

When ZTerm comes up to the terminal screen, simply begin uploading the
files from the Linux PC (minicom: Ctrl-A S, space to select files,
enter to begin upload). ZTerm will autostart ZModem download.

Now that you have ZTerm installed, you will almost certainly find it
more convenient to use for small file uploads.



Part 4: Utilities

MacGzip: find it at http://persephone.cps.unizar.es/general/gente/spd/gzip/

You will need MacGzip to decompress the kernels you get from
nubus-pmac. Before you decompress a kernel, you may need to rename it
to end in ".gz" before MacGzip will read it.

To decompress a file, click it and drag it onto the MacGzip icon,
WHILE HOLDING DOWN SHIFT release the mouse button. Keep shift down
until you see MacGzip actually decompressing the file.



Part 5: Get Debian Woody to the MacOS disk

You'll need three files from the Debian site:

http://ftp.us.debian.org/debian/dists/stable/main/disks-powerpc/current/new-powermac/drivers.tgz
http://ftp.us.debian.org/debian/dists/stable/main/disks-powerpc/current/new-powermac/images-2.88/rescue.bin
http://ftp.us.debian.org/debian/dists/stable/main/disks-powerpc/base-images-current/basedebs.tar

Transfer them to the Mac. Keep their pathnames from disks-powerpc on,
i.e. put them on the disk as:

disks-powerpc/current/new-powermac/drivers.tgz
disks-powerpc/current/new-powermac/images-2.88/rescue.bin
disks-powerpc/base-images-current/basedebs.tar

Note that basedebs.tar is about 50MB. The only way to get it there
with this configuration is ZTerm. It will take a couple hours.



Part 6: MkLinux + nubus-pmac kernel

Download the Apple MkLinux Booter here:
http://nubus-pmac.sourceforge.net/nubus-pmac/Apple_MkLinux_Booter.sit.hqx

Uncompress the file using Stuffit Expander, then follow the directions
inside to put all the files in their respective places.

Download the Debian Woody installer kernel here:
http://nubus-pmac.sourceforge.net/nubus-pmac/test/MachKernel-Debian-woody-021029.gz

Download the regular Linux kernel here:
http://nubus-pmac.sourceforge.net/nubus-pmac/test/MachKernel-2.4.27-040811.gz

UNCOMPRESS THE KERNEL IMAGES USING MACGZIP.

Place the Woody installer kernel in the Extensions folder as "Mach
Kernel", overwriting the old "Mach Kernel" file. (MacOS: Select the
file, OpenApple-D to "Duplicate" it, then rename the copy, then
drag-and-drop the copy into the Extensions folder.)

Setup lilo.conf as follows:

rootdev=/dev/ram

Now restart, select MkLinux on the boot prompt. You should see a
Linux kernel booting shortly that will take you into the Debian Woody
installer.



Part 7: Perform the Debian installation

Now restart and select MkLinux. You should see a Linux kernel booting up.

You will have to help the Debian installer along from another console
as it progresses.

After the installation window appears, press Option-F2 to switch to
the second virtual terminal window. Press enter to activate the
console. On the second console, do the following:

# mkdir /macos
# mount -t hfs /dev/hda6 /macos

Option-F1 to return to the first console. Answer the prompts. When
it asks for files, point it to a pre-mounted directory and let it
search for them in /macos.

You may get an error on the configure modules page. This is because
the installer is calling depmod and expecting a
/target/lib/modules/2.4.xx-xxx directory to be there and it isn't.
Fix this:

Option-F2
# uname -a
< Note the full kernel version. Suppose it is 2.4.20-pre11: >
# mkdir /target/lib/modules/2.4.20-pre11
Option-F1

Retry the operation and it should go on.

After Debian installs basedebs.tar, restart the system. When the
MkLinux booter appears, select MacOS.



Part 8: Switch to the running kernel

Setup lilo.conf as follows:

rootdev=/dev/hda7
mach_options= keyboard_sends_linux_keycodes=1

Now restart, select MkLinux on the boot prompt. On this boot you'll
see a slightly different kernel load. You'll get a few more pages of
the Debian installation left, then you'll be back at a prompt.



Part 9: Get PPP up and running

The Mac serial port driver under Linux works immediately on bootup.
YOU CANNOT USE SETSERIAL ON MAC SERIAL PORTS. On bootup /dev/ttyS0 is
present and working at 38400.

Establish a PPP link between the PowerBook and a desktop PC. On the
Mac, do this:

[***@mac-pb5300]# pppd debug /dev/ttyS0 nopersist passive local
nodefaultroute noauth 192.168.0.200:192.168.0.100 linkname desktop

On the PC, do this:

[***@desktop]# pppd debug /dev/ttyS0 38400 local nodefaultroute
linkname mac

You should immediately see a ppp link between the Mac and the PC. The
Mac's IP address will be 192.168.0.200, the PC's 192.168.0.100.

Now you need to get the PC to masquerade for the Mac. On my Mandrake
10.0 PC, these steps did it:

[***@desktop]# modprobe iptable_nat
[***@desktop]# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
[***@desktop]# echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
[***@desktop]# echo 1 > /proc/sys/net/ipv4/conf/ppp0/forwarding

Back to the Mac:

[***@mac-pb5300]# route add default gw 192.168.0.100

Edit /etc/resolv.conf on the Mac to include a DNS nameserver.

You should now be able to reach the Internet from the Mac.



Part 10: Finish installing Debian

Once you can do DNS and telnet/ping/etc from the Mac, run apt-setup to
add some HTTP or FTP sources to your configuration. Note that this
will take quite a while at 38400. Then you can run dselect to finish
installing the applications you need in pieces.

dselect takes FOREVER to run when it first updates with the network.
There will be a period of up to ten minutes of thrashing while it
sorts through the apt repository information to put together the first
update.

You should install aptitude as quickly as possible and use that
instead of dselect to remove the excess packages the Debian base
install included. aptitude uses far less RAM and handles dependencies
better.



Caveats

DO NOT TRY TO UPGRADE TO SARGE. You will not have enough disk space.
You can manually download individual packages and install them, or you
can compile and install new stuff yourself. The sarge upgrade will very
likely fail in the middle and you'll have a set of mismatched libraries
that won't be able to run pppd again.
CWO4 Dave Mann
2005-03-31 01:45:25 UTC
Permalink
On Wed, 30 Mar 2005 17:29:34 -0600, Kevin Lamonte
Post by Kevin Lamonte
I got it working. For the benefit of all who may come later, here is
Installing Debian Woody on a PowerBook 5300
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(Snipped to save 60-baud bandwidth)


Thanks for the information. Very helpful and I appreciate your
efforts!

Cheers,

Dave






http://misterfixit.blogspot.com/

Study History - Know the Future

If you can read this, thank a Teacher;
Since it is written in English, thank a Soldier.
Derrik Pates
2005-04-03 00:52:07 UTC
Permalink
This PowerBook has NuBus, 16MB RAM, 515MB IDE hard drive, Mac mini-din8
RS422 serial port, and floppy. No ethernet, no PCMCIA drivers to put an
ethernet card in, and no CDROM. This procedure should work for most
similarly-limited OldWorld Macs.
As a Linux-on-PPC user (I'm using a PowerBook Pismo, running Debian sid),
just thought you'd like to know that if it's NuBus, it's not OldWorld.
OldWorld is a distinguishing line between the old-style boot process and
the new-style _only_ on PCI systems.
--
Derrik Pates
***@dsdk12.net
Loading...