01 / U-Boot
U-Boot
SPL/TPL에서 U-Boot proper, driver model, storage, bootflow, 검증과 Linux handoff까지 이어지는 경로를 읽습니다.Kconfig와 Makefile의 선택이 u-boot, SPL, TPL, DTB와 결합 이미지로 굳어지는 과정을 정리합니다.
ROM이 넘긴 CPU가 `_start`에서 예외 벡터와 저수준 진입 경로를 어떻게 선택하는지 읽습니다.
`_main`이 초기 stack과 `gd_t`를 만들고 C 초기화 루틴에 들어가는 경계를 추적합니다.
console 이전의 CPU, timer, DRAM, FDT, reservation 작업이 순서가 고정된 initcall 목록으로 실행되는 방식을 읽습니다.
DRAM 상단에서 U-Boot, malloc, FDT, stack 영역을 차감해 relocation 목적지를 정하는 계산을 분석합니다.
새 DRAM 주소로 코드와 global data를 옮긴 뒤 runtime 서비스와 main loop를 여는 과정을 읽습니다.
작은 SRAM 단계인 SPL이 boot device를 선택하고 U-Boot proper 또는 OS 이미지를 DRAM으로 적재하는 경로를 읽습니다.
driver model의 root device와 uclass 목록이 만들어지고 FDT scan의 부모가 되는 과정을 읽습니다.
driver와 DT node를 `struct udevice`로 묶고 parent/uclass 목록에 연결하는 bind 단계를 읽습니다.
probe 시점에 parent, pinctrl, clock 등 의존 대상을 준비하고 driver의 probe callback을 호출하는 순서를 읽습니다.
control FDT의 node를 순회해 compatible driver에 bind하고 pre-relocation 제약을 적용하는 경로를 읽습니다.
host controller 초기화에서 card 식별, 용량 설정, block descriptor 공개까지 내려갑니다.
`mmc 0:1` 같은 사용자 표현이 block descriptor와 실제 partition offset/size로 변환되는 과정을 읽습니다.
CRC가 붙은 저장 매체의 environment를 hash table로 가져오고 default 환경으로 fallback하는 경로를 읽습니다.
boot method와 boot device를 조합해 부팅 가능한 항목을 찾고 상태를 갱신하는 iterator를 읽습니다.
FIT image node의 hash/signature subnode를 순회해 payload 무결성과 서명을 확인하는 과정을 읽습니다.
raw ARM64 Image header를 검사하고 initrd/FDT를 배치한 뒤 kernel entry로 분기하는 경로를 읽습니다.
USB gadget configuration에 fastboot function을 붙이고 download/flash 명령으로 넘기는 경계를 읽습니다.
02 / LK
LK
현재 upstream LK 코어와 classic AOSP aboot를 기준 commit별로 분리해 읽습니다.project 설정이 platform, target, arch, kernel, lib, app module을 모아 하나의 LK image로 연결되는 구조를 읽습니다.
reset entry가 exception level, stack, BSS와 CPU별 진입 조건을 정리하고 `lk_main`으로 넘어가는 경계를 읽습니다.
heap, thread, dpc, timer와 platform early init이 bootstrap thread 생성 전 어떤 순서로 준비되는지 읽습니다.
scheduler 문맥으로 들어온 bootstrap thread가 platform, target, app 초기화를 어떤 level 순서로 호출하는지 읽습니다.
thread control block과 stack을 할당하고 초기 CPU context를 만드는 과정을 읽습니다.
현재 thread를 상태에 맞게 queue에 되돌리고 다음 runnable thread를 선택해 context switch하는 경로를 읽습니다.
정렬된 timer 목록에서 만료 항목을 꺼내 callback을 실행하고 reschedule 요청을 전달하는 과정을 읽습니다.
exception vector가 register frame을 저장하고 syndrome을 해석하는 C handler로 전달하는 경계를 읽습니다.
초기 heap 영역이 선택한 allocator backend에 연결되고 malloc/free API로 노출되는 과정을 읽습니다.
physical page를 arena에서 꺼내 virtual address space에 mapping하고 해제하는 두 계층을 분리해 읽습니다.
SoC 공통 platform 코드와 보드 정책인 target 코드가 어디서 나뉘는지 QEMU ARM 예로 읽습니다.
linker section에 모인 app descriptor를 순회하고 별도 thread 또는 init callback으로 실행하는 구조를 읽습니다.
입력 line을 token으로 나누고 linker section의 command table에서 handler를 찾는 과정을 읽습니다.
LK의 현재 lkboot app가 image를 수신하고 entry address로 제어권을 넘기는 경계를 읽습니다.
Android aboot가 존재하던 고정 AOSP LK snapshot의 app descriptor와 초기화 위치를 현재 upstream과 구분합니다.
boot partition header를 읽고 page 단위 offset으로 kernel, ramdisk, second stage를 배치하는 고전 경로를 읽습니다.
ATAG 또는 DT 주소, machine type과 kernel entry를 준비하고 cache/MMU를 정리해 Linux로 분기하는 코드를 읽습니다.
USB request를 `download`, `getvar`, 등록 command로 분기하고 응답을 전송하는 event loop를 읽습니다.
download buffer의 Android boot image를 검사하고 flash 없이 RAM에서 kernel로 넘기는 경로를 읽습니다.
partition 이름을 찾고 raw 또는 sparse image를 eMMC에 쓰며 성공 응답을 결정하는 경로를 읽습니다.
03 / Barebox
Barebox
PBL, initcall, Linux식 device model과 VFS, environment/state, bootchooser, bootm과 BBU를 읽습니다.Kconfig와 linker 단계가 barebox ELF, PBL, DTB와 보드별 images를 만드는 구조를 정리합니다.
SRAM 또는 초기 DRAM의 PBL이 RAM 정보를 확정하고 main Barebox를 풀어 실행하는 경계를 읽습니다.
BSS, heap, device tree, console과 initcall 실행 준비가 shell 이전에 어떤 순서로 이루어지는지 읽습니다.
링커 section에 모인 initcall을 level 순서대로 실행하고 오류를 기록하는 방식을 읽습니다.
등록된 memory bank와 reserved area를 page table로 옮기고 cacheable mapping을 만드는 과정을 읽습니다.
새 `struct device`를 device list와 bus에 연결하고 이름, parent, resource를 공개하는 등록 단계를 읽습니다.
bus match 결과를 바탕으로 probe callback을 호출하고 dependency 오류와 deferred probe를 다루는 경로를 읽습니다.
root DT의 node를 platform device로 만들고 필요 시점까지 probe를 늦추는 Barebox 방식을 읽습니다.
character device가 devfs inode로 노출되고 read/write가 driver operation으로 전달되는 구조를 읽습니다.
block device read/write cache 위에 GPT/DOS parser가 child cdev를 등록하는 과정을 읽습니다.
영속 envfs image를 검증해 디렉터리로 펼치고 default environment와 합치는 과정을 읽습니다.
DT로 정의한 typed variable을 storage backend에서 읽고 atomic하게 저장하는 state framework를 분석합니다.
command descriptor가 linker section에 배치되고 hush parser가 이름으로 handler를 찾는 구조를 읽습니다.
문자열, cdev, directory에서 boot entry를 수집하고 우선순위에 따라 실행하는 공통 boot framework를 읽습니다.
loader/entries 파일의 key-value를 읽어 kernel, initrd, options와 devicetree를 boot entry로 만드는 과정을 읽습니다.
state에 저장한 priority와 remaining attempts로 target을 선택하고 실패 시 다음 slot으로 이동하는 정책을 읽습니다.
image type을 감지하고 OS별 handler를 선택해 kernel, initrd, FDT를 배치하는 공통 bootm 경로를 읽습니다.
FIT configuration에서 kernel, FDT, ramdisk를 선택하고 hash/signature 정책을 적용하는 handler를 읽습니다.
보드가 등록한 update handler를 선택하고 새 Barebox image를 검증해 boot medium에 기록하는 흐름을 읽습니다.