侧边栏壁纸
博主头像
Into The Abyss 博主等级

My Life is a Death Race

  • 累计撰写 34 篇文章
  • 累计创建 7 个标签
  • 累计收到 4 条评论

目 录CONTENT

文章目录

从0开始移植linux系统到树莓派4b

Administrator
2024-01-02 / 0 评论 / 0 点赞 / 499 阅读 / 0 字

格式化SD卡并创建分区

将SD卡插入读卡器,并将读卡器连接电脑

首先删除原有的分区

sudo dmesg | tail
[26272.158249]  sdb: sdb1 sdb2  # 说明设备的名称为sdb
sudo fdisk /dev/sdb
欢迎使用 fdisk (util-linux 2.38.1)。更改将停留在内存中,直到您决定将更改写入磁盘。使用写入命令前请三思。

命令(输入 m 获取帮助):d
分区号 (1,2, 默认  2): 

分区 2 已删除。
命令(输入 m 获取帮助):d
已选择分区 1
分区 1 已删除。
命令(输入 m 获取帮助):p
Disk /dev/sdb:14.84 GiB,15931539456 字节,31116288 个扇区磁盘型号:MassStorageClass
单元:扇区 / 1 * 512 = 512 字节扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节磁盘标签类型:dos
磁盘标识符:0x533b9d04

命令(输入 m 获取帮助):w
分区表已调整。将调用 ioctl() 来重新读分区表。正在同步磁盘。

添加两个分区

sudo fdisk /dev/sdb

欢迎使用 fdisk (util-linux 2.38.1)。更改将停留在内存中,直到您决定将更改写入磁盘。使用写入命令前请三思。

命令(输入 m 获取帮助):n
分区类型   p   主分区 (0个主分区,0个扩展分区,4空闲)
   e   扩展分区 (逻辑分区容器)
选择 (默认 p):
将使用默认回应 p。分区号 (1-4, 默认  1): 
第一个扇区 (2048-31116287, 默认 2048): 
最后一个扇区,+/-sectors 或 +size{K,M,G,T,P} (2048-31116287, 默认 31116287): +100M

创建了一个新分区 1,类型为“Linux”,大小为 100 MiB。分区 #1 包含一个 vfat 签名。
您想移除该签名吗?是[Y]/否[N]:Y

写入命令将移除该签名。
命令(输入 m 获取帮助):n
分区类型   p   主分区 (1个主分区,0个扩展分区,3空闲)
   e   扩展分区 (逻辑分区容器)
选择 (默认 p):
将使用默认回应 p。分区号 (2-4, 默认  2): 
第一个扇区 (206848-31116287, 默认 206848): 
最后一个扇区,+/-sectors 或 +size{K,M,G,T,P} (206848-31116287, 默认 31116287): 

创建了一个新分区 2,类型为“Linux”,大小为 14.7 GiB。分区 #2 包含一个 ext4 签名。
您想移除该签名吗?是[Y]/否[N]:Y

写入命令将移除该签名。
命令(输入 m 获取帮助):t
分区号 (1,2, 默认  2): 1
Hex 代码或别名(输入 L 列出所有代码):b

已将分区“Linux”的类型更改为“W95 FAT32”。
命令(输入 m 获取帮助):p
Disk /dev/sdb:14.84 GiB,15931539456 字节,31116288 个扇区磁盘型号:MassStorageClass
单元:扇区 / 1 * 512 = 512 字节扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节磁盘标签类型:dos
磁盘标识符:0x533b9d04

设备       启动   起点     末尾     扇区  大小 Id 类型/dev/sdb1         2048   206847   204800  100M  b W95 FAT32
/dev/sdb2       206848 31116287 30909440 14.7G 83 Linux

1 分区上的文件系统/RAID 签名将被擦除。2 分区上的文件系统/RAID 签名将被擦除。
命令(输入 m 获取帮助):w
分区表已调整。将调用 ioctl() 来重新读分区表。正在同步磁盘。

格式化分区

sudo mkfs.vfat -F 32 -n boot /dev/sdb1
sudo mkfs.ext4 -L root /dev/sdb2

挂载分区

sudo mkdir /mnt/boot
sudo mount /dev/sdb1 /mnt/boot
sudo mkdir /mnt/root
sudo mount /dev/sdb2 /mnt/root # 如果使用initramfs,可以不挂载

编译linux内核

安装git和交叉编译的依赖项

sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev

从树莓派的官方仓库下载内核源码,我使用的是比较新的6.6内核

