From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH, RFC] BSD user emulator
Date: Mon, 25 Aug 2008 21:45:54 +0300 [thread overview]
Message-ID: <f43fc5580808251145u51499e6fsda35d805514fd82b@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2569 bytes --]
Hi,
This is a preliminary implementation of BSD user emulator. Some files
inside bsd-user contain a lot of unwanted cruft copied from linux-user
and ldscript is not used. But it can already run a handcrafted Sparc64
helloworld file (on OpenBSD/Sparc64 host):
LD_BIND_NOW=y ./qemu-sparc64 -d in_asm -strace ../helloworld.sparc64_obsd
write(1,0x2001f8,13)Hello World!
= 13
exit(13)
cat /tmp/qemu.log
start end size prot
00100000-00102000 00002000 r-x
00200000-00202000 00002000 r--
00300000-00302000 00002000 rw-
00700000-00702000 00002000 rw-
40000000-40080000 00080000 rw-
40080000-40082000 00002000 ---
40d32000-40d3a000 00008000 ---
418e8000-418f0000 00008000 ---
41b84000-41b8c000 00008000 ---
4325a000-43262000 00008000 ---
4357c000-4357e000 00002000 ---
436ca000-436d2000 00008000 ---
43758000-43760000 00008000 ---
44202000-4420a000 00008000 ---
44dce000-44dd6000 00008000 ---
4643e000-46448000 0000a000 ---
466da000-466e2000 00008000 ---
467d0000-467d8000 00008000 ---
48492000-4849a000 00008000 ---
487b0000-487b8000 00008000 ---
48e8a000-48e92000 00008000 ---
49136000-4913e000 00008000 ---
4941a000-49422000 00008000 ---
494ec000-494ee000 00002000 ---
498b4000-498bc000 00008000 ---
4a950000-4a958000 00008000 ---
4ade4000-4adec000 00008000 ---
4bae8000-4baf0000 00008000 ---
4bb86000-4bb88000 00002000 ---
4d542000-4d55c000 0001a000 ---
4df92000-4df9a000 00008000 ---
4e10a000-4e112000 00008000 ---
4e212000-4e21a000 00008000 ---
4eaca000-4ead2000 00008000 ---
4f392000-4f39a000 00008000 ---
4f4ae000-4f4b6000 00008000 ---
4f6da000-4f6e2000 00008000 ---
500ba000-544bc000 04402000 ---
start_brk 0x0000000000700208
end_code 0x00000000001001f8
start_code 0x0000000000100000
start_data 0x0000000000700208
end_data 0x0000000000700208
start_stack 0x000000004007fb70
brk 0x0000000000700208
entry 0x00000000001001c8
--------------
IN:
0x00000000001001c8: mov 0xd, %o2
0x00000000001001cc: sethi %hi(0), %o0
0x00000000001001d0: sethi %hi(0x200000), %o1
0x00000000001001d4: mov %o0, %o0
0x00000000001001d8: or %o1, 0x1f8, %o1
0x00000000001001dc: sllx %o0, 0x20, %o0
0x00000000001001e0: or %o1, %o0, %o1
0x00000000001001e4: mov 1, %o0
0x00000000001001e8: mov 4, %g1
0x00000000001001ec: ta 0
--------------
IN:
0x00000000001001f0: mov 1, %g1
0x00000000001001f4: ta 0
I think in BSD (at least OpenBSD), system call numbers, system call
parameters, ioctls, and signal numbers are shared across
architectures, maybe even between *BSDs. If it's true, it should make
the emulator much simpler than Linux one.
[-- Attachment #2: bsd_user_emu.diff.bz2 --]
[-- Type: application/x-bzip2, Size: 43852 bytes --]
next reply other threads:[~2008-08-25 18:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-25 18:45 Blue Swirl [this message]
2008-08-25 19:03 ` [Qemu-devel] [PATCH, RFC] BSD user emulator M. Warner Losh
2008-08-27 19:38 ` Andreas Färber
2008-08-28 15:49 ` Blue Swirl
-- strict thread matches above, loose matches on Subject: below --
2008-08-30 8:31 Blue Swirl
2008-09-01 8:58 ` Alexander Graf
2008-09-01 9:19 ` Andreas Färber
2008-09-01 16:25 ` M. Warner Losh
2008-09-01 16:44 ` Alexander Graf
2008-09-01 17:55 ` M. Warner Losh
2008-09-01 18:21 ` Blue Swirl
2008-09-01 19:13 ` M. Warner Losh
2008-09-02 17:13 ` Blue Swirl
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=f43fc5580808251145u51499e6fsda35d805514fd82b@mail.gmail.com \
--to=blauwirbel@gmail.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).