Saturday, June 24, 2006

安裝Simplescalar

1. Download SimpleScalar Tool Set
These can be found on the SimpleScalar website, http://www.simplescalar.com/docs.html

Need the following files before installing:

simplesim-3v0d.tgz
simpleutils-990811.tar.gz
simpletools-2v0.tgz
gcc-2.7.2.3.ss.tar.gz

They can be found at the following locations:

simplesim & simpletools: http://www.simplescalar.com/tools.html
simpleutils: http://www.eecs.umich.edu/mirv/
gcc: http://arch.cs.ucdavis.edu/RAD/gcc-2.7.2.3.ss.tar.gz


2. Untar the source code

Untar the source code into a simplesim directory

mkdir (chosen installation directory) (wherever you want to put this...you 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
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
make sim-tests

Install gcc.

cd $IDIR/gcc-2.7.2.3
./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

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

結果在Suse 10.1雖然能夠安裝成功,不過在後面的configure卻會發生錯誤
之後有請google在一個看都看不懂的德文網站看到有patch可以下載

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

在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 吧(隨然感覺沒啥用處,不過沒差啦)
在終端機登入成root
# cd /usr/src/linux
# make mrproper
# make cloneconfig
# make modules_prepare

最後再清除
kernel source
# make clean


這裡最重要的是OpenGL必須由硬體驅動才行
Got my SUSE Linux 10在終端機打glxinfofglrxinfo 來看你的OpenGL是由誰驅動的
如果是mesa那就不行啦,這時就要裝Ati的驅動程式

驅動程式到Ati網頁找吧 (相信大家的能力)
在安裝時要退出視窗介面,所以在終端機用root登入輸入# init 3
到你儲存的目錄下把package解出來,因為我的電腦是AMD64所以輸入
# sh ./ati-driver-installer-8.24.8-x86_64.run –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
看看OpenGL的驅動程式是否已經變成由Ati了

有的話舊是快成功啦
到控制中心的Desktop Effects Setting把Xgl啟動(應該會叫你重新登入)
登入後就會看到軟綿綿的視窗啦!
我的電腦用X200這種爛爛的顯示卡都跑的順順順