This section mainly includes (ubuntu10.04)
1. Common compression and decompression commands in Linux
2. Environment Establishment
Iii. kernel Compilation
4. Porting
1. Common compression and decompression commands in Linux
Common compressed file formats in Linux include tar gzip zip Bzip2 compress.
First, for the tar format, the compression and decompression methods are as follows:
. Tar decompression # tar-xvf file1.tar compression # tar-CVF file1.tar
.Tar.gz decompression # tar-zxvf file1.tar compression # tar-zcvf file1.tar
. Tar. BZ extract # tar-jxvf file1.tar compression # tar-jcvf file1.tar
For GZIP format, the compression and decompression methods are as follows:
Decompress the. GZ extension # gzip-D file1.gz compression # gzip file1
For ZIP files, the compression and decompression methods are as follows:
Decompress the. Zip extension # uzip file1.zip compression # zip file.zip file1 file2 file3
For Bzip2 format, the compression and decompression methods are as follows:
. Bz2 decompression # bunzip2 file.bz2 compression # Bzip2 *
2. Environment Establishment
First, set the cross-tool (For details, refer to the previous article on the establishment of an embedded development environment)
Provided by others (
UClinux: http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20051110.tar.gz
Cross-compilation environment: http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/arm-elf-tools-20030314.sh
)
I used arm-elf-tools provided by Tianxiang.
Copy the software arm-elf-tools-20040427.sh from the CD code
A + 43 error occurs when the./arm-elf-tools-20040427.sh result is executed under the linux root directory.
(Some people say that # chmod 777 arm-elf-tools-20040427.sh after the execution is not wrong do not know did not try)
Solution:
# Tail-N + 43 arm-elf-tools-20040427.sh> 1.tar.gz
# Tar-zxvf 1.tar.gz
After the command is executed, enter arm-elf-gcc-V in the console.
If the installation is successful, a version such as 2.95.3 is displayed.
Check that the installation is there
# Which arm-elf-gcc
Check whether the path is added to the path:
Echo $ path
We should be able to see the path of our compilation tool
Then prepare the uClinux kernel. Here I use 2.4.
I directly stored this folder in the home/Wenzer/share folder and shared it with windows.
So it is more convenient
Extract
# Tar xvzf uclinux2.4.tar.gz
Then wait for compilation
Iii. kernel Compilation
Go to the folder we just decompressed and modify a file.
# Cd uClinux-Dist
# Make mrproper
Wait...
(My error is ignored. If relase is missing, I ignore this prompt)
Modify file 1
# Vi linux2.4.x/ARCH/armnommu/vmlinux-armv.lds.in
In _ sto _ kallsyms = ,;
* (. Got) is followed:
Romfs_data = .;
Romfa. o
Romfs_data.end = .;
Then WQ exits.
If this step is not performed, an error occurs during compilation (both sides of the equal sign must have spaces ).
(4510 modify makefile
# Vi vendors/Samsung/4510b/makefile
Add the following line of genromfs-v "romdisk"-F $ (romfsimg)-d $ (romfsdir)
Arm-elf-LD-r-o $ (rootdir)/$ (linuxdir)/romfs. O-B binary $ (romfsimg)
Then WQ is saved and exited.
)
# Make menuconfig
Error
> Unable to find the ncurses libraries.
>
> You must have ncurses installed in order
> To use 'make menuconfig'
Solution:
Run sudo apt-Get install ncurses-Dev!
(Ncurses is used to display the make menuconfig interface.
Try making again. OK. The configuration page is displayed.
4. Porting
I split the porting into four sections. The first section configures the last section to generate the image file. The first section is as follows: when you select the company or product to exit and save, you will be asked if you want to use IIC or other products... section 2: configuration page: Configuration System saving exit section 3 configuration page 3 Application and busybox section 4 image generation # Make Dep
# Make lib_only this step will cause errors and you need to install the software # apt-Get install bison again # Make lib_only next
# Vi config/. config
Then comment out "config_user_old_passwords = y" # config_user_old_passwords = y "# Make user_only
# Make romfs
# Make Image
If an error occurs during this step
# Make
This will generate the desired file under/image. You can run image. Rom directly in Ram at the end of Ram to decompress the image. Rom, which is exactly what we need to burn to flash.