(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) PowerPC Linux :
How do I get Linux to boot on a G4 with SCSI disks?
Whew. Thanks to Jim's suggestion, I managed to work through all the details and got YDL1.2 to boot on my 450mHz G4 Sawtooth with SCSI disks.
Here's the conundrum: BootX won't work, so you have to use yaboot. Unfortunately, yaboot likes to use open firmware aliases and there aren't any for your SCSI drives. So, it appears that yaboot won't work with SCSI. However, this isn't true. It will work if you specify fully-qualified device names (just like you would have to in linux if you didn't have aliases or soft links to complex paths). I guess that sooner or later I'll figure out if it's possible to set up the aliases in OF, which will make this procedure a lot easier. For now, though, I have it working and so will probably proceed onto the rest of the installation.
Heres what you do:
Install YDL1.2 by booting the CD and following the instructions. This should go off without a hitch. Be careful to remember the SCSI device ID and number of the boot partition. You'll see why you need this in a sec. Also, load your MacOS Software Install CD. If things get screwed up, you can always reboot from that. It will be important to be able to reset your startup drive because you'll be messing with OF's boot-drive environment variable. If you mistype something, all you have to do is reboot from the CD and reset the startup disk using the control panel and reboot.
So...
First--boot your system holding option-command-O-F. You'll wind up in a white forth interpreter screen. Forth is one of the few languages that's older than I am, having been designed to run telescopes by people who spent their daytimes sleeping. If you know forth, you will have no trouble figuring out what to do at the prompt. Otherwise, you'll be completely lost, as I was.
(There are a few Apple tech notes on the topic of the OF environment. These are technotes 1062, 1061, and 1044. Unfortunately, they hardly describe what you might need to know to fully appreciate the environment. But they do describe barely enough for you to figure out how to make sense of what's going on in this weird place. If you want to waste a Saturday figuring this out, like I did, read away...)
The first thing you have to do is to figure out what the path name is to the partition on your linux boot disk.
Type: dev / ls to see your device tree. Be careful here, neatness counts. Type dev<space>/<space>ls. Be careful where you put your spaces as they'll be interpreted differently than you would expect coming from a linux (or other) environment.
When this works you'll see a hierarchical representation of your hardware in ascii form. What you have to do is figure out where your linux boot partition is by looking at this mess. And it won't be entirely obvious how to do that.
The device tree will list devices down to a certain level of detail. It will stop at leaves that are just shy of the SCSI device id you're looking for. But you won't have any problem if you've written down your SCSI device and boot partition from the install.
Now you have to use your knowledge of the G4 hardware to figure out what's what. My G4 SCSI card is an ATTO ExpressPCIPro. (You can find this out by looking at the Apple Web Site, using the Apple System Profiler, or simple logical deduction after looking at the device tree.)
The card is plugged into a pci port that's been assigned an address of F2000000. Between the pci controller and the card is a pci bridge.
In the device tree, I see this: ... /pci@f2000000 ...
    /pci-bridge@d
....
        /ATTO,ExpressPCIProUL2D@4,1
...
            /sd
where the (...) means there's a lot of other junk intervening.
What this says is that the path to at least one of the disks can be written like:
/pci@f2000000/pci-bridge@d/ATTO,ExpressPCIProUL2D@4,1/yaddayadda
You've probably noticed that "yadda yadda" isn't in the device tree. "/sd" is in the device tree, but this isn't helpful. It's apparently an alias to something that hasn't been assigned. And what hasn't been assigned is the SCSI ID.
The full path name with SCSI ID and partition looks like this
/pci@f2000000/pci-bridge@d/ATTO,ExpressPCIProUL2D@4,1/@6:5
where 6 is the SCSI ID number of the drive in question, and 5 is the partition on the drive.
Now that you know what the fully-qualified path name should be to your disk, reboot in MacOS by typing "boot" or "reset-all".
To make yaboot work, be sure to use yaboot_0.5. For reasons I do not understand versions prior to 0.5 are not recognized by OF--at least not by MY OF on my G4.
To make yaboot work I put it at the "root" level of a MacOS partition on a SCSI drive with ID #6. "Root" level means this--when the Mac desktop boots--double click your hard drive icon. Put yaboot_0.5, yaboot.conf, and vmlinux in that window. Don't put them in a folder. (There's actually no reason you have to put these at the root level other than they make the typing easier. You can put them anywhere, just remember to fully qualify the name when you're writing yaboot.conf)
My MacOS partition is also #6. My linux boot partition is on the same SCSI drive at partition #7. My yaboot.conf looks like this:
-----
init-message = "\nWelcome to Yellow Dog Linux!\nHit <TAB> for boot options.\n\n" timeout = 10 default = linuxppc
image = /pci@f2000000/pci-bridge@d/ATTO,ExpressPCIProUL2D@4,1/@6:6,\vmlinux
     label = linuxppc
     root = /dev/sdc7
     novideo
----
I've also created a bootinfo.txt file which allows me to dual boot either to MacOS or Linux using BenH's script. Here's the file, just as Ben suggests we use it:
----
<CHRP-BOOT> <COMPATIBLE> iMac,1 PowerMac1,1 PowerBook1,1 PowerMac2,1 PowerMac3,1 PowerBook2,1 </COMPATIBLE> <DESCRIPTION> Yellow Dog Linux Bootloader </DESCRIPTION> <BOOT-SCRIPT> " get-key-map" " keyboard" open-dev $call-method dup 20 dump 5 + c@ 08 = if " Booting MacOS..." cr " boot /pci@f2000000/pci-bridge@d/ATTO,ExpressPCIProUL2D@4,1/@6:6,\\:tbxi" eval
else " Booting Yaboot..." cr " boot /pci@f2000000/pci-bridge@d/ATTO,ExpressPCIProUL2D@4,1/@6:6,\yaboot" eval
then </BOOT-SCRIPT> </CHRP-BOOT>
----
Placement of spaces is critical in this file. You have to type it EXACTLY like this or you get unpredictable results.
What happens is that when you boot your system, if you hold down the space bar (ASCII 20) you'll boot into MacOS. If you do nothing, yaboot will take over and shoot you into YDL.
Okay. Next step. Now you have to go back into OF and set it up to point to yaboot instead of it's traditional place to start MacOS, \\:tbxi.
Reboot and hold down option-command-O-F. Now you're back in weird world again.
At a prompt type
setenv boot-device (FILL IN YOUR FULLY QUALIFIED DEVICE NAME + either the path to yaboot, or the path to the dual boot script file you created above)
mine looks like this:
setenv boot-device /pci@f2000000/pci-bridge@d/ATTO,ExpressPCIProUL2D@4,1/@6:6,\bootinfo.txt
bootinfo.txt is the file containing the dual boot script. If I just wanted to boot into linux all the time, I'd have said:
/pci@f2000000/pci-bridge@d/ATTO,ExpressPCIProUL2D@4,1/@6:6,\yaboot
where "yaboot" is the name of my yaboot_0.5 file as I downloaded it from BenH's site.
Type "boot" (without the quotes) and watch it work. ...or...if it doesn't work you can either reboot into OF and make sure you didn't mistype something, or you can boot from your MacOS software install CD, reset the startup disk, and edit your bootinfo.txt and yaboot.conf files.
Now, whenever I reboot my G4, OF will launch it over to my bootinfo.txt script on the 6th partition of my #6 SCSI drive on my SCSI2. The script will run and see if I'm holding down the space bar. If I am, I get MacOS. If not, I get YDL.
I have no idea if booting this way somehow destabilizes the overall system. And, I'll probably have to add a few things to my yaboot.conf to make the graphics work in X right from the start.
But, I thought it was going to be totally hopeless, and it turned out it works.

Hope that was helpful.
Joe


joe@adaptivesilicon.com

Just need to add this to your excellent contribution. For those of you with Adaptec SCSI controlers in our new (2001) G4's, your machine will crash upon bootup. The solution, to date, is to remove the SCSI controller, See http://lppcfom.sourceforge.net/fom-serve/cache/1034.html
jbradsha@siu.edu
[Append to This Answer]
Previous: (Answer) How can I get ICQ to work thru IP Masquerading?
Next: (Answer) How do I map a 2button ADB mouse to left & right click?
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=898
[Search] [Appearance]
This is a Faq-O-Matic 2.718d.
Hosted by anduin.org and SourceForge Logo