Chinaunix首页 | 论坛 | 博客
  • 博客访问: 491146
  • 博文数量: 484
  • 博客积分: 10145
  • 博客等级: 上将
  • 技术积分: 5805
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-27 18:34
文章分类

全部博文(484)

文章存档

2011年(52)

2010年(107)

2009年(287)

2008年(38)

我的朋友

分类: LINUX

2009-04-01 20:54:42

编译内核(很痛苦)

http://hi.baidu.com/davyup/blog/item/4c462afc5dc79cf8fc037f00.html

1. 2.6内核编译步骤

make mrproper

make

make modules_install

将必须的文件拷到适宜的位置

1) cp arch/x86/bzimage 2) cp .config 3) cp System-map

2.首先遇到的就是VFS:kernel panic错误

尝试1.

driver-> ATA/ATAPI/MFM/RLL support

Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support

EIDE支持是当然要选的,否则540MB以上的硬盘都不认识而且不支持主从设备

         开始将eide编译成模块 出现kernel panic

按照saga同志的推荐配置,仔细对内核编译选项进行配置之后仍然有kernel panic!!

提示:
因为启动时候没有回滚屏幕的支持,我只能看到以下部分提示
pci: unable to reserve I/O region #1:8@1f0 for device 0000:00:02.5
pata_sis 0000:00:02.5: failed to request/iomap BARs for port 0 (errno=-16
scsi0: pata_sis
scsi1: pata_sis
ata1: DUMMY
ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15
pnp: ps/2 controller [pnp0303:ps2k] at 0x60,0x64 irq 1
pnp: ps/2 appears to have AUX port disables, if this is incorrect please boot
with i8042.nopnp
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: ps/2 mouse device common for all mice
input: PC Speaker as /class/input/input0
input: AT Translated Set 2 keyboard as /class/input/input1
TCP cubic registered
NET: Registered protocol family 1
Using IPI Shortcut mode
VFS:Cannot open root device "UUID=dde3dddd-4e49......" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions
Kernel panic - not syncing: VFS:Unable to mount root fs on unknown-block(0,0)


敲完了....
我用的是uuid通过grub 修改而来 可以保证是正确的 同时也可以保证避开pata 被识别为
sata的问题

ms下面两句是病因
pci: unable to reserve I/O region #1:8@1f0 for device 0000:00:02.5
pata_sis 0000:00:02.5: failed to request/iomap BARs for port 0 (errno=-16


lspci中
00:02.5 IDE interface : sis 5513 IDE (REV 01)

在ata/atapi 中的pci ide chipset support 中添加 sis5513支持后

提示是:

ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA,hdb:DMA

ide1: BM-DMA at 0xffa8-0xffaf, BIOS setting: hdc:DMA, hdd:DMA
Switched to NOHz mode on cpu #0
hda: Maxtor 6Y080L0, ATA DISK drive
hda:UDMA/133 mode selected ````````````````````````````````````````````````````````````````````````````````````````````````````````
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Driver 'sd' needs updating-please use bus_type methods

pnp: ps/2 controller [pnp0303:ps2k] at 0x60,0x64 irq 1
pnp: ps/2 appears to have AUX port disables, if this is incorrect please boot
with i8042.nopnp
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: ps/2 mouse device common for all mice
input: PC Speaker as /class/input/input0
input: AT Translated Set 2 keyboard as /class/input/input1
TCP cubic registered
NET: Registered protocol family 1
Using IPI Shortcut mode
VFS:Cannot open root device "UUID=dde3dddd-4e49......" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions
Kernel panic - not syncing: VFS:Unable to mount root fs on unknown-block(0,0)

hda那句应该能够表明硬盘驱动没问题了吧?

终于可以启动了阿

虽然上面显示了hda 但是panic的问题仍然在ide驱动上面

显示出了hda只是chipset得到了支持,但是ide硬盘仍然不能被加载

后来准备放弃单独使用kernel 而采取使用initrd文件的时候,无意将device drivers ---> ata/atapi/mfm/rll support----> include ide/ata-2 support 由M 改成* 内核终于跳过VFS 的kernel panic 启动了!

经过很多尝试:
最后发现Device Drivers 中的ATA/ATAPI/MFM/RLL support & SCSI device support & Serial ATA (prod) ande Parallel ATA drivers 与VFS kernel panic有很大关系

1).在Device Drivers ----->>ATA/ATAPI/MFM/RLL support 中应该将

Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
Include IDE/ATA-2 DISK support
#####(我是因为没选这个而kernel panic,ms SATA硬盘可以不选,如saga)
*****IDE chipset support/bugfixes ***
generic/default IDE chipset support

(platform driver for ide interfaces 这个应该与cf卡做ide硬盘有关)

config_blk_dev_platform 这个选项只在2.6.24.6的选项中见到,2.6.22.14 2.6.18.6均未见到

kernel doc: This is the platform IDE driver, used mostly for Memory Mapped IDE devices, like Compact Flashes running in True IDE mode.   If unsure,say N.

*****PCI IDE chipset support ****

generic PCI IDE Chipset Support(在下面的选项找不到自己主板型号前提下)

这三个编译进内核
2).SCSI device support 我是ide硬盘无法检验不过saga同志选的比较简单SCSI device support & SCSI disk support 编译进内核 & SCSI Transports中的前两项编译成了M(不知道这两个是干什么的)

