- Linux Device Driver Development Cookbook
- Rodolfo Giometti
- 486字
- 2021-06-24 13:54:10
Setting up the booting variables
After powering up, we should get the bootloader's messages from the serial console and then we should see a timeout running to 0 before doing the autoboot:
- Quickly stop the countdown by hitting the Enter key on the keyboard to get the bootloader's prompt, as follows:
Model: Marvell Armada 3720 Community Board ESPRESSOBin
CPU @ 1000 [MHz]
L2 @ 800 [MHz]
TClock @ 200 [MHz]
DDR @ 800 [MHz]
DRAM: 2 GiB
U-Boot DComphy-0: USB3 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 6 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link down
MMC: sdhci@d0000: 0
SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
Net: eth0: neta@30000 [PRIME]
Hit any key to stop autoboot: 0
Marvell>>
The ESPRESSObin's bootloader is U-Boot, which has its home page at https://www.denx.de/wiki/U-Boot.
- Now, let's check again that the microSD card has the necessary files using the ext4ls command, as follows:
Marvell>> ext4ls mmc 0:1 boot
<DIR> 4096 .
<DIR> 4096 ..
18489856 Image
8359 armada-3720-espressobin.dtb
OK, everything is in place, so there are only a few variables required to boot from the microSD card.
- We can display the currently defined variables at any point by using the echo command and optionally reconfigure them by using setenv command. First, check and set proper image and device tree paths and names:
Marvell>> echo $image_name
Image
Marvell>> setenv image_name boot/Image
Marvell>> echo $fdt_name
armada-3720-espressobin.dtb
Marvell>> setenv fdt_name boot/armada-3720-espressobin.dtb
Note that, filenames were correct but the path names were not; that's why I used the setenv command to correctly redefine them.
- Next, define the bootcmd variable, which we will use to boot from the microSD card:
Marvell>> setenv bootcmd 'mmc dev 0; \
ext4load mmc 0:1 $kernel_addr $image_name; \
ext4load mmc 0:1 $fdt_addr $fdt_name; \
setenv bootargs $console root=/dev/mmcblk0p1 rw rootwait; \
booti $kernel_addr - $fdt_addr'
We must be careful to set the preceding root path to point to where we have extracted the Debian filesystem (the first partition in our case).
- Save the set variables at any time using the saveenv command.
- Finally, we boot up the ESPRESSObin by simply typing the reset command and, if everything works well, we should see the system start and running and, at the end, we should get system login prompt, as follows:
Debian GNU/Linux 9 espressobin ttyMV0
giometti-VirtualBox login:
- Now, log in as root with the root password that was previously set up:
Debian GNU/Linux 9 espressobin ttyMV0
espressobin login: root
Password:
Linux espressobin 4.18.0 #2 SMP PREEMPT Sun Jan 13 13:05:03 CET 2019 aarch64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@espressobin:~#
推薦閱讀
- 每天5分鐘玩轉Kubernetes
- Getting Started with oVirt 3.3
- FreeRTOS實時內核應用指南
- 嵌入式應用程序設計綜合教程(微課版)
- 循序漸進學Docker
- Linux操作系統應用編程
- Python基礎教程(第3版)
- Windows Server 2012網絡操作系統企業應用案例詳解
- Windows 7中文版從入門到精通(修訂版)
- Windows 7案例教程
- Delphi Programming Projects
- Linux服務器配置與管理
- 云原生落地:產品、架構與商業模式
- Learning Continuous Integration with Jenkins(Second Edition)
- Windows Azure實戰