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 debug print syntax errors
[palacios.git] / palacios / src / devices / nvram.c
index e53f5c3..5d433bb 100644 (file)
@@ -409,7 +409,7 @@ static void update_time(struct vm_device * dev, uint_t period_us) {
   // Interrupt associated VM, if needed
   if (statc->irq) { 
     PrintDebug("nvram: injecting interrupt\n");
-    dev->vm->vm_ops.raise_irq(dev->vm, NVRAM_RTC_IRQ);
+    v3_raise_irq(dev->vm, NVRAM_RTC_IRQ);
   }
 }
 
@@ -428,7 +428,15 @@ static int handle_timer_event(struct guest_info * info,
 }
 
 static int set_nvram_defaults(struct vm_device * dev) {
+  struct guest_info * info = dev->vm;
   struct nvram_internal * nvram_state = (struct nvram_internal *)dev->private_data;
+  
+  /* TODO:
+   * The amount of ram in the system is stored in info->mem_size
+   * We need to reflect that value correctly here
+   */
+  PrintError("TODO: Set the nvram memory register to reflect info->mem_size (%p)\n", (void *)(info->mem_size));
+  
 
   //
   // 2 1.44 MB floppy drives
@@ -593,7 +601,7 @@ static int nvram_write_data_port(ushort_t port,
 
 
 static int nvram_init_device(struct vm_device * dev) {
+
   struct nvram_internal * data = (struct nvram_internal *)dev->private_data;
 
   PrintDebug("nvram: init_device\n");
@@ -602,6 +610,8 @@ static int nvram_init_device(struct vm_device * dev) {
 
   // Would read state here
   set_nvram_defaults(dev);
+  
+
 
   nvram_reset_device(dev);
 
@@ -642,7 +652,7 @@ struct vm_device * v3_create_nvram() {
 
   nvram_state = (struct nvram_internal *)V3_Malloc(sizeof(struct nvram_internal) + 1000);
 
-  PrintDebug("nvram: internal at %x\n", nvram_state);
+  PrintDebug("nvram: internal at %p\n", (void *)nvram_state);
 
   struct vm_device * device = v3_create_device("NVRAM", &dev_ops, nvram_state);