3 )serial ATA & Parallel ATA 中把AHCI SATA support + (自己主板的SATA support) + generic ATA support + (自己主板的 PATA support)编译进内核

这三个方面的工作做好了 再把 File Systems 中自己root分区所用文件类型的support编译进内核
应该就不会出现VFS引起的kernel panic 了

ps.a. 要启动内核general setup---->Create deprecated sysfs files 这个不是必需的,我没有选/sys照样挂载

        b.ATA/ATAPI/MFM/RLL support 中的 sharing PCI IDE interrupt support 是将ide 的中断共享给其他pci 只会引来冲突而不是解决多pci中断冲突的,别理解错了

3.内核能启动了,但启动过程中就有不少错误提示

1) fuse modprobe 启动时fail 这个好解决 只要把file systems 中的 fuse选项编译成模块就好了,当时把这个模块取消掉的原因是,片面的理解了内核文档提示,以为只有自己开发一种新的文件系统才需要这个模块,而实际上 ntfs-3g 就需要这个模块的支持

2) usb 鼠标不能识别的问题,这个在usb support 和 hid support选上必需的支持就可以搞定了,特别注意要将uhci ohci 编译进内核(窃以为*HCI--host control interface 都应该编译进内核,呵呵) ,内核选项的鼠标设置部分 的usb鼠标支持只是特殊硬件支持,不是必需的。

3)声卡 显卡 无线网卡这些东西的驱动错误. 一般的pci网卡驱动内核支持还是较好的,但是声卡 显卡 无线网卡的驱动配置容易出错,这个一般要接合具体硬件 下载和编译驱动模块

4) wmware 错误. 启动新内核时,发现原本应该启动vmware各种服务的提示的位置,却变成了 vmware is intalled, but it has not been (correctly) configured for the running kernel to (re-)configure it invoke the command /usr/bin/vmware-cofig.pl

而与此同时,其他的一些服务 如 samba squid等服务却正常启动,经saga指点,我意识到有一些应用程序和系统服务是跟内核版本紧密相关的,这些服务的启动需要内核及其模块的支持 /usr/bin/vmware-config.pl 就是要编译并安装vmware系统服务所需要的模块并安装到/lib/modules/新内核/ 文件夹下

目前这个问题,遇到内核头文件问题,还没有解决

5) 其他一些未知错误

      a.PNP: ps/2 appears to have Aux port if this is incorrect please disabled boot with i8042.nopnp

     b. serial: 8250/16550 driver IRQ Sharing disabled

    这两个提示,虽然感觉不对劲,但不知道到底是什么,也不知道有什么影响

阅读(1107) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~