git clone -b rpi-6.6.y --depth=1 https://github.com/raspberrypi/linux/

安装64位的交叉编译工具链

sudo apt install crossbuild-essential-arm64

配置内核参数

cd linux
KERNEL=kernel_2712
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
#  如果想要自定义修改内核配置,可以使用下面的命令进入图形化修改。选择要修改的选项,按y编译进内核,按m编译为模块,按n不编译
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig

编译内核,其中-j后面的数字按照自己的机器性能填写

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j12

经过漫长的等待(45min),终于编译完成。其他版本的树莓派或者要编译32位系统,可以参考Raspberry Pi Documentation - The Linux kernel

将编译好的内核镜像文件和设备树文件移动到/mnt/boot/下

sudo cp arch/arm64/boot/Image /mnt/boot
sudo cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /mnt/boot

移植U-Boot

引导加载程序(bootload)是启动系统并加载操作系统内核的部分。引导加载程序有两个主要工作:将系统初始化到基本级别和加载内核。U-Boot是现在比较流行的一个开源引导加载程序。

在上电或重置后,当执行引导加载程序代码的第一行时,系统处于非常小的状态。DRAM 控制器未设置,因此无法访问主内存。同样,未配置其他接口,因此通过 NAND 闪存控制器、MMC 控制器等访问的存储不可用。通常,开始时唯一可操作的资源是单个 CPU 内核、一些片上静态内存和引导 ROM。

系统引导程序由代码的几个阶段组成,每个阶段都会使更多的系统投入运行。引导加载程序的最后一步是将内核加载到 RAM 中,并为其创建一个执行环境。引导加载程序和内核之间的接口细节是特定于架构的,但在每种情况下,它都必须做两件事。首先,引导加载程序必须传递指向包含硬件配置信息的结构的指针。其次,它必须传递指向内核命令行的指针。

引导加载程序的辅助工作是提供一种维护模式,用于更新引导配置、将新的引导映像加载到内存中,以及运行诊断程序。这通常由简单的命令行用户界面控制,通常通过串行控制台进行控制。

下载U-Boot源码

git clone https://github.com/u-boot/u-boot/ --depth=1

配置编译参数

cd u-boot
make CROSS_COMPILE=aarch64-linux-gnu- rpi_4_defconfig

编译

make CROSS_COMPILE=aarch64-linux-gnu- -j12

大概几十秒就可以编译完毕,在当前目录下生成的u-boot.bin就是我们需要的原始二进制格式文件,将其移动到/mnt/boot/文件夹下

sudo cp ./u-boot.bin /mnt/boot

移植根文件系统

我们的目标是创建一个最小的根文件系统,它将为我们提供一个 shell 提示符。然后,以此为基础,我们将添加脚本来启动其他程序并配置网络接口和用户权限。

创建一个暂存目录

mkdir rootfs
cd rootfs
mkdir {bin,dev,etc,home,lib64,proc,sbin,sys,tmp,usr,var}
mkdir usr/{bin,lib,sbin}
mkdir var/log
ln -s lib64 lib

# 整个目录的结构如下
tree -d
.
├── bin
├── dev
├── etc
├── home
├── lib -> lib64
├── lib64
├── proc
├── sbin
├── sys
├── tmp
├── usr
│   ├── bin
│   ├── lib
│   └── sbin
└── var
    └── log

17 directories

文件所有权权限设置

sudo chown -R root:root *

根文件系统中的程序,使用busybox构建

git clone git://busybox.net/busybox.git --depth=1
cd busybox
make distclean
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j12
# 需要将CONFIG_PREFIX换成你的rootfs路径
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CONFIG_PREFIX=/home/pjw6/documents/kernel/rootfs install

安装需要的库文件

cd rootfs
aarch64-linux-gnu-readelf -a bin/busybox | grep "program interpreter"
      [Requesting program interpreter: /lib/ld-linux-aarch64.so.1]
aarch64-linux-gnu-objdump -x bin/busybox | grep "NEEDED"
  NEEDED               libm.so.6
  NEEDED               libresolv.so.2
  NEEDED               libc.so.6

我们需要找到ld-linux-aarch64.so.1,libm.so.6,libresolv.so.2,libc.so.6。这几个文件将它们添加到rootfs文件夹中的lib64文件夹中

