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.


build reorganization
[palacios.git] / palacios / src / devices / cdrom.c
index 75b7e33..4a52bb4 100644 (file)
@@ -1,10 +1,23 @@
 /*
- * Zheng Cui
- * cuizheng@cs.unm.edu
- * July 2008
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2008, Zheng Cui <cuizheng@cs.unm.edu> 
+ * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
+ * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Zheng Cui <cuizheng@cs.unm.edu> 
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
-
 #include <devices/cdrom.h>
 #include <palacios/vmm.h>
 
 #endif
 
 
-extern ulong_t g_ramdiskImage;
-extern ulong_t s_ramdiskSize;
+
+ulong_t g_ramdiskImage;
+ulong_t s_ramdiskSize;
 
 static
-void cdrom_init(struct cdrom_interface *cdrom)
+void cdrom_init(struct cdrom_interface * cdrom)
 {
 
   Ramdisk_Print_CD("[cdrom_init]\n");
   V3_ASSERT(g_ramdiskImage);
   cdrom->fd = g_ramdiskImage;
+  PrintDebug("CDIMAGE located at: %x\n", cdrom->fd);
   cdrom->capacity_B = s_ramdiskSize; 
   //FIXME:lba
   cdrom->lba = 1; 
@@ -36,7 +51,7 @@ void cdrom_init(struct cdrom_interface *cdrom)
  */
  
 static
-rd_bool cdrom_insert(struct cdrom_interface *cdrom, char *dev /*= NULL*/)
+rd_bool cdrom_insert(struct cdrom_interface * cdrom, char *dev /*= NULL*/)
 {
   Ramdisk_Print_CD("[cdrom_insert]\n");
   return 1;
@@ -56,7 +71,7 @@ void cdrom_eject(struct cdrom_interface *cdrom)
  * Read CD TOC. Returns false if start track is out of bounds.
  */
 static
-rd_bool cdrom_read_toc(struct cdrom_interface *cdrom, uint8* buf, int* length, rd_bool msf, int start_track)
+rd_bool cdrom_read_toc(struct cdrom_interface *cdrom, uint8_t* buf, int* length, rd_bool msf, int start_track)
 {
   Ramdisk_Print_CD("[cdrom_read_toc]\n");
   return 1;
@@ -66,7 +81,7 @@ rd_bool cdrom_read_toc(struct cdrom_interface *cdrom, uint8* buf, int* length, r
  * Return CD-ROM capacity (in 2048 byte frames)
  */
 static
-uint32 cdrom_capacity(struct cdrom_interface *cdrom)
+uint32_t cdrom_capacity(struct cdrom_interface *cdrom)
 {
   Ramdisk_Print_CD("[cdrom_capacity] s_ramdiskSize = %d\n", cdrom->capacity_B);
   if (cdrom->lba) {
@@ -87,13 +102,14 @@ uint32 cdrom_capacity(struct cdrom_interface *cdrom)
  * Read a single block from the CD
  */
 static
-void cdrom_read_block(struct cdrom_interface *cdrom, uint8* buf, int lba)// __attribute__(regparm(2));
+void cdrom_read_block(struct cdrom_interface *cdrom, uint8_t* buf, int lba)// __attribute__(regparm(2));
 {
 
   V3_ASSERT(lba != 0);
-    
-  Ramdisk_Print_CD("[cdrom_read_block] lba = %d\n", lba);
-  memcpy(buf, (uint8 *)(cdrom->fd + lba*2048), 2048);
+  
+  Ramdisk_Print_CD("[cdrom_read_block] lba = %d (cdrom_image_start=%x)\n", lba, cdrom->fd);
+  memcpy(buf, (uint8_t *)(cdrom->fd + lba * 2048), 2048);
+  PrintDebug("Returning from read block\n");
     return;
 }
 
@@ -123,3 +139,4 @@ void init_cdrom(struct cdrom_interface *cdrom)
   return;
 }
 
+