Linux Kernel Init Bootstrap 内核初始化启动
抽象
Bootloader -> kernel 初始化-> 用户空间init进程
内核版本:6.1x
点击查看kernel开机日志
[ 1.789694] Booting Linux on physical CPU 0x0000000000 [0x412fd050]
[ 1.789730] Linux version 6.1.118 (ubuntu@40b0a778a690) (aarch64-linux-gnu-gcc (ctng-1.25.0-119g-FA) 11.3.0, GNU ld (GNU Binutils) 2.38) #1 SMP Mon Aug 11 14:02:22 CST 2025
[ 1.791117] random: crng init done
[ 1.793469] Machine model: FriendlyElec NanoPi R3S
[ 1.799692] earlycon: uart8250 at MMIO32 0x00000000fe660000 (options '')
[ 1.802994] printk: bootconsole [uart8250] enabled
[ 1.803610] OF: fdt: Reserved memory: failed to reserve memory for node 'drm-logo@0': base 0x0000000000000000, size 0 MiB
[ 1.804615] OF: fdt: Reserved memory: failed to reserve memory for node 'drm-cubic-lut@0': base 0x0000000000000000, size 0 MiB
[ 1.805680] OF: reserved mem: 0x0000000000110000..0x00000000001fffff (960 KiB) map non-reusable ramoops@110000
[ 1.806594] Reserved memory: created CMA memory pool at 0x0000000010000000, size 8 MiB
[ 1.807307] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 1.808028] OF: reserved mem: 0x0000000010000000..0x00000000107fffff (8192 KiB) map reusable linux,cma
[ 1.842360] Zone ranges:
[ 1.842612] DMA [mem 0x0000000000200000-0x000000007fffffff]
[ 1.843174] DMA32 empty
[ 1.843438] Normal empty
[ 1.843699] Movable zone start for each node
[ 1.844089] Early memory node ranges
[ 1.844411] node 0: [mem 0x0000000000200000-0x00000000083fffff]
[ 1.844975] node 0: [mem 0x0000000009400000-0x000000007fffffff]
[ 1.845544] Initmem setup node 0 [mem 0x0000000000200000-0x000000007fffffff]
[ 1.847070] On node 0, zone DMA: 512 pages in unavailable ranges
[ 1.862359] On node 0, zone DMA: 4096 pages in unavailable ranges
[ 1.863025] psci: probing for conduit method from DT.
[ 1.864041] psci: PSCIv1.1 detected in firmware.
[ 1.864461] psci: Using standard PSCI v0.2 function IDs
[ 1.864933] psci: Trusted OS migration not required
[ 1.865382] psci: SMC Calling Convention v1.2
[ 1.866158] percpu: Embedded 30 pages/cpu s82424 r8192 d32264 u122880
[ 1.866768] pcpu-alloc: s82424 r8192 d32264 u122880 alloc=30*4096
[ 1.866779] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 1.866855] Detected VIPT I-cache on CPU0
[ 1.867264] CPU features: detected: GIC system register CPU interface
[ 1.867847] CPU features: detected: Virtualization Host Extensions
[ 1.868417] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[ 1.869046] alternatives: applying boot alternatives
[ 1.871380] Built 1 zonelists, mobility grouping on. Total pages: 511496
[ 1.872010] Kernel command line: storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal androidboot.dtbo_idx=0 androidboot.verifiedbootstate=orange earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 coherent_pool=1m rw root=/dev/mmcblk2p8 rootfstype=ext4 data=/dev/mmcblk2p9 consoleblank=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 androidboot.fwver=ddr-v1.21-2d653b3476,spl-v1.14,bl31-v1.44,bl32-v2.12,uboot-44f011c4ba-08/11/2025
[ 1.876183] Unknown kernel command line parameters "storagemedia=emmc data=/dev/mmcblk2p9 cgroup_enable=memory cgroup_memory=1", will be passed to user space.
[ 1.877970] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 1.878927] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 1.879633] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 1.905238] Memory: 1985344K/2078720K available (18816K kernel code, 3146K rwdata, 6352K rodata, 6528K init, 956K bss, 85184K reserved, 8192K cma-reserved)
[ 1.906667] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 1.907307] ftrace: allocating 60236 entries in 236 pages
[ 1.992217] ftrace: allocated 236 pages with 5 groups
[ 1.992892] trace event string verifier disabled
[ 1.993569] rcu: Hierarchical RCU implementation.
[ 1.994019] rcu: RCU event tracing is enabled.
[ 1.994446] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[ 1.995061] Rude variant of Tasks RCU enabled.
[ 1.995487] Tracing variant of Tasks RCU enabled.
[ 1.995939] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 1.996649] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 2.001741] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 2.003845] GICv3: GIC: Using split EOI/Deactivate mode
[ 2.004354] GICv3: 320 SPIs implemented
[ 2.004717] GICv3: 0 Extended SPIs implemented
[ 2.005174] Root IRQ handler: gic_handle_irq
[ 2.005593] GICv3: GICv3 features: 16 PPIs
[ 2.006014] GICv3: CPU0: found redistributor 0 region 0:0x00000000fd460000
[ 2.007245] ITS [mem 0xfd440000-0xfd45ffff]
[ 2.007712] ITS@0x00000000fd440000: allocated 8192 Devices @29b0000 (indirect, esz 8, psz 64K, shr 0)
[ 2.008614] ITS@0x00000000fd440000: allocated 32768 Interrupt Collections @29c0000 (flat, esz 2, psz 64K, shr 0)
[ 2.009578] ITS: using cache flushing for cmd queue
[ 2.010407] GICv3: using LPI property table @0x00000000029d0000
[ 2.011074] GIC: using cache flushing for LPI property table
[ 2.011611] GICv3: CPU0: using allocated LPI pending table @0x00000000029e0000
[ 2.012364] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 2.042191] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 2.042795] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 2.043816] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 2.045740] Console: colour dummy device 80x25
[ 2.046213] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 2.047193] pid_max: default: 32768 minimum: 301
[ 2.047708] LSM: Security Framework initializing
[ 2.048261] AppArmor: AppArmor initialized
[ 2.048723] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 2.049431] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 2.051163] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 2.052487] cblist_init_generic: Setting adjustable number of callback queues.
[ 2.053172] cblist_init_generic: Setting shift to 2 and lim to 1.
[ 2.053843] cblist_init_generic: Setting adjustable number of callback queues.
[ 2.054526] cblist_init_generic: Setting shift to 2 and lim to 1.
[ 2.055316] rcu: Hierarchical SRCU implementation.
[ 2.055772] rcu: Max phase no-delay instances is 1000.
[ 2.056960] Platform MSI: interrupt-controller@fd440000 domain created
[ 2.058112] PCI/MSI: /interrupt-controller@fd400000/interrupt-controller@fd440000 domain created
[ 2.059945] smp: Bringing up secondary CPUs ...
[ 2.061691] Detected VIPT I-cache on CPU1
[ 2.061781] cacheinfo: Unable to detect cache hierarchy for CPU 1
[ 2.061797] GICv3: CPU1: found redistributor 100 region 0:0x00000000fd480000
[ 2.061818] GICv3: CPU1: using allocated LPI pending table @0x00000000029f0000
[ 2.061866] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[ 2.063225] Detected VIPT I-cache on CPU2
[ 2.063303] cacheinfo: Unable to detect cache hierarchy for CPU 2
[ 2.063315] GICv3: CPU2: found redistributor 200 region 0:0x00000000fd4a0000
[ 2.063333] GICv3: CPU2: using allocated LPI pending table @0x0000000002a00000
[ 2.063370] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[ 2.064681] Detected VIPT I-cache on CPU3
[ 2.064753] cacheinfo: Unable to detect cache hierarchy for CPU 3
[ 2.064766] GICv3: CPU3: found redistributor 300 region 0:0x00000000fd4c0000
[ 2.064782] GICv3: CPU3: using allocated LPI pending table @0x0000000002a10000
[ 2.064815] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[ 2.064918] smp: Brought up 1 node, 4 CPUs
[ 2.074011] SMP: Total of 4 processors activated.
[ 2.074458] CPU features: detected: 32-bit EL0 Support
[ 2.074942] CPU features: detected: 32-bit EL1 Support
[ 2.075427] CPU features: detected: Data cache clean to the PoU not required for I/D coherence
[ 2.076236] CPU features: detected: Common not Private translations
[ 2.076825] CPU features: detected: CRC32 instructions
[ 2.077308] CPU features: detected: RCpc load-acquire (LDAPR)
[ 2.077847] CPU features: detected: LSE atomic instructions
[ 2.078372] CPU features: detected: Privileged Access Never
[ 2.078894] CPU features: detected: RAS Extension Support
[ 2.079403] CPU features: detected: Speculative Store Bypassing Safe (SSBS)
[ 2.080140] CPU: All CPU(s) started at EL2
[ 2.080530] alternatives: applying system-wide alternatives
[ 2.087019] devtmpfs: initialized
[ 2.104633] Registered cp15_barrier emulation handler
[ 2.105133] Registered setend emulation handler
[ 2.105735] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 2.106717] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 2.107755] pinctrl core: initialized pinctrl subsystem
[ 2.108511] regulator-dummy: no parameters, enabled
[ 2.109154] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 2.110984] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[ 2.111887] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 2.112668] audit: initializing netlink subsys (disabled)
[ 2.113399] audit: type=2000 audit(0.060:1): state=initialized audit_enabled=0 res=1
[ 2.113930] Registered FIQ tty driver
[ 2.114930] thermal_sys: Registered thermal governor 'fair_share'
[ 2.114937] thermal_sys: Registered thermal governor 'step_wise'
[ 2.115513] thermal_sys: Registered thermal governor 'user_space'
[ 2.116127] cpuidle: using governor menu
[ 2.117473] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 2.118238] ASID allocator initialised with 65536 entries
[ 2.121827] ramoops: dmesg-0 0x20000@0x0000000000110000
[ 2.123434] ramoops: console 0x80000@0x0000000000130000
[ 2.123943] ramoops: pmsg 0x50000@0x00000000001b0000
[ 2.124811] printk: console [ramoops-1] enabled
[ 2.125523] pstore: Registered ramoops as persistent store backend
[ 2.126111] ramoops: using 0xf0000@0x110000, ecc: 0
[ 2.140489] platform fe040000.vop: Fixed dependency cycle(s) with /hdmi@fe0a0000
[ 2.141270] platform fe0a0000.hdmi: Fixed dependency cycle(s) with /vop@fe040000
[ 2.158619] rockchip-gpio fdd60000.gpio: probed /pinctrl/gpio@fdd60000
[ 2.159723] rockchip-gpio fe740000.gpio: probed /pinctrl/gpio@fe740000
[ 2.160767] rockchip-gpio fe750000.gpio: probed /pinctrl/gpio@fe750000
[ 2.161803] rockchip-gpio fe760000.gpio: probed /pinctrl/gpio@fe760000
[ 2.162954] rockchip-gpio fe770000.gpio: probed /pinctrl/gpio@fe770000
[ 2.163724] rockchip-pinctrl pinctrl: probed pinctrl
[ 2.168588] KASLR disabled due to lack of seed
[ 2.178087] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[ 2.178748] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[ 2.179343] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages
[ 2.179984] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[ 2.180577] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[ 2.181219] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[ 2.181811] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages
[ 2.182452] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[ 2.183472] cryptd: max_cpu_qlen set to 1000
[ 2.347966] raid6: neonx8 gen() 2604 MB/s
[ 2.518079] raid6: neonx4 gen() 2646 MB/s
[ 2.688198] raid6: neonx2 gen() 2415 MB/s
[ 2.858317] raid6: neonx1 gen() 1949 MB/s
[ 3.028396] raid6: int64x8 gen() 1732 MB/s
[ 3.198499] raid6: int64x4 gen() 1923 MB/s
[ 3.368637] raid6: int64x2 gen() 1691 MB/s
[ 3.538753] raid6: int64x1 gen() 1243 MB/s
[ 3.539163] raid6: using algorithm neonx4 gen() 2646 MB/s
[ 3.708823] raid6: .... xor() 2052 MB/s, rmw enabled
[ 3.709300] raid6: using neon recovery algorithm
[ 3.711560] fiq_debugger fiq_debugger.0: error -ENXIO: IRQ fiq not found
[ 3.712228] fiq_debugger fiq_debugger.0: error -ENXIO: IRQ wakeup not found
[ 3.712895] fiq_debugger_probe: could not install nmi irq handler
[ 3.713563] printk: console [ttyFIQ0] enabled
[ 3.714363] printk: bootconsole [uart8250] disabled
[ 3.715017] Registered fiq debugger ttyFIQ0
[ 3.715467] vdd_usbc: 5000 mV, enabled
[ 3.715661] reg-fixed-voltage vdd-usbc: vdd_usbc supplying 5000000uV
[ 3.715770] reg-fixed-voltage vcc3v3-sys: Looking up vin-supply from device tree
[ 3.715784] vcc3v3_sys: supplied by vdd_usbc
[ 3.715792] vdd_usbc: could not add device link regulator.2: -ENOENT
[ 3.715829] vcc3v3_sys: 3300 mV, enabled
[ 3.715966] reg-fixed-voltage vcc3v3-sys: vcc3v3_sys supplying 3300000uV
[ 3.716078] reg-fixed-voltage vcc3v3-sysp: Looking up vin-supply from device tree
[ 3.716090] vcc3v3_sysp: supplied by vdd_usbc
[ 3.716098] vdd_usbc: could not add device link regulator.3: -ENOENT
[ 3.716130] vcc3v3_sysp: 3300 mV, enabled
[ 3.716270] reg-fixed-voltage vcc3v3-sysp: vcc3v3_sysp supplying 3300000uV
[ 3.716420] reg-fixed-voltage vcc5v0-sysp: Looking up vin-supply from device tree
[ 3.716432] vcc5v0_sysp: supplied by vcc3v3_sysp
[ 3.716440] vcc3v3_sysp: could not add device link regulator.4: -ENOENT
[ 3.716473] vcc5v0_sysp: 5000 mV, enabled
[ 3.716604] reg-fixed-voltage vcc5v0-sysp: vcc5v0_sysp supplying 5000000uV
[ 3.716912] reg-fixed-voltage vcc5v0-host-regulator: Looking up vin-supply from device tree
[ 3.716926] vcc5v0_host: supplied by vcc5v0_sysp
[ 3.716933] vcc5v0_sysp: could not add device link regulator.5: -ENOENT
[ 3.716985] vcc5v0_host: 5000 mV, enabled
[ 3.717121] reg-fixed-voltage vcc5v0-host-regulator: vcc5v0_host supplying 5000000uV
[ 3.717534] iommu: Default domain type: Translated
[ 3.717553] iommu: DMA domain TLB invalidation policy: strict mode
[ 3.717902] SCSI subsystem initialized
[ 3.717945] libata version 3.00 loaded.
[ 3.718098] usbcore: registered new interface driver usbfs
[ 3.718140] usbcore: registered new interface driver hub
[ 3.718182] usbcore: registered new device driver usb
[ 3.718487] mc: Linux media interface: v0.10
[ 3.718541] videodev: Linux video capture interface: v2.00
[ 3.718627] pps_core: LinuxPPS API ver. 1 registered
[ 3.718639] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 3.718658] PTP clock support registered
[ 3.718700] EDAC MC: Ver: 3.0.0
[ 3.719468] arm-scmi firmware:scmi: Enabled polling mode TX channel - prot_id:16
[ 3.719589] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
[ 3.719652] arm-scmi firmware:scmi: SCMI Protocol v2.0 'rockchip:' Firmware version 0x0
[ 3.721704] Advanced Linux Sound Architecture Driver Initialized.
[ 3.722270] Bluetooth: Core ver 2.22
[ 3.722318] NET: Registered PF_BLUETOOTH protocol family
[ 3.722330] Bluetooth: HCI device and connection manager initialized
[ 3.722345] Bluetooth: HCI socket layer initialized
[ 3.722359] Bluetooth: L2CAP socket layer initialized
[ 3.722380] Bluetooth: SCO socket layer initialized
[ 3.722408] NetLabel: Initializing
[ 3.722418] NetLabel: domain hash size = 128
[ 3.722426] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO
[ 3.722480] NetLabel: unlabeled traffic allowed by default
[ 3.722872] rockchip-cpuinfo cpuinfo: SoC : 35663000
[ 3.722888] rockchip-cpuinfo cpuinfo: Serial : a249fabf6d20f787
[ 3.723696] clocksource: Switched to clocksource arch_sys_counter
[ 3.724046] VFS: Disk quotas dquot_6.6.0
[ 3.724095] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 3.724249] FS-Cache: Loaded
[ 3.724722] AppArmor: AppArmor Filesystem Enabled
[ 3.733428] NET: Registered PF_INET protocol family
[ 3.733650] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)
[ 3.735147] tcp_listen_portaddr_hash hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 3.735233] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 3.735314] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 3.735414] TCP bind hash table entries: 16384 (order: 8, 1048576 bytes, linear)
[ 3.736380] TCP: Hash tables configured (established 16384 bind 16384)
[ 3.736606] UDP hash table entries: 1024 (order: 4, 98304 bytes, linear)
[ 3.736741] UDP-Lite hash table entries: 1024 (order: 4, 98304 bytes, linear)
[ 3.737104] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 3.737484] PCI: CLS 0 bytes, default 64
[ 3.737750] Trying to unpack rootfs image as initramfs...
[ 3.740230] rockchip-thermal fe710000.tsadc: tsadc is probed successfully!
[ 3.741011] kvm [1]: IPA Size Limit: 40 bits
[ 3.741065] kvm [1]: GICv3: no GICV resource entry
[ 3.741077] kvm [1]: disabling GICv2 emulation
[ 3.741112] kvm [1]: GIC system register CPU interface enabled
[ 3.741590] kvm [1]: vgic interrupt IRQ9
[ 3.741816] kvm [1]: VHE mode initialized successfully
[ 3.743560] Initialise system trusted keyrings
[ 3.743928] workingset: timestamp_bits=46 max_order=19 bucket_order=0
[ 3.748455] zbud: loaded
[ 3.749982] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 3.750434] fuse: init (API version 7.38)
[ 3.780186] xor: measuring software checksum speed
[ 3.781273] 8regs : 3153 MB/sec
[ 3.782412] 32regs : 2924 MB/sec
[ 3.783445] arm64_neon : 3213 MB/sec
[ 3.783457] xor: using function: arm64_neon (3213 MB/sec)
[ 3.783476] Key type asymmetric registered
[ 3.783487] Asymmetric key parser 'x509' registered
[ 3.783602] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 242)
[ 3.783862] io scheduler mq-deadline registered
[ 3.783879] io scheduler kyber registered
[ 3.784015] io scheduler bfq registered
[ 3.787316] phy phy-fe8a0000.usb2-phy.0: Looking up phy-supply from device tree
[ 3.787350] vcc5v0_host: could not add device link phy-fe8a0000.usb2-phy.0: -ENOENT
[ 3.787513] phy phy-fe8a0000.usb2-phy.1: Looking up phy-supply from device tree
[ 3.787525] phy phy-fe8a0000.usb2-phy.1: Looking up phy-supply property in node /usb2-phy@fe8a0000/otg-port failed
[ 3.787597] phy phy-fe8a0000.usb2-phy.1: Looking up vbus-supply from device tree
[ 3.787606] phy phy-fe8a0000.usb2-phy.1: Looking up vbus-supply property in node /usb2-phy@fe8a0000/otg-port failed
[ 3.790325] phy phy-fe830000.phy.2: Looking up phy-supply from device tree
[ 3.790348] phy phy-fe830000.phy.2: Looking up phy-supply property in node /phy@fe830000 failed
[ 3.790831] phy phy-fe840000.phy.3: Looking up phy-supply from device tree
[ 3.790843] phy phy-fe840000.phy.3: Looking up phy-supply property in node /phy@fe840000 failed
[ 3.793843] rk-pcie 3c0000000.pcie: invalid prsnt-gpios property in node
[ 3.793937] rk-pcie 3c0000000.pcie: Looking up vpcie3v3-supply from device tree
[ 3.793953] rk-pcie 3c0000000.pcie: Looking up vpcie3v3-supply property in node /pcie@fe260000 failed
[ 3.793976] rk-pcie 3c0000000.pcie: no vpcie3v3 regulator found
[ 3.794418] iep: Module initialized.
[ 3.794516] mpp_service mpp-srv: d0bc6a20e309 author: Hongjin Li 2025-03-28 video: rockchip: mpp: rv1126b: Remove reduce_freq func for jpegdec.
[ 3.794533] mpp_service mpp-srv: probe start
[ 3.794732] rk-pcie 3c0000000.pcie: host bridge /pcie@fe260000 ranges:
[ 3.794781] rk-pcie 3c0000000.pcie: IO 0x00f4100000..0x00f41fffff -> 0x00f4100000
[ 3.794809] rk-pcie 3c0000000.pcie: MEM 0x00f4200000..0x00f5ffffff -> 0x00f4200000
[ 3.794826] rk-pcie 3c0000000.pcie: MEM 0x0300000000..0x033fffffff -> 0x0300000000
[ 3.794892] rk-pcie 3c0000000.pcie: iATU unroll: enabled
[ 3.794906] rk-pcie 3c0000000.pcie: iATU regions: 8 ob, 8 ib, align 64K, limit 8G
[ 3.798110] mpp_service mpp-srv: probe success
[ 3.802737] dma-pl330 fe530000.dma-controller: Loaded driver for PL330 DMAC-241330
[ 3.802784] dma-pl330 fe530000.dma-controller: DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[ 3.804678] dma-pl330 fe550000.dma-controller: Loaded driver for PL330 DMAC-241330
[ 3.804717] dma-pl330 fe550000.dma-controller: DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[ 3.805109] rockchip-pvtm fde00000.pvtm: pvtm@0 probed
[ 3.805255] rockchip-pvtm fde80000.pvtm: pvtm@1 probed
[ 3.805382] rockchip-pvtm fde90000.pvtm: pvtm@2 probed
[ 3.805924] rockchip-system-monitor rockchip-system-monitor: system monitor probe
[ 3.806739] arm-scmi firmware:scmi: Failed. SCMI protocol 22 not active.
[ 3.807016] Serial: 8250/16550 driver, 15 ports, IRQ sharing disabled
[ 3.809600] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up npu-supply from device tree
[ 3.809633] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up npu-supply property in node /power-management@fdd90000/power-controller failed
[ 3.810572] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up vpu-supply from device tree
[ 3.810595] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up vpu-supply property in node /power-management@fdd90000/power-controller failed
[ 3.811046] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up rga-supply from device tree
[ 3.811065] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up rga-supply property in node /power-management@fdd90000/power-controller failed
[ 3.812499] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up rkvenc-supply from device tree
[ 3.812523] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up rkvenc-supply property in node /power-management@fdd90000/power-controller failed
[ 3.812985] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up rkvdec-supply from device tree
[ 3.813007] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up rkvdec-supply property in node /power-management@fdd90000/power-controller failed
[ 3.824288] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 3.828319] brd: module loaded
[ 3.833400] loop: module loaded
[ 3.833767] lkdtm: No crash points registered, enable through debugfs
[ 3.839223] rk_gmac-dwmac fe010000.ethernet: IRQ eth_lpi not found
[ 3.839513] rk_gmac-dwmac fe010000.ethernet: Looking up phy-supply from device tree
[ 3.839531] rk_gmac-dwmac fe010000.ethernet: Looking up phy-supply property in node /ethernet@fe010000 failed
[ 3.839557] rk_gmac-dwmac fe010000.ethernet: supply phy not found, using dummy regulator
[ 3.839710] rk_gmac-dwmac fe010000.ethernet: clock input or output? (output).
[ 3.839727] rk_gmac-dwmac fe010000.ethernet: TX delay(0x3c).
[ 3.839739] rk_gmac-dwmac fe010000.ethernet: RX delay(0x2f).
[ 3.839756] rk_gmac-dwmac fe010000.ethernet: integrated PHY? (no).
[ 3.840029] rk_gmac-dwmac fe010000.ethernet: init for RGMII
[ 3.840294] rk_gmac-dwmac fe010000.ethernet: User ID: 0x30, Synopsys ID: 0x51
[ 3.840314] rk_gmac-dwmac fe010000.ethernet: DWMAC4/5
[ 3.840328] rk_gmac-dwmac fe010000.ethernet: DMA HW capability register supported
[ 3.840339] rk_gmac-dwmac fe010000.ethernet: RX Checksum Offload Engine supported
[ 3.840348] rk_gmac-dwmac fe010000.ethernet: TX Checksum insertion supported
[ 3.840358] rk_gmac-dwmac fe010000.ethernet: Wake-Up On Lan supported
[ 3.840418] rk_gmac-dwmac fe010000.ethernet: TSO supported
[ 3.840432] rk_gmac-dwmac fe010000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[ 3.840444] rk_gmac-dwmac fe010000.ethernet: Enabled RFS Flow TC (entries=10)
[ 3.840457] rk_gmac-dwmac fe010000.ethernet: TSO feature enabled
[ 3.840468] rk_gmac-dwmac fe010000.ethernet: Using 32/32 bits DMA host/device width
[ 3.973520] Freeing initrd memory: 7756K
[ 3.985334] PPP generic driver version 2.4.2
[ 3.985582] usbcore: registered new interface driver asix
[ 3.985650] usbcore: registered new interface driver ax88179_178a
[ 3.985697] usbcore: registered new interface driver cdc_ether
[ 3.985737] usbcore: registered new interface driver rndis_host
[ 3.985773] usbcore: registered new interface driver qmi_wwan
[ 3.995135] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[ 3.995209] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[ 3.995342] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000808002010010
[ 3.995434] xhci-hcd xhci-hcd.0.auto: irq 42, io mem 0xfd000000
[ 3.995590] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[ 3.995612] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[ 3.995632] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[ 3.995914] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
[ 3.995933] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 3.995945] usb usb1: Product: xHCI Host Controller
[ 3.995955] usb usb1: Manufacturer: Linux 6.1.118 xhci-hcd
[ 3.995965] usb usb1: SerialNumber: xhci-hcd.0.auto
[ 3.996545] hub 1-0:1.0: USB hub found
[ 3.996593] hub 1-0:1.0: 1 port detected
[ 3.996968] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[ 3.997097] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.01
[ 3.997114] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 3.997125] usb usb2: Product: xHCI Host Controller
[ 3.997136] usb usb2: Manufacturer: Linux 6.1.118 xhci-hcd
[ 3.997146] usb usb2: SerialNumber: xhci-hcd.0.auto
[ 3.997511] hub 2-0:1.0: USB hub found
[ 3.997551] hub 2-0:1.0: 1 port detected
[ 3.997967] usbcore: registered new interface driver cdc_acm
[ 3.997981] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 3.998020] usbcore: registered new interface driver cdc_wdm
[ 3.998276] usbcore: registered new interface driver uas
[ 3.998341] usbcore: registered new interface driver usb-storage
[ 3.998424] usbcore: registered new interface driver usbserial_generic
[ 3.998456] usbserial: USB Serial support registered for generic
[ 3.998495] usbcore: registered new interface driver ch341
[ 3.998520] usbserial: USB Serial support registered for ch341-uart
[ 3.998560] usbcore: registered new interface driver cp210x
[ 3.998585] usbserial: USB Serial support registered for cp210x
[ 3.998635] usbcore: registered new interface driver ftdi_sio
[ 3.998661] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 3.998722] usbcore: registered new interface driver option
[ 3.998747] usbserial: USB Serial support registered for GSM modem (1-port)
[ 3.998824] usbcore: registered new interface driver pl2303
[ 3.998849] usbserial: USB Serial support registered for pl2303
[ 3.998889] usbcore: registered new interface driver qcserial
[ 3.998918] usbserial: USB Serial support registered for Qualcomm USB modem
[ 3.999386] mousedev: PS/2 mouse device common for all mice
[ 4.000345] i2c_dev: i2c /dev entries driver
[ 4.001774] fan53555-regulator 0-001c: FAN53555 Option[12] Rev[15] Detected!
[ 4.001811] fan53555-regulator 0-001c: Looking up vin-supply from device tree
[ 4.001829] vdd_cpu: supplied by vcc3v3_sys
[ 4.001839] vcc3v3_sys: could not add device link regulator.6: -ENOENT
[ 4.002018] vdd_cpu: override max_uV, 1390000 -> 1387500
[ 4.002800] vdd_cpu: 712 <--> 1387 mV at 1025 mV, enabled
[ 4.003500] i2c 0-0020: Fixed dependency cycle(s) with /i2c@fdd40000/pmic@20/pinctrl_rk8xx/rk817_slppin_rst
[ 4.003529] i2c 0-0020: Fixed dependency cycle(s) with /i2c@fdd40000/pmic@20/pinctrl_rk8xx/rk817_slppin_pwrdn
[ 4.003551] i2c 0-0020: Fixed dependency cycle(s) with /i2c@fdd40000/pmic@20/pinctrl_rk8xx/rk817_slppin_slp
[ 4.004386] rk808 0-0020: chip id: 0x8090
[ 4.004438] rk808 0-0020: No cache defaults, reading back from HW
[ 4.010579] rk808 0-0020: source: on=0x40, off=0x00
[ 4.010599] rk808 0-0020: support dcdc3 fb mode:-22, 1
[ 4.010614] rk808 0-0020: support pmic reset mode:0,0
[ 4.011069] rk808 0-0020: Fixed dependency cycle(s) with /i2c@fdd40000/pmic@20/pinctrl_rk8xx
[ 4.013820] rk808-regulator rk808-regulator: there is no dvs0 gpio
[ 4.013862] rk808-regulator rk808-regulator: there is no dvs1 gpio
[ 4.013925] rk808 0-0020: Looking up vcc1-supply from device tree
[ 4.013944] vdd_logic: supplied by vcc3v3_sys
[ 4.013954] vcc3v3_sys: could not add device link regulator.7: -ENOENT
[ 4.014158] vdd_logic: 500 <--> 1350 mV at 900 mV, enabled
[ 4.014416] rk808 0-0020: Looking up vcc2-supply from device tree
[ 4.014429] vdd_gpu: supplied by vcc3v3_sys
[ 4.014436] vcc3v3_sys: could not add device link regulator.8: -ENOENT
[ 4.014586] vdd_gpu: 500 <--> 1350 mV at 900 mV, enabled
[ 4.014800] rk808 0-0020: Looking up vcc3-supply from device tree
[ 4.014813] vcc_ddr: supplied by vcc3v3_sys
[ 4.014821] vcc3v3_sys: could not add device link regulator.9: -ENOENT
[ 4.014964] vcc_ddr: at 500 mV, enabled
[ 4.015180] rk808 0-0020: Looking up vcc4-supply from device tree
[ 4.015193] vdd_npu: supplied by vcc3v3_sys
[ 4.015205] vcc3v3_sys: could not add device link regulator.10: -ENOENT
[ 4.015354] vdd_npu: 500 <--> 1350 mV at 900 mV, enabled
[ 4.015576] rk808 0-0020: Looking up vcc9-supply from device tree
[ 4.015589] vcc_1v8: supplied by vcc3v3_sys
[ 4.015597] vcc3v3_sys: could not add device link regulator.11: -ENOENT
[ 4.015739] vcc_1v8: 1800 mV, enabled
[ 4.015943] rk808 0-0020: Looking up vcc5-supply from device tree
[ 4.015956] vdda0v9_image: supplied by vcc3v3_sys
[ 4.015964] vcc3v3_sys: could not add device link regulator.12: -ENOENT
[ 4.016621] vdda0v9_image: 900 mV, enabled
[ 4.016807] rk808 0-0020: Looking up vcc5-supply from device tree
[ 4.016820] vdda_0v9: supplied by vcc3v3_sys
[ 4.016827] vcc3v3_sys: could not add device link regulator.13: -ENOENT
[ 4.017495] vdda_0v9: 900 mV, enabled
[ 4.017686] rk808 0-0020: Looking up vcc5-supply from device tree
[ 4.017699] vdda0v9_pmu: supplied by vcc3v3_sys
[ 4.017706] vcc3v3_sys: could not add device link regulator.14: -ENOENT
[ 4.018362] vdda0v9_pmu: 900 mV, enabled
[ 4.018570] rk808 0-0020: Looking up vcc6-supply from device tree
[ 4.018582] vccio_acodec: supplied by vcc3v3_sys
[ 4.018590] vcc3v3_sys: could not add device link regulator.15: -ENOENT
[ 4.019246] vccio_acodec: 3300 mV, enabled
[ 4.019454] rk808 0-0020: Looking up vcc6-supply from device tree
[ 4.019466] vccio_sd: supplied by vcc3v3_sys
[ 4.019474] vcc3v3_sys: could not add device link regulator.16: -ENOENT
[ 4.020130] vccio_sd: 1800 <--> 3300 mV at 3300 mV, enabled
[ 4.020341] rk808 0-0020: Looking up vcc6-supply from device tree
[ 4.020354] vcc3v3_pmu: supplied by vcc3v3_sys
[ 4.020361] vcc3v3_sys: could not add device link regulator.17: -ENOENT
[ 4.021016] vcc3v3_pmu: 3300 mV, enabled
[ 4.021229] rk808 0-0020: Looking up vcc7-supply from device tree
[ 4.021242] vcca_1v8: supplied by vcc3v3_sys
[ 4.021249] vcc3v3_sys: could not add device link regulator.18: -ENOENT
[ 4.021903] vcca_1v8: 1800 mV, enabled
[ 4.022118] rk808 0-0020: Looking up vcc7-supply from device tree
[ 4.022131] vcca1v8_pmu: supplied by vcc3v3_sys
[ 4.022139] vcc3v3_sys: could not add device link regulator.19: -ENOENT
[ 4.022796] vcca1v8_pmu: 1800 mV, enabled
[ 4.022999] rk808 0-0020: Looking up vcc7-supply from device tree
[ 4.023012] vcca1v8_image: supplied by vcc3v3_sys
[ 4.023019] vcc3v3_sys: could not add device link regulator.20: -ENOENT
[ 4.023729] vcca1v8_image: 1800 mV, enabled
[ 4.023941] rk808 0-0020: Looking up vcc9-supply from device tree
[ 4.023955] vcc_3v3: supplied by vcc3v3_sys
[ 4.023963] vcc3v3_sys: could not add device link regulator.21: -ENOENT
[ 4.024120] vcc_3v3: at 3300 mV, enabled
[ 4.024346] rk808 0-0020: Looking up vcc8-supply from device tree
[ 4.024358] vcc3v3_sd: supplied by vcc3v3_sys
[ 4.024370] vcc3v3_sys: could not add device link regulator.22: -ENOENT
[ 4.024516] vcc3v3_sd: at 3300 mV, enabled
[ 4.024712] rk817-battery: Failed to locate of_node [id: -1]
[ 4.024935] rk817-charger: Failed to locate of_node [id: -1]
[ 4.026185] input: rk805 pwrkey as /devices/platform/fdd40000.i2c/i2c-0/0-0020/rk805-pwrkey/input/input0
[ 4.032649] rtc-hym8563 1-0051: rtc information is valid
[ 4.039905] rtc-hym8563 1-0051: registered as rtc0
[ 4.040946] rtc-hym8563 1-0051: setting system clock to 2025-11-20T01:04:46 UTC (1763600686)
[ 4.041419] IR NEC protocol handler initialized
[ 4.042018] rockchip-mipi-csi2-hw fdfb0000.mipi-csi2-hw: enter mipi csi2 hw probe!
[ 4.042252] rockchip-mipi-csi2-hw fdfb0000.mipi-csi2-hw: probe success, v4l2_dev:mipi-csi2-hw!
[ 4.046055] device-mapper: uevent: version 1.0.3
[ 4.046317] device-mapper: ioctl: 4.47.0-ioctl (2022-07-28) initialised: dm-devel@redhat.com
[ 4.046964] cpu cpu0: no pvtpll
[ 4.047222] cpu cpu0: bin=0
[ 4.047283] cpu cpu0: leakage=35
[ 4.047327] cpu cpu0: pvtm = 92320, from nvmem
[ 4.047346] cpu cpu0: pvtm-volt-sel=3
[ 4.047362] cpu cpu0: soc version=0, speed=3
[ 4.047413] cpu cpu0: Looking up cpu-supply from device tree
[ 4.048811] cpu cpu0: avs=0
[ 4.048992] cpu cpu0: l=0 h=2147483647 hyst=5000 l_limit=0 h_limit=0 h_table=0
[ 4.050214] cpu cpu0: EM: OPP:600000 is inefficient
[ 4.050420] cpu cpu0: EM: created perf domain
[ 4.052502] sdhci: Secure Digital Host Controller Interface driver
[ 4.052535] sdhci: Copyright(c) Pierre Ossman
[ 4.052547] Synopsys Designware Multimedia Card Interface Driver
[ 4.052989] sdhci-pltfm: SDHCI platform and OF driver helper
[ 4.053620] dwmmc_rockchip fe2b0000.dwmmc: No normal pinctrl state
[ 4.053643] dwmmc_rockchip fe2b0000.dwmmc: No idle pinctrl state
[ 4.054171] dwmmc_rockchip fe2b0000.dwmmc: IDMAC supports 32-bit address mode.
[ 4.054228] dwmmc_rockchip fe2b0000.dwmmc: Using internal DMA controller.
[ 4.054247] dwmmc_rockchip fe2b0000.dwmmc: Version ID is 270a
[ 4.054322] dwmmc_rockchip fe2b0000.dwmmc: DW MMC controller at irq 74,32 bit host data width,256 deep fifo
[ 4.054432] dwmmc_rockchip fe2b0000.dwmmc: Looking up vmmc-supply from device tree
[ 4.054672] dwmmc_rockchip fe2b0000.dwmmc: Looking up vqmmc-supply from device tree
[ 4.054858] sdhci-dwcmshc fe310000.sdhci: Looking up vmmc-supply from device tree
[ 4.054873] sdhci-dwcmshc fe310000.sdhci: Looking up vmmc-supply property in node /sdhci@fe310000 failed
[ 4.054917] sdhci-dwcmshc fe310000.sdhci: Looking up vqmmc-supply from device tree
[ 4.054927] sdhci-dwcmshc fe310000.sdhci: Looking up vqmmc-supply property in node /sdhci@fe310000 failed
[ 4.055681] ledtrig-cpu: registered to indicate activity on CPUs
[ 4.055738] arm-scmi firmware:scmi: Failed. SCMI protocol 17 not active.
[ 4.055834] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[ 4.055902] hid: raw HID events driver (C) Jiri Kosina
[ 4.056234] usbcore: registered new interface driver usbhid
[ 4.056250] usbhid: USB HID core driver
[ 4.057125] rockchip,bus bus-npu: Looking up bus-supply from device tree
[ 4.057315] rockchip,bus bus-npu: no pvtpll
[ 4.057337] rockchip,bus bus-npu: bin=0
[ 4.057370] rockchip,bus bus-npu: Failed to get leakage
[ 4.057440] rockchip,bus bus-npu: pvtm = 92320, from nvmem
[ 4.057461] rockchip,bus bus-npu: pvtm-volt-sel=2
[ 4.057511] rockchip,bus bus-npu: Looking up pvtm-supply from device tree
[ 4.058173] rockchip,bus bus-npu: avs=0
[ 4.061476] rockchip-saradc fe720000.saradc: Looking up vref-supply from device tree
[ 4.063755] hw perfevents: enabled with armv8_cortex_a55 PMU driver, 7 counters available
[ 4.063757] rk-pcie 3c0000000.pcie: PCIe Link up, LTSSM is 0x30011
[ 4.063810] rk-pcie 3c0000000.pcie: PCIe Gen.1 x1 link up
[ 4.063985] rk-pcie 3c0000000.pcie: PCI host bridge to bus 0000:00
[ 4.064006] pci_bus 0000:00: root bus resource [bus 00-0f]
[ 4.064026] pci_bus 0000:00: root bus resource [io 0x0000-0xfffff] (bus address [0xf4100000-0xf41fffff])
[ 4.064041] pci_bus 0000:00: root bus resource [mem 0xf4200000-0xf5ffffff]
[ 4.064056] pci_bus 0000:00: root bus resource [mem 0x300000000-0x33fffffff]
[ 4.064110] pci 0000:00:00.0: [1d87:3566] type 01 class 0x060400
[ 4.064148] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[ 4.064230] pci 0000:00:00.0: supports D1 D2
[ 4.064244] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[ 4.067824] mmc_host mmc0: Bus speed (slot 0) = 375000Hz (slot req 400000Hz, actual 375000HZ div = 0)
[ 4.073868] optee: probing for conduit method.
[ 4.074275] optee: revision 3.13 (185dc3c9)
[ 4.074856] optee: dynamic shared memory is enabled
[ 4.075099] optee: initialized driver
[ 4.075161] pci_bus 0000:01: busn_res: can not insert [bus 01-ff] under [bus 00-0f] (conflicts with (null) [bus 00-0f])
[ 4.075293] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
[ 4.075384] pci 0000:01:00.0: reg 0x10: initial BAR value 0x00000000 invalid
[ 4.075399] pci 0000:01:00.0: reg 0x10: [io size 0x0100]
[ 4.075500] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
[ 4.075572] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit]
[ 4.076055] pci 0000:01:00.0: supports D1 D2
[ 4.076070] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[ 4.081641] Initializing XFRM netlink socket
[ 4.081697] IPsec XFRM device driver
[ 4.082089] NET: Registered PF_INET6 protocol family
[ 4.083440] Segment Routing with IPv6
[ 4.083494] In-situ OAM (IOAM) with IPv6
[ 4.083581] NET: Registered PF_PACKET protocol family
[ 4.083798] Bluetooth: RFCOMM TTY layer initialized
[ 4.083823] Bluetooth: RFCOMM socket layer initialized
[ 4.083862] Bluetooth: RFCOMM ver 1.11
[ 4.083893] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 4.083917] Bluetooth: HIDP socket layer initialized
[ 4.084342] [BT_RFKILL]: Enter rfkill_rk_init
[ 4.084355] [WLAN_RFKILL]: Enter rfkill_wlan_init
[ 4.084789] Key type dns_resolver registered
[ 4.085559] mmc2: SDHCI controller on fe310000.sdhci [fe310000.sdhci] using ADMA
[ 4.086259] registered taskstats version 1
[ 4.086305] Loading compiled-in X.509 certificates
[ 4.086630] zswap: loaded using pool lzo/zbud
[ 4.088558] Btrfs loaded, crc32c=crc32c-generic, zoned=no, fsverity=yes
[ 4.088838] pstore: Using crash dump compression: deflate
[ 4.088961] AppArmor: AppArmor sha1 policy hashing enabled
[ 4.090542] rga2 fdeb0000.rk_rga: probe successfully, irq = 82, hw_version:3.2.63318
[ 4.090920] rga: IOMMU binding successfully, default mapping core[0x4]
[ 4.091244] rga: Module initialized. v1.3.8
[ 4.103987] pci 0000:00:00.0: BAR 8: assigned [mem 0xf4200000-0xf42fffff]
[ 4.104043] pci 0000:00:00.0: BAR 6: assigned [mem 0xf4300000-0xf430ffff pref]
[ 4.104063] pci 0000:00:00.0: BAR 7: assigned [io 0x1000-0x1fff]
[ 4.104085] pci 0000:01:00.0: BAR 4: assigned [mem 0xf4200000-0xf4203fff 64bit]
[ 4.104149] pci 0000:01:00.0: BAR 2: assigned [mem 0xf4204000-0xf4204fff 64bit]
[ 4.104209] pci 0000:01:00.0: BAR 0: assigned [io 0x1000-0x10ff]
[ 4.104239] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[ 4.104256] pci 0000:00:00.0: bridge window [io 0x1000-0x1fff]
[ 4.104272] pci 0000:00:00.0: bridge window [mem 0xf4200000-0xf42fffff]
[ 4.106910] pcieport 0000:00:00.0: PME: Signaling with IRQ 85
[ 4.125903] friendlyelec-board board: Serial : a249fabf6d20f787
[ 4.126362] rockchip-iodomain fdc20000.syscon:io-domains: Looking up pmuio1-supply from device tree
[ 4.126378] rockchip-iodomain fdc20000.syscon:io-domains: Looking up pmuio1-supply property in node /syscon@fdc20000/io-domains failed
[ 4.126421] rockchip-iodomain fdc20000.syscon:io-domains: Looking up pmuio2-supply from device tree
[ 4.126604] rockchip-iodomain fdc20000.syscon:io-domains: pmuio2(3300000 uV) supplied by vcc3v3_pmu
[ 4.126626] rockchip-iodomain fdc20000.syscon:io-domains: Looking up vccio1-supply from device tree
[ 4.126769] rockchip-iodomain fdc20000.syscon:io-domains: vccio1(3300000 uV) supplied by vccio_acodec
[ 4.126789] rockchip-iodomain fdc20000.syscon:io-domains: Looking up vccio2-supply from device tree
[ 4.126960] rockchip-iodomain fdc20000.syscon:io-domains: vccio2(1800000 uV) supplied by vcc_1v8
[ 4.126980] rockchip-iodomain fdc20000.syscon:io-domains: Looking up vccio3-supply from device tree
[ 4.127126] rockchip-iodomain fdc20000.syscon:io-domains: vccio3(3300000 uV) supplied by vccio_sd
[ 4.127146] rockchip-iodomain fdc20000.syscon:io-domains: Looking up vccio4-supply from device tree
[ 4.127307] rockchip-iodomain fdc20000.syscon:io-domains: vccio4(3300000 uV) supplied by vcc_3v3
[ 4.127327] rockchip-iodomain fdc20000.syscon:io-domains: Looking up vccio5-supply from device tree
[ 4.127395] rockchip-iodomain fdc20000.syscon:io-domains: vccio5(1800000 uV) supplied by vcc_1v8
[ 4.127413] rockchip-iodomain fdc20000.syscon:io-domains: Looking up vccio6-supply from device tree
[ 4.127482] rockchip-iodomain fdc20000.syscon:io-domains: vccio6(3300000 uV) supplied by vcc_3v3
[ 4.127500] rockchip-iodomain fdc20000.syscon:io-domains: Looking up vccio7-supply from device tree
[ 4.127584] rockchip-iodomain fdc20000.syscon:io-domains: vccio7(3300000 uV) supplied by vcc_3v3
[ 4.127988] mpp_rkvenc fdf40000.rkvenc: Adding to iommu group 5
[ 4.128223] mpp_rkvenc fdf40000.rkvenc: probing start
[ 4.128571] mpp_rkvenc fdf40000.rkvenc: Looking up venc-supply from device tree
[ 4.128743] mpp_rkvenc fdf40000.rkvenc: no pvtpll
[ 4.128764] mpp_rkvenc fdf40000.rkvenc: bin=0
[ 4.128797] mpp_rkvenc fdf40000.rkvenc: Failed to get leakage
[ 4.128852] mpp_rkvenc fdf40000.rkvenc: pvtm = 92320, from nvmem
[ 4.128873] mpp_rkvenc fdf40000.rkvenc: pvtm-volt-sel=2
[ 4.128925] mpp_rkvenc fdf40000.rkvenc: Looking up venc-supply from device tree
[ 4.128950] vdd_logic: could not add device link fdf40000.rkvenc: -EEXIST
[ 4.129226] mpp_rkvenc fdf40000.rkvenc: avs=0
[ 4.129905] mpp_rkvenc fdf40000.rkvenc: using default check_rate_volt
[ 4.129937] mpp_rkvenc fdf40000.rkvenc: l=-2147483648 h=2147483647 hyst=0 l_limit=0 h_limit=0 h_table=0
[ 4.130517] mpp_rkvenc fdf40000.rkvenc: probing finish
[ 4.131017] mpp_vdpu2 fdea0400.vdpu: Adding to iommu group 1
[ 4.131216] mpp_vdpu2 fdea0400.vdpu: probe device
[ 4.131593] mpp_vdpu2 fdea0400.vdpu: probing finish
[ 4.131979] mpp_vepu2 fdee0000.vepu: Adding to iommu group 3
[ 4.132162] mpp_vepu2 fdee0000.vepu: probing start
[ 4.132485] mpp_vepu2 fdee0000.vepu: probing finish
[ 4.132855] mpp-iep2 fdef0000.iep: Adding to iommu group 4
[ 4.133028] mpp-iep2 fdef0000.iep: probe device
[ 4.133619] mpp-iep2 fdef0000.iep: probing finish
[ 4.134054] mpp_jpgdec fded0000.jpegd: Adding to iommu group 2
[ 4.134237] mpp_jpgdec fded0000.jpegd: probe device
[ 4.134648] mpp_jpgdec fded0000.jpegd: probing finish
[ 4.135095] mpp_rkvdec2 fdf80200.rkvdec: Adding to iommu group 6
[ 4.135427] mpp_rkvdec2 fdf80200.rkvdec: rkvdec, probing start
[ 4.135798] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_a is not found!
[ 4.135816] rkvdec2_init:1250: No niu aclk reset resource define
[ 4.135832] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_h is not found!
[ 4.135843] rkvdec2_init:1253: No niu hclk reset resource define
[ 4.135878] mpp_rkvdec2 fdf80200.rkvdec: Looking up vdec-supply from device tree
[ 4.136113] mpp_rkvdec2 fdf80200.rkvdec: no pvtpll
[ 4.136134] mpp_rkvdec2 fdf80200.rkvdec: bin=0
[ 4.136263] mpp_rkvdec2 fdf80200.rkvdec: leakage=61
[ 4.136285] mpp_rkvdec2 fdf80200.rkvdec: leakage-volt-sel=0
[ 4.136328] mpp_rkvdec2 fdf80200.rkvdec: pvtm = 92320, from nvmem
[ 4.136347] mpp_rkvdec2 fdf80200.rkvdec: pvtm-volt-sel=1
[ 4.136406] mpp_rkvdec2 fdf80200.rkvdec: Looking up vdec-supply from device tree
[ 4.136439] vdd_logic: could not add device link fdf80200.rkvdec: -EEXIST
[ 4.136713] mpp_rkvdec2 fdf80200.rkvdec: avs=0
[ 4.137311] mpp_rkvdec2 fdf80200.rkvdec: using default check_rate_volt
[ 4.137347] mpp_rkvdec2 fdf80200.rkvdec: l=-2147483648 h=2147483647 hyst=0 l_limit=0 h_limit=0 h_table=0
[ 4.137823] mpp_rkvdec2 fdf80200.rkvdec: sram_start 0x00000000fdcc0000
[ 4.137845] mpp_rkvdec2 fdf80200.rkvdec: rcb_iova 0x0000000010000000
[ 4.137858] mpp_rkvdec2 fdf80200.rkvdec: sram_size 45056
[ 4.137870] mpp_rkvdec2 fdf80200.rkvdec: rcb_size 65536
[ 4.137884] mpp_rkvdec2 fdf80200.rkvdec: min_width 512
[ 4.137961] mpp_rkvdec2 fdf80200.rkvdec: link mode probe finish
[ 4.138053] mpp_rkvdec2 fdf80200.rkvdec: probing finish
[ 4.138070] mpp_rkvdec2 fdf80200.rkvdec: probing finish
[ 4.138605] rockchip-vop2 fe040000.vop: Adding to iommu group 7
[ 4.139323] rockchip-vop2 fe040000.vop: [drm:vop2_bind] vp0 assign plane mask: Smart0[0x10], primary plane phy id: Smart0[4]
[ 4.139360] rockchip-vop2 fe040000.vop: [drm:vop2_bind] vp1 assign plane mask: Cluster0 | Esmart0[0x5], primary plane phy id: Esmart0[2]
[ 4.139383] rockchip-vop2 fe040000.vop: [drm:vop2_bind] vp2 assign plane mask: Cluster1 | Esmart1 | Smart1[0x2a], primary plane phy id: Esmart1[3]
[ 4.139602] [drm] Esmart0-win0(possible_vp_mask = 0x00000002) has no possible crtcs
[ 4.139652] [drm] Esmart0-win1(possible_vp_mask = 0x00000002) has no possible crtcs
[ 4.139693] [drm] Esmart0-win2(possible_vp_mask = 0x00000002) has no possible crtcs
[ 4.139740] [drm] Esmart0-win3(possible_vp_mask = 0x00000002) has no possible crtcs
[ 4.139784] [drm] Cluster0-win0(possible_vp_mask = 0x00000002) has no possible crtcs
[ 4.139850] [drm] Cluster0-win1(possible_vp_mask = 0x00000002) has no possible crtcs
[ 4.140014] rockchip-vop2 fe040000.vop: no pvtpll
[ 4.140035] rockchip-vop2 fe040000.vop: bin=0
[ 4.140111] rockchip-vop2 fe040000.vop: leakage=61
[ 4.140131] rockchip-vop2 fe040000.vop: leakage-volt-sel=0
[ 4.140175] rockchip-vop2 fe040000.vop: pvtm = 92320, from nvmem
[ 4.140193] rockchip-vop2 fe040000.vop: pvtm-volt-sel=1
[ 4.140263] rockchip-vop2 fe040000.vop: Looking up vop-supply from device tree
[ 4.140681] rockchip-vop2 fe040000.vop: avs=0
[ 4.140869] rockchip-vop2 fe040000.vop: l=-2147483648 h=2147483647 hyst=0 l_limit=0 h_limit=0 h_table=0
[ 4.140928] rockchip-vop2 fe040000.vop: Supported VOP aclk dvfs, normal mode:396000000, reset mode:0, advanced mode:500000000
[ 4.140971] rockchip-drm display-subsystem: bound fe040000.vop (ops 0xffff800009395680)
[ 4.141116] dwhdmi-rockchip fe0a0000.hdmi: Looking up avdd-0v9-supply from device tree
[ 4.141132] dwhdmi-rockchip fe0a0000.hdmi: Looking up avdd-0v9-supply property in node /hdmi@fe0a0000 failed
[ 4.141173] dwhdmi-rockchip fe0a0000.hdmi: Looking up avdd-1v8-supply from device tree
[ 4.141186] dwhdmi-rockchip fe0a0000.hdmi: Looking up avdd-1v8-supply property in node /hdmi@fe0a0000 failed
[ 4.141360] dwhdmi-rockchip fe0a0000.hdmi: Detected HDMI TX controller v2.11a with HDCP (DWC HDMI 2.0 TX PHY)
[ 4.142414] dwhdmi-rockchip fe0a0000.hdmi: registered DesignWare HDMI I2C bus driver
[ 4.143056] dwhdmi-rockchip fe0a0000.hdmi: error -ENXIO: IRQ index 1 not found
[ 4.143903] input: hdmi_cec_key as /devices/platform/fe0a0000.hdmi/dw-hdmi-cec.4.auto/input/input1
[ 4.145108] rockchip-drm display-subsystem: bound fe0a0000.hdmi (ops 0xffff8000093ae4d8)
[ 4.146529] [drm] Initialized rockchip 4.0.0 20140818 for display-subsystem on minor 0
[ 4.146591] rockchip-drm display-subsystem: failed to parse loader memory
[ 4.146734] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[ 4.146882] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[ 4.147172] rockchip-drm display-subsystem: [drm] run display error_event monitor
[ 4.148507] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up gpu-supply from device tree
[ 4.148540] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up gpu-supply property in node /power-management@fdd90000/power-controller failed
[ 4.148643] mali fde60000.gpu: Kernel DDK version g25p0-00eac0
[ 4.148865] mali fde60000.gpu: Looking up mali-supply from device tree
[ 4.149220] mali fde60000.gpu: Looking up mem-supply from device tree
[ 4.149238] mali fde60000.gpu: Looking up mem-supply property in node /gpu@fde60000 failed
[ 4.149352] mali fde60000.gpu: no pvtpll
[ 4.149623] mali fde60000.gpu: bin=0
[ 4.149697] mali fde60000.gpu: leakage=9
[ 4.149746] mali fde60000.gpu: pvtm = 92320, from nvmem
[ 4.149801] mali fde60000.gpu: pvtm-volt-sel=3
[ 4.149834] mali fde60000.gpu: soc version=0, speed=3
[ 4.149837] rockchip-dmc dmc: no pvtpll
[ 4.149931] mali fde60000.gpu: Looking up mali-supply from device tree
[ 4.149953] rockchip-dmc dmc: bin=0
[ 4.149963] vdd_gpu: could not add device link fde60000.gpu: -EEXIST
[ 4.150011] rockchip-dmc dmc: leakage=61
[ 4.150033] rockchip-dmc dmc: leakage-volt-sel=0
[ 4.150076] rockchip-dmc dmc: pvtm = 92320, from nvmem
[ 4.150097] rockchip-dmc dmc: pvtm-volt-sel=1
[ 4.150114] rockchip-dmc dmc: soc version=0, speed=1
[ 4.150175] rockchip-dmc dmc: Looking up center-supply from device tree
[ 4.150519] rockchip-dmc dmc: avs=0
[ 4.150550] rockchip-dmc dmc: current ATF version 0x102
[ 4.150762] mali fde60000.gpu: avs=0
[ 4.150811] W : [File] : drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c; [Line] : 144; [Func] : kbase_platform_rk_init(); power-off-delay-ms not available.
[ 4.151306] mali fde60000.gpu: Register LUT 00070200 initialized for GPU arch 0x00070400
[ 4.151355] mali fde60000.gpu: GPU identified as 0x2 arch 7.4.0 r1p0 status 0
[ 4.151552] mali fde60000.gpu: No priority control manager is configured
[ 4.151571] mali fde60000.gpu: Large page allocation set to false after hardware feature check
[ 4.151666] rockchip-dmc dmc: normal_rate = 780000000
[ 4.151686] rockchip-dmc dmc: reboot_rate = 1056000000
[ 4.151701] rockchip-dmc dmc: suspend_rate = 324000000
[ 4.151714] rockchip-dmc dmc: video_4k_rate = 780000000
[ 4.151728] rockchip-dmc dmc: video_4k_10b_rate = 780000000
[ 4.151741] rockchip-dmc dmc: boost_rate = 1056000000
[ 4.151754] rockchip-dmc dmc: fixed_rate(isp|cif0|cif1|dualview) = 1056000000
[ 4.151767] rockchip-dmc dmc: performance_rate = 1056000000
[ 4.151801] rockchip-dmc dmc: failed to get vop pn to msch rl
[ 4.151839] mali fde60000.gpu: No memory group manager is configured
[ 4.153037] rockchip-dmc dmc: l=0 h=2147483647 hyst=5000 l_limit=0 h_limit=0 h_table=0
[ 4.153397] mali fde60000.gpu: l=0 h=2147483647 hyst=5000 l_limit=0 h_limit=0 h_table=0
[ 4.154505] mali fde60000.gpu: Couldn't find power_model DT node matching 'arm,mali-simple-power-model'
[ 4.154572] mali fde60000.gpu: Error -22, no DT entry: mali-simple-power-model.static-coefficient = 1*[0]
[ 4.155009] mali fde60000.gpu: Error -22, no DT entry: mali-simple-power-model.dynamic-coefficient = 1*[0]
[ 4.155383] mali fde60000.gpu: Error -22, no DT entry: mali-simple-power-model.ts = 4*[0]
[ 4.155771] mali fde60000.gpu: Error -22, no DT entry: mali-simple-power-model.thermal-zone = ''
[ 4.156093] mali fde60000.gpu: No thermal zone specified, will use the default temperature value of 55000
[ 4.158900] mali fde60000.gpu: Clearing BASE_MEM_UNCACHED_GPU flag to avoid MMA violation
[ 4.159097] mali fde60000.gpu: Using configured power model mali-g52_r1-power-model, and fallback mali-simple-power-model
[ 4.161477] input: gpio-keys as /devices/platform/gpio-keys/input/input2
[ 4.161697] mali fde60000.gpu: * MALI kbase_mmap_min_addr compiled to CONFIG_DEFAULT_MMAP_MIN_ADDR, no runtime update possible! *
[ 4.161716] mali fde60000.gpu: Probed as mali0
[ 4.164585] rk808-rtc rk808-rtc: registered as rtc1
[ 4.171523] clk: Disabling unused clocks
[ 4.172472] rockchip-pm rockchip-suspend: not set pwm-regulator-config
[ 4.173012] rockchip-suspend not set sleep-mode-config for mem-lite
[ 4.173025] rockchip-suspend not set wakeup-config for mem-lite
[ 4.173037] rockchip-suspend not set sleep-mode-config for mem-ultra
[ 4.173045] rockchip-suspend not set wakeup-config for mem-ultra
[ 4.173876] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up vi-supply from device tree
[ 4.173898] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up vi-supply property in node /power-management@fdd90000/power-controller failed
[ 4.173990] ALSA device list:
[ 4.174003] #0: rockchip,hdmi0
[ 4.180858] Freeing unused kernel memory: 6528K
[ 4.180984] Run /init as init process
[ 4.180997] with arguments:
[ 4.181002] /init
[ 4.181006] with environment:
[ 4.181010] HOME=/
[ 4.181013] TERM=linux
[ 4.181016] storagemedia=emmc
[ 4.181020] data=/dev/mmcblk2p9
[ 4.181023] cgroup_enable=memory
[ 4.181027] cgroup_memory=1
[ 4.303805] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[ 4.476635] mmc2: Host Software Queue enabled
[ 4.476737] mmc2: new HS200 MMC card at address 0001
[ 4.478060] mmcblk2: mmc2:0001 AT3SFB 29.1 GiB
[ 4.487835] mmcblk2: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10
[ 4.492034] mmcblk2boot0: mmc2:0001 AT3SFB 4.00 MiB
[ 4.494996] mmcblk2boot1: mmc2:0001 AT3SFB 4.00 MiB
[ 4.497303] mmcblk2rpmb: mmc2:0001 AT3SFB 4.00 MiB, chardev (236:0)
[ 4.498004] usb 1-1: New USB device found, idVendor=05e3, idProduct=0610, bcdDevice=94.06
[ 4.498063] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4.498075] usb 1-1: Product: USB2.1 Hub
[ 4.498085] usb 1-1: Manufacturer: GenesysLogic
[ 4.540143] hub 1-1:1.0: USB hub found
[ 4.540578] hub 1-1:1.0: 4 ports detected
[ 4.593527] vendor storage:20190527 ret = 0
[ 4.654841] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[ 4.696896] usb 2-1: New USB device found, idVendor=05e3, idProduct=0625, bcdDevice=94.06
[ 4.696943] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4.696953] usb 2-1: Product: USB3.2 Hub
[ 4.696962] usb 2-1: Manufacturer: GenesysLogic
[ 4.716175] hub 2-1:1.0: USB hub found
[ 4.716546] hub 2-1:1.0: 4 ports detected
[ 5.734106] usb 2-1.1: new SuperSpeed USB device number 3 using xhci-hcd
[ 5.765678] usb 2-1.1: New USB device found, idVendor=8564, idProduct=7000, bcdDevice=80.00
[ 5.765758] usb 2-1.1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 5.765802] usb 2-1.1: Product: StoreJet Transcend
[ 5.765838] usb 2-1.1: Manufacturer: StoreJet Transcend
[ 5.765872] usb 2-1.1: SerialNumber: WD-WXT2E70DTYTE
[ 5.768582] usb-storage 2-1.1:1.0: USB Mass Storage device detected
[ 5.771051] scsi host0: usb-storage 2-1.1:1.0
[ 6.186922] EXT4-fs (mmcblk2p8): mounted filesystem with ordered data mode. Quota mode: none.
[ 6.412459] EXT4-fs (mmcblk2p9): mounted filesystem with ordered data mode. Quota mode: none.
[ 6.421239] EXT4-fs (mmcblk2p9): re-mounted. Quota mode: none.
[ 6.439597] overlayfs: "xino" feature enabled using 32 upper inode bits.
[ 6.582423] init: Console is alive
[ 6.582828] init: - watchdog -
[ 6.856202] scsi 0:0:0:0: Direct-Access StoreJet Transcend 0 PQ: 0 ANSI: 6
入口
现代操作系统已经和以前不一样,不一定是从汇编启动了
-
lecacy BIOS,x86体系为主,
arch/x86/boot/bootsect.S汇编跳转到main入口,新版代码已经看不到了 -
grub 入口
grub> set root=(hd0,1) grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1 grub> initrd /boot/initrd.img-3.13.0-29-generic grub> boot -
uefi 入口
boot.efi -
uboot 入口(arm体系为主)
一般使用Image_header结构体+类似bl汇编跳转执行指令来启动kernel_start函数
built-in.a 内核的拓展静态库
defconfig/Makefile/Kbuild的可选开关
- 内核内置目标
-obj-y - 可加载驱动模块
-obj-m - 库文件目标
-lib-y
选择Y会编译然后统一AR打成 built-in.a
选择M会被打成.ko
这里只列举几种,更多见官网文档-Makefile
builtin的都会被内核进程通过 module_init/initcall 链接符号去调用
ELF vmlinux

