diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2014-02-14 11:32:38 +0530 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2014-03-04 12:52:03 +1100 |
commit | 5ea509fd126b7e51fb32ac46c880b86817c8d7a1 (patch) | |
tree | be6debcbe3f9ec8819680d10b397419283bcb8ec /board-qemu/slof/dev-null.fs | |
parent | ae98d1464cdb6ca645cb7d62d44ed7df106a0d3f (diff) | |
download | SLOF-5ea509fd126b7e51fb32ac46c880b86817c8d7a1.zip SLOF-5ea509fd126b7e51fb32ac46c880b86817c8d7a1.tar.gz SLOF-5ea509fd126b7e51fb32ac46c880b86817c8d7a1.tar.bz2 |
Introduce dummy console device
Qemu can create console-less machine, aka no output device. And there
are dependencies in the guest which expects a valid output device. Add
this dummy device that gobbles up all the output send, and keeps the
guest happy.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'board-qemu/slof/dev-null.fs')
-rw-r--r-- | board-qemu/slof/dev-null.fs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/board-qemu/slof/dev-null.fs b/board-qemu/slof/dev-null.fs new file mode 100644 index 0000000..d0ffad6 --- /dev/null +++ b/board-qemu/slof/dev-null.fs @@ -0,0 +1,35 @@ +\ Introduce a dummy console that will eat away all chars and make all +\ the components dependent on stdout happy. + +new-device +" devnull-console" device-name + +: open true ; +: close ; + +: write ( adr len -- actual ) + nip +; + +: read ( adr len -- actual ) + nip +; + +: setup-alias + " devnull-console" find-alias 0= IF + " devnull-console" get-node node>path set-alias + ELSE + drop + THEN +; + +: dummy-term-emit drop ; +: dummy-term-key 0 ; +: dummy-term-key? FALSE ; + +' dummy-term-emit to emit +' dummy-term-key to key +' dummy-term-key? to key? + +setup-alias +finish-device |