Search
lxdream.org :: lxdream :: r140:d26f4899898d
lxdream 0.9.1
released Jun 29
Download Now
changeset140:d26f4899898d
parent139:128f569e004e
child141:1f563629ab2a
authornkeynes
dateSun Apr 30 12:22:31 2006 +0000 (14 years ago)
Fix IDENTIFY to be non-completely-broken
src/gdrom/ide.c
1.1 --- a/src/gdrom/ide.c Sun Apr 30 01:51:29 2006 +0000
1.2 +++ b/src/gdrom/ide.c Sun Apr 30 12:22:31 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: ide.c,v 1.9 2006-04-30 01:51:08 nkeynes Exp $
1.6 + * $Id: ide.c,v 1.10 2006-04-30 12:22:31 nkeynes Exp $
1.7 *
1.8 * IDE interface implementation
1.9 *
1.10 @@ -234,10 +234,15 @@
1.11 /* NB: Bios sets cmd[4] = 0x08, no idea what this is for;
1.12 * different values here appear to have no effect.
1.13 */
1.14 - length = *((uint16_t*)(cmd+2));
1.15 - if( length > sizeof(gdrom_ident) )
1.16 - length = sizeof(gdrom_ident);
1.17 - ide_set_read_buffer(gdrom_ident, length, blocksize);
1.18 + lba = cmd[2];
1.19 + if( lba >= sizeof(gdrom_ident) ) {
1.20 + ide_set_error(0x50);
1.21 + return;
1.22 + }
1.23 + length = cmd[4];
1.24 + if( lba+length > sizeof(gdrom_ident) )
1.25 + length = sizeof(gdrom_ident) - lba;
1.26 + ide_set_read_buffer(gdrom_ident + lba, length, blocksize);
1.27 break;
1.28 case PKT_CMD_READ_TOC:
1.29 if( !gdrom_get_toc( data_buffer ) ) {
.