Git Product home page Git Product logo

nju-ics-pa's Introduction

NJU ICS2018 Programming Assignment

This are the sources code of my programming assignment of ICS2018 courses. It contains ALL contents from PA1 to PA4.

  • NEMU
  • Nexus-AM (x86-nemu, x86-navy, native)
  • Nanos-lite
  • Navy-apps

The core of this project is Abstract Machine.

AM = TRM + IOE + CTE + VME + MPE

  • TRM Turing Machine
  • IOE I/O Extension
  • CTE Context Extension
  • VME Virtual Memory Extension
  • MPE Multi-Processor Extension

The final architecture is

Type Item
Hardware (CPU and devices) NEMU
Abstract Machine x86-nemu-am
Libs on AM klib
OS Nanos-lite
Libs on OS libc, libndl, libos
Virtual Machine x86-navy-am
Apps on VM typing-am,...

Run

Environment

  1. Use Debian 9 for basic OS
  2. Install and update tools
apt update

apt install build-essential    # build-essential packages, include binary utilities, gcc, make, and so on
apt install man                # on-line reference manual
apt install gcc-doc            # manual for GCC
apt install gdb                # GNU debugger
apt install git                # reversion control system
apt install libreadline-dev    # a library to use compile the project later
apt install libsdl2-dev        # a library to use compile the project later
apt install qemu-system-x86    # QEMU

NEMU

Enter nemu/ directory, and use these commands:

# Compile
make

# Clean
make clean

# Run
make run

# Debug with gdb
make gdb

To change running mode, add these codes in nemu/include/common.h

#define DEBUG
#define DIFF_TEST

AM

Use __NATIVE_USE_KLIB__ in nexus-am/libs/klib/include/klib.h to enable klib on native-am.

CPU Tests

Enter nexus-am/tests/cputest/ directory, and use these commands:

# Run dummy on x86-nemu
make ARCH=x86-nemu ALL=dummy run

# Run dummy on native
make ARCH=native ALL=dummy run

To run all tests, enter nemu/ and use this:

bash runall.sh

Device Tests

# Serial port
cd nexus-am/apps/hello/
make ARCH=x86-nemu run

# Timer
cd nexus-am/tests/timetest/
make ARCH=x86-nemu run

# Keyboard
cd nexus-am/tests/keytest/
make ARCH=x86-nemu run

# VGA
cd nexus-am/tests/videotest/
make ARCH=x86-nemu run

Benchmarks

Disable DEBUG and DIFF_TEST, and enter nexus-am/apps/ directory, then use these commands:

cd dhrystone
make ARCG=x86-nemu run

cd coremark
make ARCG=x86-nemu run

cd microbench
make ARCG=x86-nemu run
# Use TEST test cases
make INPUT=TEST
make ARCG=x86-nemu run

AM-Apps

# Slider
cd nexus-am/apps/slider/
make ARCH=x86-nemu run

# Typing game
cd nexus-am/apps/typing/
make ARCH=x86-nemu run

Nanos-lite

Enter nanos-lite/ directory. Every time you change target AM, you need to update ramdisk first.

# Update ramdisk
make ARCH=x86-nemu update
make ARCH=native update

# Run
make ARCH=x86-nemu run
make ARCH=native run

Attention: To run PAL, it needs game data from course website.

Tests

Load one of these apps when Nanos-lite started. (At nanos-lite/src/proc.c). Their source codes are in navy-apps/test.

/bin/bmp
/bin/dummy
/bin/events
/bin/hello
/bin/text

Final

cd nanos-lite
make ARCH=x86-nemu update
make ARCH-x86-nemu run

It load /bin/hello, /bin/pal, /bin/slider-am, /bin/typing-am. You can press F1, F2, F3 to change the foreground app.

nju-ics-pa's People

Contributors

stardustdl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yhyan ehello

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.