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.


add interrupt deinitialization to devices
[palacios.git] / palacios / src / devices / ide.c
index 0af2198..4c06677 100644 (file)
@@ -956,6 +956,26 @@ static int write_cmd_port(struct guest_info * core, ushort_t port, void * src, u
 
            break;
        }
+
+       case 0x08: // Reset Device
+           drive_reset(drive);
+           channel->error_reg.val = 0x01;
+           channel->status.busy = 0;
+           channel->status.ready = 1;
+           channel->status.seek_complete = 1;
+           channel->status.write_fault = 0;
+           channel->status.error = 0;
+           break;
+
+       case 0xe5: // Check power mode
+           drive->sector_count = 0xff; /* 0x00=standby, 0x80=idle, 0xff=active or idle */
+           channel->status.busy = 0;
+           channel->status.ready = 1;
+           channel->status.write_fault = 0;
+           channel->status.data_req = 0;
+           channel->status.error = 0;
+           break;
+
        case 0xc4:  // read multiple sectors
            drive->hd_state.cur_sector_num = drive->hd_state.mult_sector_num;
        default:
@@ -1430,20 +1450,18 @@ static int init_ide_state(struct ide_internal * ide) {
 
 
 
-static int ide_free(struct vm_device * dev) {
-    // unhook io ports....
-
+static int ide_free(struct ide_internal * ide) {
 
     // deregister from PCI?
 
-
+    V3_Free(ide);
 
     return 0;
 }
 
 
 static struct v3_device_ops dev_ops = {
-    .free = ide_free,
+    .free = (int (*)(void *))ide_free,
 
 };