Finally, we need to develop the linux Device Driver.

Source: Internet
Author: User
Finally, we need to develop the linux Device Driver-general Linux technology-Linux programming and kernel information. The following is a detailed description. The first step is to build a development environment. Because the target machine is ARM2410, GCC is required. Although cygwin and other tools on the Windows platform can simulate the Linux environment, it is said that there are many problems, if the problem persists, simply go to the Linux platform.

I used Vmware to install Redhat9.0 to build a cross-compilation environment. Later, I still felt that it was too slow. It took more than five hours to compile the cross-tool chain. With the help of his colleagues who have been using linux for five years, he was eager to uninstall vmvare, directly install Linux, and use Linux as the host workstation.

The Fedora 9 selected for the Linux release version is quite easy to install because of the dizzy interface. As long as you understand the file system required by Linux, a 2 GB swap space, in addition, you can use the ext3 format. It takes about 40 minutes to install it. After the installation is complete, you also need to upgrade some software, map the Winxp disk, and finally install a Very dazzling window management tool and 3D effects.

Then we started to build the cross-compilation tool chain. Because we had previously built the tool on a virtual machine, we still used the same method to use the crosstool tool for automatic compilation, in this way, you only need to select the version to be compiled, download glibc and gcc of the corresponding version, modify several configuration files, and run demo_arm9tdmi.sh to make a cup of tea, compilation is complete. Under normal circumstances, it may take about one hour to download the corresponding database. Otherwise, crosstool will automatically use wget for download, which is quite slow. However, this compilation was not as smooth as it was previously on the virtual machine, and encountered several problems in the middle. For example, the environment variable settings were incorrect, and the target directory did not have the permission to be created, fortunately, these problems are well solved according to the error prompts. The only strange error is about the gcc version, which I have never encountered before when compiling on a VM. Later, I Googled and finally found that I installed the gcc ora 9 gcc version too new, so I downloaded a gcc3.4.6 on the Internet to install it and re-compile it. The result is still an error. Based on the debugging information of the program, it is found that the local gcc is automatically selected when the script is run. Finally, locate the error and change CC = gcc in crosstool. sh to CC = gcc34 to solve the problem.

Next, we should learn to write makefile and compile and transplant the kernel. After all, we are just getting started and there are still a lot of things to learn. We strive to write down all the problems and solutions we have encountered. First, we are afraid that we will forget them, and second, we can help other new users make detours. Linux is profound and requires everyone to learn together to make it faster.
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.