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.
WARNING #1If 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.
WARNING #2SGI 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:
- serial port
- IDE disk and cd-rom
- on-board PCI Ethernet (Intel 82557)
(except when using USB!)
- SGIVWFB framebuffer driver for console and unaccelerated graphics
- Unaccelerated X through the framebuffer driver
- USB keyboard and mouse (using the 19990405 linux-usb code)
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.
Gather the following...
What you need...
- 2nd Linux-based computer with a serial port and ethernet
- null-modem serial cable
- blank IDE disk
- blank dos floppy
- any Linux distribution (Red Hat, whatever)
- SGI Linux ext2 kernel loader, ext2load.exe (SGI ARCS PROM specific)
Here's what to do...
- Upgrade your PROM to V1.0002 if you haven't already:
- Download prom-image.gz
- As root: gunzip -c prom-image.gz | dd of=/dev/fd0
- Reboot and while in the PROM, flash the new PROM on the disk.
- 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.
- install Linux on that blank IDE disk
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:
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.
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).
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.
Make sure root is the proper device.
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.
- wire up the serial cable
[OPTIONAL] Run "cu" on the 2nd Linux box to get to the serial console on the Visual Workstation.
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).
- setup the PROM to boot the kernel
- Boot the machine and press ESC to abort boot.
- Click "Startup Settings".
- Click "New", and enter the following:
Load Identifier: Describe the OS (e.g. "Red Hat 5.2, kernel 2.2.5")
OSLoadPartition: set to anything, we're overriding it in OSLoadFilename
- 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.
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.
Click "Default" to make this boot configuration the default. Click "Save & Exit" Click "Start System" boot it!
If you're in the PROM menu, click "Start System"
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.
See "SGIVWFB: Framebuffer Device for SGI Visual Workstations" to set for further configuration, including X.
Pre-made kernel for the Visual WorkstationGrab 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.
- visws specific hacks
- flatpanel support patch (2.2.5-2.2.7), run "patch -p4" from the linux directory.
- printk serial patch [FOR DEBUGGING ONLY]
- generic USB code in patch form
This is the USB code from linux-usb including the kbd patch. (This is NOT the USB code in newer 2.2.x kernels.)
There's nothing visws-specific in this patch. (This is in a separate patch to make it easy to exclude USB totally or let you take care of USB yourself in your own way)
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.
- Prompt for development.... Y
- Processor Type...
- Symmetric multi-processing... N if you want USB
Here is a big tradeoff: if you want to run SMP then you can NOT use USB and vice versa.
- General setup
- SGI Visual Workstation support... Y
- PCI support... Y
- PCI quirks... Y
- Block devices
- Normal PC floppy... Y
- Enhanced IDE... Y
- Include IDE/ATA-2 DISK... Y
- Include IDE/ATA-2 CDROM... Y
- Networking options
- Network device support
- Network device support... Y
- Ethernet... Y
- EtherExpressPro/100... Y
- Character devices
- Virtual terminal... Y
- Support for console on virtual terminal... Y
- Standard/generic (dumb) serial support... Y [OPTIONAL]
- Support for console on serial port... Y [OPTIONAL]
- Console drivers
- VGA text console... N (that's right: NO)
- Support for frame buffer devices... Y
- SGI Visual Workstation framebuffer support... Y
- Advanced low lever driver options... Y
- 8/16/24 bpp packed pixels... Y
- Support only 8 pixels wide fonts... Y
- Select compiled-in fonts
- VGA 8x8 font... Y
- VGA 8x16 font... Y
- Universal Serial Bus (USB)
- USB Support... Y
- Universal Host... (UHCI)... Y
- Human Interface Devices Boot Protocol (HIDBP)... Y
- Boot Protocol Keyboard... Y
- Boot Protocol Mouse... Y
"make -j 2 vmlinux" ("-j 2" is especially interesting on systems with 2 cpus)
Buttons and plugsThe 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:
- "holey" memory
- video I/O
- audio I/O
- easy Linux distribution install and recovery