read syscall now behaves like readline instead of read

float_support
Anton Lydike 4 years ago
parent 0d9960c01a
commit 44ae0bac77

@ -21,6 +21,7 @@ Hello world
Program exited with code 0 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 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. See the [list of implemented syscalls](docs/syscalls.md) for more details on how to syscall.

@ -75,7 +75,7 @@ class SyscallInterface:
scall.registers.set('a0', -1) scall.registers.set('a0', -1)
return return
chars = self.open_files[fileno].read(size) chars = self.open_files[fileno].readline(size)
try: try:
data = bytearray(chars, 'ascii') data = bytearray(chars, 'ascii')
scall.cpu.mmu.write(addr, len(data), data) scall.cpu.mmu.write(addr, len(data), data)

Loading…
Cancel
Save