Page 1
Lab 1
Embedded Linux Development Environment
Page 2
Multiple OS in a PC
VMware
Page 3
Multiple OS in a PC
Oracle Virtual Box
Page 4
Linux
Debian
Ubuntu
Linux Mint
Redhat
CentOS
Fedora
Page 5
Development Environment
Host:Windows PC Target: Embedded Linux
Embedded Linuxkernel
Ethernet
Linux Host
Applicationprogram
Flash Memory
Booting
VMware player
192.168.0.2 192.168.0.60
Bridged
192.168.0.120
SerialPort
Page 6
USB to Ethernet Adapter
Page 11
VMware Player
Select Ubuntu1204_64 and play
Page 12
VMware Player
Or double click Ubuntu1204_64.vmx in
the folder D:/Ubuntu1204_64
Page 13
Log In
ID:control password:
ID:root password:control
마우스포인터가안보일경우에는 Ctrl-Alt
Page 14
Open Terminal
pwd: print working directory
ls: list directory contents
Page 15
New Terminal
Right button click
Page 16
Check IP address
ifconfig
Page 17
Open serial terminal
Open Windows SmarTTY
Page 18
Turn ON power switch
Page 19
Power on and boot the target
Page 20
Virtual Machine Network Setting
Virtual machine settings
Page 22
Configure Adapters
Page 23
Check if USB Ethernet adapter is
connected to HOST!
Page 25
IP addresses
Windows: 192.168.0.2
Ubuntu1204: 192.168.0.120
Target: 192.168.0.60
Page 27
Check target IP address
Page 28
Check host-target connection
Page 29
Make working directory
mkdir: make directory
cd: change directory
vi hello.c
Page 30
vi
Press ‘a’ key to start to enter
Page 32
To finish typing press ‘esc’ key
Page 33
vi
To save and quit press ‘:wq’ and Enter
Page 34
Compile and run
gcc hello.c
arm-none-linux-gnueabi-gcc hello.c
Page 35
Mount NFS(network file system)
mount -t nfs 192.168.0.120:/nfsroot/mnt/nfs -o rw,rsize=4096,nolock
Page 37
Run hello.c in target
Page 38
Run hello.c in target
Page 39
Run hello.c in target
Page 40
Run hello.c in target
Page 41
Run hello.c in target
Page 43
vi
‘vi hello.c’ to start editing
Move the cursor using arrow keys or
‘h,j,k,l’ keys
Press ‘i’ to insert
Page 44
vi
To finish typing press ‘esc’ key
To save ‘:w’ and Enter
To quit ‘:q’ and Enter
Page 45
vi
To delete a character press ‘x’
To append a character ‘a’
To copy a line ‘yy’
To paste a line ‘p’
To delete and copy a line ‘dd’
To delete and copy multiple lines ‘#dd’, for
example ‘5dd’ to delete and copy 5 lines
To insert a line ‘o’
To cancel the last action ‘u’
Page 46
vi
Line number ‘:set nu’
Replace a pattern ‘:%s/old/new/
Quit without saving ‘:q!’
To copy from line number #1 to line
number #2 to the next line of #3
‘:#1,#2co#3’
To move from #1 to #2 to the next line of
#3 ‘:#1,#2m#3’
To delete from #1 to #2 ‘:#1,#2d’
Page 49
Basic Linux Commands
cd: change directory
mkdir: make a new directory
rmdir: remove a directory, Directory
including files or sub-directories cannot be
deleted
cp: copy one or more files to another
location
rm: remove files and directories
ls: list files
Page 50
Workspace Switcher
Page 51
Shut Down
Do not just close the VMware window
Page 52
Exercise
Hello World를 10번프린트하는프로그램을 vi 에디터를사용하여편집한후, linux
host와 target에서각각실행해보십시오.
Page 53
File Sharing with Windows
Edit virtual machine settings
Page 54
Virtual Machine Settings