作者

彭东林

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
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4

这样,在切换gcc版本时就方便多了,可以使用下面的命令切换:

sudo update-alternatives --config gcc

此时会列出如下信息:

There are  choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
/usr/bin/gcc-4.4 auto mode
* /usr/bin/gcc-4.4 manual mode
/usr/bin/gcc-4.8 manual mode Press enter to keep the current choice[*], or type selection number:

根据需求选择我们需要的版本即可。

二、编译Linux内核

编译命令如下:

#!/bin/bash
make ARCH=i386 i386_defconfig
make ARCH=i386 menuconfig
make ARCH=i386 bzImage V= -j8

在编译的时候会提示如下的错误:

arch/x86/boot/boot.h: Assembler messages:
arch/x86/boot/boot.h:: 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) support Device Drivers
  ----> [*] Block devices
        ----> () Default number of RAM disks
        ----> () Default RAM disk size (kbytes)
        ----> () Default RAM disk block size (bytes)

三、制作跟文件系统

这一节参考用Qemu搭建x86学习环境

如果在编译的时候遇到了如下的错误:

  CC      applets/applets.o
In file included from /usr/include/bits/errno.h:,
from /usr/include/errno.h:,
from include/libbb.h:,
from include/busybox.h:,
from applets/applets.c::
/usr/include/linux/errno.h:: fatal error: asm/errno.h: No such file or directory

那么需要安装下面的软件包:

sudo apt-get install linux-libc-dev:i386

制作脚本mk_ramdisk.sh稍有不同:

#!/bin/bash

