• No results found

The Universal Boot Loader ( Das U-Boot )

N/A
N/A
Protected

Academic year: 2021

Share "The Universal Boot Loader ( Das U-Boot )"

Copied!
16
0
0

Loading.... (view fulltext now)

Full text

(1)

The Universal Boot Loader (”Das U-Boot”)

Marek Vaˇsut

<[email protected]>

(2)

´

Uvod

I

U-Boot je program typu ’monitor’

I

Licence GPLv2

I

Nasazen v mnoha produktech

I

Snadno pˇrenositeln´

y a laditeln´

y

I

Podporuje mnoho architektur

ARM, BlackFin, m68k, MIPS, NIOS, PowerPC, Sparc, x86. . .

I

1000+ zaˇr´ızen´ı v hlavn´ı ˇradˇ

e

(3)

Historie

I

1999 – 8xx-boot

I

2000 – PPCBoot

I

2002 – ARMBoot

I

Listopad 2002 – PPCBoot 2.0.0 aka. U-Boot 0.1.0

I

2002 – podpora pro x86

I

2003 – podpora pro MIPS32, MIPS64, NIOS, m68k

(4)

zivatelsk´

e rozhran´ı

I

CLI, vˇ

etˇsinou pˇres seriov´

y port

I

Bourne-kompatibiln´ı shell (HUSH z busybox)

I

Podporuje skriptov´

an´ı

(5)

zivatelsk´

e rozhran´ı – DEMO

U-Boot 2014.01 (Feb 15 2014 - 15:57:04)

CPU:

Freescale i.MX53 rev2.1 at 1200 MHz

Reset cause: POR

Board: DENX M53EVK

I2C:

ready

DRAM:

1 GiB

NAND:

256 MiB

MMC:

FSL_SDHC: 0

In:

serial

Out:

serial

Err:

serial

Net:

FEC

Hit any key to stop autoboot:

0

=>

(6)

akladn´ı pˇr´ıkazy

I

RTFM –

help

I

Memory –

md, mw, cmp, ..., cp, nm

I

Environment –

env, run

(7)

Memory

Vhodn´

e na zkoum´

an´ı registr˚

u

Ne na kaˇ

zd´

y pamˇ

et’ov´

y region lze pˇristupovat libovolnˇ

e

I

md

[

.b, .w, .l

]

address

[

# of objects

]

I

mw

[

.b, .w, .l

]

address value

[

count

]

I

cmp

[

.b, .w, .l

]

addr1 addr2

[

count

]

=> md 0x74000000 0x2

74000000: ffffffff ffffffff

...

=> md.w 0x74000000 0x2

74000000: ffff ffff

....

=> mw 0x71000000 0x12345678 0x10

=> mw 0x72000000 0x12345678 0x8

=> cmp.b 0x71000000 0x72000000 0x40

byte at 0x71000020 (0x78) != byte at 0x72000020 (0xff)

Total of 32 byte(s) were the same

(8)

Environment

=> help env

env - environment handling commands Usage:

env ask name [message] [size] - ask for environment variable env default [-f] -a - [forcibly] reset default environment

env default [-f] var [...] - [forcibly] reset variable(s) to their default values env delete [-f] var [...] - [forcibly] delete variable(s)

env edit name - edit environment variable

env export [-t | -b | -c] [-s size] addr [var ...] - export environment env grep [-e] [-n | -v | -b] string [...] - search environment

env import [-d] [-t | -b | -c] addr [size] - import environment env print [-a | name ...] - print environment

env run var [...] - run commands in an environment variable env save - save environment

(9)

Environment 2

=> env set foo bar baz => env set quux ’echo $foo’ => env print foo

foo=bar baz => env print quux quux=echo $foo => run quux bar baz

(10)

Dalˇs´ı pˇr´ıkazy

=> bdinfo arch_number = 0xFFFFFFFF boot_params = 0x70000100 DRAM bank = 0x00000000 -> start = 0x70000000 -> size = 0x20000000 DRAM bank = 0x00000001 -> start = 0xB0000000 -> size = 0x20000000 eth0name = FEC ethaddr = c0:e5:4e:XX:XX:XX current eth = FEC

ip_addr = 192.168.1.10 baudrate = 115200 bps TLB addr = 0xAFFF0000 relocaddr = 0xAFF26000 reloc off = 0x3EF26000 irq_sp = 0xAF521F28

(11)

Naˇ

cten´ı souboru z lok´

aln´ıho m´

edia

Init m´

edia:

I

SD/MMC:

mmc rescan

I

USB:

usb reset

I

SATA:

sata init

I

IDE:

ide reset

Naˇ

cten´ı souboru:

<command> <interface> <dev[:part]> [addr] [filename]

I

command:

ext2load, ext4load, fatload

(12)

Naˇ

cten´ı souboru ze s´ıt’ˇ

e

Nastaven´ı s´ıt’ˇ

e:

=> env set ipaddr 192.168.1.310

=> env set netmask 255.255.255.0

=> env set serverip 192.168.1.301

=> env set gatewayip 192.168.1.354

ICMP:

=> ping ${serverip}

TFTP:

=> tftp ${loadaddr} ${serverip}:path/to/file

=> tftp path/to/file

(13)

Form´

at j´

adra

U-Boot podporuje mnoho form´

at˚

u j´

adra:

I

ELF –

bootelf

I

zImage –

bootz

I

uImage –

bootm

I

fitImage

bootm

FDT a Ramdisk:

(14)

ysledek – DEMO

=> tftp ${loadaddr} fitImage ; bootm ${loadaddr} Using FEC device

TFTP from server 192.168.1.301; our IP address is 192.168.1.310 Filename ’fitImage’.

Load address: 0x70800000

Loading: ####################################### ...

## Loading kernel from FIT Image at 72000000 ... Using ’conf@1’ configuration

Trying ’kernel@1’ kernel subimage Description: Linux kernel ...

Verifying Hash Integrity ... sha1+ OK Booting using the fdt blob at 0x723275d8 Loading Kernel Image ... OK

Loading Device Tree to 8fff8000, end 8ffffd6d ... OK Starting kernel ...

(15)

yvoj

I

GIT:

git://git.denx.de/u-boot.git

(16)

References

Related documents

Locally developed services designed to meet local health needs – for example, enhanced medical care of asylum seekers, and specific services for people with learning

The fossil coral Gould fancies as a visualiza- tion of the logical structure of Darwin’s theory presented in the book; the lovely photograph of the snail, as read- ers familiar

coverages is not included in the re-rated premium, every effort should be made to exclude the historical charge from the historical premiums. The inclusion of

You can get one at the Arrivals (approximately €70,00 to go to Milano Stazione Centrale). 3) On arrival at Bergamo Railway Station, you will need to get to Porta Nuova, two bus

© American Academy of Sleep Medicine Interaction of Circadian Rhythms and Sleep Time 9 PM 9 AM 9 AM Sleep Wake Sleep Homeostatic drive (Sleep Load).. Circadian

The third tier in the design of the CRAFT technique deals with three final inputs from the crowd. For every feedback that the crowd members are annotating, they will have

Patients were excluded if they: were of childbearing potential (unless practicing acceptable birth control methods); had a history of life-threatening asthma within the last 5

The three articles examine the perspec- tives of key stakeholders in garment value chains — global buyers, managers of garment factories in Bangladesh, and workers at these factories