[coreboot] Device mapping problem

Peter Stuge peter at stuge.se
Tue Apr 1 19:05:10 CEST 2008


On Tue, Apr 01, 2008 at 01:55:34PM +0200, Klaus Stammermann wrote:
> At first I can't boot my system with coreboot yet.

The initrd is still not found or loaded correctly.


> Here log of coreboot booting out of ttyS0:
..
> FILO version 0.5 (klausst at thor) Mon Mar 31 14:56:38 CEST 2008
> No sound device found
> boot: hda1:/boot/vmlinuz root=/dev/sda1 initrd=/boot/initrd.splash
> console=tty0 console=ttyS0,115200
> hda: LBA 2049MB: SanDisk SDCFX-2048
> Mounted ext2fs
> Found Linux version 2.6.18.2-34-default (geeko at buildhost) #1 SMP Mon Nov
> 27 11:46:27 UTC 2006 bzImage.
> Loading kernel... ok
> Loading initrd... ok
> Jumping to entry point...
> Linux version 2.6.18.2-34-default (geeko at buildhost) (gcc version 4.1.2
> 20061115 (prerelease) (SUSE Linux)) #1 SMP Mon Nov 27 11:46:27 UTC 2006

This output shows FILO booting the kernel /boot/vmlinuz, and
supposedly loading /boot/initrd.splash as initrd, on the first
partition of the 2GB CF card.

..

> md: Autodetecting RAID arrays.
> Time: tsc clocksource has been installed.
> md: autorun ...
> md: ... autorun DONE.
> RAMDISK: Couldn't find valid RAM disk image starting at 0.

However that kernel does not consider the initrd to be valid.


> VFS: Cannot open root device "sda1" or unknown-block(0,0)

And since there is no ATA driver built-in to your kernel, the kernel
can't find the root partition.


> And here /var/log/messages with original bios:

This is much like comparing apples with oranges. Please always use
the same method to collect debugging information. In this case that
means logging serial output also when booting with the factory BIOS.

syslog does not get all relevant output.


> Apr  1 11:37:13 (none) kernel: klogd 1.4.1, log source = /proc/kmsg started.
> Apr  1 11:37:13 (none) kernel: Linux version 2.6.22.9 (root at zenwalk) (gcc
> version 4.1.2) #1 SMP PREEMPT Sat Sep 29 22:22:07 CEST 2007

This is a different kernel from the one that FILO is trying to boot.


..
> Apr  1 11:37:13 (none) kernel: TCP reno registered
> Apr  1 11:37:13 (none) kernel: checking if image is initramfs...it isn't
> (bad gzip magic numbers); looks like an initrd
> Apr  1 11:37:13 (none) kernel: Freeing initrd memory: 622k freed

Now the initrd starts exeucting.


..
> Apr  1 11:37:13 (none) kernel: PPP generic driver version 2.4.2
> Apr  1 11:37:13 (none) kernel: ACPI: PCI Interrupt 0000:00:11.1[A] -> Link
> [LNKA] -> GSI 11 (level, low) -> IRQ 11
> Apr  1 11:37:13 (none) kernel: PCI: VIA VLink IRQ fixup for 0000:00:11.1,
> from 255 to 11
> Apr  1 11:37:14 (none) kernel: scsi0 : pata_via
> Apr  1 11:37:14 (none) kernel: scsi1 : pata_via
> Apr  1 11:37:14 (none) kernel: ata1: PATA max UDMA/133 cmd 0x000101f0 ctl
> 0x000103f6 bmdma 0x0001e000 irq 14
> Apr  1 11:37:14 (none) kernel: ata2: PATA max UDMA/133 cmd 0x00010170 ctl
> 0x00010376 bmdma 0x0001e008 irq 15

And during that time the pata_via driver is loaded, which finds your
PATA controller..


> Apr  1 11:37:14 (none) kernel: ata1.00: CFA: SanDisk SDCFX-2048, HDX 4.04,
> max UDMA/66
> Apr  1 11:37:14 (none) kernel: ata1.00: 4001760 sectors, multi 0: LBA
> Apr  1 11:37:14 (none) kernel: ata1.00: configured for UDMA/33

..which has the CF card connected..


