historical/m0-applesillicon.git/xnu-qemu-arm64-5.1.0/roms/SLOF/board-qemu/slof/dev-null.fs

36 lines
589 B
Forth
Raw Normal View History

2024-01-16 17:20:27 +00:00
\ 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