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__
27 #include <devices/ramdisk.h>
28 #include <devices/ide.h>
29 #include <palacios/vmm_types.h>
37 * Load CD-ROM. Returns false if CD is not ready.
39 rd_bool (*insert_cdrom)(void * private_data);
42 * Logically eject the CD.
44 void (*eject_cdrom)(void * private_data);
47 * Read CD TOC. Returns false if start track is out of bounds.
49 rd_bool (*read_toc)(void * private_data, uchar_t * buf, int * length, rd_bool msf, int start_track);
52 * Return CD-ROM capacity (in 2048 byte frames)
54 uint32_t (*capacity)(void * private_data);
57 * Read a single block from the CD
59 void (*read_block)(void * private_data, uchar_t * buf, int lba);
62 * Start (spin up) the CD.
64 int (*start_cdrom)(void * private_data);
66 void (*set_LBA)(void * private_data, uchar_t lba);
72 struct vm_device * v3_create_cdrom(struct vm_device * ramdisk_dev, void * ramdisk, uint_t ramdisk_size);