summaryrefslogtreecommitdiffstatshomepage
path: root/examples/unix
diff options
context:
space:
mode:
Diffstat (limited to 'examples/unix')
-rw-r--r--examples/unix/machine_bios.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/unix/machine_bios.py b/examples/unix/machine_bios.py
new file mode 100644
index 0000000000..f62e4dbdb4
--- /dev/null
+++ b/examples/unix/machine_bios.py
@@ -0,0 +1,9 @@
+# This example shows how to access Video BIOS memory area via machine.mem
+# It requires root privilege and x86 legacy harfware (which has mentioned
+# Video BIOS at all).
+# It is expected to print 0xaa55, which is a signature at the start of
+# Video BIOS.
+
+import umachine as machine
+
+print(hex(machine.mem16[0xc0000]))