Build a Sylixos development environment on your Mac

Source: Internet
Author: User
Tags git clone

Mac Environment Development Guide
1. Scope and limitations
This document is for SylixOS engineers who are considering developing on a Mac. At present, the SylixOS integrated development environment does not support Mac. The current processing method in this article cannot really realize the development process on Mac.

2. Download the SylixOS source code
Open a terminal and create a directory named sylixos_workspace (the following convention stipulates that this directory is the / home / user / sylixos_workspace directory, which is ~ / sylixos_workspace):

cd ~
mkdir sylixos_workspace

Enter this directory and enter the following commands to download SylixOS Base project, mini2440 development board BSP project, example project, etc .:

cd sylixos_workspace
git clone http://git.sylixos.com/repo/sylixos-base.git
git clone http://git.sylixos.com/repo/bspmini2440.git
git clone http://git.sylixos.com/repo/examples.git
git clone http://git.sylixos.com/repo/tools.git
git clone http://git.sylixos.com/repo/qemu-mini2440.git

sylixos-base is the SylixOS Base project, which contains the libsylixos and libcextern subprojects. Enter the following commands to initialize and update the subprojects:

cd sylixos-base
git submodule init
git submodule update
cd ..

3. Install the cross compiler
The download address of the cross compiler is: https://launchpad.net/gcc-arm-embedded/+download
Go to the above website and download the Mac version of the compiler.
Enter the following command to extract it to the / usr / lib directory:

sudo tar jxvf gcc-arm-none-eabi-5_4-2016q3-20160926-mac.tar.bz2 -C / usr / lib

Enter the following command to rename the decompressed directory to the / usr / lib / gcc-arm-none-eabi directory (to avoid compiler upgrades and unnecessary problems caused by changes in version number and date):

sudo mv / usr / lib / gcc-arm-none-eabi-5_4-2016q3 / / usr / lib / gcc-arm-none-eabi

Since SylixOS modified the compiler's reent.h file, using the compiler's own reent.h file will not compile successfully, you need to copy ~ / sylixos_workspace / tools / arm-none-eabi-patch / 4.9 / reent.h file Go to the / usr / lib / gcc-arm-none-eabi / arm-none-eabi / include / sys directory to replace the original file.
Back up the original reent.h file of the compiler before replacing:

sudo mv /usr/lib/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h / usr / lib / gcc-arm-none-eabi / arm-none-eabi / include / sys /reent.h.bak

Then replace the original reent.h file of the compiler:

sudo cp ~ / sylixos_workspace / tools / arm-none-eabi-patch / 4.9 / reent.h
/ usr / lib / gcc-arm-none-eabi / arm-none-eabi / include / sys

To facilitate subsequent use, modify the environment variable PATH:

sudo vi ~ / .bash_profile

Add the following command:

export PATH = / usr / lib / gcc-arm-none-eabi / bin: $ PATH

Finally restart the terminal and enter arm-none-eabi-gcc. If you get the following result, the compiler is successfully installed:

sean-xps: ~ sean $ arm-none-eabi-gcc arm-none-eabi-gcc: fatal error: no input files compilation terminated. sean-xps: ~ sean $ 12345
4. Terminal compile SylixOS Base project
The sylixos-base project contains the SylixOS operating system libsylixos and the SylixOS process C library libextern sub-project.
Open config.mk under sylixos-base and modify it as shown in Listing 4-1.

              Program list 4-1 config.mk modify operation

# ************************************************* ***************************** # SylixOS Base Project path # *************** ************************************************** ************* SYLIXOS_BASE_PATH = / home / user / sylixos_workspace / sylixos-base # ************************ ************************************************** **** # Toolchain prefix # ********************************************** ************************************ TOOLCHAIN_PREFIX = arm-none-eabi- # ***** ************************************************** *********************** # Debug options (debug or release) # ****************** ************************************************** ********** DEBUG_LEVEL = debug
Enter the make command to compile:

make
The time it takes to compile depends on the performance of your machine. After the above configuration, use Mac to compile, and it usually takes 3 to 4 minutes to compile. It can be seen that the compilation speed under Mac is obviously better than Windows platform.

If the Base project of SylixOS is successfully compiled, finally the libsylixos subproject generates static library files libsylixos.a and libdsohandle.a and libvpmpdm.a, dynamic library files libvpmpdm.so, kernel modules xinput.ko and xsiipc.ko, and symbol table files symbol. c and symbol.h (located in the / home / user / sylixos_workspace / sylixos-base / libsylixos / Debug directory).

The libextern subproject generates the static library file libcextern.a and the dynamic library file libcextern.so (located in the / home / user / sylixos_workspace / sylixos-base / libcextern / Debug directory).

However, although the environment with the current configuration is used, the completion of the make command prompts that the compilation is complete, but it cannot compile and generate all the above files. The specific reasons are described below.

5. Build Development Environment with Ecplise
The installation of Ecplise on Mac will not be repeated in this article, you can refer to the relevant content on the Internet.

5.1 Install Zylin CDT
Open "Help" in eclipse menu bar and select "Install New Software" option


Then enter http://opensource.zylin.com/zylincdt in the input box behind "work with", and then click the "ADD" button, then eclipse will automatically find the software package, after the search is complete, the following interface appears, and then select the plugin . Click "next", when the installation agreement appears, click agree, and finally click "finish", and wait for the installation to complete, because the process is to download and then install, if the network is not good, the waiting time will be longer.

5.2 Import the project and set the compilation tool chain
Import the Base project downloaded from the official website git into Eplipli. There are many ways to import here. It is recommended that the reader first create an empty project, and then copy the entire Base file to the created empty project. This makes it easy to customize the compilation toolchain.

After the project is imported, set the cross-compilation tool chain installed above in the project property bar

5.3 Compile Base Project
After the above operations are completed, right-click the project and select "build Project" to compile the Base project.auto; "/>

                                Figure 5-4 Ecplise compilation results

The results show that the project compiled with Ecplise has not been completely successful. Looking at the console prompts that the script file for the environment variable was not found. This also leads to unsuccessful compilation.

In summary, the reason why the above two methods failed to compile on Mac is that the makeymbol.bat script file is used to generate the symbol table when compiling under Windows, but the bat script file cannot be run under the Mac environment, so think To build SylixOS development environment on Mac, you must rewrite the makesymbol script file. From the results of the compilation of Ecplise, the rest of the compiled content in the Makefile is basically executed. If you rewrite this script file, you can realize the basic development of SylixOS under Mac.



This article is from the "11451177" blog, please keep this source http://11461177.blog.51cto.com/11451177/1975462

Build SylixOS development environment on Mac

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.