How Linux Works:内核空间和启动顺序
(一)How the Linux Kernel Boots
Startup Messages
[root@li1437-101 ~]# dmesg
[ 0.000000] Linux version 4.9.7-x86_64-linode80 (maker@build) (gcc version 4.7.2 (Debian 4.7.2-5) ) #2 SMP Thu Feb 2 15:43:55 EST 2017
[ 0.000000] Command line: root=/dev/sda console=tty1 console=ttyS0 ro devtmpfs.mount=1
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[ 0.000000] x86/fpu: Using 'eager' FPU context switches.
[ 0.000000] e820: BIOS-provided physical RAM map:
…….
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] SMBIOS 2.8 present.
[ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.1-0-gb3ef39f-prebuilt.qemu-project.org 04/01/2014
[ 0.000000] Hypervisor detected: KVM
……
[ 0.371925] raid6: sse2x1 gen() 7490 MB/s
[ 0.428689] raid6: sse2x1 xor() 5953 MB/s
[ 0.485463] raid6: sse2x2 gen() 9289 MB/s
[ 0.542230] raid6: sse2x2 xor() 6754 MB/s
[ 0.599013] raid6: sse2x4 gen() 10954 MB/s
[ 0.656189] raid6: sse2x4 xor() 5522 MB/s
[ 0.656943] raid6: using algorithm sse2x4 gen() 10954 MB/s
[ 0.657588] raid6: .... xor() 5522 MB/s, rmw enabled
……
[ 1.053697] Netfilter messages via NETLINK v0.30.
[ 1.054471] nfnl_acct: registering with nfnetlink.
[ 1.055332] nf_conntrack version 0.5.0 (8192 buckets, 32768 max)
[ 1.056324] ctnetlink v0.93: registering with nfnetlink.
[ 1.057335] nf_tables: (c) 2007-2009 Patrick McHardy <kaber@trash.net>
[ 1.058393] nf_tables_compat: (c) 2012 Pablo Neira Ayuso <pablo@netfilter.org>
[ 1.059599] xt_time: kernel timezone is -0000
[ 1.060296] ip_set: protocol 6
[ 1.060791] IPVS: Registered protocols (TCP, UDP, SCTP, AH, ESP)
[ 1.061940] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[ 1.063162] IPVS: Creating netns size=2104 id=0
[ 1.064139] IPVS: ipvs loaded.
……
[ 1.744221] systemd[1]: Detected virtualization kvm.
[ 1.745058] systemd[1]: Detected architecture x86-64.
[ 1.747402] systemd[1]: Set hostname to <localhost.localdomain>.
[ 1.834328] tsc: Refined TSC clocksource calibration: 2800.119 MHz
[ 1.835512] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x285cb16f950, max_idle_ns: 440795333193 ns
[ 1.843476] systemd[1]: Created slice Root Slice.
[ 1.844251] systemd[1]: Starting Root Slice.
[ 1.845835] systemd[1]: Created slice System Slice.
[ 1.846631] systemd[1]: Starting System Slice.
[ 1.848257] systemd[1]: Listening on udev Kernel Socket.
[ 1.849119] systemd[1]: Starting udev Kernel Socket.
[ 2.014715] EXT4-fs (sda): re-mounted. Opts: (null)
[ 2.038202] systemd-journald[2010]: Received request to flush runtime journal from PID 1
[ 2.241341] audit: type=1305 audit(1488188850.897:2): audit_pid=2215 old=0 auid=4294967295 ses=4294967295 res=1
[ 2.287758] Adding 262140k swap on /dev/sdb. Priority:-1 extents:1 across:262140k FS
[ 2.905177] IPVS: Creating netns size=2104 id=1
[ 2.954613] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 2.955987] 8021q: adding VLAN 0 to HW filter on device eth0
[ 8.009765] random: crng init doneKernel initialization and Boot Options

Kernel Parameters
How User Space Starts
天字第一号进程


(三) The Initial RAM filesystem
参考文献
Last updated