Sam
Sam

Reputation: 23

How to read hardware input using emu8086

I'm trying to do an assembly code that reads how many hardware devices are connected to the pc/laptop and determine what are they? is it possible using emu8086?

I have searched alot but couldnt be able to find something that reads all hardware devices connected, so i havent actually tried anything much yet

for example if an external mouse and microphone were connected to my pc i want the output to be 2 devices are connected and they are a mouse and a microphone.

Upvotes: 2

Views: 321

Answers (1)

Peter Cordes
Peter Cordes

Reputation: 363999

EMU8086 doesn't have any support for pass-through access to real hardware for guest code running inside the emulated 8086 PC.

From what I've read, it doesn't even fully emulate PC hardware for that virtual guest machine (e.g. timer interrupts or keyboard interrupts), mostly just the int 21h DOS and int 10h and some other BIOS call interfaces.

It's a toy emulator for teaching, not writing real programs. There are some things you simply can't do with it.


If you want to talk to make the hardware on your desktop do anything, your best bet it to write a program that runs natively under your OS (Linux, Windows, OS X, or whatever) and makes system calls to access it via the kernel drivers.

Or write your own OS / bootloader and boot it so it can access real hardware directly.

Or use BOCHS which fully emulates a PC-compatible system with some hardware devices like a Soundblaster card. (From the perspective of the host OS that you're running BOCHS under, it's just another program that uses normal system calls to play / record sound. From inside the guest system that BOCHS emulates, your code has direct hardware access to a sound card.)

DOSBox is another useful emulator, but aims at games rather than a complete faithful emulation of everything in a PC. It doesn't support everything, for example a recent SO answer says it doesn't support some of the BIOS int 1Ah RTC functions.

Upvotes: 2

Related Questions