aboutsummaryrefslogtreecommitdiffstats
path: root/roms/SLOF/board-qemu/slof/dev-null.fs
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/SLOF/board-qemu/slof/dev-null.fs
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/SLOF/board-qemu/slof/dev-null.fs')
-rw-r--r--roms/SLOF/board-qemu/slof/dev-null.fs35
1 files changed, 35 insertions, 0 deletions
diff --git a/roms/SLOF/board-qemu/slof/dev-null.fs b/roms/SLOF/board-qemu/slof/dev-null.fs
new file mode 100644
index 000000000..9ac5169d2
--- /dev/null
+++ b/roms/SLOF/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 )
+ 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