Porting uClinux to nioⅱ under Fedora9

Source: Internet
Author: User
Porting uClinux to NIOSII under Fedora9-general Linux technology-Linux programming and kernel information. The following is a detailed description. To participate in the competition, we need to use the operating system uClinux in our solution. The Development Board is the DE1 Board provided by Altera. Porting uClinux is an essential step. We have been familiar with this system before, but I have never transplanted it myself.

The first step is to use the systems Builder to prepare the hardware and write a small test program to check whether the program runs correctly. It is mainly to test whether your SDRAM and FLASH are available, it should be noted that the FLASH access time must not be too short. I wasted two days for this problem and there was no progress. another important thing to note is that we must set the CPU interrupt vector in SDRAM. This is an important mistake I made at the time. Of course, it doesn't matter if you don't use uClinux. in the first place, I set the vector in the On-chip RAM. As a result, the bare metal program can run normally, but uclinux cannot run either, this small mistake that won't attract attention makes me suffer for a day, but the most important thing I want to talk about now is the compilation error of uClinux, which makes me suffer for a long time.

I am using the Linux ora9 Linux system, and the Altera Development Kit is under WINXP, so I have to stop and restart my computer, switching between the two systems constantly (who makes my machine too bad to run the virtual machine ). download the source code package from www.uclinux.org. Definition, use You can replace several functions of the same function: memset, strchr, strrchr, and memcpy. memset has three parameters, while bzero has only two, set the second parameter of memset to 0 when you replace it. The other three parameters must be replaced by the function name. you can run the following command to find the source files that use these functions (run in the uClinux-dist directory ):

Grep-lr bzero user/

Grep-lr index user/

Grep-lr bcopy user/

Use gedit or vim to open the source files corresponding to each command and replace them with the function mentioned above. save. I almost forgot to mention it. I also encountered another small error, probably because PATH_MAX is not defined. According to the make prompt, find the corresponding source file and add it to the file header:

# Define PATH_MAX 100 // 100 is a random number.

Now that these tasks are done, follow the steps http://blog.ednchina.com/duckfly/35483/message.aspx.

I hope this article will be helpful to my friends who encounter the same errors as me, and hope that experts can explain why others can compile successfully, and I need to modify the source code.

Author brother. abc from http://brother.abc.blog.163.com/

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.