Professional Documents
Culture Documents
cn
Linux
Linux
Linux
5.1
http://www.farsight.com.cn
5.1.1
BUG
ftp://gcc.gnu.org/pub/
glibc
2.95.3 3.3.2
Linux2.4 Linux2.6
cross-3.3.2
2
2
/usr/local/arm cross-3.3.2.bar.bz2
[root@localhost arm]# tar jxvf cross-3.3.2.bar.bz2
[root@localhost arm]# ls
3.3.2 cross-3.3.2.tar.bz2
[root@localhost arm]# cd ./3.3.2
[root@localhost arm]# ls
arm-linux bin etc include info lib libexec man sbin share VERSIONS
[root@localhost bin]# which arm-linux*
/usr/local/arm/3.3.2/bin/arm-linux-addr2line
/usr/local/arm/3.3.2/bin/arm-linux-ar
/usr/local/arm/3.3.2/bin/arm-linux-as
Linux 5 Linux
/usr/local/arm/3.3.2/bin/arm-linux-c++
/usr/local/arm/3.3.2/bin/arm-linux-c++filt
/usr/local/arm/3.3.2/bin/arm-linux-cpp
/usr/local/arm/3.3.2/bin/arm-linux-g++
/usr/local/arm/3.3.2/bin/arm-linux-gcc
/usr/local/arm/3.3.2/bin/arm-linux-gcc-3.3.2
/usr/local/arm/3.3.2/bin/arm-linux-gccbug
/usr/local/arm/3.3.2/bin/arm-linux-gcov
/usr/local/arm/3.3.2/bin/arm-linux-ld
/usr/local/arm/3.3.2/bin/arm-linux-nm
/usr/local/arm/3.3.2/bin/arm-linux-objcopy
/usr/local/arm/3.3.2/bin/arm-linux-objdump
/usr/local/arm/3.3.2/bin/arm-linux-ranlib
/usr/local/arm/3.3.2/bin/arm-linux-readelf
/usr/local/arm/3.3.2/bin/arm-linux-size
/usr/local/arm/3.3.2/bin/arm-linux-strings
/usr/local/arm/3.3.2/bin/arm-linux-strip
/usr/local/arm/3.3.2/bin/ arm
VERSION
Versions
gcc-3.3.2
glibc-2.3.2
binutils-head
Tool chain binutils configuration:
../binutils-head/configure
../glibc-2.3.2/configure
Tool chain gcc configuration
../gcc-3.3.2/configure
binutilsgccglibc
Version
5.1.2
Minicom
Windows Linux
http://www.farsight.com.cn
Windows
Linux Minicom
1
Windows
5.1
COM1
1 5.2
FS2410
115200 8 1
5.3
PC
5.4
5.1
Linux 5 Linux
5.2
5.3
1 2UART1
UATR2
2Minicom
Minicom Linux
Minicom
5.4
< Linux >
http://www.farsight.com.cn
minicom
minicom Minicom
5.5
5.5 minicom
Minicom CTRL-A Z
CTRL
A
O
Configure Minicom minicom
CTRL-A O 5.7
Linux 5 Linux
5.6 minicom
5.7 minicom
http://www.farsight.com.cn
minicom ttyS0COM1
ttyS1COM2
5.8 minicom
Linux 5 Linux
5.9 minicom
E
5.10
5.11
5.8
5.10
5.11
http://www.farsight.com.cn
minicom
minicom
Linux 5 Linux
5.12
minicom
minicom
5.13
5.12
minicom
5.13
http://www.farsight.com.cn
minicom
5.1.3
Linux 5 Linux
tftp
tftp
tftp
Linux Windows
1Linux tftp
Linux tftp xinetd
tftp tftp
[root@sunq tftpboot]# vi /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#
service tftp
{
socket_type
= dgram
protocol
= udp
wait
= yes
user
= root
server
= /usr/sbin/in.tftpd
server_args
= -s /tftpboot
disable
= no
per_source
= 11
cps
= 100 2
flags
= IPv4
disable=yesnoserver_argstftp
/tftpboot
xinetd
[root@sunq tftpboot]# service xinetd restart
xinetd
[ ]
xinetd
[ ]
Foreign Address
State
http://www.farsight.com.cn
udp
0 *:32768
*:*
udp
0 *:831
*:*
udp
0 *:tftp
*:*
udp
0 *:sunrpc
*:*
udp
0 *:ipp
*:*
/tftpboot tftp
tftp
IP 192.168.1.100
IP 192.168.1.1
0x30200000zImage
2Windows tftp
Windows tftp tftp tftpd32
tftpd32 5.14
tftp
tftpd32
tftp tftp
5.15 5.16
Linux 5 Linux
5.14 tftpd32
5.15 tftp
5.16 tftp
tftp
tftp 2003
8 12 Worm.Blaster tftp
tftp
tftp /tftpboot
2
DNW
< Linux >
http://www.farsight.com.cn
Windows
IP DNW
DNW
ConfigurationOptions 5.17
5.17
DNW
Serial PortConnect
Serial PortTransmit
5.18
5.19 DNW 0x30200000
5.18
DNW
Linux 5 Linux
5.19
5.1.4
DNW
Linux
Linux
Linux Linux
Linux
Linux make
3 MakefileLinux Makefile
Makefile
3
1
ARCH
:= arm
4
< Linux >
http://www.farsight.com.cn
.config
4
make config
make menuconfig
make xconfigXwindow
make oldconfig.config
Y
N
3
*
*
M
Linux 5 Linux
5.20
make menuconfig
5.21
System Type
http://www.farsight.com.cn
5.22
5.23
5.22
Linux 5 Linux
5.23
Makefile
.dependmake dep
3
make zImagemake bzImage
Linux
zImagearch/$ARCH/boot
vmlinux
Linux
.config
autoconf.h
config.h
5.1.5
http://www.farsight.com.cn
Linux
Linux 5.24
/include
/init
/arch
armi386alpha
/drivers
SCSI
/fs ext2
vfat
/net
/mm
/ipc
/kernel
5.1.6
5.24
Linux
5.25
5.25
< Linux >
Linux 5 Linux
2 Linux
Linux Linux
head.S
Linux
Linux
NFS
1
Linux Linux
Linux
cramfsromfsjffsyaffs cramfs
cramfs
Tongatapu
Truk
Wake
Wallis
Yap
WET
zone.tab
usb-storage.o
usbvideo.o
videodev.o
http://www.farsight.com.cn
mkcramfs
mount
[root@localhost fs]# mkdir sunq
[root@localhost fs]# mount -o loop FS2410XP_camare_demo4.cramfs ./sunq
[root@localhost fs]# ls sunq
bin dev etc home lib linuxrc proc Qtopia ramdisk sbin tmp usr var
2NFS
NFS Network FileSystem Sun
NFS
NFS NFS
NFS
NFS
mount NFS
NFS /etc/exports
[] [ IP] [ 1 2]
IP IP IP
*
5.1
5.1
rw
ro
no_root_squash
NFS root
root
sync
async
/etc/exports
< Linux >
Linux 5 Linux
[root@localhost fs]# cat /etc/exports
/root/workplace
*(rw,no_root_squash)
[]
[]
NFS :
[]
NFS :
[]
NFS mountd:
[]
-a
/etc/exports
-r
/etc/exports
-u
-v
export
showmount
showmount [] hostname
showmount 5.3
5.3
-a
-e
hostname /etc/exports
< Linux >
5.2
http://www.farsight.com.cn
U-Boot
5.2.1
Bootloader
1
Bootloader PC
BIOS
Bootloader
Bootloader Bootloader
Bootloader
1Bootloader CPU
CPU Bootloader Bootloader
CPU U-Boot ARM MIPS
CPU Bootloader
2Bootloader
CPU CPU
CPU ROMEEPROM
FLASH CPU Bootloader
3Bootloader Bootloader
4Bootloader Bootloader
Bootloader
RAM
Bootloader
Host
Bootloader RAM Bootloader
FLASH Bootloader
Bootloader
5Bootloader
Bootloader xmodem/
ymodem/zmodem
TFTP
Linux 5 Linux
2Bootloader
Bootloader stage1 stage2
1Bootloader stage1
stage1 Bootloader
CPU RAM
LED CPU cache
stage2 RAM stage2
RAM
Bootloader stage2 RAM
stage2 RAM stage2
RAM
sp stage2 C
2Bootloader stage2
stage2 Bootloader
main
stage2 C
C Bootloader
glibc
4GB
RAM
Flash
5.2.2
U-Boot
1U-Boot
U-BootUniversalBootloader
GPL FADSROM
8xxROMPPCBOOT Linux
U-Boot Linux
U-Boot U-Boot Linux
NetBSDVxWorksQNXRTEMSARTOSLynxOS
OpenBSDNetBSDFreeBSD4.4BSDLinuxSVR4Esix
SolarisIrixSCODellNCRVxWorks,LynxOSpSOSQNXRTEMSARTOS
U-Boot Universal U-Boot PowerPC
MIPSx86ARMNIOSXScale
< Linux >
http://www.farsight.com.cn
U-Boot
U-Boot PowerPC Linux
2U-Boot
U-Boot
LinuxNetBSDVxWorksQNXRTEMSARTOS
LynxOS
PowerPCARMx86MIPSXScale
U-Boot
SDRAMFLASHLCDNVRAMEEPROM
RTC
3U-Boot
U-Boot
NFS RAMDISK
NFS FLASH
Linux
FLASHNVRAMEEPROMCRC32 FLASH
RAMDISK
SDRAMFLASHLCDNVRAMEEPROM
USBPCMCIAPCIRTC
SDRAMFLASH SDRAM CPU
XIP
5.2.3
U-Boot
1U-Boot
U-Boot 5.26
board Makefile
U-Boot.lds
common C
5.26
U-Boot
Linux 5 Linux
start.S U-BOOT C
diskdisk
doc
drivers CFI Flash USB
fsU-BOOT cramfsfatfdosjffs2 registerfs
include
lib_arm ARM
tools S-Record U-BOOT images
2U-Boot
1cpu/arm920t/start.S
U-Boot
Flash
.globl_start
_start:
reset
ldr
pc, _undefined_instruction
ldr
pc, _software_interrupt
ldr
pc, _prefetch_abort
ldr
pc, _data_abort
ldr
pc, _not_used
ldr
pc, _irq
ldr
pc, _fiq
.word software_interrupt
_prefetch_abort:
.word prefetch_abort
_data_abort:
.word data_abort
_not_used:
.word not_used
_irq:
.word irq
_fiq:
.word fiq
http://www.farsight.com.cn
_TEXT_BASE:
.word
TEXT_BASE
.globl _armboot_start
_armboot_start:
.word _start
/*
* These are defined in the board-specific linker script.
*/
.globl _bss_start
_bss_start:
.word __bss_start
.globl _bss_end
_bss_end:
.word _end
reset:
/*
* set the cpu to SVC32 mode
*/
mrs
r0,cpsr
bic
r0,r0,#0x1f
orr
r0,r0,#0xd3
msr
cpsr,r0
relocate:
adr
r0, _start
ldr
r1, _TEXT_BASE
cmp
r0, r1
beq
stack_setup
*/
*/
ldr
r2, _armboot_start
ldr
r3, _bss_start
sub
r2, r3, r2
add
r2, r0, r2
*/
*/
*/
copy_loop:
ldmia r0!, {r3-r10}
*/
Linux 5 Linux
stmia r1!, {r3-r10}
cmp
r0, r2
ble
copy_loop
/* copy to
*/
*/
*/
stack_setup:
ldr
r0, _TEXT_BASE
*/
sub
*/
sub
*/
clear_bss:
ldr
r0, _bss_start
ldr
r1, _bss_end
/* stop here
mov
r2, #0x00000000
/* clear
/* clear loop...
add
r0, r0, #4
cmp
r0, r1
bne
clbss_l
ldr
pc, _start_armboot
2interrupts.c
#ifdef CONFIG_USE_IRQ
/* enable IRQ interrupts */
void enable_interrupts (void)
{
unsigned long temp;
__asm__ __volatile__("mrs %0, cpsr\n"
"bic %0, %0, #0x80\n"
"msr cpsr_c, %0"
: "=r" (temp)
:
: "memory");
}
*/
*/
*/
*/
http://www.farsight.com.cn
/*
* disable IRQ/FIQ interrupts
* returns true if interrupts had been enabled before we disabled them
*/
int disable_interrupts (void)
{
unsigned long old,temp;
__asm__ __volatile__("mrs %0, cpsr\n"
"orr %1, %0, #0xc0\n"
"msr cpsr_c, %1"
: "=r" (old), "=r" (temp)
:
: "memory");
return (old & 0x80) == 0;
}
#else
void enable_interrupts (void)
{
return;
}
int disable_interrupts (void)
{
return 0;
}
#endif
void show_regs (struct pt_regs *regs)
{
unsigned long flags;
const char *processor_modes[] = {
"USER_26", "FIQ_26",
"IRQ_26",
"SVC_26",
"UK4_26",
"UK5_26",
"UK6_26",
"UK7_26",
"UK8_26",
"UK9_26",
"UK10_26", "UK11_26",
"IRQ_32",
"SVC_32",
"UK4_32",
"UK5_32",
"UK6_32",
"ABT_32",
"UK8_32",
"UK9_32",
"UK10_32", "UND_32",
Linux 5 Linux
}
void do_fiq (struct pt_regs *pt_regs)
{
printf ("fast interrupt request\n");
show_regs (pt_regs);
bad_mode ();
}
3cpu.c
http://www.farsight.com.cn
unsigned long i;
disable_interrupts ();
/* flush I/D-cache */
i = 0;
asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));
return (0);
}
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text
{
cpu/arm920t/start.o
(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
< Linux >
Linux 5 Linux
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}
4memsetup.S
//memsetup.c
/* memory control configuration */
/* make r0 relative the current location so that it */
/* reads SMRDATA out of FLASH rather than memory ! */
ldr
r0, =SMRDATA
r3, [r0], #4
str
r3, [r1], #4
cmp
r2, r0
bne
0b
.ltorg
5.2.4
U-Boot
1
Makefile Makefile
s3c2410_config: unconfig @./mkconfig (@:_config=) arm arm920t s3c2410
http://www.farsight.com.cn
ARM
#make s3c2410_config
#make
2
board/s3c2410 config.mk
U-Boot 6MB 33F80000 33A00000
U-Boot GO loadb tftp U-Boot board/
s3c2410 memsetup.S 0: 5
mov r3, pc
ldr r4, =0x3FFF0000
and r3, r3, r4 // 3
aad r0, r0, r3 // GO u-boot RAM
add r2, r2, r3 //
2 FLASH SDRAM
include/configs/s3c2410
#define CONFIG_DRIVER_DM9000 1 /* we have a CS8900 on-board */
#define DM9000_BASE 0x08000000
#define DM9000_BUS16 1 /* the Linux driver does accesses as shorts */
#define CONFIG_ETHADDR 08:00:3e:26:0a:5b
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.2.120
#define CONFIG_SERVERIP 192.168.2.122
5.2.5
U-Boot
helphelp usb USB
ping PING
setenv
saveenv
ftptftp 32000000 vmlinux serverIP= serverip/tftpdroot/
vmlinux TFTP 32000000
kgo linux kgo 32000000
bootm UBOOT TOOLS LINUX bootm 3200000
protect FLASH protect on 1:0-3 FLASH
< Linux >
Linux 5 Linux
0-3
protect off 1:0-3
erase FLASH erase 1:0-2 FLASH 0-2
5.3
Linux
1
Linux Linux
2
Linux minicom
Linux2.6
3
1 minicomCTRL-A O
2
3 Linux Makefile
4make menuconfig
5make dep
6make zImage
7 tftp
8
4
http://www.farsight.com.cn
Linux minicom
Linux U-Boot
1 Linux
2 NFS