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.
7 * The V3VEE Project is a joint project between Northwestern University
8 * and the University of New Mexico. You can find out more at
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.
15 * Author: Zheng Cui<cuizheng@cs.unm.edu>
17 * This is free software. You are permitted to use,
18 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #ifndef __DEVICES_CDROM_H_
22 #define __DEVICES_CDROM_H_
24 #include <devices/ramdisk.h>
25 #include <devices/ide.h>
26 #include <palacios/vmm_types.h>
31 struct cdrom_interface;
35 void (*init)(struct cdrom_interface *cdrom);
38 * Load CD-ROM. Returns false if CD is not ready.
40 rd_bool (*insert_cdrom)(struct cdrom_interface *cdrom, char *dev /*= NULL*/);
43 * Logically eject the CD.
45 void (*eject_cdrom)(struct cdrom_interface *cdrom);
48 * Read CD TOC. Returns false if start track is out of bounds.
50 rd_bool (*read_toc)(struct cdrom_interface * cdrom, uint8_t * buf, int* length, rd_bool msf, int start_track);
53 * Return CD-ROM capacity (in 2048 byte frames)
55 uint32_t (*capacity)(struct cdrom_interface *cdrom);
58 * Read a single block from the CD
60 void (*read_block)(struct cdrom_interface *cdrom, uint8_t* buf, int lba);
63 * Start (spin up) the CD.
65 int (*start_cdrom)(struct cdrom_interface *cdrom);
69 struct cdrom_interface {
73 ulong_t fd; //memory address
75 ulong_t head; //current position
79 char *path; //for ramdisk, NULL
83 void init_cdrom(struct cdrom_interface *cdrom);