Migration of linux2.6.24 to the FS2410 Development Board was initially successful.

Source: Internet
Author: User
Porting linux2.6.24 to the FS2410 Development Board is a preliminary success-Linux general technology-Linux programming and kernel information. The following is a detailed description. It is not accurate because the Linux kernel 2.6.24 has included the s3c2410 kernel. During the transplantation, you only need to make a few minor changes and pay attention to them.

I. Preface
Kernel used: linux2.6.24, http://www.kernel.org/pub/linux/kernel/v2.6/
Arm cross-compilation tool used (4.2.0): http://www.codesourcery.com/gnu_toolchains/arm/download.html
Environment: Ubuntu 7.10 in VMware

2. Porting
1. Modify the MakeFile file to determine the arm platform and the Cross-compilation tool used:
Modified file:
Linux-2.6.24/Makefile

Modified content:

# ARCH? = $ (SUBARCH)
ARCH? = Arm
# CROSS_COMPILE? =
CROSS_COMPILE? =/Usr/local/arm/arm-2007q3/bin/arm-none-linux-gnueabi-

2. Modify the NAND Flash initialization code based on the Development Board:
Modified file:
Linux-2.6.24/arch/arm/plat-s3c24xx/common-smdk.c
Note: modifications to this Part are related to the specific development board circuit.

Modified content:
/* NAND parititon from 2.4.18-swl5 */

Static struct mtd_partition smdk_default_nand_part [] = {
[0] = {
. Name = "boot", // = "Boot Agent ",
. Size = SZ_256K, // = SZ_16K,
. Offset = 0,
},
[1] = {
. Name = "kernel", // = "S3C2410 flash partition 1 ",
. Offset = SZ_256K, // = 0,
. Size = SZ_2M-SZ_256K, // = SZ_2M,
},
[2] = {
. Name = "rootfs", // = "S3C2410 flash partition 2 ",
. Offset = SZ_2M, // = SZ_4M,
. Size = 30 * SZ_1M, // = SZ_4M,
},
[3] = {
. Name = "ext-fs1", // = "S3C2410 flash partition 3 ",
. Offset = SZ_32M, // = SZ_8M,
. Size = SZ_16M, // = SZ_2M,
},
[4] = {
. Name = "ext-fs2", // = "S3C2410 flash partition 4 ",
. Offset = SZ_32M + SZ_16M, // = SZ_1M * 10,
. Size = SZ_16M, // = SZ_4M,
},
/* [5] = {
. Name = "S3C2410 flash partition 5 ",
. Offset = SZ_1M * 14,
. Size = SZ_1M * 10,
},
[6] = {
. Name = "S3C2410 flash partition 6 ",
. Offset = SZ_1M * 24,
. Size = SZ_1M * 24,
},
[7] = {
. Name = "S3C2410 flash partition 7 ",
. Offset = SZ_1M * 48,
. Size = SZ_16M,
}*/
};
References:
Kernel source code provided by yl2.6.8.1
Linux-2.6.8.1-zzm/drivers/mtd/nand/s3c2410_nand.c

Static struct mtd_partition partition_info [] = {
{Name: "boot ",
Offset: 0,
Size: SZ_256K },
{Name: "kernel ",
Offset: SZ_256K,
Size: SZ_2M-SZ_256K },
{Name: "rootfs ",
Offset: SZ_2M,
Size: 30 * SZ_1M },
{Name: "ext-fs1 ",
Offset: SZ_32M,
Size: SZ_16M },
{Name: "ext-fs2 ",
Offset: SZ_32M + SZ_16M,
Size: SZ_16M },
};

3. Added support for the devfs file system.
Linux2.6.24 has removed devfs. To support devfs in the kernel and automatically mount/dev to the devfs file system at startup and before running/sbin/init, modify the Kconfig file of fs.
Linux-2.6.24/fs/Kconfig

