-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tobias Weingartner wrote:
[...]
> One thing your teacher may not know is that x86 assembly includes the
> 32-bit environment, and (now) also a 64-bit environment.  However, running
> 16-bit code under OpenBSD i386 is going to be somewhat difficult.  We don't
> bother supplying 16-bit services, and only consume 16-bit services (from
the
> bios) for a few things necessary.  It is hard, and somewhat error prone.

Linux has a thing called elksemu. It is, basically, a binary loader that will
allow you to run 16-bit ELKS binaries on 32-bit Linux. (ELKS is a
now-moribund
port of a Linux subset to 8086 class machines, using modified Minix
binaries.)
It intercepts int 0x80 and converts the 16-bit ELKS syscalls to 32-bit Linux
ones.

So, write(0, "Hello, world!\n", 14) becomes:

        mov ax, 0
        mov bx, _label
        mov cx, 14
        int 0x80

...which is, I believe, exactly what the OP wanted.

elksemu does all the dirty work with the vm86() syscall, which was put in for
dosemu. I know that dosemu works, or at least worked, on NetBSD and FreeBSD
- --- does OpenBSD have this functionality?

- --
bbb o=o=o< o=o=o=o=o=o=o=o<o=o=o=
 bbb
http://www.cowlark.com
bbbbbbbbbbbbbbbbbbb
b
b "There does not now, nor will there ever, exist a programming language in
b which it is the least bit hard to write bad programs." --- Flon's Axiom
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG7wDdf9E0noFvlzgRAgIeAJ9tDWiILb5ZvOHdQMFKt3IJx498DQCdHnvX
LCkFDYMfs7Boc07yqcTSVZw=
=/XPv
-----END PGP SIGNATURE-----

Reply via email to