added check to send correct(?) cmd on identify ATAPI device, added right shift to num lock map

This commit is contained in:
TomAwezome 2020-05-01 18:46:12 -04:00
parent 928f6d4671
commit 606d0b4568
4 changed files with 6 additions and 2 deletions

Binary file not shown.

5
src/Home/ahci.CC Normal file → Executable file
View File

@ -103,7 +103,10 @@ U0 AHCIPortIdentify(CBlkDev *bd)
cmd_fis = &cmd_table->command_fis;
MemSet(cmd_fis, 0, sizeof(CFisH2D));
cmd_fis->type = FISt_H2D;
cmd_fis->command = ATA_IDENTIFY;
if (Bt(&port->command, AHCI_PxCMDf_ATAPI))
cmd_fis->command = ATA_IDENTIFY_PACKET;
else
cmd_fis->command = ATA_IDENTIFY;
cmd_fis->device = 0; //No bits need to be set in the device register.
Bts(&cmd_fis->desc, AHCI_CF_DESCf_C); //Set cmd_fis->c to 1 (Command bit).

View File

@ -2896,6 +2896,7 @@ class CHBACmdTable
#define ATA_WRITE_MULTI_EXT 0x39
#define ATA_WRITE_DMA_EXT 0x35
#define ATA_IDENTIFY 0xEC
#define ATA_IDENTIFY_PACKET 0xA1 // IDENTIFY PACKET DEVICE, mirror of ATA_PACKET for ATAPI
#define ATAS_ERR 0x01
#define ATAS_DRQ 0x08

View File

@ -180,7 +180,7 @@ U8 num_lock_map[0x100]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,SC_SHIFT,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,8,9,10,0,5,6,7,0,2,
3,4,11,0x34,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,