> Apr  1 11:37:14 (none) kernel: scsi 0:0:0:0: Direct-Access     ATA     
> SanDisk SDCFX-20 HDX  PQ: 0 ANSI: 5
> Apr  1 11:37:14 (none) kernel: sd 0:0:0:0: [sda] 4001760 512-byte hardware
> sectors (2049 MB)
> Apr  1 11:37:14 (none) kernel: sd 0:0:0:0: [sda] Write Protect is off
> Apr  1 11:37:14 (none) kernel: sd 0:0:0:0: [sda] Write cache: disabled,
> read cache: enabled, doesn't support DPO or FUA
> Apr  1 11:37:14 (none) kernel: sd 0:0:0:0: [sda] 4001760 512-byte hardware
> sectors (2049 MB)
> Apr  1 11:37:14 (none) kernel: sd 0:0:0:0: [sda] Write Protect is off
> Apr  1 11:37:14 (none) kernel: sd 0:0:0:0: [sda] Write cache: disabled,
> read cache: enabled, doesn't support DPO or FUA
> Apr  1 11:37:14 (none) kernel:  sda: sda1
> Apr  1 11:37:14 (none) kernel: sd 0:0:0:0: [sda] Attached SCSI removable disk

..which is made available as /dev/sda using this particular kernel.


..
> Apr  1 11:37:14 (none) kernel: md: Autodetecting RAID arrays.
> Apr  1 11:37:14 (none) kernel: md: autorun ...
> Apr  1 11:37:14 (none) kernel: md: ... autorun DONE.
> Apr  1 11:37:14 (none) kernel: RAMDISK: Couldn't find valid RAM disk image
> starting at 0.
> Apr  1 11:37:14 (none) kernel: Freeing unused kernel memory: 228k freed
> Apr  1 11:37:14 (none) kernel: Linux agpgart interface v0.102 (c) Dave Jones

This last line shows that the root partition was mounted correctly.


..
> Apr  1 11:37:15 (none) logger: /etc/rc.d/rc.inet1:  /sbin/ifconfig lo
> 127.0.0.1

..and this is way into the boot scripts, which are irrelevant for the
problem.


On Tue, Apr 01, 2008 at 05:45:56PM +0200, Uwe Hermann wrote:
> > There are two differences I think that could be a problem.
> > At first there are two different size of memory detected:
> > coreboot: 222822k/229376k
> > origianl bios: 222384k/229312k
> 
> Not a problem, I think.

Correct, this is not a problem. Slightly more RAM is available using
coreboot. This is intentional and expected.


> > boot: hda1:/boot/vmlinuz root=/dev/sda1 initrd=/boot/initrd.splash
> > console=tty0 console=ttyS0,115200
> 
> This is the interesting part. Are you sure FILO views your disk
> (CF card?) as hda1?

Yes, his FILO does, according to the hda: blurb below.


> Is your /boot an extra partition (mount point) or is it part of the
> "/" filesystem on hda1?

Any way, the kernel FILO is booting is not the same kernel that gets
started when booting the factory BIOS.


> Are you sure Linux views your disk (CF card?) as /dev/sda1? Did you
> try /dev/sdb1?

/dev/sda1 will be correct but neither of the two kernels he has shown
logs from have the pata_via driver built-in and will never be able
to boot his system without the help of an initrd.


> Have you tried "root=801" instead of "root=/dev/sda1" in FILO (no
> idea what 801 is)?

The root kernel parameter accepts both device number and name.

0801 == major 8 minor 1 == /dev/sda1


> > Loading initrd... ok
..
> > RAMDISK: Couldn't find valid RAM disk image starting at 0.
> 
> Hm, doesn't look too good, but this also contradicts the
> "Loading initrd... ok" above.

The initrd loading does not check the initrd in any way, "ok" means
that the file was loaded successfully from the ATA device and nothing
more.


> > VFS: Cannot open root device "sda1" or unknown-block(0,0)
> 
> This is your problem. The "root=" line seems to be wrong, thus
> Linux cannot find/mount the "/" filesystem.

I now suggest for the third or fourth time that the problem is that
the kernel that is booted by FILO does not have the neccessary
drivers for the kernel to find and mount the root partition.

The way I prefer to accomplish this is the simplest method available
and therefore also what I consider the most most reliable and
deterministic:

Please please build a custom kernel with zero modules and make sure
to include the pata_via driver, so that your ATA device is found
without the help of a silly ramdisk. Expect to spend a few hours
going through the kernel configuration if you have never done so
before.


Another option is to make sure that FILO loads exactly the same
kernel and initrd as when you're booting with the factory BIOS.
Please investigate how the bootloader that is used then is
configured. For LILO a copy of the configuration is usually stored in
/etc/lilo.conf, for GRUB I don't know; I don't like GRUB. :)


//Peter




More information about the coreboot mailing list