I'm trying to read an ide hd but without sucess
I've read the wiki about pio but i still get some difficulty setting up the registers.
i'm using bochs with an hd image.
Code: Select all
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="C:\cygwin\dev\hd0", mode=flat, cylinders=4, heads=16, spt=63
Code: Select all
ata0 master: Generic 1234 ATA-6 Hard-Disk ( 1 MBytes)
Code: Select all
$ od -A d -c /dev/hd0
0000000 h e l l o \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000016 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0x1f6<-0xA0
0x1f2<-0x1
0x1f3<-0x1
0x1f4<-0x0
0x1f5<-0x0
0x1f7<-0x20
and i read with this code...
Code: Select all
still_going:
in al,dx
test al,8
jz still_going.
mov cx,10 ;10 word
mov di, buffer
mov dx,0x1f0
rep insw
mov byte dl, [buffer+2]
call putchar
putchar: function with print the char in dl on the screen
any help will be pleased