1
0
Fork 0
qemu/roms/SLOF/board-qemu/slof/dev-null.fs
Daniel Baumann ea34ddeea6
Adding upstream version 1:10.0.2+ds.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 14:27:05 +02:00

35 lines
589 B
Forth

\ 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 )
2drop 0
;
: 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