aarch64-linux-gnu-gcc -print-sysroot   # 可以获取该编译器的路径,但在我的机器上并没有显示
#我使用find命令进行了查找
sudo find / -name "ld-linux-aarch64.so.1"
# 输出/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1,其他的几个库文件也在相同的目录下
sudo cp -a /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1  ./lib64
sudo cp -a /usr/aarch64-linux-gnu/lib/libm.so.6  ./lib64
sudo cp -a /usr/aarch64-linux-gnu/lib/libresolv.so.2  ./lib64
sudo cp -a /usr/aarch64-linux-gnu/lib/libc.so.6  ./lib64
# 验证一下
ls -l ./lib64

创建设备节点

sudo mknod -m 666 dev/null c 1 3
sudo mknod -m 600 dev/console c 5 1
# 验证一下
ls -l ./dev

创建initramfs

find . | cpio -H newc -ov --owner root:root -F ../initramfs.cpio
cd ..
gzip initramfs.cpio
./u-boot/tools/mkimage -A arm64 -O linux -T ramdisk -d initradiskmfs.cpio.gz uRamdisk
# 上面的命令需要将./u-boot/tools/mkimage替换为你自己的uboot路径

将生成的uRamdisk移动到/mnt/boot/下

sudo cp ./uRamdisk /mnt/boot

配置文件获取与修改

修改config.txt

cat << EOF > config.txt
enable_uart=1
arm_64bit=1
kernel=u-boot.bin
EOF

sudo cp ./config.txt /mnt/boot

创建boot.scr

cat << EOF > boot_cmd.txt
fatload mmc 0:1 \${kernel_addr_r} Image
fatload mmc 0:1 \${ramdisk_addr_r} uRamdisk
booti \${kernel_addr_r} \${ramdisk_addr_r} \${fdt_addr}
EOF

./u-boot/tools/mkimage -A arm64 -O linux -T script -C none -d boot_cmd.txt boot.scr
# 同样需要替换./u-boot/tools/mkimage为你的uboot路径
sudo cp ./boot.scr /mnt/boot

创建cmdline.txt

echo "console=tty1 console=serial0,115200 rdinit=/bin/sh" > cmdline.txt
sudo cp ./cmdline.txt /mnt/boot

获取树莓派启动的相关文件

git clone --depth=1 https://github.com/raspberrypi/firmware.git
sudo cp firmware/boot/{bootcode.bin,fixup4.dat,start4.elf} /mnt/boot

最终文件目录结构为

ls -l /mnt/boot
-rwxr-xr-x 1 root root    54821 Dec  9 17:18 bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 root root    52476 Dec  9 17:26 bootcode.bin
-rwxr-xr-x 1 root root      207 Dec  9 17:24 boot.scr
-rwxr-xr-x 1 root root       51 Dec  9 17:39 cmdline.txt
-rwxr-xr-x 1 root root       44 Dec  9 17:35 config.txt
-rwxr-xr-x 1 root root     5412 Dec  9 17:26 fixup4.dat
-rwxr-xr-x 1 root root 25463296 Dec  9 17:18 Image
-rwxr-xr-x 1 root root  2254944 Dec  9 17:26 start4.elf
-rwxr-xr-x 1 root root   640928 Dec  9 17:21 u-boot.bin
-rwxr-xr-x 1 root root  1804995 Dec  9 17:23 uRamdisk

卸载SD卡

sudo umount /dev/sdb1
sudo umount /dev/sdb2

启动

将SD卡插入树莓派中,通过串口进行启动,启动成功

U-Boot 2024.01-rc4-gdd638467 (Dec 09 2023 - 15:53:07 +0800)

DRAM:  948 MiB (effective 7.9 GiB)
RPI 4 Model B (0xd03114)
Core:  211 devices, 16 uclasses, devicetree: board
MMC:   mmcnr@7e300000: 1, mmc@7e340000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... 
In:    serial,usbkbd
Out:   serial,vidconsole
Err:   serial,vidconsole
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0 
Card did not respond to voltage select! : -110
** Booting bootflow 'mmc@7e340000.bootdev.part_1' with script
25463296 bytes read in 1222 ms (19.9 MiB/s)
1804995 bytes read in 100 ms (17.2 MiB/s)
Moving Image from 0x80000 to 0x200000, end=1b60000
## Loading init Ramdisk from Legacy Image at 02700000 ...
   Image Name:   
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    1804931 Bytes = 1.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 2eff2500
   Booting using the fdt blob at 0x2eff2500
Working FDT set to 2eff2500
   Using Device Tree in place at 000000002eff2500, end 000000002f002f1c
