OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Nov 21, 2019 5:45 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: ATA Read
PostPosted: Mon May 09, 2011 3:10 pm 
Offline

Joined: Sat Apr 30, 2011 6:02 pm
Posts: 19
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.


Top
 Profile  
 
 Post subject: Re: ATA Read
PostPosted: Mon May 09, 2011 6:14 pm 
Offline

Joined: Sat Apr 30, 2011 6:02 pm
Posts: 19
berkus wrote:
vFnImprimir()? REALLY?


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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: MSN [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group