summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-31 04:20:48 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-31 04:22:09 +0300
commiteb0e3bab1ed5aa09e491641f427a5d637fe688bd (patch)
treee77199f38b3ce4a214fc19de58a8abdd8a4d1cc5
parent4d22ade102b9b5c5b610f2de47385cc53d4ba009 (diff)
downloadmicropython-eb0e3bab1ed5aa09e491641f427a5d637fe688bd.tar.gz
micropython-eb0e3bab1ed5aa09e491641f427a5d637fe688bd.zip
tests/machine_mem.py: Too non-portable, rework as an example for unix port.
-rw-r--r--examples/unix/machine_bios.py9
-rw-r--r--tests/extmod/machine_mem.py16
-rw-r--r--tests/extmod/machine_mem.py.exp1
3 files changed, 9 insertions, 17 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]))
diff --git a/tests/extmod/machine_mem.py b/tests/extmod/machine_mem.py
deleted file mode 100644
index 7d8a9ac01e..0000000000
--- a/tests/extmod/machine_mem.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# This test requires root privilege, so is usually skipped
-# It also assumes x86 legacy hardware (with Video BIOS present).
-
-try:
- import machine
-except ImportError:
- print("SKIP")
- import sys
- sys.exit()
-
-try:
- print(hex(machine.mem16[0xc0000]))
-except OSError:
- print("SKIP")
- import sys
- sys.exit()
diff --git a/tests/extmod/machine_mem.py.exp b/tests/extmod/machine_mem.py.exp
deleted file mode 100644
index 371f8fa44d..0000000000
--- a/tests/extmod/machine_mem.py.exp
+++ /dev/null
@@ -1 +0,0 @@
-0xaa55