Linux修改pcie resource文件

Linux修改pcie resource文件,第1张

方法如下:

设备配置空间修改

修改PCIE配置空间的命令为:setpci。

NAME

setpci _ configure PCI devices

SYNOPSIS

setpci [options] devices

对于setpci命令来说,主要的参数如下:-s [[[[]:]]:][][.[]]

就是我们要指定设备,然后修改其配置空间。常用命令格式和参数如下:

setpci -s BUSID:DEVID.FUNCID REGISTEROFFSET.B=NEWVALUE

setpci -s BUSID:DEVID.FUNCID REGISTEROFFSET.W=NEWVALUE

setpci -s BUSID:DEVID.FUNCID REGISTEROFFSET.L=NEWVALUE

如:

setpci -s 0:14.0 60.B=6

是将设备0:14.0设备,PCI配置空间便宜量为0x60,写入新的字节值为6。查看PCI配置空间修改是否生效,可以通过lspci命令来查看,如设置0:14.0后,读取命令为lspci _s 0:14.0 _xxx。

ga-m52l-s3prev1.0后面的ver1.0才是版本一般在包装盒子上有标在主板pci槽左侧也有标识像我的就是rev1.0dualbios就是ga-m52l-s3p这个板子的第一版后面还出过1.11.3现在好像没有产了

Linux内核的最初部分代码是用汇编语言写的(文件是boot/bootsect.s)。(我的汇编水平有限,暂且不看),它首先把自身这部分代码移到绝对地址0x90000,把下面的2K代码从引导设备加载到地址0x90200上,内核的其余部分加载到地址0x10000处。在加载系统时显示“loading”.然后,程序控制权交给另一个实模式汇编程序(boot/Setup.S)。接下来,此程序把整个系统从地址0x10000移到地址0x1000,进入保护模式。程序控制转给系统的其余部分即地址0x1000。下一个步骤是系统内核的解压过程,这部分代码在地址0x1000(文件/Boot/head.S),该段程序初始化寄存器,然后执行decompress_kernel(),这个函数源于zBoot/inflate.c、zBoot/unzip.c和zBoot/misc.c三个文件Loading .[ bootsect.S ]uncompress ..[ decompress_kernel() ]main.c --->start_kernel() 开始.开始 printk(banner)Linux version 2.2.6 (root@lance) (gcc version 2.7.2.3) (检查一下GCC 的版本号, 在/init/main.c 中如果gcc 的版本号不够,时不允许编译内核的)#40 Sun Apr 18 17:44:20 CST 1999调用init_time()打印出以下内容:Detected 199908264 Hz processor.然后运行 console_init() -->drivers/char/tty_io.c */Console: colour VGA+ 80x25运行一个循环,测量一下 MIPS – 据说是要用一个确定的机器指令周期来实现实时的延迟.Calibrating delay loop 199.48 BogoMIPS初始化内存/* init_mem */Memory: 63396k/65536k available (848k kernel code, 408k reserved, 856k data, 28k/** dquote_init() **/VFS: Diskquotas version dquot_6.4.0 initialized察看cpu 的类型(在2.2.14 以后听说增加了对多种cpu 的支持, 以后我可得用心看看,if I can find a bug of intel then ……)CPU: Intel Pentium Pro stepping 09初始或处理器与协处理器,对于比较老的处理器, linux 会用软件模拟协处理器?Checking 386/387 coupling OK, FPU using exception 16 error reporting.检查治理的合法性Checking 'hlt' instruction OK.POSIX conformance testing by UNIFIX此后调用 linux_thread(init ,..,..,)(arch/i386/kernel/process.c)创建一个运行 init 的进程.进入了第二阶段用户模式 ( user_mode )End of start_kerne最后进入cpu_idle ( arch/i386/kernel/process.c )第二部分 设备的初始化对设备的初始化调用. init()--->do_basic_init()--+pci_init() 对pci 设备的初始化( 在main.c文件中有这样一段 ifdef PCI …..需要看一下)下面打印出结果:PCI: PCI BIOS revision 2.10 entry at 0xfd8d1PCI: Using configuration type 1PCI: Probing PCI hardware对Socket的初始化,socket_init() (这里也许就是linux 的网络秘密所在吧,以后我的注意) -Linux NET4.0 for Linux 2.2Based upon Swansea University Computer Society NET3.039NET4: Unix domain sockets 1.0 for Linux NET4.0.NET4: Linux TCP/IP 1.0 for NET4.0IP Protocols: ICMP, UDP, TCPStarting kswapd v 1.5 kswapd_setup()调用 device_setup()Detected PS/2 Mouse Port.初始化 声卡Sound initialization startedSound initialization complete初始化 软驱Floppy drive(s): fd0 is 1.44MFDC 0 is a National Semiconductor PC87306SCSI 设备的初始化(scsi0) found at PCI 13/0(scsi0) Wide Channel, SCSI ID=7, 16/255 SCBs(scsi0) Downloading sequencer code 419 instructions downloadedscsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.1.10/3.2.4scsi : 1 host.Vendor: SEAGATE Model: ST32155W Rev: 0596ype: Direct-Access ANSI SCSI revision: 02Detected scsi disk sda at scsi0, channel 0, id 0, lun 0Vendor: SEAGATE Model: ST32155W Rev: 0596Type: Direct-Access ANSI SCSI revision: 02Detected scsi disk sdb at scsi0, channel 0, id 1, lun 0scsi : detected 2 SCSI disks total.(scsi0:0:0:0) Synchronous at 40.0 Mbyte/sec, offset 8.SCSI device sda: hdwr sector= 512 bytes. Sectors= 4197405 [2049 MB] [2.0 GB ](scsi0:0:1:0) Synchronous at 40.0 Mbyte/sec, offset 8.SCSI device sdb: hdwr sector= 512 bytes. Sectors= 4197405 [2049 MB] [2.0 GB]Partition check: sda: sda1 |sdb: sdb1 sdb2 |安装 文件系统 filesystem_setup()安装设备驱动程序 mount_root()VFS: Mounted root (ext2 filesystem) readonly.Freeing unused kernel memory: 28k freedAdding Swap: 66540k swap-space (priority -1)Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996SB 3.01 detected OK (220)at 0x220 irq 5 dma 1YM3812 and OPL-3 driver Copyright (C) by Hannu Savolainen, Rob Hooft 1993-1996 at 0x388NET4: AppleTalk 0.18 for Linux NET4.0eth0: Intel EtherExpress Pro 10/100 at 0xf800, 00:A0:C9:49:2F:FF, IRQ 9.Board assembly 645520-034, Physical connectors present: RJ45Primary interface chip DP83840 PHY #1.DP83840 specific setup, setting register 23 to 8462.General self-test: passed.Serial sub-system self-test: passed.Internal registers self-test: passed.ROM checksum self-test: passed (0x49caa8d6).Receiver lock-up workaround activated.NET4: AppleTalk 0.18 for Linux NET4.0结束 do_basic_setup()open("/dev/console", O_RDWR, 0)开始执行 /sbin/init ( execv() )内核就此启动完毕


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/7340622.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-04
下一篇 2023-04-04

发表评论

登录后才能评论

评论列表(0条)

保存