Build an arm-linux simulated Runtime Environment (NFS started)

Source: Internet
Author: User
Article Title: Build an arm-linux simulated Runtime Environment (NFS started ). 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.

Preface
This article aims to set up arm-linux on skyeye and successfully mount NFS on arm-linux. In the end, we can run our own applications in arm-linux. in fact, it is not difficult to transplant arm-linux on skyeye. There are also a lot of information on the Internet, but most of the details are omitted, so that the nuances are stuck. Therefore, this article strives to analyze the details in detail, hoping to be helpful to everyone.


Install Skyeye

We selected the version 1.2.4 of skyeye. To enable the arm-linx running on it to mount NFS, we need to modify device/net/dev_net_cs8900a.c (the modified file is in the attachment ), compile skyeye. Follow these steps to decompress the source package:
# Tar xzf skyeye-1.2.4_Rel.tar.gz
# Cd skyeye-1.2.4

Replace device/net/dev_net_cs8900a.c with dev_net_cs8900a.c in the attachment and then compile:
# Make NO_DBCT = 1 NO_BFD = 1

After compilation, the generated skyeye is in binary and copied to/usr/local/bin:
# Cp binary/skyeye/usr/local/bin


Three-core Compilation
We selected the linux-2.6.14.tar.bz2 version, with the Cross Compiler using arm-linux-gcc 3.4.1 (for the 2.6 kernel with versions earlier than 3.4 will often encounter problems ). The procedure is as follows:

1. If the kernel source code package is under/root, extract the source code first:
# Cd/root
# Tar xjf linux-2.6.14.tar.bz2

2. Go to the kernel directory:
# Cd linux-2.6.14

Modify the Makefile in this directory and set
ARCH? = $ (SUBARCH)
CROSS_COMPILE? =
Change
ARCH? = Arm
CROSS_COMPILE? =/Usr/local/arm/3.4.1/bin/arm-linux-

3. Generate the default Kernel configuration file (for s3c2410 ):
# Make smdk2410_defconfig

4. Add the cs8900 NIC driver to the kernel (see Attachment) to support NFS mounting:
(1) copy the cs8900 driver to the drivers/net/arm directory.
# Cp cs8900.c drivers/net/arm
# Cp cs8900.h drivers/net/arm

(2) modify the Kconfig file in the drivers/net/arm directory and add the following at the end:
Config arm_CS8900
Tristate "CS8900 support"
Depends on NET_ETHERNET & arm & ARCH_SMDK2410
Help
Support for CS8900A chipset based Ethernet cards. If you have a network
(Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available
From as well as. To compile this driver as a module, choose M here and read.
The module will be called cs8900.o.

Note: The [] CS8900 support option will appear when you run the make menuconfig command.

(3) modify the Makefile in the drivers/net/arm directory and add the following content at the end:
Obj-$ (CONFIG_arm_CS8900) + = cs8900.o

Note: The Makefile of the kernel version 2.6 is different from that of version 2.4. Add the preceding statement, this will enable the kernel to compile the cs8900A driver into the kernel in a module or static manner according to the configuration.

(4) Modify arch/arm/mach-s3c2410/mach-smdk2410.c in this file find the smdk2410_iodesc [] structure array, add the following content:

{VSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}

After modification, it becomes:

Static struct map_desc smdk2410_iodesc [] _ initdata = {


{VSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}
};

Add a header file reference:
# Include

(5) Create the file smdk2410.h in the include/asm-arm/arch-s3c2410 directory
# Ifndef _ INCLUDE_SMDK2410_H _
# Define _ INCLUDE_SMDK2410_H _

# Include
# Define psmdk2410_eth_ I/o 0x19000000
# Define vSMDK2410_ETH_IO 0xE0000000
# Define SMDK2410_ETH_IRQ IRQ_EINT9

# Endif

5. Modify the Kernel File with reference to the http://skyeye.wiki.sourceforge.net/Linux
Change include/asm-arm/arch-s3c2410/map. h
# Define S3C2410_CS6 (0x30000000UL)
To
# Define S3C2410_CS6 (0xC0000000UL)

Modify include/asm-arm/arch-s3c2410/memory. h
# Define PHYS_OFFSET (0x30000000UL)
To
# Define PHYS_OFFSET (0xC0000000UL)


6. Crop/customize the kernel
(1) # make menuconfig
(2) Set kernel startup parameters
Boot options ---> Default kernel command string:
Mem = 32 M console = ttySAC0 root =/dev/ram initrd = 0xc0800000, 0x00800000 ramdisk_size = 8192 rw

(3) set CS8900 support
Device Drivers --->
Network device support --->
Ethernet (10 or 100 Mbit) ---> [] CS8900 support
Select [*] CS8900 support
(4) set initrd support
Device Drivers ---> Block devices ---> [] RAM disk support
The following three items must be set:
1. Make sure that RAM disk support is selected
2. Change the Default (4096) Default RAM disk size (kbytes) to 8192;
3. Initial RAM disk (initrd) support must be selected. Remember!
(5) set NFS support
File systems ---> Network File Systems --->
Make sure that the following two items are selected:
[*] NFS file system support
[*] Provide NFSv3 client support
(6) set support for ROM file system
File systems ---> [*] ROM file system support
Ensure that [*] ROM file system support is selected
(7) set ext2 support
File systems ---> [*] Second extended fs support
Ensure that [*] Second extended fs support is selected

7. Compile
# Make
After compilation, there will be a vmlinux in the current directory. This is what we want for the arm-linux kernel.

[1] [2] [3] Next page

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.