Saturday, June 24, 2006


1. Download SimpleScalar Tool Set
These can be found on the SimpleScalar website,

Need the following files before installing:


They can be found at the following locations:

simplesim & simpletools:

2. Untar the source code

Untar the source code into a simplesim directory

mkdir (chosen installation directory) (wherever you want to put can name it whatever)
tar xzvf (the z flag unzips a gzip file as well as untars it....
if you have straight tar files then use tar xvf )

In simpetools-2v0.tgz, there is a gcc-2.6.3 compiler. Since we don't need this, delete it.

rm -rf gcc-2.6.3

3. Install

(在Suse10.1的安裝光碟理好像沒有這個檔案,我是從Fedora Core5的光碟借來用的)
Check gcc version by entering "gcc -v". GCC 4.x will cause "invalid lvalue in increment" error
while installing gcc.
GCC 3.2 are included with the Fedora Core 4 installation CD or DVD.
Make sure to have the following RPM's installed.

For CD compat-gcc-32 (On disk 3)
compat-gcc-32-c++ (On disk 4)

Setup environment variables for easy install.

export HOST=i386-*-linux
export IDIR=/home/(your-login-name)/(chosen installation directory)

Install simpleutils.

cd $IDIR/simpleutils-990811
./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIR
make install

(在Suse10.1會出現這個問題,不過在Fedora Core5就不會)
NOTE: about "../../src/ld/ldlex.l:577: error: `yy_current_buffer' undeclared (first use in this function)"
If you are getting `yy_current_buffer' undeclared errors, you are using a version of flex
which is too new, and buggy (for example 2.5.31).
We advise to uninstall flex and install the 'flex-old' package as a workaround)

Install simplesim.
cd $IDIR/simplesim-3.0
make config-pisa
make sim-tests

Install gcc.

cd $IDIR/gcc-
./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIR
make LANGUAGES="c c++" CFLAGS="-O3" CC="gcc32"
make install LANGUAGES="c c++" CFLAGS="-O3" CC="gcc32"

NOTE: If GCC 3.2 are not installed previously, replacing CC="gcc32" with CC="gcc".

NOTE: At some point, the make will fail due to an error and stop compilation.
The followings changes should cause the make to complete successfully.
Some files are set to be read only, changing the parperity if the file need to be modified.

1. Open insn-output.c in a text editor. Ensure that all multi-line quotes that
are broken over several lines are properly escaped using the correct escape
character. In this case V "\".

2. On line 35 of objc/sendmsg.c, add the following "#define STRUCT_VALUE 0"

3. find "stdio.h" ($IDIR/sslittle-na-sstrix/include) at the right place in that file and delete __NORETURN

4. gcc/obstack.h, line 341. delete "(void **)" becomes "*(__o->next_free)++ = ((void *)datum); \"

5. gcc/cxxmain.c, line 2978. disable this line

6. One line 60 of protoize.c, replace the "#include " with
"#include ".

4. Verify

First verify that simplesim is installed correctly.

cd $IDIR/simplesim-3.0
./sim-outorder tests-pisa/bin.little/test-math

If results are generated from this, simplesim is most likely installed correctly.

Next verify that the cross-compiler is working. Create a basic C program (like the "hello world" program), name
it test.c, and place it in a new directory called dev.

cd $IDIR
mkdir dev
cd dev
(create test.c and place in $IDIR/dev)
cd $IDIR
bin/sslittle-na-sstrix-gcc -o test dev/test.c
simplesim-3.0/sim-outorder test

If some errors like "syntax error before ..." occur, sslittle-na-sstrix/include/stdlib, line 43,44, change into #define __NORETURN
and #define __CONSTVALUE

If results are generated from this, the cross compiler is most likely installed correctly.

Saturday, June 17, 2006


雖然是一年前拍的 XD

安裝VMware Workstation

這還是第一次在Linux下用VMware來裝XP (誰叫Linux下類似visio的軟體不好用)

結果在Suse 10.1雖然能夠安裝成功,不過在後面的configure卻會發生錯誤

不過要用到全螢幕還需要做設定 研究中....

在Suse10.1 使用Ati顯示卡裝Xgl

很多人看到有Xgl的3D桌面才跑來裝Suse (我就是...)
Got my SUSE Linux 10不過以為只要把 Xgl/Compiz 這兩個套件給裝了就能看到炫麗的桌面....

首先你要先裝好Suse10.1 (我承認這句是廢話...)
Got my SUSE Linux 10之後在裝Xgl之前還要先裝1. kernel-source 2.gcc 3. make 還有 Xgl/Compiz

kernel modules 吧(隨然感覺沒啥用處,不過沒差啦)
# cd /usr/src/linux
# make mrproper
# make cloneconfig
# make modules_prepare

kernel source
# make clean

Got my SUSE Linux 10在終端機打glxinfofglrxinfo 來看你的OpenGL是由誰驅動的

驅動程式到Ati網頁找吧 (相信大家的能力)
在安裝時要退出視窗介面,所以在終端機用root登入輸入# init 3
# sh ./ –buildpkg SuSE/SUSE101-AMD64
# rpm -ihv fglrx64_6_9_0_SUSE101-8.23.7-1.x86_64.rpm

# ldconfig

ot my SUSE Linux 10 執行 # aticonfig –initial –input=/etc/X11/xorg.conf
Got my SUSE Linux 10 # sax2 -r -m 0=fglrx

到這裡驅動程式就安裝完成啦 重新啟動吧!

Got my SUSE Linux 10重開機後檢查 fglrxinfo

到控制中心的Desktop Effects Setting把Xgl啟動(應該會叫你重新登入)