Modified content:
Find menu "Pseudo filesystems"
Add the following statement:
Config DEVFS_FS
Bool "/dev file system support (OBSOLETE )"
Depends on EXPERIMENTAL
Help
This is support for devfs, a virtual file system (like/proc) which
Provides the file system interface to device drivers, normally found
In/dev. Devfs does not depend on major and minor number
Allocations. Device drivers register entries in/dev which then
Appear automatically, which means that the system administrator does
Not have to create character and block special device files in
/Dev directory using the mknod command (or MAKEDEV script) anymore.

This is work in progress. If you want to use this, you * must * read
The material in , Especially
The file README there.

Note that devfs no longer manages/dev/pts! If you are using UNIX98
Ptys, you will also need to mount the/dev/pts filesystem (devpts ).

Note that devfs has been obsoleted by udev,
.
It has been stripped down to a bare minimum and is only provided
Legacy installations that use its naming scheme which is
Unfortunately different from the names normal Linux installations
Use.

If unsure, say N.

Config DEVFS_MOUNT
Bool "Automatically mount at boot"
Depends on DEVFS_FS
Help
This option appears if you have CONFIG_DEVFS_FS enabled. Setting
This to 'y' will make the kernel automatically mount devfs onto/dev
When the system is booted, before the init thread is started.
You can override this with the "devfs = nomount" boot option.

If unsure, say N.

Config DEVFS_DEBUG
Bool "Debug devfs"
Depends on DEVFS_FS
Help
If you say Y here, then the/dev file system code will generate
Debugging messages. See the file
For more
Details.

If unsure, say N.

4. Compile the kernel
Make menuconfig (this part is troublesome and should be set based on your own needs and the actual situation of the Development Board)
Make zImage

5. Modify the root file system
If the root file system is not modified, the system prompts "Warning: unable to open an initial console." error message at startup. Modification Method (according to FS2410 User Manual ):
(1) Copy yl2410_demo.cramfs to any directory
(2) create two files in this directory:
Mkdir chang
Mkdir guo
(3) link yl2410_demo.cramfs to the chang directory (the system must be logged on as root)
Mount chang yl2410_demo.cramfs? O loop
(4) compress the content in the chang directory
Cd chang
Tar? Cvf/chang's upper-level directory/1.tar ./
In this way, a 1.tar package will be recorded in chang's category
(5) decompress the package to the guo directory.
Umount chang; uninstall mounting
Cd ...;
Mv 1.tar guo;
Cd guo;
Tar? Xvf 1.tar; decompress the contents in the packaged root file system
Rm 1.tar

(6) Go to the dev directory
Run mknod console c 5 1
Run mknod null c 1 3

(7) Go to the usr directory
Replace the following files with the corresponding file that has just compiled the linux2.6.24 kernel.
| -- Ov511.ko # is located in the linux-2.6.24/drivers/media/video/directory
| -- Ov511.o # is located in the linux-2.6.24/drivers/media/video/directory
| -- Sd_mod.ko # located in the linux-2.6.24/drivers/scsi/directory
| -- Usb-storage.ko # located in the linux-2.6.24/drivers/usb/storage/directory
| -- Usbvideo. ko # located in the linux-2.6.24/drivers/media/video/usbvideo/directory
| -- Usbvideo. o # located in the linux-2.6.24/drivers/media/video/usbvideo/directory
'-- Videodev. o # located in the linux-2.6.24/drivers/media/video/directory

Note: whether the above files can be generated depends on the initial configuration.

(8) create a cramfs root file system
First, copy the mkcramfs file to the directory where guo is located.
Run the following command in this directory:
Mkcramfs guo fs2410.cramfs
After running successfully, the fs2410.cramfs root file system is generated in this directory.

6. Download, burn, modify startup parameters, and start
Download and install the FS2410 user manual. First, modify the startup parameter: root = 1f02 init =/linuxrc console = ttySAC0, 115200 devfs = mount display = sam320, it is mainly to change the original ttyS0 to ttySAC0 (this is because of the Linux kernel's changes to the serial port), and then start it.

Iii. Postscript
Why is the initial success? This is because the development board is used to create the root file system, and a simple modification is made. I tried to use BusyBox to make it by myself, but it was always unsuccessful. The error "Failed to execute/linuxrc. Attempting defaults..." is always prompted. It has not been resolved yet.
Related Article

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.