如何移出debian内核中的debian9 amd显卡驱动动

在Debian的linux-2.6.21内核下装nvidia驱动
在Debian的linux-2.6.21内核下装nvidia驱动
首先,修改linux-kbuild-2.6.21:
# apt-get build-dep linux-kbuild-2.6.21 $ mkdir linux-kbuild-2.6.21-build $ cd linux-kbuild-2.6.21-build $ apt-get source linux-kbuild-2.6.21
这时,linux-kbuild-2.6.21的相关文件会出现在linux-kbuild-2.6.21-build这个目录,并且有一个解压缩之后的linux-kbuild-2.6-2.6.21目录,修改linux-kbuild-2.6-2.6.21/scripts/mod/modpost.c,在大约1177行前后,找到fatal函数,注释掉这两行fatal函数,保存文件。
生成修改过的linux-kbuild,并且安装
$ dpkg-buildpackage -uc -us -rfakeroot # apt-get install linux-kbuild-2.6.21
第二,就是安装相应的包:
# apt-get install nvidia-kernel-common nvidia-kernel-legacy-71xx-source linux-headers-2.6.21-1-k7
安装这两个包,应该还会自动安装和debhelper相关的包,如果在之后编译发现还缺少什么包,自行补齐就是了。nvidia-kernel-legacy-71xx-source安装之后,会在/usr/src里出现一个nvidia-kernel-legacy-71xx-source.tar.gz,解压缩到随便什么地方。进入解出来的modules/nvidia-kernel-legacy-71xx/nv目录,修改Makefile.kbuild,在
EXTRA_CFLAGS += -Wall -Wimplicit -Wreturn-type… 后边加入
PARAVIRT_OPS := $(shell grep “D paravirt_ops” /boot/System.map-$(shell uname -r) | colrm 9) EXTRA_LDFLAGS := -defsym paravirt_ops=0x$(PARAVIRT_OPS)
之后,安装README.Debian中的方法生成deb包。
进入modules/nvidia-kernel-legacy-71xx
# KSRC=/usr/src/linux-headers-2.6.21-1-k7 KVERS=2.6.21-1-k7 debian/rules binary_modules # dpkg -i nvidia-kernel-legacy-71xx-2.6.21-1-k7_i386.deb
最后,安装nvidia-glx # apt-get install nvidia-glx-legacy-71xx
修改/etc/X11/xorg.conf,或dpkg-reconfigure xserver-xorg,改用nvidia驱动既可。
昵称: eometry &时间:Debian下的内核编译_Linux教程_Linux公社-Linux系统门户网站
你好,游客
Debian下的内核编译
来源:Linux社区&
作者:MysticBoy
如果你装了一台Linux的机器,自己没有重新编译内核,那这台机器的效率就大打折扣了,因为默认安装的机器会生成许多不需要的东西,在启动的时候也会比较慢,而你要用的有些东西可能不能工作,比如,现在都把IPV6放在里面,但我还不知道什么时候能用到IPV6呢,启动的时候老是找啊找的,心烦,而里面的PPP默认是不配置的,你上来用不了拨号怎么办?所以,在Linux下编译内核是一项必要的工作,好了,现在开始吧:
如果你总是想用最新的内核,那么到kernel.org去下载最新的,如果你只是为了改更一些选项,那么建议你还是直接用apt-get 下载Debian的内核吧。seabird-debian:/usr/src# apt-get install linux-tree-2.6.18 kernel-package fakeroot(如果你直接用root用户,下不下fakeroot到无关紧要)安装并不是真的会把这个kernel安装到你的系统,只是下载源文件而已,好了,进入/usr/src:你会看到一个文件linux-source-2.6.18.tar.bz2
先把文件解压seabird-debian:/usr/src#tar jxvf linux-source-2.6.18.tar.bz2文件被解压后生成一个linux-source-2.6.18的目录,进入该目录:seabird-debian:/usr/src#cd linux-source-1.6.18seabird-debian:/usr/src/linux-source-1.6.18#
使用正在运行的配置文件:seabird-debian:/usr/src/linux-source-1.6.18# make oldconfig
然后进行修改:seabird-debian:/usr/src/linux-source-1.6.18# make menuconfig
生成新内核:seabird-debian:/usr/src/linux-source-1.6.18# make-kpkg cleanseabird-debian:/usr/src/linux-source-1.6.18# make-kpkg --initrd --append-to-version=seabird --revision=1.0 kernel-image
查看如有错误,再次 make menuconfig&
更改,如果顺完成,会在/usr/src下生成如下文件:linux-image-2.6.18lilin_1.0_i386.deb
好了,安装新内核seabird-debian:/usr/src# dpkg -i linux-image-2.6.18lilin_1.0_i386.deb选中了曾被取消选择的软件包 linux-image-2.6.18lilin。(正在读取数据库 ... 系统当前总共安装有 119841 个文件和目录。)正在解压缩 linux-image-2.6.18lilin (从 linux-image-2.6.18lilin_1.0_i386.deb) ...Done.正在设置 linux-image-2.6.18lilin (1.0) ...Running depmod.Finding valid ramdisk creators.Using mkinitramfs-kpkg to build the ramdisk.Running postinst hook script /sbin/update-grub.You shouldn't call /sbin/update-grub. Please call /usr/sbin/update-grub instead!Searching for GRUB installation directory ... found: /boot/grubSearching for default file ... found: /boot/grub/defaultTesting for an existing GRUB menu.lst file ... found: /boot/grub/menu.lstSearching for splash image ... none found, skipping ...Found kernel: /boot/vmlinuz-2.6.18lilinFound kernel: /boot/vmlinuz-2.6.18-6-686Found kernel: /boot/vmlinuz-2.6.18-5-686Found kernel: /boot/vmlinuz-2.6.18-4-686Updating /boot/grub/menu.lst ... done
seabird-debian:/usr/src#
注意红色的那一行,按提示自己运行一下seabird-debian:/usr/src# update-grubSearching for GRUB installation directory ... found: /boot/grubSearching for default file ... found: /boot/grub/defaultTesting for an existing GRUB menu.lst file ... found: /boot/grub/menu.lstSearching for splash image ... none found, skipping ...Found kernel: /boot/vmlinuz-2.6.18lilinFound kernel: /boot/vmlinuz-2.6.18-6-686Found kernel: /boot/vmlinuz-2.6.18-5-686Found kernel: /boot/vmlinuz-2.6.18-4-686Updating /boot/grub/menu.lst ... doneseabird-debian:/usr/src#
好了,新的kernel已经添加到启动列表了,reboot,你就可以使用新内核了!
本文永久更新链接地址:
相关资讯 & & &
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款Debian编译linux 3.11内核并安装nvidia驱动325.15【debian吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:10,224贴子:
Debian编译linux 3.11内核并安装nvidia驱动325.15收藏
上网浏览时发现-据说-非谣言-325.15只需要改个小地方就可以了,决定试一试。【Debian sid】
1)编译3.11lee@lzh-main:~/android/src/linux-3.11$ fakeroot make-kpkg --initrd -j 4 --revision 0.1.1 kernel_headers kernel_imagelee@lzh-main:~/android/src$ su -c 'dpkg -i linux-headers-3.11.0_0.1.1_amd64.deb
linux-image-3.11.0_0.1.1_amd64.deb'
2)先解压缩,略作修改NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h第961行改为#define NV_NUM_PHYSPAGES
totalram_pages$ sh NVIDIA-Linux-x86_64-325.15.run --extract-only
3)重启后选择新装内核3.11,没有可用的nvidia驱动,显示黑屏,只有光标闪闪, ctl+alt+f1打开控制台。root登录或登录后切换到root。停止X服务。# /etc/init.d/gdm3 stop进入NVIDIA-Linux-x86_64-325.15目录,尝试安装:# ./nvidia-installer出现几屏提示,仔细阅读之。有dkms提示的页面时选择yes,把它加入到dkms库中方便以后换新内核时及时编译安装。这时可以另开一个控制台,如ctl+alt+f2,以普通用户登录,将安装过程中提到的log保存一份备用,每次应重命名,如$ cp /var/log/nvidia-installer.log nvidia-installer.1.log注意上面的totalram_pages可以先不改,看看生成的log。安装成功之后提示是否生成一个配置文件,当然让它生成一个啦。随后可以启用X了:# /etc/init.d/gdm3 start进入登录界面。
验证:root@lzh-main:/home/lee# dkms statusnvidia, 325.15, 3.11.0, x86_64: installedvboxhost, 4.2.16, 3.10-2-rt-amd64, x86_64: installedvboxhost, 4.2.16, 3.11.0, x86_64: installedError! Could not locate dkms.conf file.File:
does not exist.vboxhost, 4.2.16, 3.8.7, x86_64: installedroot@lzh-main:/home/lee# 那个Error!看着让人发毛,难道VirtualBox的驱动没有编译? 重新来过:root@lzh-main:/home/lee# /etc/init.d/vboxdrv setup[ ok ] Stopping VirtualBox kernel modules:.[....] Uninstalling old VirtualBox DKMS kernel modules:Error! Could not locate dkms.conf file.File:
does not exist.Error! There are no instances of module: vboxhost4.2.16 located in the DKMS tree.Error! There are no instances of module: vboxhost4.2.16 located in the DKMS tree.. ok [ ok ] Trying to register the VirtualBox kernel modules using DKMS:.[ ok ] Starting VirtualBox kernel modules:.再看看,还是有!?root@lzh-main:/home/lee# dkms statusnvidia, 325.15, 3.11.0, x86_64: installedError! Could not locate dkms.conf file.File:
does not exist.vboxhost, 4.2.16, 3.11.0, x86_64: installedroot@lzh-main:/home/lee#先留个疑问在此处,从哪里输出的?=======================最后看看totalram_pages在linux内核的哪里定义的:lee@lzh-main:~/android/src/linux-3.11/include$ grep totalram_pages linux/*.hlinux/mm.h:extern unsigned long totalram_linux/mm.h: * and totalram_pages.linux/mmzone.h:
* long. Write access to zone-&managed_pages and totalram_pages arelinux/mmzone.h:
* touching zone-&managed_pages and totalram_pages.linux/swap.h:extern unsigned long totalram_lee@lzh-main:~/android/src/linux-3.11/include$ grep num_physpages linux/*.hlinux/mm.h:static inline unsigned long get_num_physpages(void)lee@lzh-main:~/android/src/linux-3.11/include$
登录百度帐号推荐应用Linux有问必答:如何在Debian或Ubuntu上安装完整的内核源码
问题:我需要为我的Debian或Ubuntu下载并安装完整树结构的内核源码以供编译一个定制的内核。那么在Debian或Ubuntu上有什么可行的方法来下载完整的内核源码呢?
在给你的Linux安装完整内核源码之前,先问问自己是否真的需要这样做。如果你仅仅是尝试去编译一个内核模块或是为内核定制驱动,你并不需要完整的内核源码树。你只需要安装,这样就足够了。
只有在你需要生成一个定制的内核,而且内核源码中的一些内核默认设置要被你调整了的情况下,你才需要完整的内核源码树。
这里将会解答如何在Debian或Ubuntu的库中下载并安装完整树结构的内核源码。你可以在下载官方的内核源码,不过使用发行版软件仓库可以允许你下载包含补丁的内核源码。
在Debian上安装完整的内核源码
在下载内核源码之前,先安装dpkg-dev,其中包含你在Debian上生成源代码时需要的开发工具套件。不仅如此,dpkg-dev中还包含在用来解压Debian源码包并自动打补丁的工具dpgk-source。
$ sudo apt-get install dpkg-dev
然后,运行以下命令下载完整的内核源码。
$ apt-get source linux-image-$(uname -r)
伴随着完整内核源码(linux_X.X.XX.orig.tar.xz)的还有一些可用的内核补丁(linux_X.X.X+XXX.debian.tar.xz)和源码控制文件(linux_XXXX.dsc),这些都将被下载并存储到当前目录。在.dsc文件中会指出如何给内核源码打补丁。
当下载完成,以上的命令将会自动调用工具dpkg-source将下载的内核源码解压到当前的目录中,与此同时根据.dsc文件来下补丁。
最终完整的内核源码树将会以"linux-X.X.XX"的形式呈现在当前目录中。
在Ubuntu上安装完整内核源码
如果你想安装完整内核源码的话,以上在Debian上的那一套做法在Ubuntu上仍然奏效。
在Ubuntu上还有另一套方法安装完整内核源码。事实上,你可以查一下由Canonical为Ubuntu不同发行版维护的内核源码树。
$ sudo apt-get install git
$ git clone git:///ubuntu/ubuntu-$(lsb_release --codename | cut -f2).git
举个例子,如果你使用的是Ubuntu 14.04,以上的命令将会查看Git的"ubuntu-trusty"仓库中的代码。
一旦在你对Git仓库的查询结束后,使用以下的命令来安装用来访问生成内核源码树所需依赖的重要开发包。
$ sudo apt-get build-dep linux-image-$(uname -r)
作者:&译者:&校对:
本文由&&原创翻译,&荣誉推出
上一篇:下一篇:
分享到微信
打开微信,点击顶部的“╋”,
使用“扫一扫”将网页分享至微信。
请将我们加入您的广告过滤器的白名单,请支持开源站点。谢谢您。debian内核代码执行流程(二) - qiaoqiao2003 - 博客园
继续上一篇文章《》未完成部分。
acpi_bus_init调用acpi_initialize_objects,经过一系列复杂调用后输出下面信息:
0.147393] ACPI: SSDT 7f5e7cc0 0030F (v01
0.147566] ACPI: Dynamic OEM Table Load:
0.147569] ACPI: SSDT
(null) 0030F (v01
0.148012] ACPI: SSDT 7f5e81e0 001B3 (v01
0.148176] ACPI: Dynamic OEM Table Load:
0.148178] ACPI: SSDT
(null) 001B3 (v01
acpi_bus_init接着调用acpi_sysfs_init,创建/sys/firmware/acpi/tables/以及/sys/firmware/acpi/tables/dynamic
acpi_bus_init接着输出下面信息:
0.148366] ACPI: Interpreter enabled
acpi_bus_init接着调用acpi_sleep_init,输出下面信息:
0.148372] ACPI: (supports S0 S1 S4 S5)
acpi_bus_init接着调用acpi_bus_init_irq,输出下面信息:
0.148389] ACPI: Using IOAPIC for interrupt routing
drivers/acpi/dock.c中有下面代码:
subsys_initcall(dock_init);
此时执行dock_init函数,输出下面信息:
0.152327] ACPI: No dock devices found.
drivers/acpi/pci_root.c中有下面代码:
subsys_initcall(acpi_pci_root_init);
此时执行acpi_pci_root_init函数,acpi_pci_root_init调用acpi_hest_init,输出下面信息:
0.152329] HEST: Table not found.
acpi_pci_root_init调用pci_acpi_crs_quirks函数,输出下面信息:
0.152333] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
acpi_pci_root_init执行acpi_bus_register_driver(&acpi_pci_root_driver) ,之后经过复杂的过程后调用acpi_pci_root_add,输出下面信息:
0.152382] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
acpi_pci_root_add调用pci_acpi_scan_root,pci_acpi_scan_root调用pci_scan_child_bus,pci_scan_child_bus调用 pcibios_fixup_bus,
pcibios_fixup_bus调用pci_read_bridge_bases,pci_read_bridge_bases分别调用pci_read_bridge_io和pci_read_bridge_mmio,输出下面信息:
0.152491] pci_root PNP0A08:00: host bridge window [io
0x0000-0x0cf7]
0.152494] pci_root PNP0A08:00: host bridge window [io
0x0d00-0xffff]
0.152496] pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
0.152498] pci_root PNP0A08:00: host bridge window [mem 0x000c0000-0x000dffff]
0.152501] pci_root PNP0A08:00: host bridge window [mem 0x7f600000-0xfebfffff]
lib/vsprintf.c中有下面的说明:
* - 'R' For decoded struct resource, e.g., [mem 0x0-0x1f 64bit pref]
这个对应于输出信息中使用%pR的情况。
pci_scan_child_bus调用pci_scan_slot,pci_scan_slot调用pci_scan_single_device,
pci_scan_single_device调用pci_scan_device,pci_scan_device调用pci_setup_device,输出下面信息:
0.152514] pci 0000:00:00.0: [8086:29c0] type 0 class 0x000600
类似地,输出下面信息:
0.152556] pci 0000:00:02.0: [8086:29c2] type 0 class 0x000300
pci_setup_device调用pci_read_bases,pci_read_bases循环调用__pci_read_base,输出下面信息:
0.152565] pci 0000:00:02.0: reg 10: [mem 0xfdf00000-0xfdf7ffff]
0.152571] pci 0000:00:02.0: reg 14: [io
0xff00-0xff07]
0.152576] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xdfffffff pref]
0.152582] pci 0000:00:02.0: reg 1c: [mem 0xfd600000-0xfd6fffff]
类似地,输出下面信息:
0.152645] pci 0000:00:1b.0: [8086:27d8] type 0 class 0x000403
0.152660] pci 0000:00:1b.0: reg 10: [mem 0xfdff8000-0xfdffbfff 64bit]
pci_scan_single_devcie调用pci_device_add, pci_device_add调用pci_init_capabilities,输出下面信息:
0.152723] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
&后续还有很多输出也与前面类似:
0.152744] pci 0000:00:1c.0: [8086:27d0] type 1 class 0x000604
0.152808] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
0.152830] pci 0000:00:1c.1: [8086:27d2] type 1 class 0x000604
0.152894] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
0.152916] pci 0000:00:1c.2: [8086:27d4] type 1 class 0x000604
0.152979] pci 0000:00:1c.2: PME# supported from D0 D3hot D3cold
0.153001] pci 0000:00:1c.3: [8086:27d6] type 1 class 0x000604
0.153065] pci 0000:00:1c.3: PME# supported from D0 D3hot D3cold
0.153087] pci 0000:00:1d.0: [8086:27c8] type 0 class 0x000c03
0.153124] pci 0000:00:1d.0: reg 20: [io
0xfe00-0xfe1f]
0.153154] pci 0000:00:1d.1: [8086:27c9] type 0 class 0x000c03
0.153192] pci 0000:00:1d.1: reg 20: [io
0xfd00-0xfd1f]
0.153221] pci 0000:00:1d.2: [8086:27ca] type 0 class 0x000c03
0.153258] pci 0000:00:1d.2: reg 20: [io
0xfc00-0xfc1f]
0.153287] pci 0000:00:1d.3: [8086:27cb] type 0 class 0x000c03
0.153324] pci 0000:00:1d.3: reg 20: [io
0xfb00-0xfb1f]
0.153362] pci 0000:00:1d.7: [8086:27cc] type 0 class 0x000c03
0.153379] pci 0000:00:1d.7: reg 10: [mem 0xfdfff000-0xfdfff3ff]
0.153455] pci 0000:00:1d.7: PME# supported from D0 D3hot D3cold
0.153474] pci 0000:00:1e.0: [8086:244e] type 1 class 0x000604
0.153532] pci 0000:00:1f.0: [8086:27b8] type 0 class 0x000601
0.153609] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 1 PIO at 0800 (mask 003f)
0.153652] pci 0000:00:1f.1: [8086:27df] type 0 class 0x000101
0.153664] pci 0000:00:1f.1: reg 10: [io
0x0000-0x0007]
0.153673] pci 0000:00:1f.1: reg 14: [io
0x0000-0x0003]
0.153681] pci 0000:00:1f.1: reg 18: [io
0x0000-0x0007]
0.153690] pci 0000:00:1f.1: reg 1c: [io
0x0000-0x0003]
0.153698] pci 0000:00:1f.1: reg 20: [io
0xfa00-0xfa0f]
0.153731] pci 0000:00:1f.2: [8086:27c0] type 0 class 0x000101
0.153744] pci 0000:00:1f.2: reg 10: [io
0xf900-0xf907]
0.153751] pci 0000:00:1f.2: reg 14: [io
0xf800-0xf803]
0.153759] pci 0000:00:1f.2: reg 18: [io
0xf700-0xf707]
0.153767] pci 0000:00:1f.2: reg 1c: [io
0xf600-0xf603]
0.153774] pci 0000:00:1f.2: reg 20: [io
0xf500-0xf50f]
0.153806] pci 0000:00:1f.2: PME# supported from D3hot
0.153820] pci 0000:00:1f.3: [8086:27da] type 0 class 0x000c05
0.153868] pci 0000:00:1f.3: reg 20: [io
0x0500-0x051f]
0.153935] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
0.153939] pci 0000:00:1c.0:
bridge window [io
0xb000-0xbfff]
0.153943] pci 0000:00:1c.0:
bridge window [mem 0xfde00000-0xfdefffff]
0.153949] pci 0000:00:1c.0:
bridge window [mem 0xfdd00000-0xfddfffff 64bit pref]
0.153985] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
0.153988] pci 0000:00:1c.1:
bridge window [io
0xa000-0xafff]
0.153992] pci 0000:00:1c.1:
bridge window [mem 0xfdc00000-0xfdcfffff]
0.153998] pci 0000:00:1c.1:
bridge window [mem 0xfdb00000-0xfdbfffff 64bit pref]
0.154034] pci 0000:00:1c.2: PCI bridge to [bus 03-03]
0.154037] pci 0000:00:1c.2:
bridge window [io
0xe000-0xefff]
0.154041] pci 0000:00:1c.2:
bridge window [mem 0xfda00000-0xfdafffff]
0.154047] pci 0000:00:1c.2:
bridge window [mem 0xfd900000-0xfd9fffff 64bit pref]
0.154099] pci 0000:04:00.0: [10ec:8136] type 0 class 0x000200
0.154115] pci 0000:04:00.0: reg 10: [io
0xde00-0xdeff]
0.154143] pci 0000:04:00.0: reg 18: [mem 0xfd7ff000-0xfd7fffff 64bit pref]
0.154160] pci 0000:04:00.0: reg 20: [mem 0xfd7e0000-0xfd7effff 64bit pref]
0.154172] pci 0000:04:00.0: reg 30: [mem 0x-0x0001ffff pref]
0.154233] pci 0000:04:00.0: supports D1 D2
0.154235] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold
0.160032] pci 0000:00:1c.3: PCI bridge to [bus 04-04]
0.160039] pci 0000:00:1c.3:
bridge window [io
0xd000-0xdfff]
0.160046] pci 0000:00:1c.3:
bridge window [mem 0xfd800000-0xfd8fffff]
0.160056] pci 0000:00:1c.3:
bridge window [mem 0xfd700000-0xfd7fffff 64bit pref]
0.160134] pci 0000:00:1e.0: PCI bridge to [bus 05-05] (subtractive decode)
0.160141] pci 0000:00:1e.0:
bridge window [io
0xc000-0xcfff]
0.160148] pci 0000:00:1e.0:
bridge window [mem 0xfd500000-0xfd5fffff]
0.160157] pci 0000:00:1e.0:
bridge window [mem 0xfd400000-0xfd4fffff 64bit pref]
0.160162] pci 0000:00:1e.0:
bridge window [io
0x0000-0x0cf7] (subtractive decode)
0.160167] pci 0000:00:1e.0:
bridge window [io
0x0d00-0xffff] (subtractive decode)
0.160173] pci 0000:00:1e.0:
bridge window [mem 0x000a0000-0x000bffff] (subtractive decode)
0.160178] pci 0000:00:1e.0:
bridge window [mem 0x000c0000-0x000dffff] (subtractive decode)
0.160183] pci 0000:00:1e.0:
bridge window [mem 0x7f600000-0xfebfffff] (subtractive decode
其中[ 0.160134] pci 0000:00:1e.0: PCI bridge to [bus 05-05] (subtractive decode)类似的输出也是在pci_read_bridge_bases中产生的。
查看本机pci设备信息:
$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller [8086:29c0] (rev 10)
00:02.0 VGA compatible controller [0300]: Intel Corporation 82G33/G31 Express Integrated Graphics Controller [8086:29c2] (rev 10)
00:1b.0 Audio device [0403]: Intel Corporation NM10/ICH7 Family High Definition Audio Controller [8086:27d8] (rev 01)
00:1c.0 PCI bridge [0604]: Intel Corporation NM10/ICH7 Family PCI Express Port 1 [8086:27d0] (rev 01)
00:1c.1 PCI bridge [0604]: Intel Corporation NM10/ICH7 Family PCI Express Port 2 [8086:27d2] (rev 01)
00:1c.2 PCI bridge [0604]: Intel Corporation NM10/ICH7 Family PCI Express Port 3 [8086:27d4] (rev 01)
00:1c.3 PCI bridge [0604]: Intel Corporation NM10/ICH7 Family PCI Express Port 4 [8086:27d6] (rev 01)
00:1d.0 USB controller [0c03]: Intel Corporation NM10/ICH7 Family USB UHCI Controller #1 [8086:27c8] (rev 01)
00:1d.1 USB controller [0c03]: Intel Corporation NM10/ICH7 Family USB UHCI Controller #2 [8086:27c9] (rev 01)
00:1d.2 USB controller [0c03]: Intel Corporation NM10/ICH7 Family USB UHCI Controller #3 [8086:27ca] (rev 01)
00:1d.3 USB controller [0c03]: Intel Corporation NM10/ICH7 Family USB UHCI Controller #4 [8086:27cb] (rev 01)
00:1d.7 USB controller [0c03]: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller [8086:27cc] (rev 01)
00:1e.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev e1)
00:1f.0 ISA bridge [0601]: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge [8086:27b8] (rev 01)
00:1f.1 IDE interface [0101]: Intel Corporation 82801G (ICH7 Family) IDE Controller [8086:27df] (rev 01)
00:1f.2 IDE interface [0101]: Intel Corporation NM10/ICH7 Family SATA Controller [IDE mode] [8086:27c0] (rev 01)
00:1f.3 SMBus [0c05]: Intel Corporation NM10/ICH7 Family SMBus Controller [8086:27da] (rev 01)
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller [10ec:8136] (rev 02)
上面的系统输出信息中与pci相关部分就是对pci上的各种设备执行扫描和相应初始化工作。
&acpi_pci_root_add还调用pci_acpi_scan_root,输出下面信息:
0.160216] pci_bus 0000:00: on NUMA node 0
acpi_pci_root_add多次调用acpi_pci_bridge_scan,acpi_pci_bridge_scan调用device-&parent-&ops.bind,即acpi_pci_bind。
acpi_pci_bind调用acpi_pci_irq_add_prt,因为被调用多次,输出下面信息:
0.160219] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
0.160338] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX0._PRT]
0.160373] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX1._PRT]
0.160406] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX2._PRT]
0.160438] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX3._PRT]
0.160475] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.HUB0._PRT]
acpi_pci_root_add接着输出下面信息:
pci0000:00: Requesting ACPI _OSC control (0x1d)[
pci0000:00: ACPI _OSC request failed (AE_NOT_FOUND), returned control mask: 0x1d
0.160621] ACPI _OSC control for PCIe not granted, disabling ASPM
在drivers/acpi/pci_link.c中有下面代码:
subsys_initcall(acpi_pci_link_init);
此时调用acpi_pci_link_init函数,acpi_pci_link_init调用acpi_bus_register_driver(&acpi_pci_link_driver),
之后会调用acpi_pci_link_driver.ops.add函数,即acpi_pci_link_add函数,输出下面信息(不知为何会产生多次输出):
0.167979] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 10 *11 12 14 15)
0.168037] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
0.168081] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 *5 7 9 10 11 12 14 15)
0.168124] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 11 12 14 *15)
0.168167] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
0.168210] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
0.168253] ACPI: PCI Interrupt Link [LNK0] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
0.168297] ACPI: PCI Interrupt Link [LNK1] (IRQs 3 4 5 7 9 *10 11 12 14 15)
drivers/gpu/vga/vgaarb.c中有下面代码:
subsys_initcall(vga_arb_device_init);
此时执行vga_arb_device_init函数,vga_arb_device_init调用vga_arbiter_add_pci_device,输出下面信息:
0.168380] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
vga_arb_device_init中接着输出下面信息:
0.168380] vgaarb: loaded
0.168380] vgaarb: bridge control possible 0000:00:02.0
下面这行输出信息不知道是如何产生的:
0.168380] PCI: Using ACPI for IRQ routing
&arch/x86/pci/legacy.c中有下面定义:
subsys_initcall(pci_subsys_init);
此时执行pci_subsys_init函数。pci_subsys_init调用pcibios_init,pcibios_init调用pcibios_set_cache_line_size,输出下面信息:
0.174067] PCI: pci_cache_line_size set to 64 bytes
&pcibios_init调用pcibios_resource_survey,pcibios_resource_survey调用e820_reserve_resource_late,输出下面信息:
0.174129] reserve RAM buffer: f800 - ffff
0.174132] reserve RAM buffer: 0000 - fffffff
arch/x86/kernel/hpet.c中有下面代码:
fs_initcall(hpet_late_init);
此时会调用hpet_late_init,hpet_late_init调用hpet_msi_capability_lookup,输出下面信息:
0.174232] HPET: 3 timers in total, 0 timers will be used for per-cpu timer
hpet_late_init调用hpet_reserve_platform_timers,hpet_reserve_platform_timers调用hpet_alloc,输出下面信息:
0.174237] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
0.174241] hpet0: 3 comparators, 64-bit 14.318180 MHz counter
hpet_alloc中调用clocksource_register_hz,clocksource_register_hz调用__clocksource_register_scale,
__clocksource_register_scale调用clocksource_select,输出下面信息:
0.180130] Switching to clocksource hpet
drivers/pnp/pnpacpi/core.c中有下面代码:
fs_initcall(pnpacpi_init);
此时执行pnpacpi_init函数,输出下面信息:
0.181748] pnp: PnP ACPI init
pnpacpi_init调用register_acpi_bus_type(&acpi_bus_type),输出下面信息:
0.181760] ACPI: bus type pnp registere
pnpacpi_init接着调用acpi_get_devices,输出下面信息:
0.181827] pnp 00:00: [bus 00-ff]
0.181830] pnp 00:00: [io
0x0cf8-0x0cff]
0.181832] pnp 00:00: [io
0x0000-0x0cf7 window]
0.181835] pnp 00:00: [io
0x0d00-0xffff window]
0.181837] pnp 00:00: [mem 0x000a0000-0x000bffff window]
0.181839] pnp 00:00: [mem 0x000c0000-0x000dffff window]
0.181841] pnp 00:00: [mem 0x7f600000-0xfebfffff window]
0.181885] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03 (active)
0.181940] pnp 00:01: [io
0x0010-0x001f]
0.181942] pnp 00:01: [io
0x0022-0x003f]
0.181944] pnp 00:01: [io
0x0044-0x005f]
0.181945] pnp 00:01: [io
0x0062-0x0063]
0.181947] pnp 00:01: [io
0x0065-0x006f]
0.181949] pnp 00:01: [io
0x0074-0x007f]
0.181951] pnp 00:01: [io
0x0091-0x0093]
0.181953] pnp 00:01: [io
0x00a2-0x00bf]
0.181954] pnp 00:01: [io
0x00e0-0x00ef]
0.181956] pnp 00:01: [io
0x04d0-0x04d1]
0.181958] pnp 00:01: [io
0x0800-0x087f]
0.181960] pnp 00:01: [io
0x0880-0x088f]
0.182013] system 00:01: [io
0x04d0-0x04d1] has been reserved
0.182016] system 00:01: [io
0x0800-0x087f] has been reserved
0.182018] system 00:01: [io
0x0880-0x088f] has been reserved
0.182021] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)
0.182032] pnp 00:02: [dma 4]
0.182034] pnp 00:02: [io
0x0000-0x000f]
0.182036] pnp 00:02: [io
0x0080-0x0090]
0.182037] pnp 00:02: [io
0x0094-0x009f]
0.182039] pnp 00:02: [io
0x00c0-0x00df]
0.182067] pnp 00:02: Plug and Play ACPI device, IDs PNP0200 (active)
0.182110] pnp 00:03: [irq 0 disabled]
0.182121] pnp 00:03: [irq 8]
0.182123] pnp 00:03: [mem 0xfed00000-0xfed003ff]
0.182152] pnp 00:03: Plug and Play ACPI device, IDs PNP0103 (active)
0.182177] pnp 00:04: [io
0x0070-0x0073]
0.182205] pnp 00:04: Plug and Play ACPI device, IDs PNP0b00 (active)
0.182214] pnp 00:05: [io
0.182240] pnp 00:05: Plug and Play ACPI device, IDs PNP0800 (active)
0.182249] pnp 00:06: [io
0x00f0-0x00ff]
0.182254] pnp 00:06: [irq 13]
0.182283] pnp 00:06: Plug and Play ACPI device, IDs PNP0c04 (active)
0.182409] pnp 00:07: [io
0x03f0-0x03f5]
0.182412] pnp 00:07: [io
0.182416] pnp 00:07: [irq 6]
0.182418] pnp 00:07: [dma 2]
0.182457] pnp 00:07: Plug and Play ACPI device, IDs PNP0700 (active)
0.182627] pnp 00:08: [io
0x03f8-0x03ff]
0.182632] pnp 00:08: [irq 4]
0.182689] pnp 00:08: Plug and Play ACPI device, IDs PNP0501 (active)
0.182872] pnp 00:09: [io
0x02f8-0x02ff]
0.182876] pnp 00:09: [irq 3]
0.182933] pnp 00:09: Plug and Play ACPI device, IDs PNP0501 (active)
0.183180] pnp 00:0a: [io
0x0378-0x037f]
0.183185] pnp 00:0a: [irq 7]
0.183233] pnp 00:0a: Plug and Play ACPI device, IDs PNP0400 (active)
0.183348] pnp 00:0b: [io
0x0400-0x04bf]
0.183394] system 00:0b: [io
0x0400-0x04bf] has been reserved
0.183397] system 00:0b: Plug and Play ACPI device, IDs PNP0c02 (active)
0.183415] pnp 00:0c: [mem 0xffb80000-0xffbfffff]
0.183445] pnp 00:0c: Plug and Play ACPI device, IDs INT0800 (active)
0.183612] pnp 00:0d: [mem 0xe0000000-0xefffffff]
0.183666] system 00:0d: [mem 0xe0000000-0xefffffff] has been reserved
0.183669] system 00:0d: Plug and Play ACPI device, IDs PNP0c02 (active)
0.183732] pnp 00:0e: [mem 0x000f0000-0x000fffff]
0.183734] pnp 00:0e: [mem 0x7f600000-0x7f6fffff]
0.183736] pnp 00:0e: [mem 0xfed00000-0xfed000ff]
0.183739] pnp 00:0e: [mem 0x7f590000-0x7f5fffff]
0.183740] pnp 00:0e: [mem 0x-0x0009ffff]
0.183742] pnp 00:0e: [mem 0x-0x7f58ffff]
0.183744] pnp 00:0e: [mem 0xfec00000-0xfec00fff]
0.183746] pnp 00:0e: [mem 0xfed13000-0xfed1dfff]
0.183748] pnp 00:0e: [mem 0xfed20000-0xfed8ffff]
0.183750] pnp 00:0e: [mem 0xfee00000-0xfee00fff]
0.183752] pnp 00:0e: [mem 0xffb00000-0xffb7ffff]
0.183754] pnp 00:0e: [mem 0xfff00000-0xffffffff]
0.183756] pnp 00:0e: [mem 0x000e0000-0x000effff]
0.183817] system 00:0e: [mem 0x000f0000-0x000fffff] could not be reserved
0.183820] system 00:0e: [mem 0x7f600000-0x7f6fffff] has been reserved
0.183823] system 00:0e: [mem 0xfed00000-0xfed000ff] has been reserved
0.183825] system 00:0e: [mem 0x7f590000-0x7f5fffff] could not be reserved
0.183828] system 00:0e: [mem 0x-0x0009ffff] could not be reserved
0.183831] system 00:0e: [mem 0x-0x7f58ffff] could not be reserved
0.183834] system 00:0e: [mem 0xfec00000-0xfec00fff] could not be reserved
0.183836] system 00:0e: [mem 0xfed13000-0xfed1dfff] has been reserved
0.183839] system 00:0e: [mem 0xfed20000-0xfed8ffff] has been reserved
0.183842] system 00:0e: [mem 0xfee00000-0xfee00fff] has been reserved
0.183844] system 00:0e: [mem 0xffb00000-0xffb7ffff] has been reserved
0.183847] system 00:0e: [mem 0xfff00000-0xffffffff] has been reserved
0.183847] system 00:0e: [mem 0x000e0000-0x000effff] has been reserved
0.183847] system 00:0e: Plug and Play ACPI device, IDs PNP0c01 (active)
pnpacpi_init接着输出下面信息:
0.183847] pnp: PnP ACPI: found 15 devices
pnpacpi_init接着调用unregister_acpi_bus_type,输出下面信息:
0.183848] ACPI: ACPI bus type pnp unregistered
&drivers/pnp/pnpacpi/core.c中有下面代码:
fs_initcall(pnpbios_init);
此时调用pnpbios_init,输出下面信息:
0.183851] PnPBIOS: Disabled by ACPI PNP
arch/x86/pci/i386.c中有下面代码:
fs_initcall(pcibios_assign_resources);
此时调用pcibios_assign_resources,pci_assign_resources调用pci_assign_unassigned_resources,输出下面信息:
PCI: max bus depth: 1 pci_try_num: 2
pci_assign_unassigned_resources对pci_root_buses列表中的所有总线调用__pci_bus_assign_resources,
__pci_bus_assign_resources中对于总线上所有PCI_CLASS_BRIDGE_PCI设备调用pci_setup_bridge,
pci_setup_bridge调用__pci_setup_bridge,输出下面信息:
0.220656] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
0.220659] pci 0000:00:1c.0:
bridge window [io
0xb000-0xbfff]
0.220664] pci 0000:00:1c.0:
bridge window [mem 0xfde00000-0xfdefffff]
0.220668] pci 0000:00:1c.0:
bridge window [mem 0xfdd00000-0xfddfffff 64bit pref]
&类似地,输出下面信息:
0.220674] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
0.220677] pci 0000:00:1c.1:
bridge window [io
0xa000-0xafff]
0.220682] pci 0000:00:1c.1:
bridge window [mem 0xfdc00000-0xfdcfffff]
0.220686] pci 0000:00:1c.1:
bridge window [mem 0xfdb00000-0xfdbfffff 64bit pref]
0.220691] pci 0000:00:1c.2: PCI bridge to [bus 03-03]
0.220694] pci 0000:00:1c.2:
bridge window [io
0xe000-0xefff]
0.220699] pci 0000:00:1c.2:
bridge window [mem 0xfda00000-0xfdafffff]
0.220703] pci 0000:00:1c.2:
bridge window [mem 0xfd900000-0xfd9fffff 64bit pref]
0.220711] pci 0000:04:00.0: BAR 6: assigned [mem 0xfd700000-0xfd71ffff pref]
0.220713] pci 0000:00:1c.3: PCI bridge to [bus 04-04]
0.220716] pci 0000:00:1c.3:
bridge window [io
0xd000-0xdfff]
0.220721] pci 0000:00:1c.3:
bridge window [mem 0xfd800000-0xfd8fffff]
0.220724] pci 0000:00:1c.3:
bridge window [mem 0xfd700000-0xfd7fffff 64bit pref]
0.220730] pci 0000:00:1e.0: PCI bridge to [bus 05-05]
0.220733] pci 0000:00:1e.0:
bridge window [io
0xc000-0xcfff]
0.220738] pci 0000:00:1e.0:
bridge window [mem 0xfd500000-0xfd5fffff]
0.220742] pci 0000:00:1e.0:
bridge window [mem 0xfd400000-0xfd4fffff 64bit pref]
pci_assign_unassigned_resources对pci_root_buses列表中的所有总线调用pci_enable_bridges,
pci_enable_bridges对于总线上所有设备调用pci_set_master, pci_set_master调用pcibios_set_master,因为是多次调用,所以输出下面信息:
0.220761] pci 0000:00:1c.0: setting latency timer to 64
0.220773] pci 0000:00:1c.1: setting latency timer to 64
0.220784] pci 0000:00:1c.2: setting latency timer to 64
0.220794] pci 0000:00:1c.3: setting latency timer to 64
0.220801] pci 0000:00:1e.0: setting latency timer to 64
pci_assign_unassigned_resources对pci_root_buses列表中的所有总线调用pci_bus_dump_resources,
pci_bus_dump_resources调用pci_bus_dump_res,因为多次调用,输出下面信息:
0.220804] pci_bus 0000:00: resource 4 [io
0x0000-0x0cf7]
0.220806] pci_bus 0000:00: resource 5 [io
0x0d00-0xffff]
0.220809] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
0.220811] pci_bus 0000:00: resource 7 [mem 0x000c0000-0x000dffff]
0.220813] pci_bus 0000:00: resource 8 [mem 0x7f600000-0xfebfffff]
0.220815] pci_bus 0000:01: resource 0 [io
0xb000-0xbfff]
0.220818] pci_bus 0000:01: resource 1 [mem 0xfde00000-0xfdefffff]
0.220820] pci_bus 0000:01: resource 2 [mem 0xfdd00000-0xfddfffff 64bit pref]
0.220822] pci_bus 0000:02: resource 0 [io
0xa000-0xafff]
0.220824] pci_bus 0000:02: resource 1 [mem 0xfdc00000-0xfdcfffff]
0.220827] pci_bus 0000:02: resource 2 [mem 0xfdb00000-0xfdbfffff 64bit pref]
0.220829] pci_bus 0000:03: resource 0 [io
0xe000-0xefff]
0.220831] pci_bus 0000:03: resource 1 [mem 0xfda00000-0xfdafffff]
0.220833] pci_bus 0000:03: resource 2 [mem 0xfd900000-0xfd9fffff 64bit pref]
0.220835] pci_bus 0000:04: resource 0 [io
0xd000-0xdfff]
0.220837] pci_bus 0000:04: resource 1 [mem 0xfd800000-0xfd8fffff]
0.220840] pci_bus 0000:04: resource 2 [mem 0xfd700000-0xfd7fffff 64bit pref]
0.220842] pci_bus 0000:05: resource 0 [io
0xc000-0xcfff]
0.220844] pci_bus 0000:05: resource 1 [mem 0xfd500000-0xfd5fffff]
0.220847] pci_bus 0000:05: resource 2 [mem 0xfd400000-0xfd4fffff 64bit pref]
0.220849] pci_bus 0000:05: resource 4 [io
0x0000-0x0cf7]
0.220851] pci_bus 0000:05: resource 5 [io
0x0d00-0xffff]
0.220853] pci_bus 0000:05: resource 6 [mem 0x000a0000-0x000bffff]
0.220855] pci_bus 0000:05: resource 7 [mem 0x000c0000-0x000dffff]
0.220857] pci_bus 0000:05: resource 8 [mem 0x7f600000-0xfebfffff]
net/ipv4/af_inet.c中有下面代码:
fs_initcall(inet_init);
此时调用inet_init, inet_init调用socket_register(&inet_family_ops),输出下面信息:
0.220902] NET: Registered protocol family 2
在include/linux/socket.h中有下面的定义:
#define AF_INET
/* Internet IP Protocol
inet_family_ops.family=PF_INET,而PF_INET又等于AF_INET,所以输出的协议簇是2
inet_init还分别对arp,ip,tcp,udp,ping,icmp等进行了初始化。
inet_init调用ip_init,ip_init调用ip_rt_init,输出下面信息:
0.220961] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
inet_init调用tcp_init,输出下面信息:
0.221172] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
0.221641] TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
0.221873] TCP: Hash tables configured (established 131072 bind 65536)
tcp_init调用tcp_register_congestion_control(&tcp_reno),输出下面信息:
0.221875] TCP reno registered
inet_init调用udp_init,udp_init调用udp_table_init,udp_table_init调用alloc_large_system_hash,输出下面信息:
0.221878] UDP hash table entries: 512 (order: 2, 16384 bytes)
inet_init接着调用udplite4_register,udplite4_register调用udp_table_init(&udplite_table,"UDP-LITE"),
udp_table_init调用alloc_large_system_hash,输出下面信息:
0.221886] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
net/unix/af_unix.c中有下面代码:
fs_initcall(af_unix_init);
此时调用af_unix_init,af_unit_init调用sock_register(&unix_family_ops),unix_family_ops.family=PF_UNIX,
PF_UNIX=AF_UNIX,而AF_UNIX定义位于include/linux/socket.h,如下所示:
#define AF_UNIX
/* Unix domain sockets
所以输出下面信息:
0.221963] NET: Registered protocol family 1
drivers/pci/quirks.c中有下面代码:
fs_initcall_sync(pci_apply_final_quirks);
此时执行pci_apply_final_quirks,pci_apply_final_quirks对于每个pci设备调用pci_fixup_dev(pci_fixup_final,dev).
相当于执行pci_do_fixups(dev, __start_pci_fixups_final,__end_pci_fixups_final).
该函数会调用__start_pci_fixups_final和__end_pci_fixups_final之间的所有函数。
arch/x86/kernel/vmlinux.lds中有下面的定义:
__start_pci_fixups_final = .; *(.pci_fixup_final) __end_pci_fixups_final = .;
&所以会调用.pci_fixup_final段中的所有函数。
pci_fixup_video有下面的声明(arch/x86/pci/fixup.c):
DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
DECLARE_PCI_FIXUP_FINAL定义如下(include/linux/pci.h):
#define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook)
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final,
vendor##device##hook, vendor, device, hook)
该声明会将pci_fixup_video函数放入到.pci_fixup_final段中。
所以此时会执行pci_fixup_video,输出下面信息:
0.221980] pci 0000:00:02.0: Boot video device
pci_apply_final_quirks中继续输出下面信息:
0.222136] PCI: CLS 32 bytes, default 64
init/initramfs.c中有下面代码:
rootfs_initcall(populate_rootfs);
此时执行populate_rootfs,输出下面信息:
0.222187] Unpacking initramfs...
populate_rootfs中调用free_initrd,free_initrd调用free_initrd_mem,free_initrd_mem调用free_init_pages, 输出下面信息:
2.772396] Freeing initrd memory: 116776k freed
kernel/audit.c中有下面代码:
__initcall(audit_init);
include/linux/init.h中定义如下:
#define __initcall(fn) device_initcall(fn)
此时执行audit_init,输出下面信息:
2.837035] audit: initializing netlink socket (disabled)
&audit_init中调用audit_log,输出下面信息:
2.837049] type=2000 audit(.832:1): initialized
mm/bounce.c中有下面代码:
__initcall(init_emergency_pool);
此时执行init_emergency_pool函数,输出下面信息:
2.853523] highmem bounce pool size: 64 pages
mm/hugetlb.c中有下面定义:
module_init(hugetlb_init);
include/linux/init.h中有下面定义:
#define module_init(x)
__initcall(x);
此时执行hugetlb_init,hugetlb_init调用report_hugepages,输出下面信息:
2.853528] HugeTLB registered 2 MB page size, pre-allocated 0 pages
fs/quota/dquot.c中有下面代码:
module_init(dquot_init);
此时调用dquot_init,输出下面信息:
2.853968] VFS: Disk quotas dquot_6.5.2[
2.854000] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
ipc/util.c中有下面代码:
__initcall(ipc_init);
此时执行ipc_init.ipc_init调用msg_init,输出下面信息:
2.854069] msgmni has been set to 1734
下面输出信息是从cryptomgr_notifiy中调用的(不知道是从哪个函数调用过来的):
2.854228] alg: No test for stdrng (krng)
block/bsg.c中有下面代码:
device_initcall(bsg_init);
此时调用bsg_init,输出下面信息:
2.854253] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
block/noop-iosched.c中有下面代码:
module_init(noop_init);
此时执行noop_init,noop_init调用elv_register,输出下面信息:
2.854256] io scheduler noop registered
block/deadline-iosched.c中有下面代码:
module_init(deadline_init);
此时执行deadline_init,deadline_init调用elv_register,输出下面信息:
2.854258] io scheduler deadline registered
block/cfq-iosched.c中有下面代码:
module_init(cfq_init);
此时调用cfq_init,cfq_init调用elv_register,输出下面信息:
2.854269] io scheduler cfq registered (default)
drivers/pci/pcie/portdrv_pci.c中有下面代码:
module_init(pcie_portdrv_init);
此时执行pcie_portdrv_init,pcie_portdrv_init调用pcie_register_driver,.之后会执行pcie_portdriver的probe函数,即pcie_portdrv_probe.
pcie_portdrv_probe调用pcie_port_device_register,pcie_port_device_register调用pci_set_master,pci_set_master调用pcibios_set_master,
输出下面信息:
2.854355] pcieport 0000:00:1c.0: setting latency timer to 64
下面信息是由setup_msi_irq输出的(但不知道是从哪个函数调用过去的):
2.854395] pcieport 0000:00:1c.0: irq 40 for MSI/MSI-X
类似地,输出下面信息:
2.854451] pcieport 0000:00:1c.1: setting latency timer to 64
2.854484] pcieport 0000:00:1c.1: irq 41 for MSI/MSI-X
2.854541] pcieport 0000:00:1c.2: setting latency timer to 64
2.854573] pcieport 0000:00:1c.2: irq 42 for MSI/MSI-X
2.854628] pcieport 0000:00:1c.3: setting latency timer to 64
2.854661] pcieport 0000:00:1c.3: irq 43 for MSI/MSI-X
drivers/pci/hotplug/pci_hotplug_core.c中有下面代码:
module_init(pci_hotplug_init);
此时执行pci_hotplug_init,输出下面信息:
2.854741] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
drivers/pci/hotplug/pciehp_core.c中有下面代码:
module_init(pcied_init);
此时执行pcied_init, 输出下面信息:
2.854761] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
drivers/pci/hotplug/acpiphp_core.c中有下面代码:
module_init(acpiphp_init);
此时执行acpiphp_init,输出下面信息:
2.854763] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
drivers/idle/intel_idle.c中有下面代码:
module_init(intel_idle_init);
此时执行intel_idle_init,intel_idle_init调用intel_idle_probe,输出下面信息:
2.855076] intel_idle: does not run on family 6 model 23
drivers/acpi/apei/erst.c中有下面代码:
device_initcall(erst_init);
此时执行erst_init,输出下面信息:
[ 2.855100] ERST: Table is not found!
drivers/acpi/apei/ghes.c中有下面代码:
module_init(ghes_init);
此时执行ghes_init,输出下面信息:
2.855101] GHES: HEST is not enabled!
drivers/pnp/isapnp/core.c中有下面代码:
device_initcall(isapnp_init);
此时执行isapnp_init,输出下面信息:
2.855114] isapnp: Scanning for PnP cards...
3.208006] isapnp: No Plug & Play device found
drivers/tty/serial/8250.c有下面代码:
module_init(serial8250_init);
此时执行serial8250_init,输出下面信息:
3.208065] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250_init调用serial8250_register_ports,serial8250_register_ports对于每个串口调用uart_add_one_port,
uart_add_one_port调用uart_configure_port,uart_configure_port调用uart_report_port,因多次调用,输出下面信息:
3.228404] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
3.248775] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
之后执行serial8250_probe,对于每个端口serial8250_register_port调用uart_add_one_port,uart_add_one_port调用uart_configure_port,
uart_configure_port调用uart_report_port,因为多次调用输出下面信息:
3.272684] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
3.293099] 00:09: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
drivers/char/agp/backend.c中有下面代码:
module_init(agp_init);
此时执行agp_init,输出下面信息:
3.293354] Linux agpgart interface v0.103
drivers/char/agp/intel-agp.c中有下面代码:
module_init(agp_intel_init);
此时执行agp_intel_init函数,调用pci_register_driver,经过很长一段调用后会调用agp_intel_pci_driver.probe,即agp_intel_probe.
agp_intel_probe调用agp_gmch_probe,输出下面信息:
3.293461] agpgart-intel 0000:00:00.0: Intel G33 Chipset
agp_gmch_probe调用intel_gtt_init,输出下面信息:
3.293522] agpgart-intel 0000:00:00.0: detected gtt size: 524288K total, 262144K mappable
intel_gtt_init调用intel_gtt_stolen_size,输出下面信息:
3.294055] agpgart-intel 0000:00:00.0: detected 8192K stolen memory
agp_intel_probe调用agp_add_bridge,输出下面信息:
3.294182] agpgart-intel 0000:00:00.0: AGP aperture is 256M @ 0xd0000000
driver/input/serio/i8042.c中有下面代码:
module_init(i8042_init);
&此时调用i8042_init,i8042_init调用i8042_platform_init,i8042_platform_init调用i8042_pnp_init, 输出下面信息:
3.294348] i8042: PNP: No PS/2 controller found. Probing ports directly.
之后执行platform_create_bundle,platform_create_bundle调用platform_driver_probe,之后调用i8042_probe,
i8042_probe调用i8042_register_ports,i8042_register_ports对每个串口输出信息,得到下面内容:
3.294708] serio: i8042 KBD port at 0x60,0x64 irq 1
3.294714] serio: i8042 AUX port at 0x60,0x64 irq 12
drivers/input/mousedev.c中有下面代码:
module_init(mousedev_init);
此时执行mousedev_init,输出下面信息:
3.294847] mousedev: PS/2 mouse device common for all mice
drivers/rtc/rtc-cmos.c中有下面代码:
module_init(cmos_init);
此时执行cmos_init, cmos_init调用pnp_register_driver或者platform_driver_probe,
之后会调用cmos_pnp_probe或者cmos_platform_probe,然后调用cmos_wake_setup,
cmos_wake_setup输出下面信息:
3.294893] rtc_cmos 00:04: RTC can wake from S4
cmos_do_probe调用rtc_device_register,输出下面信息:
3.294995] rtc_cmos 00:04: rtc core: registered rtc_cmos as rtc0
cmos_do_probe继续输出下面信息:
3.295017] rtc0: alarms up to one month, 242 bytes nvram, hpet irqs
drivers/cpuidle/governors/ladder.c中有下面代码:
module_init(init_ladder);
此时调用init_ladder, init_ladder调用cpuidle_register_governor(&ladder_governor),ladder_governor.name="ladder".
cpuidle_register_governor调用cpuidle_switch_governor,输出下面信息:
3.295029] cpuidle: using governor ladder
drivers/cpuidle/governors/menu.c中有下面代码:
module_init(init_menu);
跟上一行输出类似,会产生下面的输出:
3.295031] cpuidle: using governor menu
net/ipv4/tcp_cubic.c中有下面代码:
module_init(cubictcp_register);
此时执行 cubictcp_register, cubictcp_register调用tcp_register_congestion_control(&cutictcp),输出下面信息:
3.295221] TCP cubic registered
net/ipv6/af_inet6.c中有下面代码:
module_init(inet6_init);
此时执行inet6_init,inet6_init调用sock_register(&inet6_family_ops),输出下面信息:
3.295256] NET: Registered protocol family 10
net/ipv6/mip6.c中有下面代码:
module_init(mip6_init);
此时执行mip6_init,输出下面信息:
3.295692] Mobile IPv6
net/packet/af_packet.c中有下面代码:
module_init(packet_init);
此时执行packet_init,packet_init调用sock_register,输出下面信息:
3.295695] NET: Registered protocol family 17
注意:17=AF_PACKET 用于raw packet socket.
net/dns_resolver/dns_key.c中有下面代码:
module_init(init_dns_resolver)
此时调用init_dns_resolver,输出下面信息:
3.295699] Registering the dns_resolver key type
arch/x86/kernel/apci/probe_32.c中有下面代码:
late_initcall(print_ipi_mode);
此时执行print_ipi_mode函数,输出下面信息:
3.295718] Using IPI No-Shortcut mode
kernel/power/hibernate.c中有下面代码:
late_initcall(software_resume);
此时执行software_resume,输出下面信息:
3.295829] PM: Hibernation image not present or could not be loaded.
kernel/taskstats.c中有下面代码:
late_initcall(taskstats_init);
此时执行taskstats_init,输出下面信息:
3.295839] registered taskstats version 1
drivers/rtc/hctosys.c中有下面代码:
late_initcall(rtc_hctosys);
此时执行rtc_hctosys函数,输出下面信息:
3.296264] rtc_cmos 00:04: setting system clock to 2014-06-23 07:56:58 UTC ()
net/core/drop_monitor.c中有下面代码:
late_initcall(init_net_drop_monitor);
此时执行init_net_drop_monitor,输出下面信息:
3.296298] Initializing network drop monitor service
回到kernel_init函数,调用init_post,init_post调用free_initmem,free_initmem调用free_init_pages, 输出下面信息:
3.296382] Freeing unused kernel memory: 428k freed
init_post调用mark_rodata_ro,输出下面信息:
3.296529] Write protecting the kernel text: 2884k
3.296559] Write protecting the kernel read-only data: 1104k
mark_rodata_ro调用mark_nxdata_nx,输出下面信息:
3.296560] NX-protecting the kernel data: 3260k
init_post新开启一个进程执行/sbin/init。

我要回帖

更多关于 debian intel显卡驱动 的文章

 

随机推荐