Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all I want to know the basics of SATA driver and how the sata devices are communicated to the driver> In PATA we have ports to access the devices.is ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Location
    India
    Posts
    78

    Smile Help in SATA device......

    Hi all
    I want to know the basics of SATA driver and how the sata devices are communicated to the driver> In PATA we have ports to access the devices.is there anything for SATA.As in a beginner stage can anyone help me?
    Thanks in advance.

  2. #2
    Just Joined!
    Join Date
    Jan 2008
    Location
    India
    Posts
    78
    Can moderator redirect the thread to the correct forum topic?
    Thanks.

  3. #3
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Well, I think you're in the right church.

    I googled, and found this. Does it help?
    --
    Bill

    Old age and treachery will overcome youth and skill.

  4. #4
    Just Joined!
    Join Date
    Jan 2008
    Location
    India
    Posts
    78

    Smile

    I have found site that tells about sending ATA commands to SATA device using sg ioctl. I have filled the sg structure with the below value.I am running this program in Fedora4

    sg_io.interface_id = 'S';
    sg_io.cmdp = cdb;
    sg_io.cmd_len = sizeof(cdb);
    sg_io.dxferp = data_in_buffer;
    sg_io.dxfer_len = 512;//data_in_length; //
    sg_io.dxfer_direction = SG_DXFER_FROM_DEV;
    sg_io.sbp = sense;
    sg_io.mx_sb_len = sizeof(sense);
    sg_io.timeout = 15000;
    and CDB structure is,
    cdb[0] = 0x85; // ATA pass-through 12
    cdb[1] = (4 << 1); // data-in
    cdb[2] = 0x2e; // data-in
    cdb[4] = 0x00; // ATA feature ID
    cdb[6] = 1; // number of sector
    cdb[7] = 0x00; //lba_low >> 8;
    cdb[8] = 0x00; //lba_low;
    cdb[9] = 0x00; //lba_mid >> 8;
    cdb[10] = 0x00; //lba_mid;
    cdb[11] = 0x00; //lba_high >> 8;
    cdb[12] = 0x00; //lba_high;
    cdb[14] = 0xEC; // ATA command ID
    I have checked CDB values which i am passing with the document "ATA over scsi standard passthru implementation." I am creating the handle for /dev/sda. After passing the ioctl i am getting wrong values in sense buffer.
    sense buffer[0]:0x70
    sense buffer[1]:0x00
    sense buffer[2]:0x05
    sense buffer[3]:0x00
    sense buffer[4]:0x00
    sense buffer[5]:0x00
    sense buffer[6]:0x00
    sense buffer[7]:0x06
    sense buffer[8]:0x00
    sense buffer[9]:0x00
    sense buffer[10]:0x00. As per program, these values are not valid. I dont know how they have defined like this. Can anyone help me regarding the sense buffer values.

  5. #5
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I'm not ignoring you; unfortunately, I don't know the answer. I'm guessing that since nobody else has jumped in, nobody else here knows the answer here either. Sorry.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...