From: Hermès Bélusca-Maïto Date: Fri, 8 May 2015 19:43:12 +0000 (+0000) Subject: [NTVDM]: Merge Bios32 ResetBop with POST function. X-Git-Tag: backups/colins-printing-for-freedom@73041~24^2~106 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=410c54e5f96b63e2f5ca67bb373d71a88a8c69ff [NTVDM]: Merge Bios32 ResetBop with POST function. svn path=/trunk/; revision=67602 --- diff --git a/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c b/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c index c5ce5f2de2c..29efe3267b0 100644 --- a/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c +++ b/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c @@ -635,8 +635,9 @@ static VOID InitializeBiosInfo(VOID) /* * The BIOS POST (Power On-Self Test) */ -VOID -Bios32Post(VOID) +static VOID +WINAPI +Bios32Post(LPWORD Stack) { #if 0 BOOLEAN Success; @@ -645,6 +646,9 @@ Bios32Post(VOID) DPRINT("Bios32Post\n"); + /* Disable interrupts */ + setIF(0); + /* Initialize the stack */ // That's what says IBM... (stack at 30:00FF going downwards) // setSS(0x0000); @@ -686,7 +690,7 @@ Bios32Post(VOID) case 0x04: { DPRINT1("Fast restart to Bootstrap Loader...\n"); - return; + goto Quit; // Reenable interrupts and exit. } /* Flush keyboard, issue an EOI... */ @@ -711,7 +715,7 @@ Bios32Post(VOID) HIWORD(Bda->ResumeEntryPoint), LOWORD(Bda->ResumeEntryPoint)); - /* Position execution pointers to Bda->ResumeEntryPoint and return */ + /* Position execution pointers and return with interrupts disabled */ setCS(HIWORD(Bda->ResumeEntryPoint)); setIP(LOWORD(Bda->ResumeEntryPoint)); return; @@ -764,8 +768,6 @@ Bios32Post(VOID) /* Initialize the Keyboard, Video and Mouse BIOS */ if (!KbdBios32Initialize() || !VidBios32Initialize() || !MouseBios32Initialize()) { - // return FALSE; - /* Stop the VDM */ EmulatorTerminate(); return; @@ -796,18 +798,8 @@ Bios32Post(VOID) * the rest of the POST code is executed, typically calling INT 19h * to boot up the OS. */ -} - -static VOID WINAPI Bios32ResetBop(LPWORD Stack) -{ - DPRINT("Bios32ResetBop\n"); - - /* Disable interrupts */ - setIF(0); - - /* Do the POST */ - Bios32Post(); +Quit: /* Enable interrupts */ setIF(1); } @@ -839,7 +831,7 @@ BOOLEAN Bios32Initialize(VOID) *(PBYTE)(SEG_OFF_TO_PTR(0xF000, 0xFFFE)) = BIOS_MODEL; /* Redefine our POST function */ - RegisterBop(BOP_RESET, Bios32ResetBop); + RegisterBop(BOP_RESET, Bios32Post); /* We are done */ return TRUE;