Re: [edk2] Read data block from CD/DVD

Subject: Re: [edk2] Read data block from CD/DVD

From: Sergey Isakov <isakov-sl@bk.ru>

To: edk2-devel@lists.sourceforge.net

Date: 2011-11-19 01:17:53

Hi Suraj,

I am successful although this feature is not documented in EDK2 headers.
--------------------
if (ScsiIo) {
//
// Initialize SCSI REQUEST_PACKET and 6-byte Cdb
//
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));
ZeroMem (Cdb, sizeof (EFI_SCSI_OP_LENGTH_SIX));


Target = &TargetArray[0];
ScsiIo->GetDeviceLocation (ScsiIo, &Target, &Lun);



Cdb[0]  = EFI_SCSI_OP_START_STOP_UNIT;
Cdb[1]  = (UINT8) (LShiftU64 (Lun, 5) & EFI_SCSI_LOGICAL_UNIT_NUMBER_MASK);
Cdb[1] |= 0x01;
Cdb[4]  = 0x02; //eject command. NO DESCRIPTION IN HEADERS
CommandPacket.Timeout = EFI_TIMER_PERIOD_SECONDS (3);
CommandPacket.Cdb = Cdb;
CommandPacket.CdbLength = (UINT8) sizeof (Cdb);
//  CommandPacket.InDataBuffer = &ScsiDiskDevice->IdentifyData;
//  CommandPacket.InTransferLength = 0;


Status = ScsiIo->ExecuteScsiCommand (ScsiIo, &CommandPacket, NULL);
}

-------------------

Regards
Sergey


On 18.11.2011, at 15:20, Sergey Isakov wrote:

Hi Suraj,

This is clear. I want to ask about the contents of the packet.
----
  /// A pointer to buffer that contains the Command Data Block to
  /// send to the SCSI device specified by Target and Lun.
  ///
  VOID   *Cdb;

---

Sergey

On 18.11.2011, at 14:00, Suraj Joshi wrote:

HI Sergey,
 
I used PassThru() method of  EFI_EXT_SCSI_PASS_THRU_PROTOCOL to perform eject command.
 
I am using EDK 1.06 source code as base version.
 
 
Thanks,
 
Suraj
 
 
 
 
 
 
 
 
 
From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Thursday, November 17, 2011 7:38 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Read data block from CD/DVD
 
Hi Suraj,
 
You can enter shell.efi and type here
Shell> dblk blk4 10
Where blk4 is your BlockIo device and 10 is LBA number in HEX.
 
What command did you propose to use for eject?
 
Sergey
 
On 17.11.2011, at 16:32, Suraj Joshi wrote:


Hello Experts,
 
Im develpoing an application for reading data from CD/DVD using EFI protocols. Im using EDK1.06 source code as base version. I found one protocol called as EFI_EXT_SCSI_PASS_THRU_PROTOCOL. My device is of ATA type. I constructed EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET packet and send it using PassThru() method. Please let me know how can I ensure my code read one block of data successfully. Is any tool like Winhex for reading data from sectors byte by byte from CD/DVD, so that Memory dump of my block of data can be matched with data displays in tool.
 
 
Please help me.
 
Thanks in adv.
 
BR
Suraj Joshi
 
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel