Add: README

Fix: newline when PrintInt outputs 0
This commit is contained in:
2024-10-05 04:13:43 +08:00
parent 486f032cf0
commit 5b1cd5e1cf
2 changed files with 18 additions and 1 deletions

17
README.md Normal file
View File

@@ -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.

View File

@@ -37,7 +37,7 @@ int SysCreate(char *filename)
} }
void SysPrintInt(int value) { void SysPrintInt(int value) {
static char zero[2] = "0"; static char zero[3] = "0\n";
if (value == 0) { if (value == 0) {
kernel->synchConsoleOut->PutString(zero); kernel->synchConsoleOut->PutString(zero);