From 5b1cd5e1cf298cd7a1160927c618a780ca8a86cd Mon Sep 17 00:00:00 2001 From: Yi-Ting Shih Date: Sat, 5 Oct 2024 04:13:43 +0800 Subject: [PATCH] Add: README Fix: newline when PrintInt outputs 0 --- README.md | 17 +++++++++++++++++ code/userprog/ksyscall.h | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..983e3a7 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Intro. to OS HW1 + +## Docker Compose usage + +Install docker and docker-compose if not installed. + +1. Change uid / gid to yours in `Dockerfile` and `docker-compose.yaml`. +2. Run `docker compose build` to build Docker image. +3. Run `docker compose run test` to launch testing environment. + +## Makefile + +First, `cd` into `code` directory. + +- `make clean` to clean previous build. +- `make` to build. +- `make run` to run tests. diff --git a/code/userprog/ksyscall.h b/code/userprog/ksyscall.h index bf1b9f3..27fc524 100644 --- a/code/userprog/ksyscall.h +++ b/code/userprog/ksyscall.h @@ -37,7 +37,7 @@ int SysCreate(char *filename) } void SysPrintInt(int value) { - static char zero[2] = "0"; + static char zero[3] = "0\n"; if (value == 0) { kernel->synchConsoleOut->PutString(zero);