1. 程式人生 > >虛擬實驗室eCos開發環境的配置 (Linux)

虛擬實驗室eCos開發環境的配置 (Linux)

1.下載eMBosLab釋出的eCos原始碼

安裝水銀程式碼管理工具

sudo apt-get install mercurial

下載emboslab ecos程式碼

hg clone http://emboslab.hg.sourceforge.net:8000/hgroot/emboslab/ecos-emboslab /opt/ecos/ecos-hg

" /opt/ecos/ecos-hg" 表示你需要放置的目錄,請自行設定

2.下載eCos最新ARM編譯器

點選 arm-eabi 得到 arm eabi的編譯器,解壓到 /opt/ecos/gnutools/arm-eabi/

“/opt/ecos/gnutools/arm-eabi/" 可以根據你的需要而更改

3.配置環境變數

將以下兩句加到你ubuntu的~/.profile的最下面

(如果是fedora請加到~/.bashrc中)

解釋一下:第一行表示把編譯器加到系統的PATH中,第二行為ecos的配置工具提供ecos的安裝位置

export PATH=$PATH:/opt/ecos/gnutools/arm-eabi/bin

export ECOS_REPOSITORY=/opt/ecos/ecos-hg/packages

4.安裝ecos到Linux

mkdir temp

cd temp

/opt/ecos/ecos-hg/configure

make

sudo make install

這樣系統中就有了ecosconfig的命令列配置工具和synthetic api模擬工具了。

3.編譯eCos圖形配置工具

2)編譯wxGTK

解壓:

mkdir ~/src

cd ~/src

bunzip2 -c wxGTK-2.8.8.tar.bz2 | tar xf -

cd wxGTK-2.8.8

配置wxGTK:

mkdir ~/wx-build
cd ~/wx-build
$HOME/src/wxGTK-2.8.8/configure --disable-shared /
    --disable-sockets --prefix=$HOME/wxGTK-2.8.8
make
make install

3)編譯配置ecos的host工具庫給圖形配置工具用:

mkdir ~/infra-build
cd ~/infra-build
/ecos/ecos-hg/host/configure --prefix=$HOME/ecos-tools
make
make install

4)編譯圖形配置工具:

mkdir ~/configtool-build
cd ~/configtool-build
make -f /opt/ecos/ecos-hg/host/tools/configtool/standalone/wxwin/makefile.gnu /
    install WXDIR=$HOME/wxGTK-2.8.8 ECOSSRCDIR=/opt/ecos/ecos-hg/host /
    INSTALLDIR=$HOME/ecos-tools

這樣就可以在ecos-tools目錄得到configtool工具了

4.下載並編譯 eMBosLab釋出的MINI2440 QEMU軟體模擬器

git clone git://emboslab.git.sourceforge.net/gitroot/emboslab/qemu-mini2440

下載以後會有qemu-mini2440的目錄,還需要切換到ecos-emboslab這個分支

git checkout -b ecos-emboslab remotes/origin/ecos-emboslab

./configure --target-list=arm-softmmu

make

然後就可以在arm-softmmu的目錄中得到一個qemu-system-arm的可執行檔案,我們需要的模擬器就是他。

不需要安裝copy出來就可以。

5.編譯redboot來測試qemu

編譯redboot for mini2440

mkdir mini2440_redboot

cd mini2440_redboot

命令列配置方法

ecosconfig new mini2440 redboot

ecosconfig tree

make

圖形介面配置方法:

模擬redboot

qemu-system-arm -M mini2440 -kernel install/bin/redboot.elf  -serial stdio -show-cursor

應該能看操作終端和LCD的redboot畫面了,目前的輸入只能通過終端完成

S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
QEMU mini2440_reset: loaded kernel install/bin/redboot.elf at 0x30000000
S3C: CLK=240 HCLK=60 PCLK=30 UCLK=57
S3C: CLK=400 HCLK=100 PCLK=50 UCLK=57
S3C: CLK=400 HCLK=100 PCLK=50 UCLK=48
+
RedBoot(tm) bootstrap and debug environment [QEMU]
Non-certified release, version UNKNOWN - built 21:51:48, May 20 2011

Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
RedBoot is free software, covered by the eCos license, derived from the
GNU General Public License. You are welcome to change it and/or distribute
copies of it under certain conditions. Under the license terms, RedBoot's
source code and full license terms must have been made available to you.
Redboot comes with ABSOLUTELY NO WARRANTY.

Platform: MINI2440 system (ARM9)
RAM: 0x00000000-0x03600000 [0x00025e10-0x03600000 available]
RedBoot>