This commit is contained in:
施羿廷
2024-10-04 19:53:08 +00:00
parent 0284b75ab6
commit ba9ef819ba
59 changed files with 419 additions and 193 deletions

View File

@@ -107,13 +107,14 @@ LD = $(GCCDIR)ld
INCDIR =-I../userprog -I../lib
CFLAGS = -G 0 -c $(INCDIR) -B../../usr/local/nachos/lib/gcc-lib/decstation-ultrix/2.95.2/ -B../../usr/local/nachos/decstation-ultrix/bin/
NACHOS = ../build.linux/nachos
ifeq ($(hosttype),unknown)
PROGRAMS = unknownhost
else
# change this if you create a new test program!
# PROGRAMS = add halt consoleIO_test1 consoleIO_test2 fileIO_test1 fileIO_test2
PROGRAMS = halt
PROGRAMS = add halt consoleIO_test1 consoleIO_test2 fileIO_test1 fileIO_test2
# PROGRAMS = halt
endif
all: $(PROGRAMS)
@@ -196,6 +197,13 @@ clean:
distclean: clean
$(RM) -f $(PROGRAMS)
run: $(PROGRAMS)
for i in $(PROGRAMS); do \
echo ===== $$i =====; \
$(NACHOS) -e $$i; \
done
unknownhost:
@echo Host type could not be determined.
@echo make is terminating.

Binary file not shown.

Binary file not shown.

View File

@@ -1,12 +1,9 @@
#include "syscall.h"
int
main()
{
int n;
for (n=9;n>5;n--) {
int main() {
int n;
for (n = 9; n > 5; n--)
PrintInt(n);
}
Halt();
Halt();
}

Binary file not shown.

1
code/test/file1.test Normal file
View File

@@ -0,0 +1 @@
abcdefghijklmnopqrstuvwxyz

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +1,2 @@
make clean
make -d
../build.linux/nachos -e halt
make run

View File

@@ -186,6 +186,14 @@ ThreadJoin:
j $31
.end ThreadJoin
.globl PrintInt
.ent PrintInt
PrintInt:
addiu $2,$0,SC_PrintInt
syscall
j $31
.end PrintInt
/* dummy function to keep gcc happy */
.globl __main