Linux is very common in embedded development. Let's take a look at some settings of this system. Here we will mainly explain the Linux NFS settings. Hope to help you. Preparation: A REDHAT9.0 installed PC, a set of LJD2410-I Development Board, PC installed with LJD2410 software package, if we through Linux NFS to load the file system
/LJD2410/root_dir/root_china
If config eth0 192.168.1.100 // set the IP address of PC linux: 192.168.1.100,
If config eth0 192.168.1.10 // Development Board IP: 192.168.1.10
We need to reconfigure and compile the kernel to enable the Linux NFS file system function of the Development Board. The specific steps are as follows:
Modify the kernel/arch/arm/def-configs/smdk2410 configuration file
Set CONFIG_CMDLINE = "root =/dev/mtdblock2 noinitrd init =/linuxrc
Console = ttyS0 "changed to CONFIG_CMDLINE =" root =/dev/nfs rw
Nfsroot = 192.168.1.100:/LJD2410/root_dir/root_china noinitrd
Init = linuxrc console = ttys0 ip = 192.168.1.10"
Run make menuconfig to enter the configuration menu and load the configuration file SMDK2410.
Select the Load an Alternate Configuration File and enter the path and File name of the Configuration File to add Kernel support for Linux NFS:
Select networking options-> IP: kernel level aulow.alion.
Select the root file system on nfs and nfs file system support under file systems-network file systems-to re-compile the kernel and download bootloader and kernel to the Development Board. Now, the development board settings have been completed.
PC settings:
We must enable the Linux NFS service on the PC. The specific settings are as follows:
1. Run setup in the LINUX Command Line, select the nfs service in system services, and save and exit.
2. Set the shared directory on the PC to run vi/etc/exports, add a line in it:/LJD2410/root_dir/root_china (rw), save and exit, And/and rw should have spaces
(/LJD2410/root_dir/root_china is the shared directory, and rw is the read/write permission ).
3. Run/etc/rc. d/init. d/nfs restart to restart the nfs service.
4. In order not to start the nfs service every time we start the system, we set/etc/rc. d/init. d/nfs restart is added to/etc/rc. d/rc. local, the nfs service will be enabled when the PC starts.
5. Test the NFS service:
After the settings are complete, you can perform a test on the local machine. If the local IP address is 192.168.1.100, you can use mount 192.168.1.100:/LJD2410/root_dir/root_china/mnt. If the mount is successful, in the/mnt directory, you can see the contents under root_china.
6. Modify the root_china/usr/etc/rc. local file and set the IP address of the Development Board to 192.168.1.10.
Now, the settings of the Development Board and PC have been basically completed. If the application we have debugged on the PC has been placed under the/root_china embedded file system, we can use the network to connect the Development Board and PC, the Development Board is powered on, the system starts to run and you can enter the familiar Linux interface by running the linux NFS Network File System. after debugging the program, you only need to put the compiled program under the root_china directory, and the Development Board does not need to be burned.