Article Title: the process of running uClinux-2.6 on. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Assume that the working directory is/root.
Step 1 download the following four files to the/root directory
Linux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.gz "> http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.gz
Http://opensrc.sec.samsung.com/download/arm-uclinux-tools-base-gcc3.4.0-20040713.sh
Http://opensrc.sec.samsung.com/download/linux-2.6.9-hsc0.patch.gz
Http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.9.tar.bz2
Step 2 install the arm-uclinux Compiler
Execute sh arm-uclinux-tools-base-gcc3.4.0-20040713.sh
Modify/root/. bash_profile and the environment variable PATH.
PATH = $ PATH: $ HOME/bin: $ HOME/arm-uclinux-tool/bin
You can test the arm-uclinux-gcc-v. The version information should be available.
Step 3 release the kernel source code
Run the following commands in sequence:
Tar-zxvf uClinux-dist-20041215.tar.gz
Cd uClinux-dist
Tar-jxvf ../linux-2.6.9.tar.bz2
Gzip-dc ../linux-2.6.9-hsc0.patch.gz | patch-p0
Rm-rf linux-2.6.x
Mv linux-2.6.9 linux-2.6.x
Cp linux-2.6.x/arch/armnommu/configs/espd_4510b_defconfig vendor/Samsung/4510B/config. linux-2.6.x (kernel configuration)
Cp vendor/Samsung/4510B/config. vendor-2.4.x vendor/Samsung/4510B/config. vendor-2.6.x (vendor configuration, keep consistent with 2.4)
Step 4 modify the kernel
Modify the vendor/Samsung/4510B/Makefile and add the following content:
63 image:
64 [-d $ (IMAGEDIR)] | mkdir-p $ (IMAGEDIR)
65 genromfs-v-V "ROMdisk"-f $ (ROMFSIMG)-d $ (ROMFSDIR)
66 arm-uclinux-ld-r-o $ (ROOTDIR)/$ (LINUXDIR)/romfs. o-B binary $ (ROMFSIMG)
67 $ (CROSS_COMPILE) objcopy-O binary -- remove-section =. romvec 68 -- remove-section =. text -- remove-section =. ramvec 69 -- remove-section =. init 70 -- remove-section =. bss -- remove-section =. eram 71 $ (ROOTDIR)/$ (LINUXDIR)/linux $ (IMAGEDIR)/linux. data
Modify vendor/Samsung/4510B/rc to block the dhcpcd of the last line.
11 cat/etc/motd
12 ifconfig lo 127.0.0.1
13 route add-net 127.0.0.0 netmask 255.255.255.0 lo
14 # dhcpcd &
Modify vendor/config/armnommu/config. arch and change arm-elf to arm-uclinux.
40 MACHINE = arm
41 ARCH = armnommu
42 CROSS_COMPILE = arm-uclinux-
43 CROSS = $ (CROSS_COMPILE)
Modify linux-2.6.x/arch/armnommu/arch/kernel/vmlinux-lds and add romfs. o
78 * (. got)/* Global offset table */
79
80 romfs_start = .;
81 romfs. o
82 romfs_end = .;
Modify linux-2.6.x/arch/armnommu/kernel/setup. c, add the variable romfs_start, romfs_end and set default_command_line
64 extern int _ stext, _ text, _ etext, _ edata, _ end;
65 extern int romfs_start, romfs_end;
Execute make menconfig, select all of the following, and save and exit. Other specific configurations will not be changed.
(Linux-2.6.x) Kernel Version
(UClibc) Libc Version
Default all settings (lose changes) (NEW)
Customize Kernel Settings (NEW)
Customize Vendor/User Settings (NEW)
Update Default Vendor Settings (NEW)
If you exit the configuration for the first time, you may also need to select the board type. Simply select espd_4510b by number.
Step 6 compile
Execute make
After execution, the images directory contains the image. ram file, which is loaded to the 0x8000 address using bootloader. Then, the following information is displayed on the serial port.
Linux version 2.6.9-hsc0 (root@localhost.localdomain) (gcc version 3.4
. 3) #24 Thu Jun 30 00:04:47 EDT 2005
CPU: Samsung-S3C4510B [36807001] revision 1 (armv4T)
Machine: ESPD 4510B (jx4510b)
Warning: bad configuration page, trying to continue
Built 1 zonelists
Kernel command line: root =/dev/ram0 initrd = 0x0011d000, 884 k keepinitrd
PID hash table entries: 128 (order: 7, 2048 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 16 MB = 16 MB total
Memory: 14080KB available (1936 K code, 122 K data, 56 K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Checking if image is initramfs... it isn' t (ungzip failed); looks like an initrd
NET: Registered protocol family 16
TtyS0 at I/O 0x3ffd000 (irq = 4) is a Samsung s34510b Internal UART
TtyS1 at I/O 0x3ffe000 (irq = 6) is a Samsung s34510b Internal UART
RAMDISK driver initialized: 16 RAM disks of 1024 K size 1024 blocksize
Loop: loaded (max 8 devices)
Samsung s34510b Ethernet Driver version 0.2)
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4 Kbytes
TCP: Hash tables configured (established 1024 bind 2048)
NET: Registered protocol family 1
NET: Registered protocol family 17
RAMDISK: romfs filesystem found at block 0
RAMDISK: Loading 881KiB [1 disk] into ram disk... done.
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 56 K
Shell invoked to run file:/etc/rc
Command: hostname Samsung
Command:/bin/expand/etc/ramfs. img/dev/ram1
Command: mount-t proc/proc
Command: mount-t ext2/dev/ram1/var
Command: mkdir/var/config
Command: mkdir/var/tmp
Command: mkdir/var/log
Command: mkdir/var/run
Command: mkdir/var/lock
Command: mkdir/var/empty
Command: cat/etc/motd
Welcome
______
/__ | _ |
_ | _________
| _ \ | | \\//
| _ | |__ | _ |/| ___ \____ | _ | \____ | \_/ \_/
|
| _ |
For further information check:
Http://www.uclinux.org/
Command: ifconfig lo 127.0.0.1
Command: route add-net 127.0.0.0 netmask 255.255.255.0 lo
Execution Finished, Exiting
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service