ECE 320 · Week 4
Modern Computer: Embedded Systems
A load address, and why the kernel and the device tree do not share one.
Week 4 of 10 · Das Frite
ECE 320 · Week 4 · In class
A load address, and why the kernel and the device tree do not share one.
- A load address is the place in memory where an image sits before it starts.
- The kernel and the device tree are two images, so each needs its own place.
- Do not change the memory clock.
- Do not rebuild the bootloader.
ECE 320 · Week 4 · In class
The lab stops at the stock bootloader prompt, loads the two images by hand, and draws the two addresses.
- The commands are the ones the linked module shows for a hand boot.
- These notes do not print a second command list.
- The homework is a paragraph that defines a load address and says why the two images do not share one.
ECE 320 · Week 4 · Lecture
An image has an address and a size
- Loading copies an image's bytes from storage into DRAM, starting at the load address.
- It then occupies every byte from that address to address + size.
- Nothing checks for you that two images do not overlap: the second copy silently overwrites the first.
- The bootloader's own code, stack and heap also live in DRAM and must stay clear.
ECE 320 · Week 4 · Lecture
Drawing a load map
| Region | Starts at | Ends before |
|---|---|---|
| Kernel image | K | K + kernel size, plus room it needs at run time |
| Device tree | D | D + device-tree size, plus room to grow |
| Bootloader itself | wherever it moved itself, often near the top of DRAM | |
Draw each image as a bar on one address axis. Two bars must never touch.
ECE 320 · Week 4 · Lecture
Why the file size is not the whole story
- A 64-bit Arm kernel needs more memory than its file: its header records a larger image size that covers zeroed data.
- The bootloader edits the device tree in place before the jump, adding the command line and memory nodes, so the tree can grow.
- The 64-bit Arm boot rules want the device tree on an 8-byte boundary and no larger than 2 MB.
ECE 320 · Week 4 · Lecture
What this lab leaves alone
- The memory clock: the DRAM stage already set and trained it. Changing it can make the board unbootable.
- The bootloader binary: the stock one in flash is the one you use. Nothing is rebuilt.
- The commands: the linked module shows them; your transcript is what you hand in.
ECE 320 · Week 4 · Lab
Lab
- Stop at the stock bootloader prompt. Load the kernel and the device tree by hand and boot them.
- Draw the load address of each image. Do not change the memory clock and do not rebuild. Second pass: stop at the prompt again and read the two addresses back without booting.
ECE 320 · Week 4 · Lab
Lab (continued)
- Assemble the lab hand-in: The command transcript that loaded the kernel and the device tree by hand from the stock bootloader prompt, and a memory map of those load addresses.
ECE 320 · Week 4 · Lab
Hand in
The command transcript that loaded the kernel and the device tree by hand from the stock bootloader prompt, and a memory map of those load addresses.
ECE 320 · Week 4 · Homework
Homework
- Write what a load address is, and why the kernel and the device tree need different ones.
ECE 320 · Week 4 · Homework
Turn in
A paragraph defining a load address and why the two images do not share one.
ECE 320 · Week 4 · Read
Read
On the lab site: Module 5, Memory bring-up, and Module 6, Software in DRAM. This week grades the hand-boot transcript and the load map.
ECE 320 · Week 4 · Next
Week 5
An EFI boot entry: what it names, and what it does not set.