Linux kernel for SGI Visual Workstations

Bent Hagemark, Jeffrey Newquist
April 20, 1999

Here are some tips on how to compile and boot the Linux kernel on the SGI Visual Workstation -- this is NOT a complete guide.

As of 2.2.5 even more of the most important stuff specific to the Visual Workstation is in the normal linux source code.

This web page provides additional information required to compile and boot the Linux kernel on the Visual Workstation.


If you are not comfortable building Linux kernels from source and operating computers at their boot firmware you've reached this web page in error. I'm not pretending any of this to be "user friendly".

Someday all of this will be smooth as silk and this web page will be obsolete.


SGI does NOT SUPPORT you running Linux on your Visual Workstation!

If you think you have any problem with your computer the SGI support people will probably want you to boot up NT and debug stuff from there.

But, if your idea of "support" is posting questions (and answers!) to the linux kernel mailing list then you'll be right at home. Just follow the normal instructions found in the normal places. (Hint: read all the text files you can in the linux sources if you're unclear on "normal").

What you get...

What you will NOT get at this point is dmedia, 1394, accelerated X or gfx, or easy installation.

What you DO get is support for:

New stuff...

New stuff with the latest patch includes reboot and power-off support.

The latest Visual Workstation patches also includes the "multiple keyboard patch" from linux-usb as well as the entire 19990405 linux-usb code conveniently repackaged as a patch -- so, you do not have to pull down that code yourself. There are a few minor tweaks to get it to compile and run, but nothing particular to the Visual Workstation.

With the USB code quite functional you can now run Linux on your Visual Workstation pretty much stand-alone.

What you need...

Gather the following...
  1. 2nd Linux-based computer with a serial port and ethernet

  3. null-modem serial cable

  5. blank IDE disk
  6. blank dos floppy

  8. any Linux distribution (Red Hat, whatever)
  9. SGI Linux ext2 kernel loader, ext2load.exe (SGI ARCS PROM specific)

