Is the memory model when BIOS transfers control to the Expansion ROM in big real mode? Not always.
In general, the system will probably be in big real mode, but if you are developing a ROM that will run on an arbitrary BIOS, this is not a safe assumption! If the BIOS supports PMM (Post Memory Manager), then the system is supposed to be in big real mode, otherwise there is no assurance of this. As far as I know, even if the BIOS support PMM, only the initial option ROM execution is guaranteed to be in big real mode.
It would probably be safer to:
- Only use legacy I/O access for the AHCI registers (this is also the easiest)
- Check to see if the BIOS supports PMM first, then either use legacy I/O or MMIO (but only during BIOS option ROM init)
- Go ahead and put the CPU in to big real mode and use MMIO to access those registers (for bonus points, you could put the system back to the state you found it in, but most BIOSs will clean up after you)
The reason why IDP used before might be: at that time when control is passed to expansion is still real mode, right ? Not exactly.
It's mostly likely because it is the safest and easiest option, since there is no assurance the system will be in big real mode (and would therefore be safe to use MMIO access above 1MB).
So the memory model is dependent on system BIOS, right ? No (with a caveat).
The system should be in real mode when the BIOS hands off control (to a boot loader or option ROM). Big real mode is basically an extension of this mode, but the BIOS will not put the system in other other mode (any protected mode, long mode, etc).
Links:
http://bioshacking.blogspot.com/2011/07/memory-management-in-legacy-bios.html
http://lists.ipxe.org/pipermail/ipxe-devel/2012-August/001736.html
http://wiki.osdev.org/Unreal_Mode
http://www.linkedin.com/groups/PCI-extension-memory-allocation-4330449.S.99498421
A short disclaimer: This really only applies to legacy BIOS or UEFI with legacy support. I apologize in advance if there are any errors!