OSDev.org
https://forum.osdev.org/

ATA Read
https://forum.osdev.org/viewtopic.php?f=1&t=23574
Page 1 of 1

Author:  raz0r [ Mon May 09, 2011 3:10 pm ]
Post subject:  ATA Read

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:

Code:
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);
      }
    }
  }
}


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.

Author:  raz0r [ Mon May 09, 2011 6:14 pm ]
Post subject:  Re: ATA Read

berkus wrote:
vFnImprimir()? REALLY?


is a print function. ignore that plz
how can i do that. .go...

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/