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.


173c08d275fd38cf8f52ec222c17567dd06dc042
[palacios.git] / palacios / include / devices / cdrom.h
1
2 /*
3  * This file is part of the Palacios Virtual Machine Monitor developed
4  * by the V3VEE Project with funding from the United States National 
5  * Science Foundation and the Department of Energy.  
6  *
7  * The V3VEE Project is a joint project between Northwestern University
8  * and the University of New Mexico.  You can find out more at 
9  * http://www.v3vee.org
10  *
11  * Copyright (c) 2008, Zheng Cui<cuizheng@cs.unm.edu> 
12  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
13  * All rights reserved.
14  *
15  * Author: Zheng Cui<cuizheng@cs.unm.edu> 
16  *
17  * This is free software.  You are permitted to use,
18  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
19  */
20
21 #ifndef __DEVICES_CDROM_H_
22 #define __DEVICES_CDROM_H_
23
24 #include <devices/ramdisk.h>
25 #include <devices/ide.h>
26 #include <palacios/vmm_types.h>
27
28
29
30
31 struct cdrom_interface;
32
33 struct cdrom_ops {
34   
35   void (*init)(struct cdrom_interface *cdrom);
36
37   /* 
38    * Load CD-ROM. Returns false if CD is not ready. 
39    */
40   rd_bool (*insert_cdrom)(struct cdrom_interface *cdrom, char *dev /*= NULL*/);
41
42   /* 
43    * Logically eject the CD.
44    */
45   void (*eject_cdrom)(struct cdrom_interface *cdrom);
46   
47   /* 
48    * Read CD TOC. Returns false if start track is out of bounds.
49    */
50   rd_bool (*read_toc)(struct cdrom_interface * cdrom, uint8_t * buf, int* length, rd_bool msf, int start_track);
51   
52   /* 
53    * Return CD-ROM capacity (in 2048 byte frames)
54    */
55   uint32_t (*capacity)(struct cdrom_interface *cdrom);
56   
57   /*
58    * Read a single block from the CD
59    */
60   void (*read_block)(struct cdrom_interface *cdrom, uint8_t* buf, int lba);
61   
62   /*
63    * Start (spin up) the CD.
64    */
65   int (*start_cdrom)(struct cdrom_interface *cdrom);
66 };
67
68
69 struct cdrom_interface {
70
71   struct cdrom_ops ops;
72
73   ulong_t fd; //memory address
74   ulong_t capacity_B;
75   ulong_t head; //current position
76
77   uchar_t lba;
78
79   char *path; //for ramdisk, NULL
80   int using_file; //no
81 };
82
83 void init_cdrom(struct cdrom_interface *cdrom);
84
85 #endif