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)