首页 > 代码库 > 搭建《深入Linux内核架构》的Linux环境
搭建《深入Linux内核架构》的Linux环境
作者
彭东林
pengdonglin137@163.com
软件
Host: Ubuntu14.04 64
Qemu 2.8.0
Linux 2.6.24
busybox 1.24.2
gcc 4.4.7
概述
为了尽量还原《深入Linux内核架构》这本书的环境,我下载了Linux 2.6.24,由于这个内核版本比较老,所以用最新的gcc编译会有问题,所以需要安装一个比较老的gcc,从该内核的README得知,gcc的版本最少应该是3.2.
正文
一、安装GCC
使用apt-cache search gcc发现,目前可以安装的最老的gcc版本是4.4,安装命令如下:
sudo apt-get install gcc-4.4*
为了便于跟原来的高版本的gcc切换,可以使用下面的命令:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 0sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 1
这样,在切换gcc版本时就方便多了,可以使用下面的命令切换:
sudo update-alternatives --config gcc
此时会列出如下信息:
There are 2 choices for the alternative gcc (providing /usr/bin/gcc). Selection Path Priority Status------------------------------------------------------------ 0 /usr/bin/gcc-4.4 1 auto mode* 1 /usr/bin/gcc-4.4 1 manual mode 2 /usr/bin/gcc-4.8 0 manual modePress enter to keep the current choice[*], or type selection number:
根据需求选择我们需要的版本即可。
二、编译Linux内核
编译命令如下:
#!/bin/bashmake ARCH=i386 i386_defconfigmake ARCH=i386 menuconfigmake ARCH=i386 bzImage V=1 -j8
在编译的时候会提示如下的错误:
arch/x86/boot/boot.h: Assembler messages:arch/x86/boot/boot.h:112: Error: bad register name `%dil‘
也就是下面的一行代码出现问题:
asm volatile("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr));
在网上搜索一番后,出现这个问题的原因如下:(http://nxlhero.blog.51cto.com/962631/702421/)
"r"表示的时任何寄存器,而dil寄存器时x86_64上才有的,所以将上面的"=r"换为"=q",即限定为只能选eax,ebx,ecx,edx之一。
修改完成后,就可以编译通过了。
支持ramdisk:
General setup ----> [*] Initial RAM filesystem and RAM disk (initramfs/initrd) supportDevice Drivers ----> [*] Block devices ----> (16) Default number of RAM disks ----> (65535) Default RAM disk size (kbytes) ----> (1024) Default RAM disk block size (bytes)
三、制作跟文件系统
这一节参考用Qemu搭建x86学习环境
制作脚本mk_ramdisk.sh稍有不同:
#!/bin/bashsudo rm -rf rootfssudo rm -rf tmpfssudo rm -rf ramdisk*sudo mkdir rootfssudo cp /home/pengdonglin/disk_ext/Third_Part/Busybox/x86_2_6_24/_install/* rootfs/ -rafsudo mkdir -p rootfs/proc/sudo mkdir -p rootfs/sys/sudo mkdir -p rootfs/tmp/sudo mkdir -p rootfs/root/sudo mkdir -p rootfs/var/sudo mkdir -p rootfs/mnt/sudo cp etc rootfs/ -arfsudo mkdir -p rootfs/libsudo cp -arf /lib/i386-linux-gnu/* rootfs/lib/sudo rm -f rootfs/lib/*.asudo strip rootfs/lib/*sudo mkdir -p rootfs/dev/sudo mknod rootfs/dev/tty1 c 4 1sudo mknod rootfs/dev/tty2 c 4 2sudo mknod rootfs/dev/tty3 c 4 3sudo mknod rootfs/dev/tty4 c 4 4sudo mknod rootfs/dev/console c 5 1sudo mknod rootfs/dev/null c 1 3sudo dd if=/dev/zero of=ramdisk bs=1M count=32sudo mkfs.ext2 -F ramdisksudo mkdir -p tmpfssudo mount -t ext2 ramdisk ./tmpfs/ -o loopsudo cp -raf rootfs/* tmpfs/sudo umount tmpfs
这里不需要压缩ramdisk,因为Linux 2.6.24不支持gzip压缩的ramdisk,我们直接使用制作出的32M的ramdisk就好了。
四、运行qemu
run.sh:
sudo qemu-system-i386 -smp 2 -m 1024M -kernel ./Linux-2.6.24/arch/x86/boot/bzImage -nographic -append "root=/dev/ram1 rw rootfstype=ext2 console=ttyS0 init=/linuxrc" -initrd ./rootfs/ramdisk -net nic,vlan=0 -net tap,vlan=0,ifname=tap0
注意上面的root是/dev/ram1,initrd使用的是未压缩的ramdisk。
五、启动log
$./run.sh [sudo] password for pengdonglin: sudo tunctl -u root -t tap0TUNSETIFF: Device or resource busysudo ifconfig tap0 0.0.0.0 promisc upsudo brctl addif br0 tap0brctl showbridge name bridge id STP enabled interfacesbr0 8000.027fb716b96e no eth0 tap0[ 0.000000] Linux version 2.6.24-gcbe024b4-dirty (pengdonglin@pengdonglin-dell) (gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-8ubuntu1) ) #7 SMP Sun Jul 2 12:29:54 CST 2017[ 0.000000] BIOS-provided physical RAM map:[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)[ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)[ 0.000000] BIOS-e820: 0000000000100000 - 000000003ffe0000 (usable)[ 0.000000] BIOS-e820: 000000003ffe0000 - 0000000040000000 (reserved)[ 0.000000] BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)[ 0.000000] 127MB HIGHMEM available.[ 0.000000] 896MB LOWMEM available.[ 0.000000] found SMP MP-table at 000f6a90[ 0.000000] Zone PFN ranges:[ 0.000000] DMA 0 -> 4096[ 0.000000] Normal 4096 -> 229376[ 0.000000] HighMem 229376 -> 262112[ 0.000000] Movable zone start PFN for each node[ 0.000000] early_node_map[1] active PFN ranges[ 0.000000] 0: 0 -> 262112[ 0.000000] DMI 2.8 present.[ 0.000000] Using APIC driver default[ 0.000000] ACPI: RSDP 000F6860, 0014 (r0 BOCHS )[ 0.000000] ACPI: RSDT 3FFE1936, 0030 (r1 BOCHS BXPCRSDT 1 BXPC 1)[ 0.000000] ACPI: FACP 3FFE180A, 0074 (r1 BOCHS BXPCFACP 1 BXPC 1)[ 0.000000] ACPI: DSDT 3FFE0040, 17CA (r1 BOCHS BXPCDSDT 1 BXPC 1)[ 0.000000] ACPI: FACS 3FFE0000, 0040[ 0.000000] ACPI: APIC 3FFE187E, 0080 (r1 BOCHS BXPCAPIC 1 BXPC 1)[ 0.000000] ACPI: HPET 3FFE18FE, 0038 (r1 BOCHS BXPCHPET 1 BXPC 1)[ 0.000000] ACPI: PM-Timer IO Port: 0x608[ 0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)[ 0.000000] Processor #0 6:6 APIC version 20[ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)[ 0.000000] Processor #1 6:6 APIC version 20[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])[ 0.000000] ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])[ 0.000000] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)[ 0.000000] Enabling APIC mode: Flat. Using 1 I/O APICs[ 0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000[ 0.000000] Using ACPI (MADT) for SMP configuration information[ 0.000000] Allocating PCI resources starting at 50000000 (gap: 40000000:bffc0000)[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260065[ 0.000000] Kernel command line: root=/dev/ram1 rw rootfstype=ext2 console=ttyS0 init=/linuxrc[ 0.000000] Enabling fast FPU save and restore... done.[ 0.000000] Enabling unmasked SIMD FPU exception support... done.[ 0.000000] Initializing CPU#0[ 0.000000] PID hash table entries: 4096 (order: 12, 16384 bytes)[ 0.000000] Detected 3591.653 MHz processor.[ 0.440318] Console: colour VGA+ 80x25[ 0.441036] console [ttyS0] enabled[ 0.449033] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)[ 0.450203] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)[ 0.526150] Memory: 1000056k/1048448k available (3234k kernel code, 47704k reserved, 1580k data, 264k init, 130944k highmem)[ 0.526566] virtual kernel memory layout:[ 0.526571] fixmap : 0xffe14000 - 0xfffff000 (1964 kB)[ 0.526577] pkmap : 0xff800000 - 0xffc00000 (4096 kB)[ 0.526582] vmalloc : 0xf8800000 - 0xff7fe000 ( 111 MB)[ 0.526586] lowmem : 0xc0000000 - 0xf8000000 ( 896 MB)[ 0.526591] .init : 0xc05bb000 - 0xc05fd000 ( 264 kB)[ 0.526596] .data : 0xc0428b57 - 0xc05b3f0c (1580 kB)[ 0.526601] .text : 0xc0100000 - 0xc0428b57 (3234 kB)[ 0.527733] Checking if this processor honours the WP bit even in supervisor mode... Ok.[ 0.529667] SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=2, Nodes=1[ 0.610936] Calibrating delay using timer specific routine.. 7223.22 BogoMIPS (lpj=14446442)[ 0.612052] Mount-cache hash table entries: 512[ 0.616757] CPU: L1 I cache: 32K, L1 D cache: 32K[ 0.616915] CPU: L2 cache: 4096K[ 0.617011] CPU: L3 cache: 16384K[ 0.617364] Compat vDSO mapped to ffffe000.[ 0.617873] Checking ‘hlt‘ instruction... OK.[ 0.633293] SMP alternatives: switching to UP code[ 0.634978] ACPI: Core revision 20070126[ 0.656303] Parsing all Control Methods:[ 0.657602] Table [DSDT](id 0001) - 319 Objects with 54 Devices 88 Methods 9 Regions[ 0.658273] tbxface-0598 [00] tb_load_namespace : ACPI Tables successfully acquired[ 0.659332] evxfevnt-0091 [00] enable : Transition to ACPI mode successful[ 0.663913] CPU0: Intel QEMU Virtual CPU version 2.5+ stepping 03[ 0.665581] SMP alternatives: switching to SMP code[ 0.667474] Booting processor 1/1 eip 3000[ 0.678304] Initializing CPU#1[ 0.758847] Calibrating delay using timer specific routine.. 7237.43 BogoMIPS (lpj=14474868)[ 0.758965] CPU: L1 I cache: 32K, L1 D cache: 32K[ 0.758971] CPU: L2 cache: 4096K[ 0.758976] CPU: L3 cache: 16384K[ 0.759066] CPU1: Intel QEMU Virtual CPU version 2.5+ stepping 03[ 0.760347] Total of 2 processors activated (14460.65 BogoMIPS).[ 0.760865] ENABLING IO-APIC IRQs[ 0.761888] ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1[ 0.909441] checking TSC synchronization [CPU#0 -> CPU#1]: passed.[ 0.930299] Brought up 2 CPUs[ 0.936650] net_namespace: 64 bytes[ 0.939296] NET: Registered protocol family 16[ 0.941882] ACPI: bus type pci registered[ 0.944310] PCI: PCI BIOS revision 2.10 entry at 0xfd536, last bus=0[ 0.944708] PCI: Using configuration type 1[ 0.944969] Setting up standard PCI resources[ 0.965663] evgpeblk-0956 [00] ev_create_gpe_block : GPE 00 to 0F [_GPE] 2 regs on int 0x9[ 0.967935] evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 0 Wake, Enabled 3 Runtime GPEs in this block[ 0.987575] Completing Region/Field/Buffer/Package initialization:................................[ 0.993463] Initialized 6/9 Regions 0/0 Fields 22/22 Buffers 4/4 Packages (328 nodes)[ 0.993951] Initializing Device/Processor/Thermal objects by executing _INI methods:.[ 0.996741] Executed 1 _INI methods requiring 0 _STA executions (examined 58 objects)[ 0.997565] ACPI: Interpreter enabled[ 0.997789] ACPI: (supports S0 S3 S5)[ 0.998529] ACPI: Using IOAPIC for interrupt routing[ 1.033396] ACPI: PCI Root Bridge [PCI0] (0000:00)[ 1.037227] PCI quirk: region 0600-063f claimed by PIIX4 ACPI[ 1.037557] PCI quirk: region 0700-070f claimed by PIIX4 SMB[ 1.601786] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)[ 1.602799] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)[ 1.603545] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)[ 1.604263] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)[ 1.604751] ACPI: PCI Interrupt Link [LNKS] (IRQs *9)[ 1.605642] Linux Plug and Play Support v0.97 (c) Adam Belay[ 1.606005] pnp: PnP ACPI init[ 1.606194] ACPI: bus type pnp registered[ 1.613416] pnp: PnP ACPI: found 11 devices[ 1.613718] ACPI: ACPI bus type pnp unregistered[ 1.615432] SCSI subsystem initialized[ 1.617297] usbcore: registered new interface driver usbfs[ 1.618416] usbcore: registered new interface driver hub[ 1.619362] usbcore: registered new device driver usb[ 1.620612] PCI: Using ACPI for IRQ routing[ 1.620944] PCI: If a device doesn‘t work, try "pci=routeirq". If it helps, post a report[ 1.635350] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0[ 1.635660] hpet0: 3 64-bit timers, 100000000 Hz[ 1.638597] Time: tsc clocksource has been installed.[ 1.681402] NET: Registered protocol family 2[ 1.720234] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)[ 1.723501] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)[ 1.726897] TCP bind hash table entries: 65536 (order: 7, 524288 bytes)[ 1.729321] TCP: Hash tables configured (established 131072 bind 65536)[ 1.730276] TCP reno registered[ 1.746360] checking if image is initramfs...it isn‘t (bad gzip magic numbers); looks like an initrd[ 1.938773] Freeing initrd memory: 32768k freed[ 1.943777] IA-32 Microcode Update Driver: v1.14a <tigran@aivazian.fsnet.co.uk>[ 1.947253] highmem bounce pool size: 64 pages[ 1.947632] Total HugeTLB memory allocated, 0[ 1.963164] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).[ 1.964768] io scheduler noop registered[ 1.964965] io scheduler anticipatory registered (default)[ 1.965183] io scheduler deadline registered[ 1.965438] io scheduler cfq registered[ 1.965701] Limiting direct PCI/PCI transfers.[ 1.965926] PCI: PIIX3: Enabling Passive Release on 0000:00:01.0[ 1.966507] Activating ISA DMA hang workarounds.[ 1.970978] input: Power Button (FF) as /class/input/input0[ 1.971269] ACPI: Power Button (FF) [PWRF][ 2.108664] Real Time Clock Driver v1.12ac[ 2.109772] Linux agpgart interface v0.102[ 2.110646] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled[ 2.111801] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A[ 2.114751] 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A[ 2.116457] Floppy drive(s): fd0 is 2.88M AMI BIOS[ 2.132601] FDC 0 is a S82078B[ 2.139792] RAMDISK driver initialized: 16 RAM disks of 65535K size 1024 blocksize[ 2.141816] loop: module loaded[ 2.142121] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2[ 2.142610] Copyright (c) 1999-2006 Intel Corporation.[ 2.147196] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11[ 2.147869] ACPI: PCI Interrupt 0000:00:03.0[A] -> Link [LNKC] -> GSI 11 (level, high) -> IRQ 11[ 2.402031] e1000: 0000:00:03.0: e1000_probe: (PCI:33MHz:32-bit) 52:54:00:12:34:56[ 2.441061] e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection[ 2.442663] e100: Intel(R) PRO/100 Network Driver, 3.5.23-k4-NAPI[ 2.442895] e100: Copyright(c) 1999-2006 Intel Corporation[ 2.447368] console [netcon0] enabled[ 0.000000] Linux version 2.6.24-gcbe024b4-dirty (pengdonglin@pengdonglin-dell) (gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-8ubuntu1) ) #7 SMP Sun Jul 2 12:29:54 CST 2017[ 0.000000] BIOS-provided physical RAM map:[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)[ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)[ 0.000000] BIOS-e820: 0000000000100000 - 000000003ffe0000 (usable)[ 0.000000] BIOS-e820: 000000003ffe0000 - 0000000040000000 (reserved)[ 0.000000] BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)[ 0.000000] 127MB HIGHMEM available.[ 0.000000] 896MB LOWMEM available.[ 0.000000] found SMP MP-table at 000f6a90[ 0.000000] Zone PFN ranges:[ 0.000000] DMA 0 -> 4096[ 0.000000] Normal 4096 -> 229376[ 0.000000] HighMem 229376 -> 262112[ 0.000000] Movable zone start PFN for each node[ 0.000000] early_node_map[1] active PFN ranges[ 0.000000] 0: 0 -> 262112[ 0.000000] DMI 2.8 present.[ 0.000000] Using APIC driver default[ 0.000000] ACPI: RSDP 000F6860, 0014 (r0 BOCHS )[ 0.000000] ACPI: RSDT 3FFE1936, 0030 (r1 BOCHS BXPCRSDT 1 BXPC 1)[ 0.000000] ACPI: FACP 3FFE180A, 0074 (r1 BOCHS BXPCFACP 1 BXPC 1)[ 0.000000] ACPI: DSDT 3FFE0040, 17CA (r1 BOCHS BXPCDSDT 1 BXPC 1)[ 0.000000] ACPI: FACS 3FFE0000, 0040[ 0.000000] ACPI: APIC 3FFE187E, 0080 (r1 BOCHS BXPCAPIC 1 BXPC 1)[ 0.000000] ACPI: HPET 3FFE18FE, 0038 (r1 BOCHS BXPCHPET 1 BXPC 1)[ 0.000000] ACPI: PM-Timer IO Port: 0x608[ 0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)[ 0.000000] Processor #0 6:6 APIC version 20[ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)[ 0.000000] Processor #1 6:6 APIC version 20[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])[ 0.000000] ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])[ 0.000000] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)[ 0.000000] Enabling APIC mode: Flat. Using 1 I/O APICs[ 0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000[ 0.000000] Using ACPI (MADT) for SMP configuration information[ 0.000000] Allocating PCI resources starting at 50000000 (gap: 40000000:bffc0000)[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260065[ 0.000000] Kernel command line: root=/dev/ram1 rw rootfstype=ext2 console=ttyS0 init=/linuxrc[ 0.000000] Enabling fast FPU save and restore... done.[ 0.000000] Enabling unmasked SIMD FPU exception support... done.[ 0.000000] Initializing CPU#0[ 0.000000] PID hash table entries: 4096 (order: 12, 16384 bytes)[ 0.000000] Detected 3591.653 MHz processor.[ 0.440318] Console: colour VGA+ 80x25[ 0.441036] console [ttyS0] enabled[ 0.449033] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)[ 0.450203] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)[ 0.526150] Memory: 1000056k/1048448k available (3234k kernel code, 47704k reserved, 1580k data, 264k init, 130944k highmem)[ 0.526566] virtual kernel memory layout:[ 0.526571] fixmap : 0xffe14000 - 0xfffff000 (1964 kB)[ 0.526577] pkmap : 0xff800000 - 0xffc00000 (4096 kB)[ 0.526582] vmalloc : 0xf8800000 - 0xff7fe000 ( 111 MB)[ 0.526586] lowmem : 0xc0000000 - 0xf8000000 ( 896 MB)[ 0.526591] .init : 0xc05bb000 - 0xc05fd000 ( 264 kB)[ 0.526596] .data : 0xc0428b57 - 0xc05b3f0c (1580 kB)[ 0.526601] .text : 0xc0100000 - 0xc0428b57 (3234 kB)[ 0.527733] Checking if this processor honours the WP bit even in supervisor mode... Ok.[ 0.529667] SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=2, Nodes=1[ 0.610936] Calibrating delay using timer specific routine.. 7223.22 BogoMIPS (lpj=14446442)[ 0.612052] Mount-cache hash table entries: 512[ 0.616757] CPU: L1 I cache: 32K, L1 D cache: 32K[ 0.616915] CPU: L2 cache: 4096K[ 0.617011] CPU: L3 cache: 16384K[ 0.617364] Compat vDSO mapped to ffffe000.[ 0.617873] Checking ‘hlt‘ instruction... OK.[ 0.633293] SMP alternatives: switching to UP code[ 0.634978] ACPI: Core revision 20070126[ 0.656303] Parsing all Control Methods:[ 0.657602] Table [DSDT](id 0001) - 319 Objects with 54 Devices 88 Methods 9 Regions[ 0.658273] tbxface-0598 [00] tb_load_namespace : ACPI Tables successfully acquired[ 0.659332] evxfevnt-0091 [00] enable : Transition to ACPI mode successful[ 0.663913] CPU0: Intel QEMU Virtual CPU version 2.5+ stepping 03[ 0.665581] SMP alternatives: switching to SMP code[ 0.667474] Booting processor 1/1 eip 3000[ 0.678304] Initializing CPU#1[ 0.758847] Calibrating delay using timer specific routine.. 7237.43 BogoMIPS (lpj=14474868)[ 0.758965] CPU: L1 I cache: 32K, L1 D cache: 32K[ 0.758971] CPU: L2 cache: 4096K[ 0.758976] CPU: L3 cache: 16384K[ 0.759066] CPU1: Intel QEMU Virtual CPU version 2.5+ stepping 03[ 0.760347] Total of 2 processors activated (14460.65 BogoMIPS).[ 0.760865] ENABLING IO-APIC IRQs[ 0.761888] ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1[ 0.909441] checking TSC synchronization [CPU#0 -> CPU#1]: passed.[ 0.930299] Brought up 2 CPUs[ 0.936650] net_namespace: 64 bytes[ 0.939296] NET: Registered protocol family 16[ 0.941882] ACPI: bus type pci registered[ 0.944310] PCI: PCI BIOS revision 2.10 entry at 0xfd536, last bus=0[ 0.944708] PCI: Using configuration type 1[ 0.944969] Setting up standard PCI resources[ 0.965663] evgpeblk-0956 [00] ev_create_gpe_block : GPE 00 to 0F [_GPE] 2 regs on int 0x9[ 0.967935] evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 0 Wake, Enabled 3 Runtime GPEs in this block[ 0.987575] Completing Region/Field/Buffer/Package initialization:................................[ 0.993463] Initialized 6/9 Regions 0/0 Fields 22/22 Buffers 4/4 Packages (328 nodes)[ 0.993951] Initializing Device/Processor/Thermal objects by executing _INI methods:.[ 0.996741] Executed 1 _INI methods requiring 0 _STA executions (examined 58 objects)[ 0.997565] ACPI: Interpreter enabled[ 0.997789] ACPI: (supports S0 S3 S5)[ 0.998529] ACPI: Using IOAPIC for interrupt routing[ 1.033396] ACPI: PCI Root Bridge [PCI0] (0000:00)[ 1.037227] PCI quirk: region 0600-063f claimed by PIIX4 ACPI[ 1.037557] PCI quirk: region 0700-070f claimed by PIIX4 SMB[ 1.601786] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)[ 1.602799] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)[ 1.603545] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)[ 1.604263] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)[ 1.604751] ACPI: PCI Interrupt Link [LNKS] (IRQs *9)[ 1.605642] Linux Plug and Play Support v0.97 (c) Adam Belay[ 1.606005] pnp: PnP ACPI init[ 1.606194] ACPI: bus type pnp registered[ 1.613416] pnp: PnP ACPI: found 11 devices[ 1.613718] ACPI: ACPI bus type pnp unregistered[ 1.615432] SCSI subsystem initialized[ 1.617297] usbcore: registered new interface driver usbfs[ 1.618416] usbcore: registered new interface driver hub[ 1.619362] usbcore: registered new device driver usb[ 1.620612] PCI: Using ACPI for IRQ routing[ 1.620944] PCI: If a device doesn‘t work, try "pci=routeirq". If it helps, post a report[ 1.635350] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0[ 1.635660] hpet0: 3 64-bit timers, 100000000 Hz[ 1.638597] Time: tsc clocksource has been installed.[ 1.681402] NET: Registered protocol family 2[ 1.720234] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)[ 1.723501] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)[ 1.726897] TCP bind hash table entries: 65536 (order: 7, 524288 bytes)[ 1.729321] TCP: Hash tables configured (established 131072 bind 65536)[ 1.730276] TCP reno registered[ 1.746360] checking if image is initramfs...it isn‘t (bad gzip magic numbers); looks like an initrd[ 1.938773] Freeing initrd memory: 32768k freed[ 1.943777] IA-32 Microcode Update Driver: v1.14a <tigran@aivazian.fsnet.co.uk>[ 1.947253] highmem bounce pool size: 64 pages[ 1.947632] Total HugeTLB memory allocated, 0[ 1.963164] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).[ 1.964768] io scheduler noop registered[ 1.964965] io scheduler anticipatory registered (default)[ 1.965183] io scheduler deadline registered[ 1.965438] io scheduler cfq registered[ 1.965701] Limiting direct PCI/PCI transfers.[ 1.965926] PCI: PIIX3: Enabling Passive Release on 0000:00:01.0[ 1.966507] Activating ISA DMA hang workarounds.[ 1.970978] input: Power Button (FF) as /class/input/input0[ 1.971269] ACPI: Power Button (FF) [PWRF][ 2.108664] Real Time Clock Driver v1.12ac[ 2.109772] Linux agpgart interface v0.102[ 2.110646] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled[ 2.111801] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A[ 2.114751] 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A[ 2.116457] Floppy drive(s): fd0 is 2.88M AMI BIOS[ 2.132601] FDC 0 is a S82078B[ 2.139792] RAMDISK driver initialized: 16 RAM disks of 65535K size 1024 blocksize[ 2.141816] loop: module loaded[ 2.142121] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2[ 2.142610] Copyright (c) 1999-2006 Intel Corporation.[ 2.147196] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11[ 2.147869] ACPI: PCI Interrupt 0000:00:03.0[A] -> Link [LNKC] -> GSI 11 (level, high) -> IRQ 11[ 2.402031] e1000: 0000:00:03.0: e1000_probe: (PCI:33MHz:32-bit) 52:54:00:12:34:56[ 2.441061] e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection[ 2.442663] e100: Intel(R) PRO/100 Network Driver, 3.5.23-k4-NAPI[ 2.442895] e100: Copyright(c) 1999-2006 Intel Corporation[ 2.447368] console [netcon0] enabled[ 2.490168] netconsole: network logging started[ 2.490426] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2[ 2.490751] ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx[ 2.491802] PIIX3: IDE controller (0x8086:0x7010 rev 0x00) at PCI slot 0000:00:01.1[ 2.492277] PIIX3: not 100% native mode: will probe irqs later[ 2.493036] ide0: BM-DMA at 0xc040-0xc047, BIOS settings: hda:pio, hdb:pio[ 2.493638] ide1: BM-DMA at 0xc048-0xc04f, BIOS settings: hdc:pio, hdd:pio[ 4.469939] hdc: QEMU DVD-ROM, ATAPI CD/DVD-ROM drive[ 4.471796] hdc: MWDMA2 mode selected[ 4.473365] ide1 at 0x170-0x177,0x376 on irq 15[ 5.044145] hdc: ATAPI 4X DVD-ROM drive, 512kB Cache[ 5.044537] Uniform CD-ROM driver Revision: 3.20[ 5.047601] 3ware Storage Controller device driver for Linux v1.26.02.002.[ 5.048199] Driver ‘sd‘ needs updating - please use bus_type methods[ 5.048598] Driver ‘sr‘ needs updating - please use bus_type methods[ 5.050191] Fusion MPT base driver 3.04.06[ 5.050357] Copyright (c) 1999-2007 LSI Corporation[ 5.050619] Fusion MPT SPI Host driver 3.04.06[ 5.052538] ieee1394: raw1394: /dev/raw1394 device initialized[ 5.052969] usbmon: debugfs is not available[ 5.053578] USB Universal Host Controller Interface driver v3.0[ 5.054255] usbcore: registered new interface driver usblp[ 5.054469] Initializing USB Mass Storage driver...[ 5.054809] usbcore: registered new interface driver usb-storage[ 5.055038] USB Mass Storage support registered.[ 5.055861] PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12[ 5.057675] serio: i8042 KBD port at 0x60,0x64 irq 1[ 5.057993] serio: i8042 AUX port at 0x60,0x64 irq 12[ 5.059483] mice: PS/2 mouse device common for all mice[ 5.076443] input: AT Translated Set 2 keyboard as /class/input/input1[ 5.100959] device-mapper: ioctl: 4.12.0-ioctl (2007-10-02) initialised: dm-devel@redhat.com[ 5.102606] usbcore: registered new interface driver usbhid[ 5.103054] drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver[ 5.104214] oprofile: using NMI interrupt.[ 5.105193] TCP cubic registered[ 5.105441] NET: Registered protocol family 1[ 5.107096] NET: Registered protocol family 10[ 5.111118] IPv6 over IPv4 tunneling driver[ 5.112899] NET: Registered protocol family 17[ 5.114154] RPC: Registered udp transport module.[ 5.114367] RPC: Registered tcp transport module.[ 5.115520] Using IPI No-Shortcut mode[ 5.294197] input: ImExPS/2 Generic Explorer Mouse as /class/input/input2[ 5.330384] RAMDISK: ext2 filesystem found at block 0[ 5.331404] RAMDISK: Loading 32768KiB [1 disk] into ram disk... done.[ 6.704432] VFS: Mounted root (ext2 filesystem).mount: mounting debugfs on /sys/kernel/debug failed: No such file or directory[ 7.024907] e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX[ 7.028493] ADDRCONF(NETDEV_UP): eth0: link is not ready[ 7.033541] ADDRCONF(NETDEV_CHANGE): eth0: link becomes readyPlease press Enter to activate this console. [root@x86 ]# [root@x86 ]# [root@x86 ]# ifconfig eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56 inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:398 (398.0 B) Base address:0xc000 Memory:febc0000-febe0000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)[root@x86 ]# [ 113.736471] Clocksource tsc unstable (delta = 42952780594 ns)[ 113.871004] Time: hpet clocksource has been installed.[root@x86 ]# ping 192.168.1.105PING 192.168.1.105 (192.168.1.105): 56 data bytes64 bytes from 192.168.1.105: seq=0 ttl=64 time=7.657 ms64 bytes from 192.168.1.105: seq=1 ttl=64 time=2.020 ms64 bytes from 192.168.1.105: seq=2 ttl=64 time=0.371 ms64 bytes from 192.168.1.105: seq=3 ttl=64 time=0.368 ms--- 192.168.1.105 ping statistics ---4 packets transmitted, 4 packets received, 0% packet lossround-trip min/avg/max = 0.368/2.604/7.657 ms[root@x86 ]#
完。
搭建《深入Linux内核架构》的Linux环境