From 44ae0bac777800be500b5037f9f2fd76609ddf6d Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Thu, 22 Apr 2021 11:22:05 +0200 Subject: [PATCH] read syscall now behaves like readline instead of read --- README.md | 1 + riscemu/Syscall.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 960eec9..10247f6 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Hello world Program exited with code 0 ``` +The [`read` syscall](docs/syscalls.md) defaults to readline behaviour. Reading "true chunks" (ignoring newlines) is currently not supported. See the docs on [asembly](docs/assembly.md) for more detail on how to write assembly code for this emulator. See the [list of implemented syscalls](docs/syscalls.md) for more details on how to syscall. diff --git a/riscemu/Syscall.py b/riscemu/Syscall.py index 1ea4a9d..ec9fe51 100644 --- a/riscemu/Syscall.py +++ b/riscemu/Syscall.py @@ -75,7 +75,7 @@ class SyscallInterface: scall.registers.set('a0', -1) return - chars = self.open_files[fileno].read(size) + chars = self.open_files[fileno].readline(size) try: data = bytearray(chars, 'ascii') scall.cpu.mmu.write(addr, len(data), data)