As I knew the AHCI expansion ROM uses IDP(Index/Data pair) to access the AHCI registers(global and Port registers).
The ahci spec v1.3 says:
The IDP mechanism allows host software to access all of the MMIO registers using indirect I/O addressing
Thus even ABAR is above 1MB, expansion ROM still can access MMIO in real mode via this way.
But we found within expansion below way is OK when accessing AHCI MMIO registers:
push 0000h
pop es ; set es = 0
mov bx, F732h
shl ebx, 16
mov bx, 0000h ; put ABAR to ebx register
mov eax, es:[ebx] ; read AHCI CAP registers to eax(4byte)
If above is OK then it implies the memory model now is not real mode(I guess it's big-real mode,that is, access under 4G is ok)
Our question is if the memory model when BIOS transfers control to Expansion is big-real mode nowadays (anyway, not real-mode) ? If yes then we can always use the memory operation to access AHCI's MMIO... It is correct ?
- The reason why IDP used before might be: at that time when control is passed to expansion is still real mode, right ? So the memory model is dependent on system BIOS, right ?