Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


IDE/ATAPI bug fix - allow sense and other requests to read past
[palacios.git] / palacios / src / devices / atapi.h
index f202d6d..fe29a2d 100644 (file)
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
+#ifndef __DEVICES_ATAPI_H__
+#define __DEVICES_ATAPI_H__
+
 #define ATAPI_PACKET_SIZE 12
 
 #include "atapi-types.h"
 
 
+
 /* ATAPI sucks...
  * The OS will write to the cylinder register the number of bytes it wants to read 
  * however the device can change that value 
@@ -235,9 +239,11 @@ static int atapi_read10(struct guest_info * core,
 static void atapi_req_sense(struct ide_internal * ide, struct ide_channel * channel) {
     struct ide_drive * drive = get_selected_drive(channel);
 
+    drive->cd_state.sense.read_len=0xa;
+
     memcpy(drive->data_buf, drive->cd_state.sense.buf, sizeof(drive->cd_state.sense.buf));
    
-    atapi_setup_cmd_resp(ide, channel, 18);
+    atapi_setup_cmd_resp(ide, channel, sizeof(drive->cd_state.sense.buf));
 }
 
 
@@ -723,3 +729,5 @@ static void atapi_identify_device(struct ide_drive * drive) {
     /* Disabled until command packet DMA is fixed */
     drive_id->dma_ultra = 0x2020; // Ultra_DMA_Mode_5_Selected | Ultra_DMA_Mode_5_Supported;
 }
+
+#endif