U-Boot Consoles



The Serial Console

Being designed to run on embedded computers, U-Boot assumes that the serial console is always present and uses it as its initial console. Even if another device is configured as the default console, U-Boot still initialises the serial console very early in the boot process and sends messages to it until the real console device is initialised and ready to take over.

The LinkStation V2 has only one serial port which can be used either to communicate with the microcontroller or as a serial console. Read The Serial Port for the LinkStation V2 for a description of how it works and how to switch the serial port between the two. As U-Boot assumes that the serial console is always present, the serial port routines have been modified to check the state of the console jumper and to discard all serial console traffic if the jumper is off.

To use the serial console, set the jumper to on and start the LinkStation with the microcontroller watchdog disabled.

Net Console

As most users will not install the serial port, the net console is the default console. This can be easily be changed by modifying three environment variables and saving the new environment to flash.

The net console is the U-Boot driver which uses the UDP protocol with a default port of 6666 to send the console output to and receive the console input from a remote computer. You need to run netcat on the remote computer to communicate with the U-Boot net console. The communication is bidirectional. Netcat will display on your screen the console output received from U-Boot and will send your keyboard input back to U-Boot.

If U-Boot cannot contact the remote computer, it switches the console to the serial port. To show that it has changed the console, U-Boot makes the HDD LED blink with the pattern corresponding to the serial console (see The Reset Button below). The timeout period is 20 sec. U-Boot switches to the serial console even if the serial console jumper is off, effectively disabling the console communication. If this happens, U-Boot can still be controlled by the minimal console.

Minimal Console

The minimal console only works if the serial console jumper is off to allow the CPU to communicate with the microcontroller.

U-Boot for the LinkStation is designed to allow some control over the boot process even in the absence of a console. For this, it uses the power button (the big button at the front) and the reset button (the small red button at the back).

Before installing U-Boot, when the LinkStation is switched on, the power LED starts blinking, the original boot loader starts executing. It initialises the hardware and then boots the kernel from flash. The blinking power LED indicates that the watchdog in the microcontroller will reboot the LinkStation at the end of boot timeout period.

If U-Boot is installed, it disables the microcontroller watchdog and shows it by changing the blinking pattern of the power LED to a very slow one, the same pattern used to indicate sleep mode in normal operation. When the power LED starts blinking slowly at boot, U-Boot is counting down the boot delay before booting the kernel. The default boot delay is 10 sec. From the moment when the power LED starts blinking slowly and for the duration of the boot delay, you can control the boot process with the power and reset buttons.

The Power Button

If you push the power button and keep it pressed for more than 1 sec, the boot process will stop and the LinkStation will wait for a command. A stopped boot process is indicated by the power LED being lit solid. The effect is the same a pressing 's' on the console keyboard.

A long push of the power button acts as a toggle. If the boot delay count down is in progress, a long push of the power button stops the boot process. If the boot process is stopped, a long push of the power button restarts the boot process resetting the boot delay to its original value. The restart of the boot process is indicated by the power LED blinking slowly.

By default U-Boot supports three pre-configured boot commands:

  1. The first boot command will attempt to load and boot a file named boot/vmlinuz from the first hard disk partition, /dev/hda1. The file can be in any of the U-Boot bootable formats but a compressed ELF file is the preferred format. If it cannot load the file, U-Boot will fall back to booting the kernel from flash.

  2. The second boot command will boot the kernel from flash.
    Note:The original "encrypted" kernel image is not supported. You will have to replace it with a kernel image in one of the formats supported by U-Boot.

  3. The third boot command will attempt to boot in emergency mode (EM) from flash. It does this by passing the argument root=/dev/ram0 to the kernel.

    When the kernel boots in emergency mode, it mounts the initial RAM disk (initrd) as the root partition instead of /dev/hda1. The initial RAM disk is embedded in the kernel image and the kernel mounts it when passed "root=/dev/ram0" on the command line. Unfortunately, the original kernel ignores the command line received from the boot loader and reads the command line from flash. Read the section on EM mode in the installation guide if you intend to use EM mode.

You can cycle through the boot commands with the power button.

To see which of the three commands U-Boot is going to execute, press the power button quickly. The HDD LED will start blinking. The number of times the LED blinks, shows the number of the active boot command. For example, a pattern short on - short off - short on - long off, means that the boot command number 2 is active. U-Boot will repeat the blinking cycle for a total duration of about 5 sec counting from the moment the power button is released.

A short press of the power button while the HDD LED is blinking will advance the boot command to the next one.

Changing the boot command does not change the boot status. If the boot is stopped, it will not be restarted. If the boot is in progress, it will not be stopped but the boot delay will be reset to the original value.

The Reset Button

Two consoles are currently configured, the serial console and the net console. The first console is the serial console and the second console is the net console (nc). The net console is the default console.

The reset button can be used, similarly to the power button, to switch consoles. A press on the reset button (here, it doesn't matter how long you keep the button pressed) displays the currently active console using the HDD LED. Repeatedly pressing the reset button while the HDD LED is blinking will toggle between the two consoles. The blinking pattern is different from the one showing the boot command. The pattern which shows that the second (net) console is active is short off - short on - short off - long on. U-Boot will repeat the blinking cycle for a total duration of about 5 sec counting from the moment the reset button is released.

Pressing the reset button will switch to the serial console even if the jumper is off. This behaviour, left from the U-Boot port to the LinkStation V1 / HG, might change in a future release.