aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-11-12 22:23:01 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-11-12 22:23:01 +0000
commitbd0d90b21d84c7ac3eb258fbf93bec1cbf277986 (patch)
tree8657eef3a9c02bbaf22e0c1efbb60a7ace7b870f /hw
parent1a0636f8d79088e967f9fa0f93962008c0b303d9 (diff)
make Knoppix CD-ROM probe happy
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@448 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/ide.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/hw/ide.c b/hw/ide.c
index 96e43da5cc..49ae488bbb 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -371,6 +371,17 @@ static void padstr(char *str, const char *src, int len)
}
}
+static void padstr8(uint8_t *buf, int buf_size, const char *src)
+{
+ int i;
+ for(i = 0; i < buf_size; i++) {
+ if (*src)
+ buf[i] = *src++;
+ else
+ buf[i] = ' ';
+ }
+}
+
static void ide_identify(IDEState *s)
{
uint16_t *p;
@@ -1013,6 +1024,21 @@ static void ide_atapi_cmd(IDEState *s)
cpu_to_ube32(buf + 4, 2048);
ide_atapi_cmd_reply(s, 8, 8);
break;
+ case GPCMD_INQUIRY:
+ max_len = packet[4];
+ buf[0] = 0x05; /* CD-ROM */
+ buf[1] = 0x80; /* removable */
+ buf[2] = 0x00; /* ISO */
+ buf[3] = 0x21; /* ATAPI-2 (XXX: put ATAPI-4 ?) */
+ buf[4] = 31; /* additionnal length */
+ buf[5] = 0; /* reserved */
+ buf[6] = 0; /* reserved */
+ buf[7] = 0; /* reserved */
+ padstr8(buf + 8, 8, "QEMU");
+ padstr8(buf + 16, 16, "QEMU CD-ROM");
+ padstr8(buf + 32, 4, QEMU_VERSION);
+ ide_atapi_cmd_reply(s, 36, max_len);
+ break;
default:
error_cmd:
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,