Installation of cross-compilation tool chains and U-boot, kernel, file system simple compilation

Source: Internet
Author: User
Tags parent directory
I. Installing the cross-compilation tool chain

To extract the tool chain into a suitable folder (/opt/)
Modify/etc/profile Add the path to the tool chain command
Source/etc/profile
(or modify/ETC/BASHRC to take effect immediately)

two. U-boot configuration, compile extract source u-boot-1.1.6.tar.bz2 to current folder

Modify Include/configs/smdk6410.h
#define Config_boot_nand//1
#define Config_boot_movinand//2
Select one, if it is NAND start, then select 1,sd Card to start, select 2

modifying Config_bootcommand, and so on, can reduce the configuration steps in future configurations.
The following options are available to configure as needed
#define Config_bootdelay 3
Fusq
#define Config_bootargs "Root=/dev/mtdblock2 rootfstype=yaffs2 console=tty0 console=ttysac0,115200"
#define Config_bootargs "Root=/dev/mtdblock2 Rootfstype=cramfs console=ttysac0,115200"
#define CONFIG_ETHADDR 00:40:5c:26:0a:5b
#define Config_netmask 255.255.255.0
#define CONFIG_IPADDR 192.168.1.20
#define Config_serverip 192.168.1.10
#define CONFIG_GATEWAYIP 192.168.1.1

You can also customize the Modify #define CFG_PROMPT "[pika@nand]#" (can be labeled to boot better, so as to prevent the PC operation to confuse)

Modify Makefile
Find Cross_compile, find the cross_compile in front of export, change the value to the right of the equal sign to arm-linux-(make sure-no spaces after)


Make Smdk6410_config


Make


./mknand (./mkmovi)


After compiling, u-boot-nand.bin or U-boot-sd.bin are generated in the directory.
Then test.
The steps have been mentioned in the previous article, not to say more.
three. Compiling kernel: modifying makefile
Search Cross_compile, modify its parameters arm-linux-(again, make sure there are no spaces behind)
Copy smdk6410_config to. config
Make (if PC is multi-core, you can use MAKE-J4 to speed up)
Note the compilation process
. (c)->. O-> build-in.o-> vmlinux.o (LD)-> Vmlinux
In the end, creating a zimage in arch/arm/boot/is the kernel we're going to get (it's been compressed)

What to do if there is no Smdk6410_config file.
1. can take arch/arm/configs/???. Config to change.
2. If not, we can compile it manually by make Menuconfig
We can enter System Type->arm system Type (Samsun s3c64xx)->

Select the Samsung s3c64xx and exit to the parent directory.

Others can be modified as needed (some options are preceded by M, which means compiled as modules)
After being configured, a drivers/video/samsung/may produce a s3cfb_ut_lcd43c_d. C,

. c Before the space removed (this is a small problem for Samsung)

Then make

Four. Compiling the file systemTar xvf busybox-1.13.3.tar.gz
Enter the unpacked directory
Make Menuconfig
Enter Build Options
Modify the contents of the cross Compiler prefix front brackets as arm-linux-
Exit to the upper level and enter the installation Options
Make sure that the BusyBox installation prefix before the brackets have./install (if not added)
Others can be modified as needed


And then
Make && make install
When we're done, we'll find our compiled file system in the _install.


Of course, this system is not complete, we can test, edge modification can put our file System package after we build a new NFS home directory (TESTFS) configuration in the previous chapter has been said.


Add etc in home directory such as Proc Dev home lib mnt opt sys var sdcard directory
Now, there is nothing in our library, we can copy it from the Library of Arm Cross compilation tool chain (Cp-f/opt/4.3.2/arm-none-linux-gnueabi/libc/lib/*/testfs/lib/).


During the testing process, we were prompted to have no console device, no tty2,tty3,tty4, and so on, we can add our equipment according to the device above the host.
Ls-l/dev/console We can see that the console is a character-type device, its main device number is 5, and the secondary device number is 1, which can be created with the following command


Mknod/testfs/dev/console C 5 1
The same way that we create tty2,tty3,tty4
Mknod Tty2 C 4 2
Mknod tty3 C 4 3
Mknod Tty4 C 4 4


Our file system is ready to run, however, there is still something missing, on the PC, we can see in the proc currently there are those processes running, in the SYS can see the current system of some things, we run the Mount command will see some mount information, we can see PROC and SYS, these two folders are in there.
But after our development board runs, the two folders are empty
We can initialize the start routines, Vim/testfs/etc/init.d/rcs
Join in the Inside

Mount-n-T proc None/proc
Mount-n-T Sysfs None/sys
Mdev-s

Of course, we can add some welcome information later, which is not necessary, and we will not repeat them here.

At this point, the function of our file system has been relatively complete, we can modify as needed, for example, if our system supports USB, can be added to the RCS
Mount-n-T Usbfs none/proc/bus/usb
Wait a minute


Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.