本文和之前一直一样,从Linux官方下载最新的Linux内核代码(arm64 6.6.0-rc2)并一步一步配置修改,编译,到最后在Orange pi 3上跑起来。本文从通用移植思路的角度,展现是思考的过程,通过这种方式希望能让读者一通百通,授之以渔,一定要读完!后续持续更新系统移植系列文章,欢迎关注、点赞、收藏。
移植前思考
移植思路其实和之前uboot一样,也需要看看mainline linux 是否已经合入orange pi 3开发板的相关代码和设备树文件等。
我们来到Linux官方github代码仓库:https://github.com/torvalds/linux,搜索”orange pi3“相关文件,可以看到最新版本代码已经有了对我们目标硬件的支持,那就工作量小很多了,剩下的工作就是配置编译,按部就班的操作了。
搜索结果
下载源码
在ubuntu命令行下执行以下命令下载最新代码:
https://github.com/torvalds/linux.git
配置内核
执行以下命令来生成开发板默认配置
make ARCH=arm64 CROSS_COMPILE=aARCH64-linux-gnu- defconfig
ARM64机构相关硬件的配置文件现在只有一个defconfig,在arch/arm64/configs下,这和之前arm的系统结构的不一样,之前arch/arm/configs下面各个厂商的芯片的默认配置文件都在那里有多个,而arm64共用这一个,可能也是现在kernel对arm64支持没那么好,因为arm64比较新。
执行上面指令之后在源码树顶层目录会生成一个.config文件,就是配置结果文件。
name这个配置文件由于是所有arm64芯片厂家共用,肯定有很多其他芯片相关冗余代码,当然也包含全志的arm64相关h6支持代码,所以需要进一步做些裁剪。
下面采用图形窗口方式来配置裁剪:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
出来这个熟悉窗口:
配置界面1
platform selection平台选择,将allwinner sunxi 64-bit soc Family留下,其它厂家的芯片支持全部去掉。
配置界面2
另外,ARMv8 software model这一项保留,因为查看它的help,这一项和电源管理(PM)相关支持代码,肯定要留。
配置界面3
至于其他选项,比如device driver,设备驱动这些后面我们根据具体硬件情况再做进一步慢慢配置或者修改,这样就完成了一个内核初步配置。
编译
执行下面指令进行编译源码,生成linux内核镜像:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image -j8
编译完成,会在arch/arm64/boot目录下生成Image内核镜像文件。
执行下面命令,会生产设备树文件:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs -j8
这样会把所有的硬件的设备树全部编译,前面我们查找过,orange pi 3这款开发板的设备树是arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts,
该文件会被编译成sun50i-h6-orangepi-3.dtb文件。
运行
要想把内核跑起来,思路是这样的:
TF卡最前面20M用于存储uboot程序,在前面我们已经做过了。现在我们需要把内核镜像文件和dtb文件烧写到TF卡第一分区,所以需要TF卡创建一个新的分区,大小为128M,格式化为FAT文件系统。然后设置uboot启动命令,uboot启动起来之后,从TF卡第一分区加载内核和设备树文件到内存,然后通过booti命令启动linux 内核。
TF卡创建分区,烧写文件
将TF卡插入ubuntu系统,下面我们先使用fdisk工具来创建分区,并格式化为FAT。
sudo fdisk /dev/sdd # 新建分区
n
p
40960
303104
#保存分区表到TF
w
# 进行 FAT 格式化
sudo mkfs.fat /dev/sdb1
过程如下:
通过以下这操作将两个文件存入TF卡第一分区。
# 挂载 FAT 文件系统
sudo mount /dev/sdb1 /mnt/boot/
# 复制内核以及设备树到FAT分区
sudo cp arch/arm64/boot/Image /mnt/boot/
sudo cp arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dtb /mnt/boot/
# 卸载 FAT 文件系统
sudo umount /mnt/boot
设置uboot环境变量,自动启动内核
连上串口软件,开发板上电,uboot运行起来,自动启动倒计时结束前按任意键,进入uboot命令行模式。
现在开始设置环境变量。
#设置默认终端
setenv bootargs 'console=ttyS0,115200'
#设置bootcmd环境变量的值
setenv bootcmd 'fatload mmc 0:1 0x40200000 Image;fatload mmc 0:1 0x4fa00000 sun50i-h6-orangepi-3.dtb;booti 0x40200000 - 0x4fa00000'
#保存设置,下次重启自动执行,不用再设置
saveenv
# 使用 bootcmd 启动
boot
上面bootcmd设置我们来解释一下,bootcmd是uboot自动启动时候自动会执行bootcmd变量值中的哪些语句,每条语句分号隔开,值如下:
fatload mmc 0:1 0x40200000 Image;fatload mmc 0:1 0x4fa00000 sun50i-h6-orangepi-3.dtb;booti 0x40200000 - 0x4fa00000
到此程序就可以跑起来了。以下是输出的日志:
=> setenv bootargs 'console=ttyS0,115200'
=> setenv bootcmd 'fatload mmc 0:1 0x40200000 Image;fatload mmc 0:1 0x4fa00000 sun50i-h6-orangepi-3.dtb;booti 0x40200000 - 0x4fa00000'
=> saveenv
Saving Environment to FAT... OK
=> boot
24066560 bytes read in 1191 ms (19.3 MiB/s)
24660 bytes read in 3 ms (7.8 MiB/s)
## Flattened Device Tree blob at 4fa00000
Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
Host not halted after 16000 microseconds.
Loading Device Tree to 0000000049ff6000, end 0000000049fff053 ... OK
Working FDT set to 49ff6000
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.6.0-rc2 (albert@albert-vm) (aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP PREEMPT Wed Sep 20 02:03:01 CST 2023
[ 0.000000] KASLR disabled due to lack of seed
[ 0.000000] Machine model: OrangePi 3
[ 0.000000] efi: UEFI not found.
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x00000000bfffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0xbfbd49c0-0xbfbd6fff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000040000000-0x00000000bfffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000040000000-0x00000000bfffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]
[ 0.000000] cma: Reserved 32 MiB at 0x00000000bba00000 on node -1
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.4
[ 0.000000] percpu: Embedded 22 pages/cpu s49384 r8192 d32536 u90112
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] alternatives: applying boot alternatives
[ 0.000000] Kernel command line: console=ttyS0,115200
[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] Fallback order for Node 0: 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 516096
[ 0.000000] Policy zone: DMA
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] software IO TLB: area num 4.
[ 0.000000] software IO TLB: mapped [mem 0x00000000b7800000-0x00000000bb800000] (64MB)
[ 0.000000] Memory: 1933524K/2097152K available (13696K kernel code, 1486K rwdata, 4968K rodata, 3200K init, 531K bss, 130860K reserved, 32768K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_IRQs: 64, preallocated irqs: 0
[ 0.000000] Root IRQ handler: gic_handle_irq
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000001] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000119] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000571] Console: colour dummy device 80x25
[ 0.000649] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[ 0.000662] pid_max: default: 32768 minimum: 301
[ 0.000749] LSM: initializing lsm=capability,integrity
[ 0.000859] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.000878] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.001918] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 0.002794] RCU Tasks: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[ 0.002877] RCU Tasks Trace: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[ 0.003124] rcu: Hierarchical SRCU implementation.
[ 0.003129] rcu: Max phase no-delay instances is 1000.
[ 0.004139] EFI services will not be available.
[ 0.004401] smp: Bringing up secondary CPUs ...
[ 0.005233] Detected VIPT I-cache on CPU1
[ 0.005331] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.006084] Detected VIPT I-cache on CPU2
[ 0.006143] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.006805] Detected VIPT I-cache on CPU3
[ 0.006861] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.006951] smp: Brought up 1 node, 4 CPUs
[ 0.006960] SMP: Total of 4 processors activated.
[ 0.006966] CPU features: detected: 32-bit EL0 Support
[ 0.006969] CPU features: detected: 32-bit EL1 Support
[ 0.006975] CPU features: detected: CRC32 instructions
[ 0.007059] CPU: All CPU(s) started at EL2
[ 0.007085] alternatives: applying system-wide alternatives
[ 0.009151] devtmpfs: initialized
[ 0.015904] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.015931] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.017181] pinctrl core: initialized pinctrl subsystem
[ 0.017768] DMI not present or invalid.
[ 0.018487] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.019566] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[ 0.019746] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.019957] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.020012] audit: initializing netlink subsys (disabled)
[ 0.020233] audit: type=2000 audit(0.020:1): state=initialized audit_enabled=0 res=1
[ 0.020750] thermal_sys: Registered thermal governor 'step_wise'
[ 0.020756] thermal_sys: Registered thermal governor 'power_allocator'
[ 0.020797] cpuidle: using governor menu
[ 0.020950] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.021058] ASID allocator initialised with 65536 entries
[ 0.021738] Serial: AMBA PL011 UART driver
[ 0.030770] platform 6510000.tcon-top: Fixed dependency cycle(s) with /soc/hdmi@6000000/ports/port@0/endpoint
[ 0.030997] platform 6515000.lcd-controller: Fixed dependency cycle(s) with /soc/tcon-top@6510000/ports/port@4/endpoint@0
[ 0.031029] platform 6515000.lcd-controller: Fixed dependency cycle(s) with /soc/tcon-top@6510000/ports/port@1/endpoint@2
[ 0.031058] platform 6515000.lcd-controller: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[ 0.032843] platform connector: Fixed dependency cycle(s) with /soc/hdmi@6000000/ports/port@1/endpoint
[ 0.034419] Modules: 26752 pages in range for non-PLT usage
[ 0.034425] Modules: 518272 pages in range for PLT usage
[ 0.035249] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[ 0.035257] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[ 0.035264] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages
[ 0.035269] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[ 0.035275] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.035280] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[ 0.035286] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages
[ 0.035290] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[ 0.036942] ACPI: Interpreter disabled.
[ 0.037570] iommu: Default domain type: Translated
[ 0.037577] iommu: DMA domain TLB invalidation policy: strict mode
[ 0.037903] SCSI subsystem initialized
[ 0.038279] usbcore: registered new interface driver usbfs
[ 0.038313] usbcore: registered new interface driver hub
[ 0.038349] usbcore: registered new device driver usb
[ 0.038666] pps_core: LinuxPPS API ver. 1 registered
[ 0.038671] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.038688] PTP clock support registered
[ 0.038835] EDAC MC: Ver: 3.0.0
[ 0.039227] scmi_core: SCMI protocol bus registered
[ 0.039596] FPGA manager framework
[ 0.039697] Advanced Linux Sound Architecture Driver Initialized.
[ 0.040803] vgaarb: loaded
[ 0.041246] clocksource: Switched to clocksource arch_sys_counter
[ 0.041648] VFS: Disk quotas dquot_6.6.0
[ 0.041683] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.041895] pnp: PnP ACPI: disabled
[ 0.050194] NET: Registered PF_INET protocol family
[ 0.050402] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)
[ 0.052438] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[ 0.052473] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.052490] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 0.052682] TCP bind hash table entries: 16384 (order: 7, 524288 bytes, linear)
[ 0.053289] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.053418] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 0.053477] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 0.053681] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.054157] RPC: Registered named UNIX socket transport module.
[ 0.054164] RPC: Registered udp transport module.
[ 0.054168] RPC: Registered tcp transport module.
[ 0.054171] RPC: Registered tcp-with-tls transport module.
[ 0.054175] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.054191] PCI: CLS 0 bytes, default 64
[ 0.054667] kvm [1]: IPA Size Limit: 40 bits
[ 0.056056] kvm [1]: vgic interrupt IRQ9
[ 0.056090] kvm [1]: Hyp mode initialized successfully
[ 0.057528] Initialise system trusted keyrings
[ 0.057770] workingset: timestamp_bits=42 max_order=19 bucket_order=0
[ 0.058144] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.058415] NFS: Registering the id_resolver key type
[ 0.058440] Key type id_resolver registered
[ 0.058445] Key type id_legacy registered
[ 0.058468] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.058475] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[ 0.058634] 9p: Installing v9fs 9p2000 file system support
[ 0.100968] Key type asymmetric registered
[ 0.100975] Asymmetric key parser 'x509' registered
[ 0.101029] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[ 0.101037] io scheduler mq-deadline registered
[ 0.101042] io scheduler kyber registered
[ 0.101076] io scheduler bfq registered
[ 0.105155] EINJ: ACPI disabled.
[ 0.114620] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.124121] loop: module loaded
[ 0.124996] megasas: 07.725.01.00-rc1
[ 0.129395] tun: Universal TUN/TAP device driver, 1.6
[ 0.130072] thunder_xcv, ver 1.0
[ 0.130108] thunder_bgx, ver 1.0
[ 0.130138] nicpf, ver 1.0
[ 0.130548] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[ 0.130554] hns3: Copyright (c) 2017 Huawei Corporation.
[ 0.130601] hclge is initializing
[ 0.130637] e1000: Intel(R) PRO/1000 Network Driver
[ 0.130641] e1000: Copyright (c) 1999-2006 Intel Corporation.
[ 0.130672] e1000e: Intel(R) PRO/1000 Network Driver
[ 0.130676] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 0.130705] igb: Intel(R) Gigabit Ethernet Network Driver
[ 0.130709] igb: Copyright (c) 2007-2014 Intel Corporation.
[ 0.130738] igbvf: Intel(R) Gigabit Virtual Function Network Driver
[ 0.130742] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[ 0.130860] sky2: driver version 1.30
[ 0.131410] VFIO - User Level meta-driver version: 0.3
[ 0.132914] usbcore: registered new interface driver usb-storage
[ 0.135721] sun6i-rtc 7000000.rtc: registered as rtc0
[ 0.135750] sun6i-rtc 7000000.rtc: setting system clock to 1970-01-01T00:04:12 UTC (252)
[ 0.136040] i2c_dev: i2c /dev entries driver
[ 0.138093] sdhci: Secure Digital Host Controller Interface driver
[ 0.138099] sdhci: Copyright(c) Pierre Ossman
[ 0.138602] Synopsys Designware Multimedia Card Interface Driver
[ 0.139320] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.140327] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.140748] SMCCC: SOC_ID: ID = jep106:091e:1728 Revision = 0x00000001
[ 0.141281] usbcore: registered new interface driver usbhid
[ 0.141287] usbhid: USB HID core driver
[ 0.143126] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[ 0.145952] NET: Registered PF_PACKET protocol family
[ 0.146060] 9pnet: Installing 9P2000 support
[ 0.146134] Key type dns_resolver registered
[ 0.157894] registered taskstats version 1
[ 0.158074] Loading compiled-in X.509 certificates
[ 0.180921] platform 1100000.mixer: Fixed dependency cycle(s) with /soc/tcon-top@6510000/ports/port@0/endpoint@0
[ 0.182043] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.184663] sun50i-h6-r-pinctrl 7022000.pinctrl: initialized sunXi PIO driver
[ 0.189377] sun50i-h6-r-pinctrl 7022000.pinctrl: supply vcc-pm not found, using dummy regulator
[ 0.191549] sun50i-h6-r-pinctrl 7022000.pinctrl: supply vcc-pl not found, using dummy regulator
[ 0.192619] sunxi-rsb 7083000.rsb: RSB running at 3000000 Hz
[ 0.192980] axp20x-rsb sunxi-rsb-745: AXP20x variant AXP806 found
[ 0.194436] axp20x-rsb sunxi-rsb-745: AXP20X driver loaded
[ 0.195857] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.201373] sun50i-h6-pinctrl 300b000.pinctrl: initialized sunXi PIO driver
[ 0.202133] sun50i-h6-pinctrl 300b000.pinctrl: supply vcc-ph not found, using dummy regulator
[ 0.202762] printk: console [ttyS0] disabled
[ 0.223510] 5000000.serial: ttyS0 at MMIO 0x5000000 (irq = 234, base_baud = 1500000) is a 16550A
[ 0.223570] printk: console [ttyS0] enabled
[ 1.500354] 5000400.serial: ttyS1 at MMIO 0x5000400 (irq = 235, base_baud = 1500000) is a 16550A
[ 1.509443] serial serial0: tty port ttyS1 registered
[ 1.518354] sun50i-h6-pinctrl 300b000.pinctrl: supply vcc-pf not found, using dummy regulator
[ 1.521911] usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for exclusive requests
[ 1.527995] ehci-platform 5101000.usb: EHCI Host Controller
[ 1.528198] sunxi-mmc 4020000.mmc: Got CD GPIO
[ 1.528232] sunxi-mmc 4021000.mmc: allocated mmc-pwrseq
[ 1.529304] ehci-platform 5311000.usb: EHCI Host Controller
[ 1.529332] ehci-platform 5311000.usb: new USB bus registered, assigned bus number 1
[ 1.529430] ehci-platform 5311000.usb: irq 240, io mem 0x05311000
[ 1.530238] ohci-platform 5101400.usb: Generic Platform OHCI controller
[ 1.530259] ohci-platform 5101400.usb: new USB bus registered, assigned bus number 2
[ 1.530360] ohci-platform 5101400.usb: irq 241, io mem 0x05101400
[ 1.531013] ohci-platform 5311400.usb: Generic Platform OHCI controller
[ 1.531037] ohci-platform 5311400.usb: new USB bus registered, assigned bus number 3
[ 1.531123] ohci-platform 5311400.usb: irq 242, io mem 0x05311400
[ 1.536657] musb-hdrc musb-hdrc.2.auto: MUSB HDRC host driver
[ 1.541744] ehci-platform 5101000.usb: new USB bus registered, assigned bus number 4
[ 1.545263] ehci-platform 5311000.usb: USB 2.0 started, EHCI 1.00
[ 1.546026] hub 1-0:1.0: USB hub found
[ 1.546062] hub 1-0:1.0: 1 port detected
[ 1.546408] musb-hdrc musb-hdrc.2.auto: new USB bus registered, assigned bus number 5
[ 1.551488] ehci-platform 5101000.usb: irq 237, io mem 0x05101000
[ 1.553418] sunxi-mmc 4022000.mmc: initialized, max. request size: 2048 KB, uses new timings mode
[ 1.553888] sunxi-mmc 4020000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[ 1.557700] hub 5-0:1.0: USB hub found
[ 1.577263] ehci-platform 5101000.usb: USB 2.0 started, EHCI 1.00
[ 1.577449] hub 5-0:1.0: 1 port detected
[ 1.589174] mmc1: host does not support reading read-only switch, assuming write-enable
[ 1.596155] hub 4-0:1.0: USB hub found
[ 1.599216] clk: Disabling unused clocks
[ 1.602579] mmc1: new high speed SDHC card at address aaaa
[ 1.603339] mmcblk1: mmc1:aaaa SC16G 14.8 GiB
[ 1.605661] hub 4-0:1.0: 1 port detected
[ 1.606524] mmcblk1: p1
[ 1.611887] ALSA device list:
[ 1.618598] hub 3-0:1.0: USB hub found
[ 1.625243] No soundcards found.
[ 1.697192] mmc2: new DDR MMC card at address 0001
[ 1.700185] hub 3-0:1.0: 1 port detected
[ 1.706432] mmcblk2: mmc2:0001 8GTF4R 7.28 GiB
[ 1.711209] hub 2-0:1.0: USB hub found
[ 1.715949] mmcblk2: p1 p2 p3 < p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 >
[ 1.716521] hub 2-0:1.0: 1 port detected
[ 1.719471] mmcblk2: p1 size 6840320 extends beyond EOD, truncated
[ 1.757823] mmcblk2boot0: mmc2:0001 8GTF4R 4.00 MiB
[ 1.761284] sunxi-mmc 4021000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[ 1.767618] mmcblk2boot1: mmc2:0001 8GTF4R 4.00 MiB
[ 1.781997] /dev/root: Can't open blockdev
[ 1.786167] VFS: Cannot open root device "" or unknown-block(0,0): error -6
[ 1.793152] Please append a correct "root=" boot option; here are the available partitions:
[ 1.801547] b300 15558144 mmcblk1
[ 1.801557] driver: mmcblk
[ 1.808380] b301 131072 mmcblk1p1 cad4ebea-01
[ 1.808388]
[ 1.815209] b320 7634944 mmcblk2
[ 1.815216] driver: mmcblk
[ 1.822045] b321 3387392 mmcblk2p1 00000000-01
[ 1.822053]
[ 1.828886] b322 16384 mmcblk2p2 00000000-02
[ 1.828894]
[ 1.835710] b323 1 mmcblk2p3
[ 1.835716]
[ 1.841617] b325 16384 mmcblk2p5 00000000-05
[ 1.841625]
[ 1.848438] b326 32768 mmcblk2p6 00000000-06
[ 1.848446]
[ 1.855258] b327 1572864 mmcblk2p7 00000000-07
[ 1.855265]
[ 1.862090] b328 16384 mmcblk2p8 00000000-08
[ 1.862097]
[ 1.868908] b329 16384 mmcblk2p9 00000000-09
[ 1.868916]
[ 1.875727] b32a 32768 mmcblk2p10 00000000-0a
[ 1.875735]
[ 1.882638] b32b 1572864 mmcblk2p11 00000000-0b
[ 1.882646]
[ 1.889551] b32c 16384 mmcblk2p12 00000000-0c
[ 1.889558]
[ 1.896455] b32d 65536 mmcblk2p13 00000000-0d
[ 1.896462]
[ 1.903359] b32e 16384 mmcblk2p14 00000000-0e
[ 1.903367]
[ 1.910270] b32f 32768 mmcblk2p15 00000000-0f
[ 1.910277]
[ 1.917165] b330 16384 mmcblk2p16 00000000-10
[ 1.917172]
[ 1.924069] b331 786432 mmcblk2p17 00000000-11
[ 1.924076]
[ 1.930988] b340 4096 mmcblk2boot0
[ 1.930995] (driver?)
[ 1.937819] b360 4096 mmcblk2boot1
[ 1.937826] (driver?)
[ 1.944637] List of all bdev filesystems:
[ 1.948656] ext3
[ 1.948660] ext4
[ 1.950597] ext2
[ 1.952528] squashfs
[ 1.954466] vfat
[ 1.956743]
[ 1.960173] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.968428] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.6.0-rc2 #1
[ 1.974604] Hardware name: OrangePi 3 (DT)
[ 1.978697] Call trace:
[ 1.981142] dump_backtrace 0x90/0xe8
[ 1.984817] show_stack 0x18/0x24
[ 1.988135] dump_stack_lvl 0x48/0x60
[ 1.991804] dump_stack 0x18/0x24
[ 1.995124] panic 0x314/0x370
[ 1.998173] mount_root_generic 0x240/0x31c
[ 2.002360] mount_root 0x164/0x2d4
[ 2.005851] prepare_namespace 0x6c/0x298
[ 2.009861] kernel_init_freeable 0x244/0x284
[ 2.014218] kernel_init 0x24/0x1e0
[ 2.017710] ret_from_fork 0x10/0x20
[ 2.021288] SMP: stopping secondary CPUs
[ 2.025210] Kernel Offset: disabled
[ 2.028695] CPU features: 0x00000008,00020000,0000421b
[ 2.033829] Memory Limit: none
[ 2.036884] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
可以看到内核已经初步运行起来了。
版本为6.6.0-rc2,Machine model是OrangePi 3,当然这里还有些设备驱动有问题。
日志最后我们可以看到,kernel panic,是无法挂载根文件系统rootfs。这是正常的。因为我们根文件系统没有创建,下一步我们就是要创建更文件系统了。
Copyright © 2024 妖气游戏网 www.17u1u.com All Rights Reserved