Author Topic: emm386.exe and dma  (Read 2716 times)

locche

  • Guest
emm386.exe and dma
« on: May 28, 2012, 04:53:23 AM »
Hello all
wrote a floppy reader using fc and dma ports.  Tested on a 386sx, 486sx, no issues. However, the 486 had emm386.exe in the config.sys. So first time testing I got this unfriendly "dma not supported - emm386 do a restart locche".   Fair enough, went to MS and read up on the dma switched. Changed it accordingly in the config.sys file, nada, nichts da.  Same crash, same message.  Ms docs say message means user accessed dma in the wrong mode.  I don't know. Used mode 2 for floppy. 
So commented it out of the config file, no issues, Blood runs great, Windows boots, etc... The computer boots better...
My question, does anyone have an idea about why the crash?  I mean, it seems the BIOS uses dma for 13 and co and no issues.  Just curious, it's nice to know such things.  Btw.. the dma init code used is basically the same as I found all over.   
Thanks,
locche

Tedd

  • Member
  • ***
  • Posts: 353
  • Procrastinor Extraordinaire
Re: emm386.exe and dma
« Reply #1 on: May 28, 2012, 10:27:41 AM »
The DMA code you found all over assumes you have full control of the machine, specifically that nothing else is touching interrupts, IRQs, or DMA.
With EMM386 loaded, that's no longer true, so behaviour will vary depending on what it allows you to access and how it expects you to do that; for many things, that means you won't have direct access.
Potato2

locche

  • Guest
Re: emm386.exe and dma
« Reply #2 on: May 29, 2012, 05:21:46 AM »
Ay,  virtual x86.  Should have thought of that.  Memory manager, it's in the name.  Thanks for the reply.