Recently, I learned about the mini2440 driver. The first step is to port the kernel. I 've done it before and forgot about it. Now I want to write it down for future use !!
(1) Configure TFTP first:
1. sudo apt-Get install TFTP-HPA tftpd-HPA
Sudo apt-Get install xinetd
2. CD/
Sudo mkdir/tftpboot
Sudo chmod 777/tftpboot
3. Open the/etc/xinetd. d/directory/
Create File TFTP
TFTP content:
Service tftp
{
Disable = No
Socket_type = dgram
Protocol = UDP
Wait = Yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-S/tftpboot-C
Per_source = 11
CPIs = 100 2
}
4. Restart the service:
Sudo/etc/init. d/xinetd restart
5. test:
CD/tftpboot
Touch Test
Create a file
. CD/home/usrname
Log on to another directory
. TFTP 127.0.0.1
> Get/tftpboot/test
If there is a test file in your current directory, the configuration is successful.
(2) NFS configuration:
NFS installation (1)
Apt-Get install nfs-kernel-Server
Apt-Get install Portmap nfs-common
(2)
Edit/etc/exports
/Nfsboot * (RW, sync, no_root_squash)
(3)
Create the nfsboot directory and modify the attributes of the mount point.
Sudo mkdir nfsboot in the root directory
Sudo chmod 777/nfsboot
(4)
Restart NFS
Sudo/etc/init. d/nfs-kernel-server restart
Sudo/etc/init. d/Portmap restart
(5)
Test on Local Machine
Showmount-e
Iii. configuration of minicom
Because I use a notebook, I need to use USB to serial port:
Installation:
Sudo apt-Get install minicom
Configuration:
1. Enter minicom in the terminal to start minicom;
2. Press Ctrl + A to open it, and then press o to display the configuration menu.
3. select Serial Port setup. In "change which setting", type "A" and move the cursor to the corresponding position of item A: ttys0 for serial port COM1, com2 corresponds to ttys1. (select)
The specific configuration information is as follows:
Serial Port setup [enter]
+ ------------------------------------------------------------- +
| A-serial device:/dev/ttyusb0 |
| B-lockfile location:/var/lock |
| C-callin program: |
| D-callout Program-: |
| E-bps/PAR/bits: 115200 8n1 |
| F-hardware Flow Control: No |
| G-software flow control: No |
|
| Change which setting? |
+ -------------------------------------------------------------
Save setup as DFL and exit
IV:
Next, compile the kernel:
Bytes
1. Install the cross-compilation environment
# Tar jxvf arm-linux-gcc-4.4.3.tar.gz
#/Home/huangjin/opt/friendlyarm/toolschain/4.4.3/bin
# Ls
# Vi ~ /. Bashrc
Add this path to the PATH environment variable and add the following ~ /. Bashrc STARTUP script:
Export Path = $ path:/home/huangjin/opt/friendlyarm/toolschain/4.4.3/bin
(Then you must get the source ~ /. Bashrc. I forgot this step when I did it, which leads to incorrect compiling environment)
Arm-Linux-gcc-V
Arm-Linux-GCC hello. C-O hello
2. Compile the kernel
Decompress:
Linux-2.6.32.2-mini2440-20110413.tar.gz
Go to the kernel directory:
~ $ Linux-2.6.32.2 CD
First modify makefile and find
Arch
? = $ (Subarch)
Cross_compile? =
Change
Arch
? = Arm
Cross_compile? = Arm-Linux-
Note arch? = There must be no space after arm. Make sure that the space is deleted and do not miss the arm-Linux-end.
"-" At the end. Next, apply the patch to the kernel (note that do not duplicate the patch ):
~ /Linux-2.6.32.2 $ patch-P1 <../patch-2.6.27-aka
Paych-2.6.27-aka online seems to have, I want a friend
(Confirm
Your host has the libncurses-dev package installed ).
Sudo apt-Get install ncurses-Dev
Note: You can only apply patches once.
Then there is a config_mini2440_w35 file in the kernel directory. I use this file because I am a w35 screen,
CP config_mini2440_w35. config
Use menuconfig to customize the kernel
~ Linux-2.6.32.2 $ make menuconfig
View the following options in the configuration menu (some of which are selected by default ):
1. Select nwfpe math emulation in floating point emulation. Because ARM920T has no floating point
The coprocessor and floating point number commands must be simulated using other commands.
There are two ways to simulate floating-point commands: one method, as mentioned earlier, enables the cross compiler to support
Soft-float,
That is, the simulation command is automatically generated when a floating point operation in the C code is encountered,
Another method is cross-encoding.
The interpreter still generates floating point operation commands (for ARM platforms, which refer to coprocessor commands). However, ARM920T does not have floating point coprocessor commands.
Processor, unable to recognize floating point commands, thus generating an undefined exception, this floating point emulation
The kernel option is to simulate floating point operations in the undefined exception handler.
That is to say,
Here we use
Non-soft-float cross compiler and floating point simulation in the kernel.
This operation is more efficient than using soft-float.
Low compilation, because every floating point operation requires handling exceptions and entering the kernel, but the compatibility is good so that we can use other
Compiled programs.
2. Select File Systems-> pseudo filesystems->/proc file system support; sysctl
Support (/proc/sys); sysfs file system support and virtual memory File System
Support (former shm fs); tmpfs POSIX access control lists. /Proc file system
(Or procfs) is the interface provided by the kernel to the user program. Many Linux programs need to read in procfs.
Write data, such as busybox. Therefore, this option is generally indispensable. Virtual Memory File System (or
Tmpfs) is used for memory Virtual Disks. We will mount a tmpfs to/dev when working on the root file system.
Directory.
3. You do not need to change the boot options-> default kernel command string because
The kernel startup parameters Replace the settings here.
4. Select Device Drivers-> network device support-> Ethernet (10 or 100 Mbit)->
Cs8900a support, added support for the NIC chip. Choose file systems> network file systems.
Select NFS client support, client support for NFS version3, and client support from the menu.
NFS
NFS
For the nfsv3 ACL protocol extension and root file system on NFS.
5. Select device drivers> memory technology devices (MTD)> MTD partitioning.
Support, in Device Drivers-> memory technology devices (MTD), select the NAND Device
Support and its NAND Flash Support for S3C2410/S3C2440 SOC; S3C2410 NAND driver
Debug, do not select S3C2410 NAND hardware ECC, because the ECC code algorithm generated by the S3C2410 hardware and I
Are inconsistent.
6. Select yaffs2 file system support from file systems> miscellaneous filesystems;
Auto select yaffs2 format; cache short names in ram, and then select compressed ROM file
System Support (cramfs ).
7. Select support for frame buffer devices from Device Drivers-> graphics support,
Then select the Enable firmware edid under it; Enable video mode handling helpers; S3C2410
LCD framebuffer support. Virtual Frame Buffer support is not selected because it is used for debugging.
Virtual Device Driver instead of the actual hardware driver. If the bootup logo is selected
During framebuffer initialization, the Linux penguin logo will be displayed on the screen. This is the testing framebuffer driver.
The most direct method for normal operation. The bootup logo has three specifications. Our Development Board supports VGA output and can
Select a beautiful 224-color logo.
8. Select support for host-side USB from Device Drivers-> USB support, and then select OHCI
HCd support, select the mouse interface in Device Drivers-> input device support, and set
Set the screen resolution horizontal screen resolution and vertical screen resolution to 1024 and
768.
9. Select Device Drivers-> real time clock-> set system time from RTC on startup and
Resume;/sys/class/RTC/rtcn (sysfs);/proc/driver/RTC (procfs for rtc0);/dev/rtcn
(Character devices); test driver/device.
10. If you do not want to generate a large number of Pseudo Terminal Device Files in the/dev directory, You Can deselect Device Drivers->
Character devices-> legacy (BSD) Pty support.
After the configuration is complete, use the make command to compile the kernel. This process takes a long time.
~ /Linux-2.6.32/ARCH/ARM/boot/zimage. Download the self-compiled kernel to the Development Board to see if the system is correct.
Always start.