First post, by vladstamate
- Rank
- Oldbie
Hi,
I am trying to add host folder sharing to my emulator CAPE. Since I am emulating the machine not DOS, the way I thought I can approach this is to intercept INT 21h calls that DOS makes and if I see say "X:\" I can take over and instead of letting DOS dealing with listing files, opening/closing files I would do that (for anything else I would just normally execute the INT instruction and let the processor normal course happen). Any file operation while current DOS drive is my special letter would be handled by me in the emulator.
That however does not seem to work as DOS pretty quickly decides that X is not in fact a real drive and does not call "set current drive/folder" with X (functions that I hoped to intercept). I assume DOS knows how many drives there are using INT 13H AH=8. I can hack that one too and return real drives+1. But that can quickly turn into a deep rabbit hole that I do not want to go into.
So I thought there must be a way to add drive letters to DOS, for example RAMDRIVE does it, even quite late after boot. How is that done? There does not seem to be a INT 21H service that simply says: "hey DOS, here is another disk for you, tell me, the driver, if someone is touching it and I will deal with it, no reason to bother poor BIOS INT 13 for that drive".
I can write something akin to RAMDRIVE driver and execute into the emulated DOS environment, but I was really really hoping I can "cheat" by just hijacking few INT 21H calls and redirecting them if I see the drive the user operates on is my special letter.
Any advice?
Vlad.
YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/