수강한 개념
1. 임베디드 리눅스 이론
- 임베디드 리눅스 4요소
- 툴체인
- 부트로더
- 커널
- 루트파일시스템
GPL : copyleft
BSD MIT : permissive
QEMU : 다른 cpu 아키텍쳐 에뮬레이팅
sudo apt install qemu-system-arm
qemu-system-aarch64 -machine help
sudo apt-get install qemu-system-arm bridge-utils
sudo apt-get install qemu-user-static
aarch64-linux-gnu-gcc sample.c -o sample -static
static 컴파일
qemu 가상환경 구성
https://cloud-images.ubuntu.com/minimal/releases/noble/release/
EFI 펌웨어를 부팅할 때 필용한 NVRAM 변수를 저장하기 위한 VM별 플래시 볼륨 생성
truncate -s 64m varstore.img
ARM UEFI 펌웨어 복사
truncate -s 64m efi.img
dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fdof=efi.img conv=notrunc
ㄴ disk dump 명령어, if(input file), of(output file)
ㄴ기본적으로 블럭단위 파일이다. (touch, cat 등을 활용한 것은 캐릭터 단위의 파일이다.)
리눅스 클라우드 이미지의 root 계정의 비밀번호 설정
sudo apt install libguestfs-tools
sudo virt-customize -a ubuntu 24.04-minimal-clouding-arm64.img --root-password password:<password>`
qemu를 이용한 ARM64 비트 ubuntu 24.04-minimal 클라우드 이미지 기반 가상머신 구동
```bash
sudo qemu-system-aarch64 \
-m 2048 \
-cpu max \
-M virt \
-nographic \
-drive if=pflash,format=raw,file=efi.img,readonly=on \
-drive if=pflash,format=raw,file=varstore.img \
-drive if=none,file=ubuntu-24.04-minimal-cloudimg-arm64.img,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-netdev type=tap,id=net0 \
-device virtio-net-device,netdev=net0
ubuntu에서 라즈베리파이 가상머신 돌리기 (intel -> arm)
https://farabimahmud.github.io/emulate-raspberry-pi3-in-qemu/
tar xvJf disk.xz
라즈베리파이 가상머신에서
sudo apt update
sudo apt install openssh-server
sudo systemctl start ssh
sudo systemctl enable ssh
ubuntu에서
ssh -p 5555 pi@127.0.0.1
scp -P 5555 sample pi@127.0.0.1:/home/pi
-> pw 입력 이후 Permission denied, please try again. 에러가 발생하는 경우
-> -P 5555를 붙이지 않은 경우
->scp: stat local "5555": No such file or directory 에러가 발생하는 경우
-> 포트 옵션 -P를 대문자가 아닌 소문자로 입력한 경우 발생하는 에러.
2. 툴체인
표준 GNU 툴체인
3. 부트로더
커널을 메모리에 적재하는 역할 -> 메모리에 대한 초기화 작업 필요
/boot/firmware
dtb 디바이스 트리 블록
cmdline.txt -> 커널에 전달
기타 사항
u-boot 설치하기
VEDA 바로가기 : www.vedacademy.co.kr
VEDA(한화비전 아카데미) 영상으로 확인하기 : https://url.kr/zy9afd
본 후기는 VEDA(한화비전 아카데미) 1기 학습 기록으로 작성되었습니다.
'교육관련 > 한화비전 VEDA 수강일지' 카테고리의 다른 글
[VEDA 1기 수강일지] 57일차 - 임베디드 리눅스 (3) : 장치파일 / yocto (1) | 2024.10.16 |
---|---|
[VEDA 1기 수강일지] 50일차 - openCV (2) : (0) | 2024.10.02 |
[VEDA 1기 수강일지] 48일차 - 라즈베리파이와 GPIO (2) : 조도센서, 멀티스레드 실습 (0) | 2024.09.30 |
[VEDA 1기 수강일지] 42일차 - linux 미니프로젝트 : tcp 통신을 이용한 채팅프로그램 (2) (0) | 2024.09.13 |
[VEDA 1기 수강일지] 40일차 - linux 미니프로젝트 : tcp 통신을 이용한 채팅프로그램 (1) (0) | 2024.09.11 |
댓글