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.


reworked ramdisk now compiles, not tested
[palacios.git] / palacios / include / devices / cdrom.h
1 /*
2  * Zheng Cui
3  * cuizheng@cs.unm.edu
4  * July 2008
5  */
6
7 #ifndef __DEVICES_CDROM_H_
8 #define __DEVICES_CDROM_H_
9
10 #include <devices/ramdisk.h>
11 #include <devices/ide.h>
12 #include <palacios/vmm_types.h>
13
14
15
16
17 struct cdrom_interface;
18
19 struct cdrom_ops {
20   
21   void (*init)(struct cdrom_interface *cdrom);
22
23   /* 
24    * Load CD-ROM. Returns false if CD is not ready. 
25    */
26   rd_bool (*insert_cdrom)(struct cdrom_interface *cdrom, char *dev /*= NULL*/);
27
28   /* 
29    * Logically eject the CD.
30    */
31   void (*eject_cdrom)(struct cdrom_interface *cdrom);
32   
33   /* 
34    * Read CD TOC. Returns false if start track is out of bounds.
35    */
36   rd_bool (*read_toc)(struct cdrom_interface * cdrom, uint8_t * buf, int* length, rd_bool msf, int start_track);
37   
38   /* 
39    * Return CD-ROM capacity (in 2048 byte frames)
40    */
41   uint32_t (*capacity)(struct cdrom_interface *cdrom);
42   
43   /*
44    * Read a single block from the CD
45    */
46   void (*read_block)(struct cdrom_interface *cdrom, uint8_t* buf, int lba);
47   
48   /*
49    * Start (spin up) the CD.
50    */
51   int (*start_cdrom)(struct cdrom_interface *cdrom);
52 };
53
54
55 struct cdrom_interface {
56
57   struct cdrom_ops ops;
58
59   ulong_t fd; //memory address
60   ulong_t capacity_B;
61   ulong_t head; //current position
62
63   uchar_t lba;
64
65   char *path; //for ramdisk, NULL
66   int using_file; //no
67 };
68
69 void init_cdrom(struct cdrom_interface *cdrom);
70
71 #endif