qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [RFC v2 4/6] Add uart test case
Date: Thu,  1 Dec 2011 12:43:30 -0600	[thread overview]
Message-ID: <1322765012-3164-5-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1322765012-3164-1-git-send-email-aliguori@us.ibm.com>

---
 serial-test.py |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 serial-test.py

diff --git a/serial-test.py b/serial-test.py
new file mode 100644
index 0000000..7aed0cb
--- /dev/null
+++ b/serial-test.py
@@ -0,0 +1,24 @@
+from qtest import outb, inb
+import qtest, sys
+
+def main(args):
+    if len(args) != 1:
+        raise Exception('Missing argument')
+
+    qtest.init(args[0])
+
+    base = 0x3f8
+
+    # disable THRE and RDA interrupt
+    outb(base + 1, 0x00)
+
+    for ch in "Hello, World!\r\n":
+        # wait for THRE
+        while (inb(base + 5) & 0x20) == 0:
+            pass
+
+        outb(base + 0, ord(ch))
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv[1:]))
-- 
1.7.4.1

  parent reply	other threads:[~2011-12-02  1:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 18:43 [Qemu-devel] [RFC v2 0/6] qtest unit test framework Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 1/6] qtest: add " Anthony Liguori
2011-12-05 14:27   ` Luiz Capitulino
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 2/6] qtest: add support for target-i386 -M pc Anthony Liguori
2011-12-02  7:52   ` Paolo Bonzini
2011-12-29 17:40   ` Peter Maydell
2011-12-29 18:47     ` Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 3/6] Add core python test framework Anthony Liguori
2011-12-01 18:43 ` Anthony Liguori [this message]
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 5/6] Add RTC test case Anthony Liguori
2011-12-05 14:32   ` Luiz Capitulino
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 6/6] Add C version of rtc-test Anthony Liguori
2011-12-02 17:25   ` Kevin Wolf
2011-12-02 17:26     ` Anthony Liguori
2011-12-02 17:45       ` Kevin Wolf
2011-12-02 18:20         ` Luiz Capitulino
2011-12-02 18:43         ` Anthony Liguori
2011-12-05  8:51           ` Kevin Wolf
2011-12-04 10:03 ` [Qemu-devel] [RFC v2 0/6] qtest unit test framework Dor Laor
2011-12-05 15:29   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322765012-3164-5-git-send-email-aliguori@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).