At any rate, I am still having issues, perhaps I am still doing it wrong:
Code:
#define secPerTrk 0x3F //= 63
#define maxHeadNm 0xFE //= 254
#define intATACmd 0x91 //= initialize ata command
unsigned long val;
unsigned long res;
// read, then write
pci_read_config_dword(&pci,BAR5+0x90,&i);
val=(i&0xFF00FFFF) + (secPerTrk<<16);
pci_write_config_dword(&pci, BAR5+0x90, val);
res=(i>>16) & 0xff;
//print
printf(0x0F,3,10,"res: 0x%x, val: 0x%x", res, val);
Output:
Shouldn't *res* be the same as *val*, and shouldn't val = 0x003F0000?