The many consoles of Linux

October 1, 2005

People who are considering setting up serial consoles for their Linux machines often wind up a little bit confused about what's necessary and what sort of features are possible. A lot of this is natural, because the PC is fundamentally convinced that the console is the more or less mandatory video display.

This results in a situation where there are many different consoles in a Linux system. I'll inventory them, in the order that they get encountered during booting a system.

  1. where the BIOS output appears. Expensive servers (and expensive addins) can change this from 'only the video display'
  2. what the bootloader talks to; how to configure this varies with the bootloader.
  3. where Linux kernel messages go. This is set by the kernel's 'console=...' arguments; you can specify multiple places. The kernel listen for so-called 'magic SysRq' keys on all of these.
  4. what is /dev/console. This has to be a single real device, and is either the last console=... device listed or the video console.
  5. where you can log in after the kernel has finished booting, which is determined by what /etc/inittab says to start getty on.

/dev/console is what init talks to during system startup (and system shutdown). This means that it's where startup messages appear (barring things like Red Hat's simplified graphical boot process) and what you need to interact with during single-user mode or if an automated fsck fails and needs a person to help it out.

In many situations, the ideal answer for 'what device is the console' is 'both the video display and a serial line', and most of these many consoles allow this. /dev/console is the unfortunate exception; you have to pick just one, because the Linux kernel requires it to map to only a single real device.

(I sympathize with the Linux kernel about /dev/console, honestly. The issues involved with merging simultaneous input from multiple real terminal devices are kind of tricky, especially if you want to avoid hooking into very low-level input routines down in the depths of drivers.)

Written on 01 October 2005.
« Pinging weblogs.com in Python
Some problems in common definitions of 'spam email' »

Page tools: View Source.
Search:
Login: Password:

Last modified: Sat Oct 1 00:55:48 2005
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.