userland: move getchar from cpp-cheat

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent e611806df9
commit fb3fdaa8a6
3 changed files with 41 additions and 0 deletions

View File

@@ -3785,6 +3785,25 @@ Simulated exit code not 0! Exit code is 1
which we parse in link:run[] and then exit with the correct result ourselves...
==== gem5 syscall emulation mode program stdin
gem5 shows its own stdout to terminal, and does not allow you to type stdin to programs.
Instead, you must pass stdin non-interactively with the through a file with the `--se.py --input` option, e.g.:
....
printf a > f
./run --emulator gem5 --userland userland/c/getchar.c --static -- --input f
....
leads to gem5 output:
....
enter a character: you entered: a
....
Source: link:userland/c/getchar.c[]
==== User mode vs full system benchmark
Let's see if user mode runs considerably faster than full system or not.