tests/machine_mem.py: Too non-portable, rework as an example for unix port.

pull/2282/head
Paul Sokolovsky 2016-07-31 04:20:48 +03:00
rodzic 4d22ade102
commit eb0e3bab1e
3 zmienionych plików z 9 dodań i 17 usunięć

Wyświetl plik

@ -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]))

Wyświetl plik

@ -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()

Wyświetl plik

@ -1 +0,0 @@
0xaa55