【linux kernel】start_kernel函数详解系列之开篇

start_kernel函数详解系列之开篇

一、背景

linux 内核启动过程中,start_kernel()函数是分析Linux内核的切入点。小生想着对start_kernel函数体中一连串的函数调用过程进行分析和学习。也计划将这些输出、总结成相应文档和笔记。本篇文章作为《start_kernel详解系列》的开篇笔记。于是便有了本篇文章。

【实验环境】


  • linux内核版本:4.1.15
  • 开发环境:ubuntu 18.4
  • 运行平台:nxp - imx6ull

二、start_kernel函数打印信息概览

在本文中,小生将linux内核向终端打印出的消息作为分析概览,并使用printk()函数在源码相应位置打印出对应的标记信息。如下所示:

【start_kernel打印出的信息】
(注,信息有点长)

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.1.15 (iriczhao@iriczhao) (gcc version 5.5.0 (Linaro GCC 5.5-2017.10) ) #4 SMP PREEMPT Sat Feb 26 11:48:48 CST 2022
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Freescale i.MX6 ULL 14x14 EVK Board
Reserved memory: created CMA memory pool at 0x98000000, size 128 MiB
Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @97b90000 s16768 r8192 d24192 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=tty1 console=ttymxc0,115200 root=/dev/nfs rw nfsroot=192.168.1.30:/home/iriczhao/linux_dev_server/nfs/rootfs ip=192.168.1.9:192.168.1.30:192.168.1.1:255.255.255.0::eth0:off
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 377784K/524288K available (6927K kernel code, 322K rwdata, 2360K rodata, 396K init, 424K bss, 15432K reserved, 131072K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xa0800000 - 0xff000000   (1512 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .text : 0x80008000 - 0x8091a134   (9289 kB)
      .init : 0x8091b000 - 0x8097e000   ( 396 kB)
      .data : 0x8097e000 - 0x809ce900   ( 323 kB)
       .bss : 0x809d1000 - 0x80a3b2d4   ( 425 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
	Additional per-CPU info printed with stalls.
	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS:16 nr_irqs:16 16
mxc_clocksource_init 3000000
Switching to timer-based delay loop, resolution 333ns
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns
clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
Console: colour dummy device 80x30
console [tty1] enabled
Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok

[1]===================================================
【rest_init()】
[2]===================================================

/cpus/cpu@0 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000

[3]===================================================
Setting up static identity map for 0x80008280 - 0x
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

iriczhao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值