Port Linux to s3c2410-general Linux technology-Linux programming and kernel information. The following is a detailed description. When I first started Linux porting, I started thinking that I wanted to port uClinux to samsung s3c2410. Previously I knew that uClinux is an operating system for CPUs without MMU (Memory Management Unit, I read the official documents of s3c2410 (PS: all English. Although I have passed cet6, I am still very tired. The English in the IT industry is really TMD important. Who is calling NX technology? It's made by the birds! Not only does it remind me of the previous saying that there are so many Linux systems in China, but none of them are named in the Linux kernel. We also know that the CPU on the s3c2410 instance carries MMU units. However, my point of view has not changed. I want to port the s3c2410 program to the s3c2410 program. Baidu did not find any clue for a long time, so he had to continue his work.
We can see that linux 2.6 kernel supports s3c2410, but when compiling uClinux, there is no such board in vendors (buyer. I naively changed the copy of the 4510B file in vendors/samsung to s3c2410. The final compilation ended in failure.
There is no way to seek help from the newly added embedded group. Fortunately, a friend gave me a prompt: The standard linux kernel supports MMU, while the s3c2410 includes MMU. We should port the standard Linux kernel to s3c2410 instead of uClinux, and use the standard Linux features more powerful.
Now I have found a little hope, and I am very excited. Download the arm-linux-Cross-compilation tool, because the kernel 2.6.18.2 is still in the previous upgrade, so prepare to port the linux-2.6.18.2 to the s3c2410.
I collected some information on the Internet, carefully looked at the operations of those predecessors, and read the official information of s3c2410. Work again.
Mount the drive letter in windows (Fortunately, I am a dual-System windows & linux, and it is very good to transplant the platform ). Perform cross-compilation directly under this drive letter.
Modify the makefile file: Change the corresponding architecture and cross-compilation tool:
ARCH? = Arm
CROSS_COMPILE? = Arm-linux-
# Cp arch/arm/configs/s3c2410_defconfig. config
# Make ARCH = arm CROSS_COMPILE = arm-linux-zImage
Error message:
CHK include/linux/version. h
SYMLINK include/asm-arm/arch-> include/asm-arm/arch-s3c2410
Ln: creating the symbolic link 'include/asm-arm/arch 'to connect to 'arch-sance': The operation is not allowed.
Make: *** [include/asm-arm/. arch] Error 1
From the error message, it seems that the symbolic link is not allowed and cannot be understood. Delete all previous compilation and configuration: # make distclean, and repeat yesterday's operations. The error message is still displayed. I thought the source program was changed.
Decompress the kernel to the root directory: # cd/root/ARM/linux-2.6.18.2
Modify the Makefile file in the directory and change the corresponding architecture and cross-compilation tool:
ARCH? = Arm
CROSS_COMPILE? = Arm-linux-
# Make ARCH = arm CROSS_COMPILE = arm-linux-uImage // image file guided by u_boot
A bunch of birds are flashing. Haha, the familiar kernel compilation process is coming soon. The compilation is successful!
# Cd arch/arm/boot
# Ls
The zImage and Image of the compiled Image files (work results) are ecstatic. Let's look back at the problem we encountered before: why can the compilation be successful under/root, and the Create Symbolic Link error will occur under/mnt/hda7? Recall the previous knowledge about links when I read APUE (Advanced Programe in Unix Environment. It turns out that symbolic links cannot be cross-partition.
Append. tips:
◎ The kernel vmlinux imageunder arch/arm/boot/compressed, which is compressed into piggy.gz, and then generated a link between piggy. o and the decompression program to generate the kernel zImage.
◎ The kernel decompression process is to extract vmlinux to zreladdr from the ZTEXTADDR compression kernel. ZTEXTADDR indicates the location where the compressed kernel is loaded, and zreladdr indicates the location after compression.
◎ ZTEXTADDR and ZBSSADDR are the address of the Code forging and BSS segment of the decompression program. 2.6 The kernel is set through the CONFIG_ZBOOT_ROM_TEXT and CONFIG_ZBOOT_ROM_BSS parameters. The 2.4 kernel is set in arch/$ (arch)/boot/Makefile. Generally, ZTEXTADDR is set to 0x30008000, and ZBSSADDR is set to null, indicating that it is followed by the previous segment.
◎ The zreladdr, initrd_phys, and params_phys variables are only available in the 2.6 kernel, indicating the extracted kernel address, initrd address, and parameter table address. Specify the values of these three variables by zreladdr-y, initrd_phys-y, and number of params_phys-y in arch/$ (arch)/$ (machine)/Makefile. boot.
A warning is prompted during power manager Compilation:
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