임베디드 리눅스 실습 환경 설정 (vmware – Ubuntu8.10)
==== Windows XP, VMware, MEP2440 Board ====
타겟 보드에 부트로더 굽기: u-boot:
T32를 통한 u-boot-mep2440.bin이미지 굽기
flash_rebis_atmel.cmm T32스크립트 파일을 T32에서 로드 및 Do 실행
u-boot-mep2440.bin 파일 선택 및 굽기
Trace32 for ARM 을 이용해 u-boot.bin을 NOR 플래시에 굽는다.
- u-boot.bin 위치: CD/images/ u-boot-mep2440.bin
- T32 script 위치: CD/Scripts/ mep2440_nor_write.cmm
타겟 보드를 Reset시켜 TeraTerm으로 부트로더 메시지가 뜨는지 확인한다.
- 자동부트 카운터가 내려가기 전에 부트로더 쉘로 진입한다.
네트워크 설정 및 패키지 설치
1. 사용자 권한을 root 사용자로 변경한다.
root@mdsedu-desktop:/# su
password : mdsedu
2. /etc/network/interface 파일을 수정하여 IP Address를 설정한다.
root@mdsedu-desktop:/# vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.10.3
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.1
3. /etc/resolv.conf 파일을 수정하여 DNS를 추가한다.
root@mdsedu-desktop:/# vim /etc/resolv.conf
nameserver 210.221.215.14
4. 설정한 이더넷 인터페이스를 활성화시킨다.
root@mdsedu-desktop:/# /etc/init.d/networking restart
5. apt-get 패키지를 업데이트하고 SSH, Samba 패키지를 설치한다.
root@mdsedu-desktop:/# apt-get update
root@mdsedu-desktop:/# apt-get install ssh
/etc/init.d/ssh restart 로 시작
root@mdsedu-desktop:/# apt-get install samba smbfs
6. 각종 서버들을 설치한다.
root@mdsedu-desktop:/# apt-get install nfs-kernel-server tftpd tftp dhcp3-server
7. ncurses 라이브러리를 설치한다.
root@mdsedu-desktop:/# apt-get install build-essential
root@mdsedu-desktop:/# apt-get install libncurses5-dev
8. ctags 사용를 위해 설치한다.
root@mdsedu-desktop:/# apt-get install exuberant-ctags
TFTP 설정
9. /etc/inetd.conf 파일에서 tftp 디렉터리명을 /tftpboot로 수정한다.
root@mdsedu-desktop:~# vim /etc/inetd.conf
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
10. /tftpboot 디렉터리를 생성하고, 접근권한을 변경한다.
root@mdsedu-desktop:~# mkdir /tftpboot
root@mdsedu-desktop:~# chmod 777 /tftpboot
11. 데몬을 재시작시킨다.
root@mdsedu-desktop:~# /etc/init.d/openbsd-inetd restart
12. /tftpboot 디렉터리에 파일을 생성하고 아무 내용이나 기록한 후, tftp가 잘 동작하는지 확인한다.
root@mdsedu-desktop:~# vim /tftpboot/aa.txt
root@mdsedu-desktop:~# tftp localhost
tftp> get aa.txt
Received 13 bytes in 0.0 seconds
Note Target 보드와의 통신 테스트도 수행하여 동작을 확인한다.
13. Kernel 이미지 파일을 /tftpboot 디렉터리로 복사한다.
root@mdsedu-desktop:~# cp uImage-mep2440 /tftpboot
NFS 설정
14. Cross Toolchain과 루트 파일 시스템을 /opt 디렉터리에 압축을 해제한다.
root@mdsedu-desktop:/# cd /opt/
root@mdsedu-desktop:/opt# tar xfz 4.2.4-arm-toochain_and_rootfs.tar.gz
15. /etc/exports 파일에nfs로 마운트 할 디렉터리 설정을 추가한다.
root@mdsedu-desktop:~# vim /etc/exports
……
/opt/4.2.4-arm/arm-generic-linux-gnu/sys-root *(rw,sync,no_root_squash,no_all_squash)
16. nfs 데몬을 재시작한다.
root@mdsedu-desktop:~# /etc/init.d/nfs-kernel-server restart
* Stopping NFS kernel daemon
...done.
* Unexporting directories for NFS kernel daemon...
...done.
* Exporting directories for NFS kernel daemon...
exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/opt/rootfs".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
...done.
* Starting NFS kernel daemon
...done.
17. Target 보드에 nfs 부팅 설정을 하고, 보드 부팅을 확인한다.
Cross Toolchain Path 지정
18. /root/.bashrc 파일에 Cross Toolchain path 설정을 추가한다.
root@mdsedu-desktop:~# vim .bashrc
……
# cross toolchain path
export PATH=/opt/4.2.4-arm/bin:$PATH
Note root 계정이 아닌 일반 계정의 경우에는 사용자 계정 디렉터리의 .bashrc 파일에 추가하면 된다. 만약 사용자 계정이 mdsedu 라면 /home/mdsedu/.bashrc 파일을 수정하면 된다.
19. logout 후에 다시 login 하여 path를 적용시킨다.
20. Cross Toolchain 버전 정보를 확인한다.
root@mdsedu-desktop:~# arm-generic-linux-gnu-gcc -v
Figure 2-1 Cross Toolchain Version Information
Samba 설정
21. /etc/samba/smb.conf 파일을 다음과 같이 수정한다. (미리 설정된 파일을 복사해서 이용해도 된다.)
root@mdsedu-desktop:~# vim /etc/samba/smb.conf
……
workgroup = WORKGROUP 네트워크 그룹명
……
guest ok = yes
guest account = root
……
[root]
comment = root
path = /
writable = yes
browseable = yes
guest ok = yes
……
22. samba 서비스를 재시작 시킨다.
root@mdsedu-desktop:~# service samba restart
* Stopping Samba daemons
...done.
* Starting Samba daemons
...done.
23. Windows 탐색기에서 samba 서버를 연결한다. (도구 네트워크 드라이브 연결)
Figure 2-2 Connect of Samba Server
24. Windows 탐색기에서 samba 서버 연결을 확인한다.
Figure 2-3 Connected of Samba Server
□ u-boot의 설정
1) u-boot를 이용한 다운로드
printenv 환경확인
set ipaddr 192.168.10.4 타겟 보드의 IP 설정
set serverip 192.168.10.2 호스트 IP의 설정
set gatewayip 192.168.10.1 gateway IP 주소
set netmask 255.255.255.0 Netmask 값
set bootcmd 'tftpboot 32000000 uImage-mep2440; bootm 32000000' //go 와 동일한 의미
set bootargs 'root=/dev/nfs rw nfsroot=192.168.10.2:/opt/4.2.4-arm/arm-generic-linux-gnu/sys-root ip=192.168.10.4:192.168.10.2:192.168.0.1:255.255.255.0::eth0:off netmask=255.255.255.0 mem=49M console=ttySAC0,115200n81' u-boot 매개변수의 인자 전달하기
save Flash에 환경설정 기록하기
위의 u-boot 환경설정 후 타겟 보드를 껏다 켜면 다운로드가 된다.
매개변수 쓰기: set bootargs 'root=/dev/nfs rw nfsroot=호스트IP:NFS로사용할_루트_디렉토리 ip=타겟IP:호스트IP:게이트웨이IP:넷마스크::eth0:off netmask=넷마스크 mem =49M console=시리얼디바이스명, 115200n81'
vmware가 bridged로 설정되어 있는 경우 같은 네트워크ID 내에 있어야 한다.
2) hello world 프로그램 컴파일 해보기
Host Shell --
cd /work/rootfs_nfs/project ///opt/4.2.4-arm/arm-generic-linux-gnu/sys-root ls
vi hello.c
arm-linux-gcc hello.c –o hello_arm
Target Shell --
cd /project
./hello_arm
□ 부트로더 및 커널 컴파일
임베디드 시스템 개발 시 필요한 경우 부트로더나 커널을 수정하여 직접 컴파일 하도록 한다.
3) 커널 소스 및 u-boot 소스 풀기
# tar -xzf /work/linux-2.6.21.st_fin.tar.gz
# tar -xzf /work/u-boot-1.3.3.st_fin.tar.gz
압축 해제 후 커널 컴파일 및 u-boot 등을 수정할 수 있다.
4) u-boot 1.3.3 컴파일
BSP로 제공된 u-boot 1.3.3버전은 arm-generic-linux-gnu-gcc 4.2.4버전에서 컴파일 된다.
NOR flash 부팅으로 컴파일 하기
make distclean
make mep2440_config Makefile 규칙
make
u-boot 헤더를 커널 이미지에 붙이려면 컴파일 후 /tools/mkimage를 /usr/bin에 복사해 놓는다.
- uImage 를 만들기 위해 필요 하다.
cp tools/mkimage /usr/bin
5) 커널 컴파일
BSP로 제공된 포팅되어 미리 준비된 rebis용 커널을 사용할 수 있다.
cd /work/linux-2.6.21-mep2440 // linux-2.6.21.st_fin
make mep2440_defconfig (make menuconfig 관련 메뉴 설정 )
make uImage 커널이 컴파일 되어 mkimage 유틸리티에 의해 이미지에 u-boot 헤더를 포함한다.
cp ./arch/arm/boot/uImage /tftpboot/uImage-new 새 버전의 커널을 tftpboot 디렉터리에 복사
이후 부트커맨드를 수정하여 새 커널을 테스트 할 수 있다.
Target u-boot Prompt -----------
set bootcmd 'tftp 32000000 uImage-new; bootm 32000000'
피드 구독하기:
댓글 (Atom)
UPBIT is a South Korean company, and people died of suicide cause of coin investment.
UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...
-
프루나는 이제 믿을만한 공유가 안되고 있다. 젠장. 영화 다운 받아보면 전부 야동이나 포르노류 밖에는 없다. 신고되어 있는 자료부터 보지만 신고가 안되어 있는 것은 제대로 다운도 되지 않는다. 이젠 유료 사이트를 믿을 수 밖엔... ...
-
Intel의 새로운 MMX - "KNI" KNI 는 Katmai New Instruction 의 약자이다 . 아는 분들은 잘 알고있겠지만 KATMAI( 이하 카트마이로 부름 ) 는 인텔의 다음번 펜티엄...
-
C:\program files\ 베이비론 폴더가 있다. 브라우저 창 다닫고 지우고 다시 실행하면 없어진다.
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.