Skip to main content
University of Glasgow
A-Z : ACADEMIC DEPARTMENTS | SERVICES | STAFF |
Faculty of Information and Mathematical Systems > School of Computing Science
Home

Booting into Linux on the iMac

This is a step-by-step overview of how Linux boots to a "standard" graphical desktop (Gnome or KDE) on an iMac (an other New World machines). It might be usefull to understand where exactly things went wrong if your system doesn't boot. My iMac runs Mandrakelinux (10.1, at the moment), so some details are Mandrakelinux-specific. Other distro's might have a sligthly different way of starting X, but by and large it's like this.

1. Power on

iMac boots into Open Firmware (OF). Even for normal MacOS boot, OF is always the first stage on a New Word machine.

2. OF "boots" Yaboot

OF boots whatever the boot-device variable is pointing at. (You can try this out for yourself:

> setenv boot-device hd:5,\\:tbxi
> boot

This will boot MacOS 9 on my iMac, because MacOS 9 is on partition 5.

> setenv boot-device hd:7,\\:tbxi
> boot

This will boot Linux on my iMac, because Yaboot is on partition 7.)

3. Loading the kernel

Yaboot loads the kernel (based on the content of the /etc/yaboot.conf file)

4. The kernel boots

The kernel boots and (by default) starts the init program. That's why you must specify the path to the root partition in yaboot.conf. It's passed on to the kernel, and used to find init.

5. init does its job

init looks in /etc/inittab for the runlevel (5 for graphical login), and starts all initialisation scripts associated with the runlevel (all scripts in /etc/rc.d/rc5.d. These are scripts to load drivers, set the keyboard, start services etc.

6. init starts the graphical window system

init starts a script ( /etc/X11/prefdm on Mandrakelinux) which will in its turn start the graphical desktop. This script will take different actions depending on how your login is configured:

7a. Autologin

In case of autologin (login as default user without having to type your password), this script calls the autologin program. This program looks in /etc/sysconfig/autologin to know which user to log in and what to do next. By default it runs the startx script. This script (startx) runs the xinit progam, which starts the X server and runs the /etc/X11/xinit/xinitrc script, which in its turn runs yet another script (/etc/X11/Xsession), which again runs a few more scripts ... at least that's how it is in Mandrakelinux, totally convoluted. For a shortcut see later. Anyway, and finally the X window system will start up.

7b. Gnome/KDE login

Otherwise, the script (prefdm) will start gdm, the Gnome login manager (or kdm, the KDE login manager). This program (gdm) finds all its configuration information in /etc/X11/gdm/gdm.conf.It will display a graphical login screen, and on succesfull login, starts the X window system etc (see 8.) (Actually, gdm uses the X window system to display the login screen, but restarts in on succesful login).

8. Gnome/KDE starts

Typically, after X has started, Gnome (or KDE, depending on the contents of /etc/sysconfig/desktop) will be launched. This is done by executing the program gnome-session, which in its turn will start all programs needed for the desktop (session manager, panel, nautilus, window manager, ...)

9. Summary:

OF->Yaboot->Linux kernel->init->prefdm->autologin->startx->xinit->X->[convoluted Mandrakelinux scripts]->gnome-session

10. A shortcut:

The Mandrakelinux scripts to start the graphical desktop are extremey convoluted because they check lots of things like language, keyboard etc. It is possible to skip all of them simply by creating a file called .xinitrc in your home directory. Mine looks like this:

#Fix the keyboard
/usr/X11R6/bin/xmodmap /local/home/wim/.Xmodmap
#Start Gnome
exec gnome-session

11. An even shorter cut:

You can also skip the prefdm script completely by changing the last line/etc/inittab to

x:5:respawn:/usr/sbin/autologin

and you can change /etc/sysconfig/autologin to directly launch xinit instead of startx

This will take you via the shortest possible route to your Gnome session: autologin->xinit->gnome-session

Last modified: Mon 10 Jan 2005 16:32 GMT