sudo rm -rf rootfs
sudo rm -rf tmpfs
sudo rm -rf ramdisk*
sudo mkdir rootfs
sudo cp /home/pengdonglin/disk_ext/Third_Part/Busybox/x86_2_6_24/_install/* rootfs/ -raf
sudo 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/ -arf
sudo mkdir -p rootfs/lib
sudo cp -arf /lib/i386-linux-gnu/* rootfs/lib/
sudo rm -f rootfs/lib/*.a
sudo strip rootfs/lib/*
sudo mkdir -p rootfs/dev/
sudo mknod rootfs/dev/tty1 c 4 1
sudo mknod rootfs/dev/tty2 c 4 2
sudo mknod rootfs/dev/tty3 c 4 3
sudo mknod rootfs/dev/tty4 c 4 4
sudo mknod rootfs/dev/console c 5 1
sudo mknod rootfs/dev/null c 1 3
sudo dd if=/dev/zero of=ramdisk bs=1M count=32
sudo mkfs.ext2 -F ramdisk
sudo mkdir -p tmpfs
sudo mount -t ext2 ramdisk ./tmpfs/ -o loop
sudo cp -raf rootfs/* tmpfs/
sudo umount tmpfs

这里不需要压缩ramdisk,因为Linux 2.6.24不支持gzip压缩的ramdisk,我们直接使用制作出的32M的ramdisk就好了。

四、运行qemu

run.sh:

sudo qemu-system-i386 \
-smp \
-m 1024M \
-kernel ./Linux-2.6./arch/x86/boot/bzImage \
-nographic \
-append "root=/dev/ram1 rw rootfstype=ext2 console=ttyS0 init=/linuxrc" \
-initrd ./rootfs/ramdisk \
-net nic,vlan= -net tap,vlan=,ifname=tap0

注意上面的root是/dev/ram1,initrd使用的是未压缩的ramdisk。

五、启动log

$./run.sh
[sudo] password for pengdonglin:
sudo tunctl -u root -t tap0
TUNSETIFF: Device or resource busy
sudo ifconfig tap0 0.0.0.0 promisc up
sudo brctl addif br0 tap0
brctl show
bridge name bridge id STP enabled interfaces
br0 .027fb716b96e no eth0
tap0
[ 0.000000] Linux version 2.6.-gcbe024b4-dirty (pengdonglin@pengdonglin-dell) (gcc version 4.4. (Ubuntu/Linaro 4.4.-8ubuntu1) ) # SMP Sun Jul :: CST
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: - 000000000009fc00 (usable)
[ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000f0000 - (reserved)
[ 0.000000] BIOS-e820: - 000000003ffe0000 (usable)
[ 0.000000] BIOS-e820: 000000003ffe0000 - (reserved)
[ 0.000000] BIOS-e820: 00000000fffc0000 - (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.000000] Normal ->
[ 0.000000] HighMem ->
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[] active PFN ranges
[ 0.000000] : ->
[ 0.000000] DMI 2.8 present.
[ 0.000000] Using APIC driver default
[ 0.000000] ACPI: RSDP 000F6860, (r0 BOCHS )
[ 0.000000] ACPI: RSDT 3FFE1936, (r1 BOCHS BXPCRSDT BXPC )
[ 0.000000] ACPI: FACP 3FFE180A, (r1 BOCHS BXPCFACP BXPC )
[ 0.000000] ACPI: DSDT 3FFE0040, 17CA (r1 BOCHS BXPCDSDT BXPC )
[ 0.000000] ACPI: FACS 3FFE0000,
[ 0.000000] ACPI: APIC 3FFE187E, (r1 BOCHS BXPCAPIC BXPC )
[ 0.000000] ACPI: HPET 3FFE18FE, (r1 BOCHS BXPCHPET BXPC )
[ 0.000000] ACPI: PM-Timer IO Port: 0x608
[ 0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[ 0.000000] Processor # : APIC version
[ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[ 0.000000] Processor # : APIC version
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[ 0.000000] ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[])
[ 0.000000] IOAPIC[]: apic_id , version , address 0xfec00000, GSI -
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq dfl dfl)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] Enabling APIC mode: Flat. Using 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 (gap: :bffc0000)
[ 0.000000] Built zonelists in Zone order, mobility grouping on. Total pages:
[ 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.000000] PID hash table entries: (order: , 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: (order: , bytes)
[ 0.450203] Inode-cache hash table entries: (order: , 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 ( kB)
[ 0.526577] pkmap : 0xff800000 - 0xffc00000 ( kB)
[ 0.526582] vmalloc : 0xf8800000 - 0xff7fe000 ( MB)
[ 0.526586] lowmem : 0xc0000000 - 0xf8000000 ( MB)
[ 0.526591] .init : 0xc05bb000 - 0xc05fd000 ( kB)
[ 0.526596] .data : 0xc0428b57 - 0xc05b3f0c ( kB)
[ 0.526601] .text : 0xc0100000 - 0xc0428b57 ( kB)
[ 0.527733] Checking if this processor honours the WP bit even in supervisor mode... Ok.
[ 0.529667] SLUB: Genslabs=, HWalign=, Order=-, MinObjects=, CPUs=, Nodes=
[ 0.610936] Calibrating delay using timer specific routine.. 7223.22 BogoMIPS (lpj=)
[ 0.612052] Mount-cache hash table entries:
[ 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
[ 0.656303] Parsing all Control Methods:
[ 0.657602] Table [DSDT](id ) - Objects with Devices Methods Regions
[ 0.658273] tbxface- [] tb_load_namespace : ACPI Tables successfully acquired
[ 0.659332] evxfevnt- [] enable : Transition to ACPI mode successful
[ 0.663913] CPU0: Intel QEMU Virtual CPU version 2.5+ stepping
[ 0.665581] SMP alternatives: switching to SMP code
[ 0.667474] Booting processor / eip
[ 0.678304] Initializing CPU#
[ 0.758847] Calibrating delay using timer specific routine.. 7237.43 BogoMIPS (lpj=)
[ 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
[ 0.760347] Total of processors activated (14460.65 BogoMIPS).
[ 0.760865] ENABLING IO-APIC IRQs
[ 0.761888] ..TIMER: vector=0x31 apic1= pin1= apic2=- pin2=-
[ 0.909441] checking TSC synchronization [CPU# -> CPU#]: passed.
[ 0.930299] Brought up CPUs
[ 0.936650] net_namespace: bytes
[ 0.939296] NET: Registered protocol family
[ 0.941882] ACPI: bus type pci registered
[ 0.944310] PCI: PCI BIOS revision 2.10 entry at 0xfd536, last bus=
[ 0.944708] PCI: Using configuration type
[ 0.944969] Setting up standard PCI resources
[ 0.965663] evgpeblk- [] ev_create_gpe_block : GPE to 0F [_GPE] regs on int 0x9
[ 0.967935] evgpeblk- [] ev_initialize_gpe_bloc: Found Wake, Enabled Runtime GPEs in this block
[ 0.987575] Completing Region/Field/Buffer/Package initialization:................................
[ 0.993463] Initialized / Regions / Fields / Buffers / Packages ( nodes)
[ 0.993951] Initializing Device/Processor/Thermal objects by executing _INI methods:.
[ 0.996741] Executed _INI methods requiring _STA executions (examined 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] (:)
[ 1.037227] PCI quirk: region -063f claimed by PIIX4 ACPI
[ 1.037557] PCI quirk: region -070f claimed by PIIX4 SMB
[ 1.601786] ACPI: PCI Interrupt Link [LNKA] (IRQs * )
[ 1.602799] ACPI: PCI Interrupt Link [LNKB] (IRQs * )
[ 1.603545] ACPI: PCI Interrupt Link [LNKC] (IRQs *)
[ 1.604263] ACPI: PCI Interrupt Link [LNKD] (IRQs *)
[ 1.604751] ACPI: PCI Interrupt Link [LNKS] (IRQs *)
[ 1.605642] Linux Plug and Play Support v0. (c) Adam Belay
[ 1.606005] pnp: PnP ACPI init
[ 1.606194] ACPI: bus type pnp registered
[ 1.613416] pnp: PnP ACPI: found 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 , ,
[ 1.635660] hpet0: -bit timers, Hz
[ 1.638597] Time: tsc clocksource has been installed.
[ 1.681402] NET: Registered protocol family
[ 1.720234] IP route cache hash table entries: (order: , bytes)
[ 1.723501] TCP established hash table entries: (order: , bytes)
[ 1.726897] TCP bind hash table entries: (order: , bytes)
[ 1.729321] TCP: Hash tables configured (established bind )
[ 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- Microcode Update Driver: v1.14a <tigran@aivazian.fsnet.co.uk>
[ 1.947253] highmem bounce pool size: pages
[ 1.947632] Total HugeTLB memory allocated,
[ 1.963164] Installing knfsd (copyright (C) 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 ::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.
[ 2.110646] Serial: / driver $Revision: 1.90 $ ports, IRQ sharing disabled
[ 2.111801] serial8250: ttyS0 at I/O 0x3f8 (irq = ) is a 16550A
[ 2.114751] :: ttyS0 at I/O 0x3f8 (irq = ) is a 16550A
[ 2.116457] Floppy drive(s): fd0 is 2.88M AMI BIOS
[ 2.132601] FDC is a S82078B
[ 2.139792] RAMDISK driver initialized: RAM disks of 65535K size blocksize
[ 2.141816] loop: module loaded
[ 2.142121] Intel(R) PRO/ Network Driver - version 7.3.-k2
[ 2.142610] Copyright (c) - Intel Corporation.
[ 2.147196] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ
[ 2.147869] ACPI: PCI Interrupt ::03.0[A] -> Link [LNKC] -> GSI (level, high) -> IRQ
[ 2.402031] e1000: ::03.0: e1000_probe: (PCI:33MHz:-bit) :::::
[ 2.441061] e1000: eth0: e1000_probe: Intel(R) PRO/ Network Connection
[ 2.442663] e100: Intel(R) PRO/ Network Driver, 3.5.-k4-NAPI
[ 2.442895] e100: Copyright(c) - Intel Corporation
[ 2.447368] console [netcon0] enabled
[ 0.000000] Linux version 2.6.-gcbe024b4-dirty (pengdonglin@pengdonglin-dell) (gcc version 4.4. (Ubuntu/Linaro 4.4.-8ubuntu1) ) # SMP Sun Jul :: CST
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: - 000000000009fc00 (usable)
[ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000f0000 - (reserved)
[ 0.000000] BIOS-e820: - 000000003ffe0000 (usable)
[ 0.000000] BIOS-e820: 000000003ffe0000 - (reserved)
[ 0.000000] BIOS-e820: 00000000fffc0000 - (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.000000] Normal ->
[ 0.000000] HighMem ->
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[] active PFN ranges
[ 0.000000] : ->
[ 0.000000] DMI 2.8 present.
[ 0.000000] Using APIC driver default
[ 0.000000] ACPI: RSDP 000F6860, (r0 BOCHS )
[ 0.000000] ACPI: RSDT 3FFE1936, (r1 BOCHS BXPCRSDT BXPC )
[ 0.000000] ACPI: FACP 3FFE180A, (r1 BOCHS BXPCFACP BXPC )
[ 0.000000] ACPI: DSDT 3FFE0040, 17CA (r1 BOCHS BXPCDSDT BXPC )
[ 0.000000] ACPI: FACS 3FFE0000,
[ 0.000000] ACPI: APIC 3FFE187E, (r1 BOCHS BXPCAPIC BXPC )
[ 0.000000] ACPI: HPET 3FFE18FE, (r1 BOCHS BXPCHPET BXPC )
[ 0.000000] ACPI: PM-Timer IO Port: 0x608
[ 0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[ 0.000000] Processor # : APIC version
[ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[ 0.000000] Processor # : APIC version
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[ 0.000000] ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[])
[ 0.000000] IOAPIC[]: apic_id , version , address 0xfec00000, GSI -
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq dfl dfl)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] ACPI: INT_SRC_OVR (bus bus_irq global_irq high level)
[ 0.000000] Enabling APIC mode: Flat. Using 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 (gap: :bffc0000)
[ 0.000000] Built zonelists in Zone order, mobility grouping on. Total pages:
[ 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.000000] PID hash table entries: (order: , 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: (order: , bytes)
[ 0.450203] Inode-cache hash table entries: (order: , 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 ( kB)
[ 0.526577] pkmap : 0xff800000 - 0xffc00000 ( kB)
[ 0.526582] vmalloc : 0xf8800000 - 0xff7fe000 ( MB)
[ 0.526586] lowmem : 0xc0000000 - 0xf8000000 ( MB)
[ 0.526591] .init : 0xc05bb000 - 0xc05fd000 ( kB)
[ 0.526596] .data : 0xc0428b57 - 0xc05b3f0c ( kB)
[ 0.526601] .text : 0xc0100000 - 0xc0428b57 ( kB)
[ 0.527733] Checking if this processor honours the WP bit even in supervisor mode... Ok.
[ 0.529667] SLUB: Genslabs=, HWalign=, Order=-, MinObjects=, CPUs=, Nodes=
[ 0.610936] Calibrating delay using timer specific routine.. 7223.22 BogoMIPS (lpj=)
[ 0.612052] Mount-cache hash table entries:
[ 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
[ 0.656303] Parsing all Control Methods:
[ 0.657602] Table [DSDT](id ) - Objects with Devices Methods Regions
[ 0.658273] tbxface- [] tb_load_namespace : ACPI Tables successfully acquired
[ 0.659332] evxfevnt- [] enable : Transition to ACPI mode successful
[ 0.663913] CPU0: Intel QEMU Virtual CPU version 2.5+ stepping
[ 0.665581] SMP alternatives: switching to SMP code
[ 0.667474] Booting processor / eip
[ 0.678304] Initializing CPU#
[ 0.758847] Calibrating delay using timer specific routine.. 7237.43 BogoMIPS (lpj=)
[ 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
[ 0.760347] Total of processors activated (14460.65 BogoMIPS).
[ 0.760865] ENABLING IO-APIC IRQs
[ 0.761888] ..TIMER: vector=0x31 apic1= pin1= apic2=- pin2=-
[ 0.909441] checking TSC synchronization [CPU# -> CPU#]: passed.
[ 0.930299] Brought up CPUs
[ 0.936650] net_namespace: bytes
[ 0.939296] NET: Registered protocol family
[ 0.941882] ACPI: bus type pci registered
[ 0.944310] PCI: PCI BIOS revision 2.10 entry at 0xfd536, last bus=
[ 0.944708] PCI: Using configuration type
[ 0.944969] Setting up standard PCI resources
[ 0.965663] evgpeblk- [] ev_create_gpe_block : GPE to 0F [_GPE] regs on int 0x9
[ 0.967935] evgpeblk- [] ev_initialize_gpe_bloc: Found Wake, Enabled Runtime GPEs in this block
[ 0.987575] Completing Region/Field/Buffer/Package initialization:................................
[ 0.993463] Initialized / Regions / Fields / Buffers / Packages ( nodes)
[ 0.993951] Initializing Device/Processor/Thermal objects by executing _INI methods:.
[ 0.996741] Executed _INI methods requiring _STA executions (examined 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] (:)
[ 1.037227] PCI quirk: region -063f claimed by PIIX4 ACPI
[ 1.037557] PCI quirk: region -070f claimed by PIIX4 SMB
[ 1.601786] ACPI: PCI Interrupt Link [LNKA] (IRQs * )
[ 1.602799] ACPI: PCI Interrupt Link [LNKB] (IRQs * )
[ 1.603545] ACPI: PCI Interrupt Link [LNKC] (IRQs *)
[ 1.604263] ACPI: PCI Interrupt Link [LNKD] (IRQs *)
[ 1.604751] ACPI: PCI Interrupt Link [LNKS] (IRQs *)
[ 1.605642] Linux Plug and Play Support v0. (c) Adam Belay
[ 1.606005] pnp: PnP ACPI init
[ 1.606194] ACPI: bus type pnp registered
[ 1.613416] pnp: PnP ACPI: found 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 , ,
[ 1.635660] hpet0: -bit timers, Hz
[ 1.638597] Time: tsc clocksource has been installed.
[ 1.681402] NET: Registered protocol family
[ 1.720234] IP route cache hash table entries: (order: , bytes)
[ 1.723501] TCP established hash table entries: (order: , bytes)
[ 1.726897] TCP bind hash table entries: (order: , bytes)
[ 1.729321] TCP: Hash tables configured (established bind )
[ 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- Microcode Update Driver: v1.14a <tigran@aivazian.fsnet.co.uk>
[ 1.947253] highmem bounce pool size: pages
[ 1.947632] Total HugeTLB memory allocated,
[ 1.963164] Installing knfsd (copyright (C) 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 ::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.
[ 2.110646] Serial: / driver $Revision: 1.90 $ ports, IRQ sharing disabled
[ 2.111801] serial8250: ttyS0 at I/O 0x3f8 (irq = ) is a 16550A
[ 2.114751] :: ttyS0 at I/O 0x3f8 (irq = ) is a 16550A
[ 2.116457] Floppy drive(s): fd0 is 2.88M AMI BIOS
[ 2.132601] FDC is a S82078B
[ 2.139792] RAMDISK driver initialized: RAM disks of 65535K size blocksize
[ 2.141816] loop: module loaded
[ 2.142121] Intel(R) PRO/ Network Driver - version 7.3.-k2
[ 2.142610] Copyright (c) - Intel Corporation.
[ 2.147196] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ
[ 2.147869] ACPI: PCI Interrupt ::03.0[A] -> Link [LNKC] -> GSI (level, high) -> IRQ
[ 2.402031] e1000: ::03.0: e1000_probe: (PCI:33MHz:-bit) :::::
[ 2.441061] e1000: eth0: e1000_probe: Intel(R) PRO/ Network Connection
[ 2.442663] e100: Intel(R) PRO/ Network Driver, 3.5.-k4-NAPI
[ 2.442895] e100: Copyright(c) - Intel Corporation
[ 2.447368] console [netcon0] enabled
[ 2.490168] netconsole: network logging started
[ 2.490426] Uniform Multi-Platform E-IDE driver Revision: .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 ::01.1
[ 2.492277] PIIX3: not % 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
[ 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..
[ 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.
[ 5.050357] Copyright (c) - LSI Corporation
[ 5.050619] Fusion MPT SPI Host driver 3.04.
[ 5.052538] ieee1394: raw1394: /dev/raw1394 device initialized
[ 5.052969] usbmon: debugfs is not available
[ 5.053578] USB Universal Host Controller Interface driver v3.
[ 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/ Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq ,
[ 5.057675] serio: i8042 KBD port at 0x60,0x64 irq
[ 5.057993] serio: i8042 AUX port at 0x60,0x64 irq
[ 5.059483] mice: PS/ mouse device common for all mice
[ 5.076443] input: AT Translated Set keyboard as /class/input/input1
[ 5.100959] device-mapper: ioctl: 4.12.-ioctl (--) initialised: dm-devel@redhat.com
[ 5.102606] usbcore: registered new interface driver usbhid
[ 5.103054] drivers/hid/usbhid/hid-core.c: v2.:USB HID core driver
[ 5.104214] oprofile: using NMI interrupt.
[ 5.105193] TCP cubic registered
[ 5.105441] NET: Registered protocol family
[ 5.107096] NET: Registered protocol family
[ 5.111118] IPv6 over IPv4 tunneling driver
[ 5.112899] NET: Registered protocol family
[ 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/ Generic Explorer Mouse as /class/input/input2
[ 5.330384] RAMDISK: ext2 filesystem found at block
[ 5.331404] RAMDISK: Loading 32768KiB [ 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 Mbps Full Duplex, Flow Control: RX
[ 7.028493] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 7.033541] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Please press Enter to activate this console.
[root@x86 ]#
[root@x86 ]#
[root@x86 ]# ifconfig
eth0 Link encap:Ethernet HWaddr :::::
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80:::ff:fe12:/ Scope:Link
UP BROADCAST RUNNING MULTICAST MTU: Metric:
RX packets: errors: dropped: overruns: frame:
TX packets: errors: dropped: overruns: carrier:
collisions: txqueuelen:
RX bytes: (0.0 B) TX bytes: (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: ::/ Scope:Host
UP LOOPBACK RUNNING MTU: Metric:
RX packets: errors: dropped: overruns: frame:
TX packets: errors: dropped: overruns: carrier:
collisions: txqueuelen:
RX bytes: (0.0 B) TX bytes: (0.0 B) [root@x86 ]# [ 113.736471] Clocksource tsc unstable (delta = ns)
[ 113.871004] Time: hpet clocksource has been installed. [root@x86 ]# ping 192.168.1.105
PING 192.168.1.105 (192.168.1.105): data bytes
bytes from 192.168.1.105: seq= ttl= time=7.657 ms
bytes from 192.168.1.105: seq= ttl= time=2.020 ms
bytes from 192.168.1.105: seq= ttl= time=0.371 ms
bytes from 192.168.1.105: seq= ttl= time=0.368 ms --- 192.168.1.105 ping statistics ---
packets transmitted, packets received, % packet loss
round-trip min/avg/max = 0.368/2.604/7.657 ms
[root@x86 ]#

完。

搭建《深入Linux内核架构》的Linux环境的更多相关文章

  1. 学习构建调试Linux内核网络代码的环境MenuOS系统

    构建调试Linux内核网络代码的环境MenuOS系统 一.前言 这是网络程序设计的第三次实验,主要是学习自己编译linux内核,构建一个具有简易功能的操作系统,同时在系统上面进行调试linux内核网络 ...

  2. 24小时学通Linux内核之构建Linux内核

    今天是腊八节,说好的女票要给我做的腊八粥就这样泡汤了,好伤心,好心酸呀,看来代码写久了真的是惹人烦滴,所以告诫各位技术男敲醒警钟,不要想我看齐,不然就只能和代码为伴了的~~话说没了腊八粥但还是有代码, ...

  3. 24小时学通Linux内核之有关Linux文件系统实现的问题

    有时间睡懒觉了,却还是五点多醒了,不过一直躺倒九点多才算起来,昨晚一直在弄飞凌的嵌入式开发板,有些问题没解决,自己电脑系统的问题,虽然Win10发布了,,但我还是好喜欢XP呀,好想回家用用家里的XP来 ...

  4. linux内核学习之一:环境搭建--安装Debian7.3

    本系列文章假设读者已对linux有一定的了解,其实学习linux内核不需要有很深的关于linux的知识,只需要了解以下内容:linux基础知识及基本shell命令:现代操作系统的基本概念:C语言和gc ...

  5. Linux内核架构与底层--读书笔记

    linux中管道符"|"的作用 命令格式:命令A|命令B,即命令1的正确输出作为命令B的操作对象(下图应用别人的图片) 1. 例如: ps aux | grep "tes ...

  6. Linux内核入门到放弃-页面回收和页交换-《深入Linux内核架构》笔记

    概述 可换出页 只有少量几种页可以换出到交换区,对其他页来说,换出到块设备上与之对应的后备存储器即可,如下所述. 类别为 MAP_ANONYMOUS 的页,没有关联到文件,例如,这可能是进程的栈或是使 ...

  7. 深入Linux内核架构——进程管理和调度(上)

    如果系统只有一个处理器,那么给定时刻只有一个程序可以运行.在多处理器系统中,真正并行运行的进程数目取决于物理CPU的数目.内核和处理器建立了多任务的错觉,是通过以很短的间隔在系统运行的应用程序之间不停 ...

  8. 【深入理解Linux内核架构】3.3 页表

    页表:用于建立用户进程空间的虚拟地址空间和系统物理内存(内存.页帧)之间的关联. 向每个进程提供一致的虚拟地址空间. 将虚拟内存页映射到物理内存,因而支持共享内存的实现. 可以在不增加物理内存的情况下 ...

  9. Linux内核入门到放弃-网络-《深入Linux内核架构》笔记

    网络命名空间 struct net { atomic_t count; /* To decided when the network * namespace should be freed. */ a ...

