- 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:~#
推薦閱讀
- Linux實戰
- Installing and Configuring Windows 10:70-698 Exam Guide
- 混沌工程實戰:手把手教你實現系統穩定性
- Windows Phone應用程序開發
- RESS Essentials
- Linux內核設計的藝術:圖解Linux操作系統架構設計與實現原理
- Vim 8文本處理實戰
- Building Telephony Systems With Asterisk
- Learn CUDA Programming
- Heroku Cloud Application Development
- 統信UOS應用開發進階教程
- Learn Quantum Computing with Python and IBM Quantum Experience
- C#實用教程(第2版)
- 數字系統設計與VHDL
- Mastering Spring Cloud