Using Fabrice Bellard's runcom to run COM files under Linux (Announce)
> How does runcom work?
> In brief runcom works by using the Linux system call vm86() which provides
> a 16bit virtual machine however only on an Intel based (or emulated in the
> case of JSLinux machine) . vm86() is also used by DOSEmu:
(note that with "intel" they mean 32-bit x86 class, not CPU's made by Intel only)
>
> #define __NR_vm86 166
> #define __NR_vm86old 113
>
IIRC most 32-bit OSes have such calls for interfacing with the bios, e.g. FreeBSD x86 has (machine/x86.h):
extern int vm86_emulate(struct vm86frame *);
extern int vm86_sysarch(struct thread *, char *);
extern void vm86_trap(struct vm86frame *);
extern int vm86_intcall(int, struct vm86frame *);
extern int vm86_datacall(int, struct vm86frame *, struct vm86context *);
extern void vm86_initialize(void);
extern vm_offset_t vm86_getpage(struct vm86context *, int);
extern vm_offset_t vm86_addpage(struct vm86context *, int, vm_offset_t);
extern int vm86_getptr(struct vm86context *, vm_offset_t, u_short *, u_short *)
extern vm_offset_t vm86_getaddr(struct vm86context *, u_short, u_short);
But the main problem of this technology, like all hardware VM based solutions, is that won't work under 64-bit OSes? Hence, investing in this kind of technology at this point doesn't really make sense, since for direct usage there are mature solutions like dosemu.
To properly support running 16-bit code, in time you need to move to technology that can emulate or JIT 16-bit code on any CPU.
Complete thread:
- Using Fabrice Bellard's runcom to run COM files under Linux - Arjay, 21.03.2012, 01:17 (Announce)
- Using Fabrice Bellard's runcom to run COM files under Linux - marcov, 21.03.2012, 13:43
- Using Fabrice Bellard's runcom to run COM files under Linux - Arjay, 21.03.2012, 19:53
- Using Fabrice Bellard's runcom to run COM files under Linux - Ibidem, 30.03.2012, 01:00
- Using Fabrice Bellard's runcom to run COM files under Linux - Rugxulo, 31.03.2012, 00:47
- Using Fabrice Bellard's runcom to run COM files under Linux - marcov, 31.03.2012, 09:15
- libx86 / Alpha - Rugxulo, 10.04.2012, 00:26
- Using Fabrice Bellard's runcom to run COM files under Linux - Ibidem, 30.03.2012, 01:00
- Using Fabrice Bellard's runcom to run COM files under Linux - Rugxulo, 19.04.2012, 05:40
- Using Fabrice Bellard's runcom to run COM files under Linux - Arjay, 21.03.2012, 19:53
- Emu8080-Stefan Tramm's Intel 8080 CPU Emulator running CP/M - Arjay, 16.04.2012, 21:14
- Emu8080-Stefan Tramm's Intel 8080 CPU Emulator running CP/M - Rugxulo, 17.04.2012, 00:03
- Emu8080-Stefan Tramm's Intel 8080 CPU Emulator running CP/M - Ibidem, 17.04.2012, 08:47
- Emu8080-Stefan Tramm's Intel 8080 CPU Emulator running CP/M - Rugxulo, 17.04.2012, 19:49
- Grant Searle's CP/M on breadboard - updated 21st April 2012 - Arjay, 22.04.2012, 18:57
- Grant Searle's CP/M on breadboard - updated 26th April 2012 - Arjay, 04.05.2012, 22:54
- Grant Searle's CP/M on breadboard - updated 26th April 2012 - Arjay, 02.08.2012, 00:37
- Grant Searle's CP/M on breadboard - updated 23th July 2013 - Arjay, 05.08.2013, 19:05
- Grant Searle's CP/M on breadboard - updated 26th April 2012 - Arjay, 02.08.2012, 00:37
- Grant Searle's CP/M on breadboard - updated 26th April 2012 - Arjay, 04.05.2012, 22:54
- Using Fabrice Bellard's runcom to run COM files under Linux - marcov, 21.03.2012, 13:43