随机推荐

  1. 网易与Google合作发布开源UI自动化测试方案 牛逼:Google 方面评价,这可能是目前世界上最好的 Android 游戏自动化测试方案。

    美西时间 3 月 19 日,在 GDC 开幕第一天的 Google 开发者专场,Google 发布了一款由网易研发的 UI 自动化测试方案:Airtest Project.Google 方面评价,这可 ...

  2. 文字小于12px时,设置line-height不居中问题

    设置了文字了小于12px时,会存在设置了line-height的不生效的问题,主要是由于基线的问题,这篇文章解释的很清楚,有兴趣的可以看下https://blog.csdn.net/q12151634 ...

  3. poj2049

    优先队列广搜,有人说用SPFA,不知道怎么做的 #include <cstdio> #include <queue> #include <cmath> #inclu ...

  4. cube-ui

    cube-ui 新官网:https://didi.github.io/cube-ui/#/zh-CN

  5. HDOJ题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  6. NTP服务放大攻击的解决办法

    什么是NTP服务? 网络时间协议NTP(Network Time Protocol)是用于互联网中时间同步的标准互联网协议.NTP服务器通过NTP服务向网络上的计算机或其他设备提供标准的授时服务,以保 ...

  7. BCTF2017 BabyUse

    BCTF2017 BabyUse 问题 问题在于drop函数中在释放块之后没有清空bss_gun_list中的指针. 一般因为存在对bss_gun_flag的验证,所以不会出现什么问题,但是在use功 ...

  8. element-ui的rules中正则表达式

    <template> <el-form :model="unuseForm" label-position="top" :rules=&quo ...

  9. jquery下载,实时更新jquery1.2到最新3.3.1所有版本下载

    描述:jquery下载,实时更新jquery1.2到最新3.3.1所有版本下载 https://www.jb51.net/zt/jquerydown.htm (注意:jquery-2.0以上版本不再支 ...

  10. 【Ray Tracing The Next Week 超详解】 光线追踪2-1

     Preface 博主刚放假回家就进了医院,今天刚完事儿,来续写第二本书  Ready 我们来总结一下上一本书的笔记中我们的一些规定 1. 数学表达式 我们采用小写粗黑体代表向量,大写粗黑体代表矩阵, ...