- MM_Map( 0, 0 ); // IVT / BDA
- // Map (but allow allocation) of 0x1000 - 0x9F000
- // - So much hack, it isn't funny
- // TODO: Remove this and replce with something less hacky
- for(i=1;i<0x9F;i++) {
- MM_Map( i * 0x1000, i * 0x1000 );
- while(MM_GetRefCount(i*0x1000))
- MM_DerefPhys( i * 0x1000 );
+ MM_RefPhys(0);
+ MM_Map( (void*)0, 0 ); // IVT / BDA
+ if( MM_GetRefCount(0x00000) > 2 ) {
+ Log_Notice("VM8086", "Ok, who's touched the IVT? (%i)",
+ MM_GetRefCount(0x00000));
+ }
+ MM_RefPhys(0x9F000);
+ MM_Map( (void*)0x9F000, 0x9F000 ); // Stack / EBDA
+ if( MM_GetRefCount(0x9F000) > 2 ) {
+ Log_Notice("VM8086", "And who's been playing with my EBDA? (%i)",
+ MM_GetRefCount(0x9F000));