Working FDT set to 2eff2500

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 6.6.5-v8+ (pjw6@debian4pjw6) (aarch64-linux-gnu-gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Sat Dec  9 15:41:25 CST 2023
[    0.000000] KASLR enabled
[    0.000000] random: crng init done
[    0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.4
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x000000002ac00000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] OF: reserved mem: 0x000000002ac00000..0x000000002ebfffff (65536 KiB) map reusable linux,cma
[    0.000000] OF: reserved mem: 0x000000003ef63ac0..0x000000003ef63b6b (0 KiB) nomap non-reusable nvram@0
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000]   node   0: [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] On node 0, zone DMA32: 19456 pages in unavailable ranges
[    0.000000] On node 0, zone Normal: 16384 pages in unavailable ranges
[    0.000000] percpu: Embedded 30 pages/cpu s85672 r8192 d29016 u122880
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v3a
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: Spectre-BHB
[    0.000000] CPU features: kernel page table isolation forced ON by KASLR
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] CPU features: detected: ARM erratum 1742098
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] alternatives: applying boot alternatives
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 bcm2708_fb.fbwidth=0 bcm2708_fb.fbheight=0 bcm2708_fb.fbswap=1 smsc95xx.macaddr=DC:A6:32:FD:70:0E vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=tty1 console=ttyS0,115200 rdinit=/bin/sh
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2028848
[    0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[    0.000000] software IO TLB: area num 4.
[    0.000000] software IO TLB: mapped [mem 0x0000000037400000-0x000000003b400000] (64MB)
[    0.000000] Memory: 7925316K/8245248K available (13376K kernel code, 2210K rwdata, 4256K rodata, 4864K init, 1083K bss, 254396K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 43034 entries in 169 pages
[    0.000000] ftrace: allocated 169 pages with 4 groups
[    0.000000] trace event string verifier disabled
[    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]  Rude 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 54.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[    0.000000] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[    0.000321] Console: colour dummy device 80x25
[    0.000339] printk: console [tty1] enabled
[    0.001042] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=216000)
[    0.001084] pid_max: default: 32768 minimum: 301
[    0.001215] LSM: initializing lsm=capability,integrity
[    0.001463] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.001558] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.002756] cgroup: Disabling memory control group subsystem
[    0.005056] RCU Tasks: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[    0.005229] RCU Tasks Rude: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[    0.005409] RCU Tasks Trace: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[    0.005796] rcu: Hierarchical SRCU implementation.
[    0.005821] rcu:     Max phase no-delay instances is 1000.
[    0.007824] EFI services will not be available.
[    0.008329] smp: Bringing up secondary CPUs ...
[    0.009162] Detected PIPT I-cache on CPU1
[    0.009276] CPU1: Booted secondary processor 0x0000000001 [0x410fd083]
[    0.010213] Detected PIPT I-cache on CPU2
[    0.010302] CPU2: Booted secondary processor 0x0000000002 [0x410fd083]
[    0.011227] Detected PIPT I-cache on CPU3
[    0.011319] CPU3: Booted secondary processor 0x0000000003 [0x410fd083]
[    0.011445] smp: Brought up 1 node, 4 CPUs
[    0.011534] SMP: Total of 4 processors activated.
[    0.011555] CPU features: detected: 32-bit EL0 Support
[    0.011574] CPU features: detected: 32-bit EL1 Support
[    0.011595] CPU features: detected: CRC32 instructions
[    0.011728] CPU: All CPU(s) started at EL2
[    0.011761] alternatives: applying system-wide alternatives
[    0.014470] devtmpfs: initialized
[    0.024007] Enabled cp15_barrier support
[    0.024064] Enabled setend support
[    0.024259] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.024307] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.026123] pinctrl core: initialized pinctrl subsystem
[    0.026739] DMI not present or invalid.
[    0.027310] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.030338] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.030636] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.031434] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.031529] audit: initializing netlink subsys (disabled)
[    0.031779] audit: type=2000 audit(0.028:1): state=initialized audit_enabled=0 res=1
[    0.032329] thermal_sys: Registered thermal governor 'step_wise'
[    0.032402] cpuidle: using governor menu
[    0.032604] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.032805] ASID allocator initialised with 32768 entries
[    0.033774] Serial: AMBA PL011 UART driver
[    0.043301] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[    0.056780] raspberrypi-firmware soc:firmware: Attached to firmware from 2023-10-17T15:39:16, variant start
[    0.060786] raspberrypi-firmware soc:firmware: Firmware hash is 30f0c5e4d076da3ab4f341d88e7d505760b93ad7
[    0.073796] Modules: 2G module region forced by RANDOMIZE_MODULE_REGION_FULL
[    0.073831] Modules: 0 pages in range for non-PLT usage
[    0.073841] Modules: 517792 pages in range for PLT usage
[    0.078899] bcm2835-dma fe007000.dma-controller: DMA legacy API manager, dmachans=0x1
[    0.081564] iommu: Default domain type: Translated
[    0.081592] iommu: DMA domain TLB invalidation policy: strict mode
[    0.081994] SCSI subsystem initialized
[    0.082190] usbcore: registered new interface driver usbfs
[    0.082247] usbcore: registered new interface driver hub
[    0.082324] usbcore: registered new device driver usb
[    0.082890] pps_core: LinuxPPS API ver. 1 registered
[    0.082916] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.082953] PTP clock support registered
[    0.086061] vgaarb: loaded
[    0.086517] clocksource: Switched to clocksource arch_sys_counter
[    0.087010] VFS: Disk quotas dquot_6.6.0
[    0.087084] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.087270] FS-Cache: Loaded
[    0.090565] CacheFiles: Loaded
[    0.099815] NET: Registered PF_INET protocol family
[    0.100476] IP idents hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.109203] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.109323] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.109367] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.109775] TCP bind hash table entries: 65536 (order: 9, 2097152 bytes, linear)
[    0.112112] TCP: Hash tables configured (established 65536 bind 65536)
[    0.112593] MPTCP token hash table entries: 8192 (order: 5, 196608 bytes, linear)
[    0.112939] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.113045] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.113348] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.114082] RPC: Registered named UNIX socket transport module.
[    0.114112] RPC: Registered udp transport module.
[    0.114131] RPC: Registered tcp transport module.
[    0.114149] RPC: Registered tcp-with-tls transport module.
[    0.114168] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.114202] PCI: CLS 0 bytes, default 64
[    0.114677] Trying to unpack rootfs image as initramfs...
[    0.122646] kvm [1]: IPA Size Limit: 44 bits
[    0.123865] kvm [1]: vgic interrupt IRQ9
[    0.123936] kvm [1]: Hyp mode initialized successfully
[    0.241454] Freeing initrd memory: 1756K
[    1.124328] Initialise system trusted keyrings
[    1.124683] workingset: timestamp_bits=46 max_order=21 bucket_order=0
[    1.124790] zbud: loaded
[    1.125594] NFS: Registering the id_resolver key type
[    1.125635] Key type id_resolver registered
[    1.125656] Key type id_legacy registered
[    1.125694] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.125721] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.126478] Key type asymmetric registered
[    1.126547] Asymmetric key parser 'x509' registered
[    1.126630] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    1.126871] io scheduler mq-deadline registered
[    1.126900] io scheduler kyber registered
[    1.126954] io scheduler bfq registered
[    1.135785] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.135845] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.135944] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.136035] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x00bfffffff -> 0x0400000000
[    1.137170] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00
[    1.137206] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.137235] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff])
[    1.137319] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400
[    1.137535] pci 0000:00:00.0: PME# supported from D0 D3hot
[    1.141347] pci_bus 0000:01: supply vpcie3v3 not found, using dummy regulator
[    1.141522] pci_bus 0000:01: supply vpcie3v3aux not found, using dummy regulator
[    1.141624] pci_bus 0000:01: supply vpcie12v not found, using dummy regulator
[    1.248586] brcm-pcie fd500000.pcie: link up, 5.0 GT/s PCIe x1 (SSC)
[    1.248761] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330
[    1.248890] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    1.249309] pci 0000:01:00.0: PME# supported from D0 D3hot
[    1.249994] pci 0000:00:00.0: BAR 8: assigned [mem 0x600000000-0x6000fffff]
[    1.250033] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit]
[    1.250121] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.250152] pci 0000:00:00.0:   bridge window [mem 0x600000000-0x6000fffff]
[    1.250598] pcieport 0000:00:00.0: enabling device (0000 -> 0002)
[    1.250797] pcieport 0000:00:00.0: PME: Signaling with IRQ 26
[    1.251208] pcieport 0000:00:00.0: AER: enabled with IRQ 26
[    1.252493] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[    1.252527] bcm2708_fb: probe of soc:fb failed with error -2
[    1.259857] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    1.262788] iproc-rng200 fe104000.rng: hwrng registered
[    1.263185] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    1.275133] brd: module loaded
[    1.282158] loop: module loaded
[    1.282895] Loading iSCSI transport class v2.0-870.
[    1.287934] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
[    1.490646] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
[    1.491904] usbcore: registered new device driver r8152-cfgselector
[    1.491963] usbcore: registered new interface driver r8152
[    1.492017] usbcore: registered new interface driver lan78xx
[    1.492077] usbcore: registered new interface driver smsc95xx
[    1.538080] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.538127] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[    1.541586] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0700240000000890
[    1.542563] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.542601] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    1.542645] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[    1.543055] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    1.543091] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.543119] usb usb1: Product: xHCI Host Controller
[    1.543142] usb usb1: Manufacturer: Linux 6.6.5-v8+ xhci-hcd
[    1.543165] usb usb1: SerialNumber: 0000:01:00.0
[    1.543863] hub 1-0:1.0: USB hub found
[    1.543946] hub 1-0:1.0: 1 port detected
[    1.544861] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    1.544898] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.544926] usb usb2: Product: xHCI Host Controller
[    1.544948] usb usb2: Manufacturer: Linux 6.6.5-v8+ xhci-hcd
[    1.544971] usb usb2: SerialNumber: 0000:01:00.0
[    1.545583] hub 2-0:1.0: USB hub found
[    1.545701] hub 2-0:1.0: 4 ports detected
[    1.547115] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.548356] usbcore: registered new interface driver uas
[    1.548442] usbcore: registered new interface driver usb-storage
[    1.549203] mousedev: PS/2 mouse device common for all mice
[    1.554212] sdhci: Secure Digital Host Controller Interface driver
[    1.554248] sdhci: Copyright(c) Pierre Ossman
[    1.554723] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.557945] ledtrig-cpu: registered to indicate activity on CPUs
[    1.558264] hid: raw HID events driver (C) Jiri Kosina
[    1.558391] usbcore: registered new interface driver usbhid
[    1.558415] usbhid: USB HID core driver
[    1.565678] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available
[    1.566408] NET: Registered PF_PACKET protocol family
[    1.566771] Key type dns_resolver registered
[    1.591057] registered taskstats version 1
[    1.591304] Loading compiled-in X.509 certificates
[    1.601927] Key type .fscrypt registered
[    1.601968] Key type fscrypt-provisioning registered
[    1.610208] uart-pl011 fe201000.serial: there is not valid maps for state default
[    1.611058] uart-pl011 fe201000.serial: cts_event_workaround enabled
[    1.611483] fe201000.serial: ttyAMA1 at MMIO 0xfe201000 (irq = 35, base_baud = 0) is a PL011 rev2
[    1.611804] serial serial0: tty port ttyAMA1 registered
[    1.615753] bcm2835-aux-uart fe215040.serial: there is not valid maps for state default
[    1.616585] printk: console [ttyS0] disabled
[    1.617176] fe215040.serial: ttyS0 at MMIO 0xfe215040 (irq = 36, base_baud = 62500000) is a 16550
[    1.617266] printk: console [ttyS0] enabled
[    3.123763] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    3.130687] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    3.139393] mmc-bcm2835 fe300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    3.145548] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated
[    3.181633] of_cfs_init
[    3.184326] of_cfs_init: OK
[    3.188880] clk: Disabling unused clocks
[    3.222976] mmc0: SDHCI controller on fe340000.mmc [fe340000.mmc] using ADMA
[    3.240566] Freeing unused kernel memory: 4864K
[    3.245506] Run /bin/sh as init process
[    3.249521] usb 1-1: new high-speed USB device number 2 using xhci_hcd
/bin/sh: can't access tty; job control turned off
~ # [    3.286893] mmc1: new high speed SDIO card at address 0001
[    3.346658] mmc0: new ultra high speed DDR50 SDHC card at address aaaa
[    3.354186] mmcblk0: mmc0:aaaa SC16G 14.8 GiB
[    3.365132]  mmcblk0: p1 p2
[    3.368473] mmcblk0: mmc0:aaaa SC16G 14.8 GiB (quirks 0x00004000)
[    3.405222] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
[    3.413576] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.420850] usb 1-1: Product: USB2.0 Hub
[    3.426905] hub 1-1:1.0: USB hub found
[    3.431054] hub 1-1:1.0: 4 ports detected
ls
bin      etc      lib      linuxrc  root     sys      usr
dev      home     lib64    proc     sbin     tmp      var
~ # uname -a
Linux (none) 6.6.5-v8+ #1 SMP PREEMPT Sat Dec  9 15:41:25 CST 2023 aarch64 GNU/Linux
0

评论区