(Host) set up : Linux Backend RS-232, Ethernet, parallel(jtag) Host terminal Target terminal : monitor (Minicom) JTAG Cross compiler Boot loader
Pentium Redhat 9.0 Serial port Serial cross cable Ethernet cross cable JTAG parallel cable Host linux shell bash. Minicom : redhat 9.0. Arm cross compiler : arm-linux
Target board JTAG power. host PC. JTAG Image loading. Jflash-linux-pxa255) target board console. Minicom. Ethernet downloading
Host Minicom ( )
Boot Loader Flash Memory.
Boot Loader,. Ex) memcpy [ToAdderss FromAddress NumberOfBytes] target> memcpy c0008000 00100000 00100000 Ex) memset [Adderss Value NumberOfBytes] memset c0000000 0 ff
TFTP(Trivial FTP) Image Downloading Ex) tftp [filename RAMAddress] target> tftp zimage c0008000 Flash Ex) flash [ToROMAdderss FromRAMAddress NumberOfBytes] target> flash 00100000 c0000000 00100000 RAM Linux booting Ex) boot [Adderss arg0 argc1] target> boot c0008000 0 14 Dump Ex) dumpmem [startadderss NumberOfBytes] target> dumpmem a0000004 4
flash download tftp sdram kernel ramdisk flash. speed serial terminal serial download. help. download kernel SDRAM download. ramdisk download ramdisk SDRAM c0500000 download. reload flash kernel SDRAM loading. ramdisk SDRAM loading. boot --- sdram linux.
Bootp tcp/ip, udp tftp. Host target. tftp. bootp. Bootp inetd, bootpd configuration file inetd.conf, bootptab, hosts, services Host Target Board
1. Bootp : Target board host IP IP packet. 2. Bootp : host Ip. IP packet inetd. inetd bootpd IP packet. IP packet bootpd bootptab IP packet. configuration Bootp Bootp services hosts Target Board Host Xinetd bootpd Xinetd.conf bootptab
1. TCP/IP inetd. 2. Bootp : host IP 3. Bootp : host Ip. bootpd Xinetd tftpd telnetd ftpd Inetd TCP/IP. TCP/IP inetd TCP/IP.
Bootp (format) 1. Number of Second : client bootstrap set Secondary server Client IP Address : client ip 0.0.0.0 Your IP Address : client ip 0 server ip Server IP Address : server Gateway IP Address : Proxy server Proxy server IP Address Client Hardware Address : client setting, ethernet mac address Server Host Name : client option 0, 0 Boot Filename : client Boot Filename (Reply) Boot file vendor-specific information : bootp parameter Target Board Bootp Request Port 67, ip 0.0.0.0 Bootp Reply Port 68, ip 211.104.101.228 Host bootp request client ip ip 0.0.0.0 reply server client ip port server 67 client 68
xinetd target bootpd bootpd Xinetd.conf (tftp, bootp, telnet, ftp ).. xinetd, Xinetd Xinetd.conf.
Xinetd, inetd, TCP wrapper.
Bootp 1. Bootptab [host]# cd etc [host]# vi bootptab.default:\ :hd=/user/boot:bf=null:\ :sm=255.255.255.0 Linux:ht=1:ha=0x00D0CAF12620:tc=.default Bootptab file /etc directory. Bootptab file bootptab MAC address. sm. hd host directory. ht. ha.
Bootp 2. Xinetd.conf [host]# cd etc [host]# vi xinetd.conf tftp dgram udp wait root /usr/sbin/in.tftpd /tftpdir Bootps dgram udp wait root /usr/sbin/tcpd bootpd Inetd.conf. 3. hosts [host]# cd etc [host]# vi hosts 127.0.0.1 localhost.localdomain localhost 211.104.101.227 linux hosts file target IP. host bootptab host. bootp linuxcerf IP Bootptab ip (linuxcerf)
Bootp 4. services [host]# cd etc [host]# vi services bootps 67/tcp # boop server tftp 69/udp # tftp server services file. bootps 67 tcp tftp 69 udp. bootps 67/tcp server bootpc 68/udp client. 4 target host.
1. Bootpd bootpd. (bootptab ) host target. sm hd ht ha : target
300 bytes Bootp (format) Transaction ID Number of seconds Client IP address Your IP address Server IP address Gageway IP address 0 7 8 15 16 23 24 31bit Opcode 1=Request, 2=Rep Hardware type 1 = Ethernet bootp ( 300 ) : Request Reply Opcode : message type 1=Request, 2=Reply Hardware type : 1= 10 Base Ethernet Client hardware address (16bytes) Server Hostname (64bytes) Boot filename (128bytes) Vendor-specific information (64bytes) Hardware address Length : 6 = 10 Base Ethernet HOP count : 0 Setting, Transaction ID : 32bit (Random), client set, server return client Request Reply Hardware ddress Length(6=ethernet) Unused Hop count
Tftp Trivial File Protocol, ftp. ftp tcp tftp udp. udp tcp udp tcp. udp.
tftp IP Datagram UDP Datagram IP Header UDP Header TFTP Message 20bytes 8bytes =<512bytes 512 bytes Data Block. Block 4bytes Block 1. ASCII Binary. Remote File Read Write. No Checksum.
OPCODE = 1 File name 0 mode 0 2bytes String N Byte 1byte String N Byte 1byte OPCODE = 2 File name 0 mode 0 2bytes String N Byte 1byte String N Byte 1byte OPCODE = 3 Block# DATA 2bytes 2bytes =<512bytes OPCODE = 4 2bytes Block# 2bytes OPCODE = 5 Error code Error Message 0 2bytes 2Bytes String N Byte 1byte
tftp (1) 1. inetd.conf [host]# cd etc [host]# vi inetd.conf tftp dgram udp wait root /usr/sbin/in.tftpd /tftpdir Bootps dgram udp wait root /usr/sbin/tcpd bootpd Inetd.conf tftp. (/tftpdir) 2. Write Request Opcode = 2bytes 2 File name Sting N bytes 0 1byte Mode String N bytes 0 1byte
tftp (2) 3. Read Request Opcode = 2bytes 1 File name Sting N bytes 0 1byte Mode String N bytes 0 1byte Read Request port 69 (file name mode ) port 512 (Block Number = 1) Block ACK Block Number 1 512 Block (Number = 2) ACK Block Number 2 Block( 512 ) Block 512 Block. Block 512, opcode block number.
target board device driver host arm cross compiler compile ftp target board target board. Host device driver module,. arm cross compiler. Cross compiler PATH. PATH. Compile module target Downloading. Module Module compile Module
Device,,,, Device on Linux Linux Device File operation Major number Minor number Device Driver Device Interface Type of Device Driver Char device driver Block device driver Network device driver
Application System Call Interface Virture File System(VFS) Buffer Cache Network Subsystem Character Block Network Device Driver Device Driver Device Driver BSD socket Inet(AF_INET) Transport(TCP,UD P) Network(IP) Device Interface Hardware
1. Host device driver. host root/gpio/ directory gpio.c gpio.h. [host]# cd root [host]# cd gpio [host]# vi gpio.c 2. Make file. directory make file. [host]# vi makefile CC = armv4l-unknown-linux-gcc INCLUDEDIR = /usr/include CFLAGS = D KERNEL -DMODULE Wall 02 CFLAGS += -I.. I$(INCLUDEDIR) gpio.o: gpio.c $(CC) $(CFLAGS) c o gpio.o gpio.o
3. Cross compile. (arm cross compiler compile) gpio.o file [host]# make 4. Host gpio.o target. (ftp) minicom target linux host gpio.o target ifconfig ip host ip 211.104.101.227 ftp. ftp network. [target]# ifconfig eth0 211.104.101.228 [target]# ftp 211.104.101.227 Login pass word host. login : buniel passwd : ******
5. Host directory.. ftp>cd root ftp>cd gpio ftp>get gpio.o ftp>quit 6. Target. target]# insmod gpio.o target]# cat /proc/devices target]# mknod /dev/gpio c 253 0
device driver test target board. Host test program code. arm cross compiler. Cross compiler PATH. PATH. Compile target Downloading. Module Module compile Module
1. Host Application program. host root/gpio/ directory test.c. (gpio test program source ) [host]# cd root [host]# cd gpio [host]# vi test.c 2. Make file. directory make file. [host]# vi makefile CC = armv4l-unknown-linux-gcc INCLUDEDIR = /usr/include CFLAGS = D KERNEL -DMODULE Wall 02 CFLAGS += -I.. I$(INCLUDEDIR) Test: test.c $(CC) o test test.c
3. Cross compile. (arm cross compiler compile) test file. [host]# make 4. Host target test. device driver. minicom target linux host test target ifconfig ip host ip 211.104.101.227 ftp. ftp network. [target]# ftp 211.104.101.227 Login pass word login. login : buniel passwd : ******
5. Host directory. Host tset target directory. Ftp. ftp>cd root ftp>cd gpio ftp>get test ftp>quit 6. Target test program. Target test file. Test gpio device driver. Test program check bit. (.) target]# chmod +x test target]#./test