Skip to content

Commit

Permalink
> nemu
Browse files Browse the repository at this point in the history
161220002
bjy
Linux Debian 4.9.0-3-686-pae #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) i686 GNU/Linux
 23:23:53 up 1 day, 22:27,  1 user,  load average: 0.06, 0.64, 1.06
410e7914c5379e68ba71961f2f4c8ca106e0b14
  • Loading branch information
ruichima authored and bjy committed Jan 31, 2018
0 parents commit 4579022
Show file tree
Hide file tree
Showing 444 changed files with 190,832 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.o
*.d
testcase/bin
game/src/nemu-pal/data
1 change: 1 addition & 0 deletions .~lock.Q1.doc#
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
,bjy161220002,161220002,23.11.2017 22:28,file:///home/bjy161220002/.config/libreoffice/4;
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.PHONY: nemu clean run test testkernel testgame do_not_call_me_testcase do_not_call_me_kernel do_not_call_me_game

include Makefile.git

nemu:
$(call git_commit, "nemu")
cd nemu && make

run: nemu do_not_call_me_testcase
$(call git_commit, "run")
./nemu/nemu -run hello-inline
test: nemu do_not_call_me_testcase
$(call git_commit, "test")
./nemu/nemu -autorun

testkernel: nemu do_not_call_me_testcase do_not_call_me_kernel
$(call git_commit, "testkernel")
./nemu/nemu -kernel-test

testgame: nemu do_not_call_me_kernel do_not_call_me_game
$(call git_commit, "testgame")
./nemu/nemu -game

clean:
cd nemu && make clean
cd testcase && make clean
cd kernel && make clean
cd game && make clean

submit: clean
cd .. && tar cvj $(shell pwd | grep -o '[^/]*$$') > $(STU_ID).tar.bz2


#### do not use the following targets directly ####

do_not_call_me_game:
cd game && make

do_not_call_me_testcase:
cd testcase && make

do_not_call_me_kernel:
cd testcase && make
cd kernel && make


12 changes: 12 additions & 0 deletions Makefile.git
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
STU_ID = 161220002

# DO NOT modify the following code!!!

GITFLAGS = -q --author='tracer-pa2017 <[email protected]>' --no-verify --allow-empty

# prototype: git_commit(msg)
define git_commit
-@git add . -A --ignore-errors
-@while (test -e .git/index.lock); do sleep 0.1; done
-@(echo "> $(1)" && echo $(STU_ID) && id -un && uname -a && uptime && (head -c 20 /dev/urandom | hexdump -v -e '"%02x"') && echo) | git commit -F - $(GITFLAGS)
endef
Binary file added PA2实验报告.docx
Binary file not shown.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# PA 2017

This is the code for the 'Programming Assignment' for the course 'Introduction to Computer Systems' in Fall, 2017.

# OS setup

Debian 32-bit with desktop environment (tested with MATE)

# Get the code:

git clone https://github.com/ics-pa/pa2017.git

# Guide book

https://cs.nju.edu.cn/wangliang/pa2017.html
37 changes: 37 additions & 0 deletions game/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
LIB_COMMON_DIR = ../include
NEWLIBC_DIR = $(LIB_COMMON_DIR)/newlib

#GAME = typing
GAME = nemu-pal

CC = gcc
CFLAGS = -m32 -MMD -Wall -Werror -Wno-format\
-fno-builtin -fno-omit-frame-pointer -fno-stack-protector \
-I./include -I$(LIB_COMMON_DIR) -I$(NEWLIBC_DIR)/include
LDFLAGS = -melf_i386 -Ttext=0x800000

CFLAGS += -I./src/$(GAME)/include

COMMON_FILES = $(shell find src/common -name "*.c")
GAME_FILES = $(shell find src/$(GAME) -name "*.c")

CFILES = $(COMMON_FILES) $(GAME_FILES)
OBJS = $(CFILES:.c=.o)

NEWLIBC = $(NEWLIBC_DIR)/libc.a
#FLOAT = $(LIB_COMMON_DIR)/FLOAT.o

#game: $(OBJS) $(FLOAT)
game: $(OBJS)
ld $(LDFLAGS) -e game_init -o game $(OBJS) $(NEWLIBC) #$(FLOAT)
ifeq ($(GAME),nemu-pal)
dd if=/dev/null of=game seek=2048
cat `find src/nemu-pal/data -type f | sort` >> game
endif

-include $(OBJS:.o=.d)

.PHONY: clean

clean:
-rm -f game $(OBJS) $(OBJS:.o=.d)
Loading

0 comments on commit 4579022

Please sign in to comment.