Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mips cross compile OS LAB.

Similar presentations


Presentation on theme: "Mips cross compile OS LAB."— Presentation transcript:

1 Mips cross compile OS LAB

2 Mips compiler Mips란 Mips 는 대표적인 risc 계열의 컴퓨터로 고정되고 제한된 opcode를 사용하여 동작하도록 구성 기존의 intel pc와는 동작 구성 자체가 다르므로 mips를 위한 별도의 컴파일이 필요 Linux base로 진행

3 Mips cross compile 환경구성
Compiler 구성 Binutil Collection of binary tools(gcc 구성에서의 기본 툴) Gcc Compiler Gdb Debuger Linux 환경에서 기본으로 제공 하나 mips 옵션에 대한 정의가 되어 있지 않다. 따라서 해당 compiler소스를 통해 compiler를 새로 만들어야 한다.

4 Cross compiler 각각의 소스는 ftp.gnu.org 에서 다운로드 받을 수 있다
wget wget wget 해당 파일을 /tmp에 저장(사용자 권한은 root)

5 Cross compiler 소스의 저장 및 사용경로 설정 export WDIR=/tmp
export TARGET=mipsel-unknown-linux-gnu export PREFIX=/opt/cross Install 경로 설정 export PATH="${PATH}":${PREFIX}/bin 경로 이동 cd $WDIR mkdir ${TARGET}-toolchain && cd ${TARGET}-toolchain

6 Cross compiler Binutil 설치 tar xjfz binutils-2.16.1.tar.gz
mkdir build-binutils && cd build-binutils ../binutils /configure --target=$TARGET --prefix=$PREFIX make make install

7 Cross compiler Gcc 설치 tar xjfz gcc-3.4.4.tar.gz
mkdir build-gcc-bootstrap && cd build-gcc-bootstrap ../gcc-3.4.4/configure --target=$TARGET --prefix=$PREFIX --enable-languages=c --without-headers --with-gnu-ld --with-gnu-as --disable-shared --disable-threads make -j2 make install cd ..

8 Cross compiler Gdb 설치 tar xjfz gdb-6.3.tar.gz
mkdir build-gdb && cd build-gdb ../gdb-6.3/configure --target=$TARGET --prefix=$PREFIX make make install cd ..

9 Cross compiler Compiler 활용
${PREFIX}/bin/mipsel-unknown-linux-gnu-(gcc.. etc) (little endian) Ex> ${PREFIX}/bin/mipsel-unknown-linux-gnu-gcc target_file.c ${PREFIX}/bin/mips-unknown-linux-gnu-(gcc.. etc) (big endian) Ex> ${PREFIX}/bin/mips-unknown-linux-gnu-gcc target_file.c 참고 사이트

10 SPIM SPIM 이란 SPIM 설치 mips chip을 가상으로 만드는 시뮬레이터
Linux 버전을 다운 해당 파일은 유저 프로그램이므로 어느 곳에 설치해도 관계 없다.

11 SPIM tar xvfz spim.tar.gz ./Configure make make install
Spim 설치는 Makefile에 모든 설정이 기본으로 되어 있으므로 별도의 옵션을 설정할 필요가 없다.

12 실행예제

13 실행예제

14 실행예제

15 실행예제

16 실행예제

17 실행예제

18 과제설명 1 bit adder 구현 1 bit adder는 별도의 함수로 구현할 것 1 bit adder의 회로를 구현할 것
자신의 어셈블리 코드를 분석하고 그에 대한 설명 첨부 Input 값의 변화로 인한 Register의 변화부분을 확인 결과 분석 소스코드는 조교에게 메일로 보낼 것(file.c, file.s) 학번_이름_no.tar.gz 의 형태 준수!


Download ppt "Mips cross compile OS LAB."

Similar presentations


Ads by Google