jal wrote:Ready4Dis wrote:I jump back and forth between r-mode and unreal mode (flat real mode) while loading
Ehmm... I hope this doesn't mean what it seems to mean. Flat real is just real mode. You can do anything you can also do in real mode, and of course a bit more. There's no need to go jumping (let alone back and forth).
JAL
I'm affraid it does man, I switch back and forth between the two, they are NOT identical, and there is no gaurantee that the bios interrupts won't touch your segment registers, so you can't gaurantee that the calls will work properly. Unless I missed something, reloading ds or es will cause you to leave unreal mode, and who's to say that bios interrupts don't do this? A simple push/pop can cause it, or sometimes the bios functions run in pmode (16-bit or 32-bit), so they would hose up unreal mode. I know this isn't common practice, but it does happen, and I'd rather just avoid it. I wrote a copy32 function that takes esi,edi and ecx, sets the pmode flag, reloads ds,es, does the rep movsd call, then clears the pmode flag, pop's ds/es and returns. I know, most bios interrupts avoid changing these registers, and avoid trying to change modes, since they have to work in vm86 mode, so I may switch back to the other method, but for now this works and is fast enough.
--- Edit ---
Well, after a bit of thinking, i'm pretty sure most bios functions won't touch ds, since it would break vm86 mode. so I will probably change my method soon, however, interestingly, I realized I am doing the rep movsd call before clearing the pmode bit, so I actually don't know what state the cpu thinks it's in, but it has the 16-bit real-mode CS in there, and 32-bit DS/ES, i need to do an a32 rep movsd call (rather than a regular rep movsd), so possibly I have something messed up (however it works, but I think I am going to set unreal mode in the beginning and just assume it won't get hosed).