Questions tagged [x86-emulation]
38 questions
7
votes
1 answer
How does dynamic recompilation handle instruction-pointer checks in software virtualization?
(This question isn't intended to be specific to VirtualBox or x86 per se, but since they're the best examples I'm aware of, I'll be referencing them and asking how VBox handles some scenarios. If you're aware of other solutions that aren't used by…

user541686
- 205,094
- 128
- 528
- 886
7
votes
3 answers
x86 80-bit floating point type in Java
I want to emulate the x86 extended precision type and perform arithmetic operations and casts to other types in Java.
I could try to implement it using BigDecimal, but covering all the special cases around NaNs, infinity, and casts would probably a…

box
- 3,156
- 3
- 26
- 36
4
votes
2 answers
In this X86 emulator, why is the overflow flag getting set when adding 0xFFFF to 0xFFFF?
I'm building an x86 emulator, and I'm using this online x86 sandbox to check my work. In my emulator, running this code:
mov AX, 0xFFFF
add AX, AX
...sets AX to 0xFFFE and sets the overflow flag to 0.
In the sandbox, the same code sets the overflow…

Peter Malamud Smith
- 41
- 3
2
votes
0 answers
QEMU virtio-pci-pmem memory addresses over 4G
I want a persistent memory in a qemu 32bits machine that I can access directly from my code.
My idea is to place a virtio-pci-pmem memory just after the RAM (at 0x400000) and reload the persistent memory file at the same address at each reboot.
I…

Pierre Neumann
- 23
- 3
2
votes
1 answer
How can I properly emulate x86 with Unicorn in Python?
Background / Explanation of What I'm Trying to Accomplish
I'm currently working on a little malware analysis project and am trying to implement a string decryptor that I wrote using Unicorn. In order to condense things and make the code easier to…

Destiny
- 91
- 8
2
votes
0 answers
8086 instructions which ignore Trap Flag when set
When the 8086 Trap Flag (TF) is set, a type 1 interrupt is generated automatically after nearly every instruction. I'm looking for a full list of the exceptions for an 8086/8088 emulator. Have I missed any from the list below or written anything…

TonyB
- 31
- 1
2
votes
2 answers
NTVDM System Error 4001h when running a 32-bit DOS app
I have cross-compiled a 32-bit analog clock made in ArithmeticExpressionCompiler from Linux to DOS using the GNU Assembler. When run under FreeDOS in QEMU or VirtualBox (which are far better emulators than NTVDM is, right?), it creates this…

FlatAssembler
- 667
- 7
- 30
2
votes
0 answers
QEMU: how to create a 486 VM without fpu
I'm trying to create a VM of a 486 without FPU, like the 80486SX. I figured this could be accomplished with QEMU. I couldn't find the possibility to directly specify such a cpu (there's only the option -cpu=486). Based on the documentation, I…

Ant6n
- 1,887
- 1
- 20
- 26
2
votes
1 answer
In simics, what is the command to print virtual to physical memory map?
When debugging a kernel running on the simics-x86-core-i7-x58-ich10 target, how to print the physical memory map?
memory-map seems to print only the physical memory space mapping for objects (ram, apic, vga, etc.).
l2p print the mapping for a…

Mahouk
- 902
- 9
- 28
2
votes
2 answers
Is it safe to assume that any x86 compiled app would always run under x64 edition?
Is it safe to assume that any x86 compiled app would always run under x64 edition of same OS the app was compiled in?
As far as I know, For Windows OS the answer is "Yes". Windows x86 emulation layer is built for the same purpose. But, I just want…

user1
- 4,031
- 8
- 37
- 66
1
vote
0 answers
DOS 01h Read character behavior on EOF
Using 01h interrupt (AH = 01h - READ CHARACTER FROM STANDARD INPUT, WITH ECHO), what will be output at the end of stdin for a cat program? Is ^Z (1Ah) used to mark the end of stdin by convention?
Testing this program with emu2 (emu2 doscat.com <…

qwr
- 9,525
- 5
- 58
- 102
1
vote
1 answer
How can I boot my bootsector files with qemu?
I'm doing some experimenting with (very basic) OS development in order to teach myself something about machine language and x86 assembly.
I have lib-virt / qemu installed on my system. (Debian 11)
However I am struggling to find a convenient way to…

FreelanceConsultant
- 13,167
- 27
- 115
- 225
1
vote
0 answers
How to run Gem5 system emulation with Golang program
I am trying to run Gem5 system emulation with a binary I compiled from a Golang program. I am using X86 O3CPU and classic memory. However, I have to launch the same process on 3 cpus to have the system emulation set up. Otherwise I will receive…

Yingchen Wang
- 11
- 1
1
vote
1 answer
8086 d bit in opcode 1: what is the more common value, 0 or 1?
For quite a lot of 8086 instructions, bit 1 of opcode 1 is a direction bit d (not to be confused with the DF flag), allowing two ways to encode the same instruction.
An emulator I am writing can decode 'from' and 'to' for either d=0 or d=1 but not…

TonyB
- 31
- 1
1
vote
0 answers
How to make Library in X86 assembly?
How to make your own library in X86 assembly Intel with your own functions.
I'm currently using invine.inc library,not that proficient at it

Zain Haider
- 11
- 1