vmlinux(Virtual Memory Linux) 就是我们常说的内核,本身是一个带有调试符号的ELF文件,包含了上面的built-in.a, 虚拟内存
Tips:ELF(Executable and Linkable Format)是UNIX世界的可执行文件,LINUX内核也是一个程序; vmlinux是一个ELF文件,如果是vmlinuz则代表是压缩过的vmlinux。但这里没有UNIX环境所以没办法直接启动。那为什么还编译出ELF呢?因为编译器只能编译出ELF(摊手🤷
zImage/bzImage
一个带有自解压的可引导的可执行二进制程序,通过OBJCOPY\AS\CC\LD等编译器操作将 带有vmlinux的压缩包+自解压程序及其解压所需链接库打在一起,然后用OBJCOPY去除了ELF和符号,加上了BIOS/UEFI/Loader可执行的程序码用于“原始”启动。
原料:主要由 arch/
head.o架构初始化代码,被Bootloader执行head-<cpu>.o处理器初始化代码- decompress.o, misc.o 自解压代码
- *.gz. 包含裁剪过符号的vmlinux内核ELF的压缩包
产物:
- zImage 可执行自解压出内核ELF内压缩可执行文件,此外还有衍生的
Image.lz4+resource.img=>boot.img

文件系统 rootfs
有两种可选
- initrd/initramfs 只读虚拟最小文件系统,挂载的ramdisk镜像,安卓方案就是这个。
- 直接挂载储存器分区
/
然后内核就会启动rootfs上用户空间的第一个进程 init
CPU模式转换
一般CPU/SOC会从高权限转向低权限,在内核启动,用户和内核空间等涉及权限切换的场景、在兼容或者安全状态下的切换,都和CPU模式转换息息相关
如X86实模式转保护模式

X64_86保护模式下的Long Mode,有64/32位兼容态

ARM的SVC(EL0)


The Arm architecture includes the exception-generating instructions SVC, HVC, and SMC. The purpose of these instructions is solely to generate an exception and enable the PE to move between Exception levels:
The Supervisor Call (SVC) instruction enables a user program at EL0 to request an OS service at EL1
The Hypervisor Call (HVC) instruction, available if the Virtualization Extensions are implemented, enables the OS to request hypervisor services at EL2
The Secure Monitor Call (SMC) instruction, available if the Security Extensions are implemented, enables the Normal world to request Secure world services from firmware at EL3
When the PE is executing at EL0, it cannot call directly to a hypervisor at EL2 or secure monitor at EL3, as this is only possible from EL1 and higher. The application at EL0 must use an SVC call to the kernel, and have the kernel perform the action to call into higher Exception levels.
Assuming the respective Exception levels have been implemented, the OS kernel (EL1) can execute an HVC instruction to call the hypervisor at EL2 or call the secure monitor at EL3 with the SMC instruction. Similarly, from EL2 the PE can use the SMC instruction to call the EL3 secure monitor. This is illustrated in the following diagram:

而在TEE/TPM则还多了安全模式的转换
LINUX KERNEL 阶段
无论启动方式如何,最后都会启动内核这个main文件的start_kernel(void)函数
像内核驱动开发里面经常需要处理的 early_init 的钩子就在这里
1,记录第一个堆栈的魔数,用于堆栈溢出检测
set_task_stack_end_magic(&init_task)
这里就是将init_task的堆栈底赋值一个魔数。

2, 多核处理器亲和性处理
smp_setup_processor_id(void)
- 这里获取了 MPIDR, Multiprocessor Affinity Register 多核亲和性寄存器
- 也就是经常在内核启动日志里看到的
"Booting Linux on physical CPU 0x%010lx [0x%08x]\n", mpidr, cpuid 
3, early boot准备,初始化hash桶,并连接obj到obj_poll对象池,用于对象追踪(objcect tracker)
debug_objects_early_init(void)
这里只是追踪对象的
在cpu和内存总线的拓扑上可区分:
- SMP(Symmetric Multi-Processor) 对称多处理器结构
- NUMA(Non-Uniform Memory Access) 非一致储存访问结构
- MPP(Massive Parallel Processing) 海量并行处理结构
4,vmlinux的build_id记录
init_vmlinux_build_id(void)
ELF可执行文件的头部包含了多种信息,其中便有build id,这是一种基于哈希算法的校验方式,同一版本的源码就能编译出相同buildid,方便追溯,也能给调试器确认同版本。
而前文说过vmlinux是ELF格式,所以这里从里面读出来。
5, early阶段的cgourp初始化
cgroup_init_early(void)
初始化root的cgroup
6, 禁用irq中断
local_irq_disable();
early_boot_irqs_disabled = true;
这里会使用内联汇编来禁用中断,可以避免过程中被打断打乱
7, 各部分开始初始化
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them.
*/
boot_cpu_init();
page_address_init();
pr_notice("%s", linux_banner);
early_security_init();
setup_arch(&command_line);
setup_boot_config();
setup_command_line(command_line);
setup_nr_cpu_ids();
setup_per_cpu_areas();
smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
boot_cpu_hotplug_init();
build_all_zonelists(NULL);
page_alloc_init();
//...
最后阶段kernel_ini(void *unused)
等待 kthreadd 进程完成量之后,初始化init进程需要的环境,标记状态,释放initcall相关内核内存,更新用户内核页表,配置NUMA,然后查询执行储存上的init用户程序。
启动用户空间第一个程序init进程 arch_call_rest_init
arch_call_rest_init -> rest_init ->
pid = user_mode_thread(kernel_init, NULL, CLONE_FS);
释放内存free_initmem(void)
这里主要是跑完前面的内核initcall之后,从内存伙伴释放所有__init内存。
原因:__init段已经跑完了,后续不可能再调用了,现在该回收还给系统了,主要是以下
链接脚本(vmlinux.lds.S)把所有带 __init / __initdata / __initconst 标注的代码和数据集中放到 .init.* 段,地址范围就是 [__init_begin, __init_end)。包括:
- __init 函数:start_kernel、mm_init、numa_policy_init、所有 *_init() …
- __initdata 数据:boot_command_line、tmp_cmdline、各种 __initdata 数组
- initcall 表:__initcall0_start..__initcall_end(启动后再没人用了)
- __setup 解析表:__setup_start..__setup_end
- .init.text / .init.rodata 整段
对应日志:
[ 4.180858] Freeing unused kernel memory: 6528K
配置多核NUMA(Non-Uniform Memory Access)策略numa_default_policy();
这里把NUMA策略从initcal配置回默认。
嵌入式核心少能耗低内存少,所以嵌入式包括安卓移动设备ARM一般没有NUMA,所以就是单node。
run_init_process(execute_command)启动第一个init进程
在日志里面打印如
[ 4.180984] Run /init as init process
[ 4.180997] with arguments:
[ 4.181002] /init
[ 4.181006] with environment:
[ 4.181010] HOME=/
[ 4.181013] TERM=linux
[ 4.181016] storagemedia=emmc
[ 4.181020] data=/dev/mmcblk2p9
[ 4.181023] cgroup_enable=memory
[ 4.181027] cgroup_memory=1
然后return kernel_execve(init_filename, argv_init, envp_init); 将pid1控制权移交用户态
后面就是需要时才切换进入内核态了,如系统调用,中断异常、调度等
然后并创建kthreadd内核线程 -> kernel_clone
End
refer to:
- AMD64 ArchitectureProgrammer's Manual https://docs.amd.com/v/u/en-US/24592_3.24
- Linux kernl 6.10 'source
- ARM Supervisor Call - SVC
- https://hernan.de/blog/super-hexagon-a-journey-from-el0-to-s-el3/
本文来自博客园,作者:蓝天上的云℡,采用 BY-NC-SA 许可协议,转载请注明:转载自作者蓝天上的云℡ 原文链接 https://www.cnblogs.com/yucloud/p/19876282/Linux_Kernel_Init

浙公网安备 33010602011771号