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.


fixed cdrom
[palacios.git] / palacios / src / devices / cdrom.c
index eaf073f..ff1c55c 100644 (file)
@@ -18,6 +18,8 @@
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
+
+
 #include <devices/cdrom.h>
 #include <devices/ide.h>
 #include <palacios/vmm.h>
@@ -64,6 +66,7 @@ static void cdrom_eject(void * private_data) {
  */
 static rd_bool cdrom_read_toc(void * private_data, uint8_t* buf, int* length, rd_bool msf, int start_track)
 {
+  *length = 4;
   PrintDebug("[cdrom_read_toc]\n");
   return 1;
 }
@@ -101,7 +104,7 @@ static void cdrom_read_block(void * private_data, uint8_t * buf, int lba)/* __at
   
   PrintDebug("[cdrom_read_block] lba = %d (cdrom_image_start=%x)\n", lba, cdrom->image_addr);
   memcpy(buf, (uchar_t *)(cdrom->image_addr + lba * 2048), 2048);
-  PrintDebug("Returning from read block\n");
+  //PrintDebug("Returning from read block\n");
   return;
 }
 
@@ -165,13 +168,13 @@ struct vm_device *  v3_create_cdrom(struct vm_device * ramdisk_dev, void * ramdi
 
   memset(cd, 0, sizeof(struct cdrom_state));
 
-  cd->image_addr = (uchar_t *)ramdisk;
+  cd->image_addr = (uchar_t *)V3_VAddr(ramdisk);
   cd->capacity_in_bytes = ramdisk_size;
   cd->ide_dev = ramdisk_dev;
   
   PrintDebug("Creating RamDISK CDROM\n");
 
-  struct vm_device * cd_dev = create_device("Ram Based CD", &dev_ops, cd);
+  struct vm_device * cd_dev = v3_create_device("Ram Based CD", &dev_ops, cd);
 
   return cd_dev;
 }