Question

I'm trying to add a switch to send linux kernel log to the serial console on XenServer6.

The kernel command options can be edited on the EXTLinux config file ( /boot/extlinux.conf ).

Here is an excerpt:

serial 1 115200
default xe
prompt 1
timeout 50

label xe
  # XenServer
  kernel mboot.c32
  append /boot/xen.gz mem=1024G dom0_max_vcpus=4 dom0_mem=752M lowmem_emergency_pool=1M crashkernel=64M@32M console= vga=mode-0x0311 --- /boot/vmlinuz-2.6-xen root=LABEL=root-tfnnfzfp ro xencons=hvc com2=115200,8n1 console=com2 console=hvc0 console=tty0 quiet vga=785 splash --- /boot/initrd-2.6-xen.img

label xe-serial
  # XenServer (Serial)
  kernel mboot.c32
  append /boot/xen.gz com1=115200,8n1 console=com1,vga mem=1024G dom0_max_vcpus=4 dom0_mem=752M lowmem_emergency_pool=1M crashkernel=64M@32M --- /boot/vmlinuz-2.6-xen root=LABEL=root-tfnnfzfp ro console=tty0 xencons=hvc console=hvc0 --- /boot/initrd-2.6-xen.img

What is the meaning of the triple dashes ( --- )on the command line?

Is it loading 3 boot files?

Was it helpful?

Solution

TL;DR Yes, it is. ExtLinux must load both Xen and the Linux kernel. It uses mboot.c32 to do this. --- separates the Xen image path and its command line from the Linux image path and its command line.

This is just the way that ExtLinux (indeed, all boot loaders in the SysLinux family) implement multiboot, which is necessary to load Xen.

Most simple boot configurations will load just a kernel. There's a way that the boot loader writes the command line where you would expect it. In Syslinux style:

label Simple
    kernel linux.c32
    append <linux kernel filename> <linux command line>

Or in Grub:

title Simple Boot
    root (hd0,0)
    kernel <linux kernel filename> <linux command line>

More complex boot configurations might load boot Xen and the kernel. These use a system called "multiboot", which loads both and gives them each their own command line. That allows you to pass Xen its commands and Linux its commands. You can even pass in another stage to load something else, like an initial ramdisk. In SysLinux style:

label Complex
    kernel mboot.32
    append <xen kernel filename> <xen command line> --- <linux kernel filename> <kernel command line> --- <initrd filename>

Or in Grub:

label Complex Boot
kernel <xen kernel filename> <xen command line>
module <linux kernel filename> <linux command line>
module <initrd filename>

If you were using grub, it actually specifies these in their own stanzas. Grub acts as sort of a super-bootloader in that it can have tons of little modules loaded into it for functionality such as multiboot (or different filesystems, etc). In that case, Grub does most of it magically without you knowing.

Syslinux and family divide labor differently. Rather than having one giant boot loader that must handle all situations, they have two layers that have many different pieces. On the top, they have the core boot loader that knows the system its booting (i.e. syslinux knows BIOS booting with files on FAT filesystem, pxelinux knows loading things over then network, isolinux knows loading files from a CD-ROM, etc.). Extlinux is just the one that knows how to boot off of an Ext2, Ext3, Ext4, or BTRFS filesystem.

Other common functionality is implemented as "comboot" modules, which can plug into any of the boot loaders. For example:

In the case of multiboot, they load the mboot.c32 module, which implements multiboot. Unlike Grub and family (which know about the multiple command lines), syslinux must include all of the modules and their commandlines in a single commandline. Since -- is often used as an argument separator in other programs, they chose to use --- to delimit the modules.

In this case, Xen requires multiboot, which is requiring that syntax to separate the command lines for the Xen Hypervisor Kernel and the Linux Kernel that runs as its initial privileged guest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top