ATA Read
Posted: Mon May 09, 2011 3:10 pm
HI,
Im trying to develop a IDE/ATA Driver in ANSI C / ASM. I read this page: http://wiki.osdev.org/ATA and I developed a test function using that standards driver functions:
The OS detect my ATA and it read one sector good. The problem is, where is the data that I read? I need read byte/word/stream and I need recover the information for print this info in a shell.
Using this functions (http://wiki.osdev.org/ATA) can I recover the data that I read? thanks.
Im trying to develop a IDE/ATA Driver in ANSI C / ASM. I read this page: http://wiki.osdev.org/ATA and I developed a test function using that standards driver functions:
Code: Select all
void read_test_ide()
{
ide_initialize(0x1F0, 0x3F4, 0x170, 0x374, 0x000);
//ide_initialise_harcoded();
unsigned char* readbuf = (unsigned char*)pvFnMalloc(512);
int dispositivo = 0;
unsigned char numsect = 0x200; //READ PIO
unsigned int lba = 40001;
for(dispositivo=0;dispositivo<4;dispositivo++)
{
if(ide_devices[dispositivo].Reserved == 1)
{
if (!ide_read_sectors(dispositivo, numsect, lba, (unsigned int)readbuf))
{
vFnImprimir("No se pudo leer la direccion lba: %d!\n",lba);
iFnFree(readbuf);
}
else
{
vFnImprimir("READ Test completed\n\n%s\n\n",readbuf);
iFnFree(readbuf);
}
}
}
}
Using this functions (http://wiki.osdev.org/ATA) can I recover the data that I read? thanks.