Here's what to do...

  1. Upgrade your PROM to V1.0002 if you haven't already:
    1. Download prom-image.gz
    2. As root: gunzip -c prom-image.gz | dd of=/dev/fd0
    3. Reboot and while in the PROM, flash the new PROM on the disk.
  2. put a copy of ext2load.exe in a FAT partition somewhere (/dev/hda1 is probably a FAT partition if you have kept the NT disk in your system).  The root directory of the FAT partition is probably a good idea where to put ext2load.exe.  If you don't have a disk with a FAT partition on it, you'll need to make one, or put ext2load.exe on a floppy.

  4. install Linux on that blank IDE disk

  5. Copy the / file system from any other (i386) Linux (don't wander into /proc), or run an install on that 2nd Linux system.  If using tar, make sure to add '-p' when untarring to preserve permissions.  Make sure there's a 1777 /tmp and /var/tmp on the new /. Make sure /dev/null is 666, etc.  If you're running Red Hat, type 'rpm --setperms --setugids -a' to fix permissions and user/group IDs.

    Here's a list of Red Hat 5.2 rpms for a most minimal system you can rlogin into and do interesting things like rebuild the kernel.

    Aside from setting up the network config (/etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-eth0, /etc/hosts...) fix up a few teensy things on that disk:

    1. /dev/console

    2. Make sure /dev/console is char (5,1).  If it isn't, then remove it and 'mknod /dev/console c 5 1'.
      If you want to force the console to the serial port, either pass console=ttyS0,9600 as a boot option or hardlink /dev/console to /dev/ttyS0 (major 4, minor 64).
    3. /etc/inittab

    4. A default initstate of 1 (single user) might be a good idea (make sure the console is ttyS0 as described above). You'll have to manually "init 3" from the single user prompt.
    5. /etc/fstab

    6. Make sure root is the proper device.
    7. /etc/passwd

    8. With Red Hat /etc/passwd is pretty secure. You generally can't log in as root so make sure to create an account with a password you know before you try a multiuser bootup.

      Diddling /etc/securetty might be a good idea as well.

    NOTE: Be sure to write down your root partition (i.e. /dev/hda1, /dev/hdb5, etc), as this will be needed later to enter in the PROM boot configuration screen.
  6. wire up the serial cable

  7. [OPTIONAL] Run "cu" on the 2nd Linux box to get to the serial console on the Visual Workstation.
  8. kernel

  9. For most initial use you can just grab a pre-compiled kernel.  Put the kernel in /boot and be sure you know the name (e.g. vmlinux-2.2.5).
  10. setup the PROM to boot the kernel
    1. Boot the machine and press ESC to abort boot.
    2. Click "Startup Settings".
    3. Click "New", and enter the following:

    4. Load Identifier: Describe the OS (e.g. "Red Hat 5.2, kernel 2.2.5")
      OSLoader: ext2load.exe
      OSLoadFilename: multi(0)disk(1)rdisk(0)partition(3)/boot/vmlinux-2.2.5
      • If your root partition is on /dev/hda, use "disk(0)", and "disk(1)" otherwise.
      • To determine what to set "partition()" to, count the partitions (primary or logical), skipping any "extended" partition.  When you get to the root partition, use that number.  For example, 2 primaries (hda1 and hda2), one extended (hda3), and 3 logical (hda5, hda6, hda7), with root=/dev/hda6, use "partition(4)".
      • Put the path to the kernel on the root partition in place of "/boot/vmlinux-2.2.3" if yours is different.
      OSLoadPartition: set to anything, we're overriding it in OSLoadFilename
      System Partition: select the FAT partition (or floppy) the ext2load.exe file is on.
      OSLoad Options: root=/dev/hdb3 console=ttyS0,9600
      • Put the correct root partition device using "root=..."
      • The "console=..." specifies what console should be used.  In this case the console is being redirected to /dev/ttyS0 at 9600 baud.
      • Refer to the linux kernel for further information on the options line.
    5. Click "Default" to make this boot configuration the default.
    6. Click "Save & Exit"
    7. Click "Start System"
  11. boot it!

  12. If you're in the PROM menu, click "Start System"
  13. single user

  14. You should see the familiar linux kernel messages on the serial port (and/or on the monitor) pretty instantly after the boot loader jumps to the kernel. And, the 2nd line should say "Silicon Graphics 320..."

    Eventually you'll get the single-user prompt. Go to multiuser by doing "/sbin/init 3". This fires up the networking servers and eventually prints a login prompt on the serial port and/or the gfx frame buffer.

  15. See "SGIVWFB: Framebuffer Device for SGI Visual Workstations" to set for further configuration, including X.

Pre-made kernel for the Visual Workstation

Grab this kernel file.

Note that RAM size is hardwired to 128Mb, and it has most things like network, SGIVWFB fbdev console support, and USB built-in. .

Rolling your own kernel for Visual Workstation

Get the 2.2.5 kernel sources via Linux HQ (or your favorite distribution point).

(Other kernel revs probably work fine with these patches, but these were generated relative to 2.2.5...)

Read the top level README of the kernel sources forwards, backwards, inside out, up and down. And, then... read it a few more times.

Visual Workstation patches

Know patch(1) inside and out... consider the patch(1) man page and/or "patch --help".

There are some patch files relative to 2.2.5 available here.

Note on memory size

The Visual Workstation hacks to the Linux kernel do NOT automatically size memory -- hence the term "hacks"! It's hardwired to 128 MB (all Visual Workstations have at least 128 MB). Look at arch/i386/kernel/setup.c and set MEGS to whatever is appropriate if you want to use more of your RAM.

Making the kernel

Using "make xconfig" or "make menuconfig" consider the following configuration options.

"make dep"

"make -j 2 vmlinux" ("-j 2" is especially interesting on systems with 2 cpus)

Buttons and plugs

The sorta recessed horizontal button is the reset switch.

The round one below it is the power button. Hold it down for 6 seconds to turn off the power.

The thick black cable leading to the receptacle with 3 metal prongs is the power cord. If you have ANY strange h/w issues unplug that and go stretch for a few minutes. When you plug it back in the power and fans will come on. If you STILL have trouble UNPLUG the power, open up the case, and disconnect the power supply control connector from the motherboard, close up the case, and then plug the power back in -- be ready for the machine to just turn on at this point (a known boot firmware issue with a fix available soon).


In no particular priority with no attempt at completeness: