一 bios的设置
在cf卡上建立好根文件系统后,在cf卡上安装grub引导程序,然后把编译好的内核bzImage 拷贝到/boot/下,修改/boot/grub/menu.lst/。理论上来现在至少应该能够出现grub的menu画面了,可是bios自检过后出现错误:
searching for boot record from ide-0.. not found
boot failure
reboot and select proper boot device or insert boot media in selected boot device
然后怀疑是grub没有装成功,就重装了grub
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
Running "embed /boot/grub/reiserfs_stage1_5 (hd1)"... 19 sectors are embedded
.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+19 p (hd1,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
问题仍然存在,说明问题在其他地方。然后进入bios进行设置,由于cf卡在linux就相当于一个ide的硬盘,所以修改ide的相关设置,发现问题在于PCI/Plug an d Play Setup选项下PCI IDE BusMaster 必须设置为Disabled 才能进入grub画面。
二 启动内核的过程中出现 kernel panic -not syncing :vfs:unable to mount root fs on unknown-block(0,0)
这个问题的本质原因是根文件系统所在的硬件的驱动程序没有编译进kernel或者在initrd.img 中也没有把硬盘或者cf卡的驱动程序作为模块加入。还有一种是在grub或者lilo的设置中 root=/dev/sd* 或者 /dev/hd* 的设置有误。这导致内核无法识别硬盘或cf卡。所以,建议在编译内核的时候特别细心,找出硬盘是属于ata的,还是pci的,或者scsi的,然后选择相应的选项。如果很难确定硬盘或cf卡的类型,则建议先全部选上,这样先保证能够进入系统,然后用dmesg | less 查看相应的硬盘或者cf卡的硬件信息,接下来再重新选择它们的驱动,把不要的去掉。
三 内核启动过程中出现很多DMA的错误信息
我的cf是Kinston ELITE PRO CF CARD 8GB的,应该是不支持DMA模式,所以出现重复以下错误,导致启动时间变长了很多.
ide:failed opcode was :unknown
hdc:dma disabled
hdc:dma_timer_expiry: dma status (0x21)
hdc: dma timeout error