MIT OS 1. Tools and soft

来源:互联网 发布:isis base软件下载 编辑:程序博客网 时间:2024/05/06 22:32

课程主页:http://pdos.csail.mit.edu/6.828/2010

环境配置:

MIT的JOS实验采用Git作为版本管理软件。而我们只需要在本地(自己电脑)做实验。不需要登录课程的服务器,检查也可在本地进行。

 获取源码:  git clone http://pdos.csail.mit.edu/6.828/2010/jos.git lab

软件安装:

1.官网用的GCC是4.5版本,而Ubutnu10.10自带GCC4.4.5。为了避免以后出现人品事件,少在软件兼容性上浪费时间,决定编译GCC4.5~~

   (PS。测试gcc4.1会遇到“无法识别-Wno-overlength-strings”的错误。 GCC4.3测试没有问题。)

2.一些基本的tar m4 grep bison……基本软件能先装上的装上:

  sudo apt-get install m4 tar bison gawk build-essential dejagnu zip gcc g++ libc6-dev libc6

   这些包是必需的,后面安装GCC时,如果缺少这些包会有很多很怪异的错误。

   所需软件以及版本参考LFS要求。http://www.linuxfromscratch.org/lfs/view/stable/prologue/hostreqs.html (上面的要求比较完整和严格,不一定完全符合)

3.为了避免每次输入一些固定路径,添加环境变量在 .bashrc里。诸如软件安装地点,工作目录等~~

4.按照官网安装GCC GDB

5.通过apt get安装的QEMU有个小Bug,采用官网上的QEMU版本,重编译。 

Tips:如果是64bit的OS,出现的错误比较多,并非不可,只是花时间又不值得,花了很久才搞定,呜呼~~。 现在又换到32bit环境作了,啊哈!

后面附带history的操作,以供参考。

Error Occur:

1.GMP MPFR MPC 缺少: 

可从LFS包中获得源码  download here  或者直接:

ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.bz2

http://www.mpfr.org/mpfr-current/mpfr-2.4.2.tar.bz2

http://www.multiprecision.org/mpc/download/mpc-0.8.2.tar.gz

Useful link:

   http://www.linuxfromscratch.org/lfs/view/development/chapter06/gmp.html

    http://www.linuxquestions.org/questions/linux-from-scratch-13/i-have-an-error-building-gcc-requires-gmp-4-1-and-mpfr-2-3-0-a-690426/

    http://hi.baidu.com/ldg__2050/blog/item/4b0fb514d96a675df3de32d7.html

   Tips: 那些check做的很慢,如果时间有限,可以不做。

2.如果上面的软件包齐全且版本正确的话,基本不会有大问题。

   途中遇到一个问题:

configure: error: cannot compute suffix of object files: cannot compile

See `config.log' for more details.

make[2]: *** [configure-stage1-target-libgcc] Error 1

   这个是否会因为其他原因也导致不得而知。我做的时候是因为刚才安装的GMP三个包的动态链接库未加载引起。 (通过编译安装的软件默认路径为/usr/local,我不喜欢,换成自定义的文件夹。因而实验的时候,需要把自定义文件夹中lib文件夹加到连接搜索路径。

    解决方法:  sudo ldconf -c self-libc.conf  ###其中self-libc.conf包含自定义LIB路径。

GCC安装完成~~

3。安装Qemu的时候出现: need glib2.0: 解决方法:

直接安装相应的包libglib2.0-dev  或者自己编译: http://blog.csdn.net/banyao2006/article/details/7352779

 History:


## some line of cmd histroy

  532  tar xvf binutils-2.20.1.tar.bz2 

  534  cd binutils-2.20.1/

  536  ./configure  --prefix=$SOFT--target=i386-jos-elf --disable-nls

  539  make -j4

  540  make install 

  542  cd ..

  553  tar xvf gmp-5.0.1.tar.bz2 

  554  cd gmp-5.0.1/

  556  ./configure --prefix=$SOFT 

  557  make -j4 && make check

  558  make install

  560  cd ..

  562  tar xvf mpfr-3.0.0.tar.bz2 

  563  cd mpfr-3.0.0/

  564  ./configure --prefix=$SOFT --with-gmp=$SOFT

  565  make -j4 && make chech -j4 && make install

  567  cd ..

  569  tar xvf mpc-0.8.2.tar.gz 

  570  cd mpc-0.8.2/

  572  ./configure  --prefix=$SOFT --with-gmp=$SOFT --with-mpfr=$SOFT

  573  make -j4 && make check -j4 && make install

  575  cd ..

  603  mkdir gcc-build

  604  cd gcc-build/

  605  ./../gcc-4.5.1/configure --prefix=$SOFT --target=i386-jos-elf --disable-nls --without-headers --with-newlib --disable-threads --disable-shared --disable-libmudflap --disable-libssp  --with-gmp=$SOFT --with-mpfr=$SOFT --with-mpc=$SOFT

  606  make -j4

  619  make install

  623  cd ..

  626  cd qemu-0.12.5-6828/