Question

Org 0xe05b; POST Entry Point
Post:
xor ax, ax

,, First reset the DMA controllers
0x0d out at
0xda out at

,, Then initialize the DMA controllers
mov al, # 0xC0
0xD6 out at; cascade enabled mode of channel 4
mov al, # 0x00
out 0xD4, al; unmask channel 4

I did some research but I can't figure out what 0xc0 means? And which register in the DMA registers port 0xD6 and 0xD4 correspond to ?

Was it helpful?

Solution

You might want to look at this site: OS Dev Wiki: ISA DMA Controller. It has a lot of good information about legacy PC devices.

You'll have to forgive me as I'm a little rusty on this but:

Register 0xD6 - The DMA Mode register for the master DMA controller. Writing 0xC0 (1100 0000b) sets the controller up to daisy chain the other (slave) DMA controller on the system. Bits 6 and 7 determine the mode the chip should be in:

  • 00 - Transfer on Demand
  • 01 - Single DMA Transfer
  • 10 - Block DMA Transfer
  • 11 - Cascade Mode (this is the mode 0xC0 selects)

PC compatible systems have two of these DMA controllers cascaded together to provide a total of 7 functional channels (1 is lost in the daisy chaining).

Register 0xD4 - the Single Channel Mask register for the master DMA controller. It can be used to individually turn off/on the mask for a given channel. Bits 0 and 1 indicate the desired channel and Bit 2 is the mask enable. Writing 0x00 ensures that channel 4 (i.e. channel 0 on the master DMA controller) is unmasked so that the channels 0-3 are not also masked off.

I apologize in advance if any of this is confusing/incorrect!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top