Modem Working on 12" G4 Powerbook

David Chart yellowdog-general@lists.terrasoftsolutions.com
Fri May 2 11:30:01 2003


12" G4 Powerbook Modem

This is what I did, and it has worked. I make no claims that it will
work on anyone else's machine, or, indeed, not damage anyone else's
machine. It is also entirely possible that I did something very bad
while compiling my kernel, as I've never done this before. Indeed, the
first time I tried I managed to compile without keyboard support, which
was embarrassing... Caveat utor!
I have dial-up access only, so I have no access to the internet from
Linux when I start. I do have access from OS X, and an HFS transfer
partition which is automatically mounted on /transfer in Linux.

I should also note that I did a workstation install, and added kernel
development files (and gnome). Some of the files I mention are kernel
related, and may have come with the kernel development option. My
procedure drew heavily on Stephan Bruda's howto on the Yellow Dog
website, but since it wasn't just a case of doing what he did, I'm
posting the full version.

Downloads

These must be done from OS X, and I used Camino. I doubt that matters,
though.

The stock YDL 3.0 kernel will not support the modem driver, so you need
a new kernel.

Go to http://www.kernel.org/ and download the latest 2.4.x kernel
sources. As of the time of writing, this is 2.4.20, but 2.4.21 is in
release candidate stage, so that may not last long.

Also download benh's most recent patch.
http://www.penguinppc.org/dev/kernel.shtml
As of the time of writing, this is 2.4.20-ben10.

Finally, the modem drivers. Go to http://www.linuxant/com/drivers/ and
download the latest hcfusb...ppc driver. As of writing, this is
hcfusbmodem-0.99lnxbeta03042703ppc.tar.gz

Copy all the files to your transfer partition. The file name for the
modem driver is too long, so rename it. I called it modem.tar.gz.

Reboot into Linux.

The Kernel

First, copy your three downloaded files to your home directory.
Next, open the kernel sources.
tar jxvf linux-2.4.30.tar.bz2 [if you downloaded a later version,
substitute that number]

Now uncompress benh's patch.
bunzip2 patch-2.4.20-ben10

Now apply the patch. Do this from your home directory, which should now
contain both a linux-2.4.20 directory and a patch-2.4.20-ben10 file.
patch -p0 --verbose < patch-2.4.20-ben10
Note the direction of the arrow: patch takes its input from stdin and
that arrow feeds the following files to stdin. There are other ways to
do it, but this is what worked for me.
Lots of feedback will scroll up the screen as the source is patched. It
doesn't take long.

Now:
cd linux-2.4.20
You need to configure the kernel. I cheated wildly and copied Yellow
Dog's configuration.
cp /boot/config-2.4.20-8d .config
Then
make menuconfig
Most of the settings are correct. Scroll down to the USB settings, and
change USB serial support from a module to compiled into the kernel.
(Note: this may be unnecessary, but I did it and it worked.)

make deps
make vmlinux
These two make the kernel.

make modules
Now become root.
make modules_install
cp vmlinux /boot/vmlinux-2.4.20-ben10
cp System.map /boot/System.map-2.4.20-ben10
This installs the new kernel. Now you have to set yaboot to know about
it.

Still as root:
gedit /etc/yaboot.conf
Copy the 'image=/boot/vmlinux-2.4.20-8d' section. (I.e. that line and
all the indented lines below it.)
You should now have two identical image sections in the file.
Edit one of them:
image=/boot/vmlinux-2.4.20-ben10
label=benh
The other lines can be left the same, it seems. (If someone could tell
me what initrd-2.4.20-8d.img is, I'd be interested.)

Before you can boot the new kernel, you need to run ybin. As root, type
ybin
and press return. (If it isn't found, try /usr/sbin/ybin instead.)

Reboot.

At the first prompt, press 'l', because you still want Linux.
At the second, type benh.
This will boot your new kernel. Everything went flawlessly on my
machine.

Modem Driver

Unpack the modem driver
tar zxvf modem.tar.gz
This gives you a directory like hcfusbmodem-0.99lnxbeta03042703ppc

cd to it. (cd h<tab><return> is probably the easiest way.)
Become root.
make install

The last message tells you to run /usr/sbin/hcfusbconfig
So do it.
Let it automatically configure your hardware.
Pick your country.

Let it automatically recompile the modules. Make sure that it is
pointing at the ben10 kernel sources -- mine did so automatically, but
checking doesn't hurt.
This should succeed, with no errors or unresolved symbols.

Modem Configuration

Open 'System Setting->Network' from the menu with the friendly doggy at
the top.
Go to Hardware, and click New.
Add a modem.
The device is /dev/modem, which you will probably have to type in -- it
wasn't on the drop-down menu I got.
Set the baud rate to 115200, and hardware flow control.
Save the settings, but a restart is not necessary.

Dial-up Configuration

I used kppp, so these instructions will need to be changed for other
software.
Launch kppp, and choose 'Setup'.

Go to the 'Device' tab and increase the modem timeout to 80 seconds.
Also, set the baud rate to 115200. The modem hung up immediately when I
had it set to 57600.

Then go to the 'Modem' tab and press 'Query Modem...'. This should work
and produce information about the modem.

Type in your ISP details.

Connect.

No noises, but a fully functional net connection (at least as far as I
can tell from brief examination).

Default Kernel

If this all works, you probably want to make ben10 your default kernel.
Edit yaboot.conf so that default=benh (not defaultos, which is near the
bottom -- leave that as linux).
Run ybin so that the changes take hold.
-- 
David Chart
http://www.dchart.demon.co.uk/
PGP Key: 1786 15B1 53A3 7ED0 CBD4 AFBE 9B61 6D10 46C9 1CBE