ST0 = 40h
ST1 = 4h
ST2 = 10h
But it returns the correct CHS value.
I have given my DMA initialization code:
Code: Select all
void ReadSector(int block)
{
...
InitDMA (2, 0x80000, DEV_READ, 512);
...
}
void InitDMA(UCHAR Channel, long tBuffer, UCHAR Mode, int Size)
{
__asm__ __volatile__ ("cli");
outb (DMA_MASK, 4 | Channel);
outb (DMA_FLIPFLOP, 0);
if(Mode == DEV_READ)
outb (DMA_MODE, 0x58 | Channel);
else
outb (DMA_MODE, 0x54 | Channel);
outb (DMA_PAGE, tBuffer >> 16);
outb (DMA_ADDRESS, 0x00);
outb (DMA_ADDRESS, (tBuffer & 0xFF));
outb (DMA_ADDRESS, (tBuffer & 0xFFFF) >> 8);
outb (DMA_SIZE, Size & 0xFF);
outb (DMA_SIZE, (Size & 0xFFFF) >> 8);
outb (DMA_MASK, 2);
__asm__ __volatile__ ("sti");
}
thank u.