Commit bd0d90b2 authored by bellard's avatar bellard
Browse files

make Knoppix CD-ROM probe happy


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@448 c046a42c-6fe2-441c-8c8c-71466251a162
parent 1a0636f8
...@@ -371,6 +371,17 @@ static void padstr(char *str, const char *src, int len) ...@@ -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) static void ide_identify(IDEState *s)
{ {
uint16_t *p; uint16_t *p;
...@@ -1013,6 +1024,21 @@ static void ide_atapi_cmd(IDEState *s) ...@@ -1013,6 +1024,21 @@ static void ide_atapi_cmd(IDEState *s)
cpu_to_ube32(buf + 4, 2048); cpu_to_ube32(buf + 4, 2048);
ide_atapi_cmd_reply(s, 8, 8); ide_atapi_cmd_reply(s, 8, 8);
break; 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: default:
error_cmd: error_cmd:
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment