diff --git a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c index 1405962b960..75a04fe7ea8 100644 --- a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c +++ b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c @@ -825,8 +825,8 @@ VOID WINAPI DosInt21h(LPWORD Stack) { setAX(LOWORD(SectorsPerCluster)); setCX(LOWORD(BytesPerSector)); - setBX(LOWORD(NumberOfFreeClusters)); - setDX(LOWORD(TotalNumberOfClusters)); + setBX(min(NumberOfFreeClusters, 0xFFFF)); + setDX(min(TotalNumberOfClusters, 0xFFFF)); } else { @@ -1873,6 +1873,15 @@ VOID WINAPI DosInt27h(LPWORD Stack) DosTerminateProcess(getCS(), 0, (getDX() + 0x0F) >> 4); } +VOID WINAPI DosIdle(LPWORD Stack) +{ + /* + * This will set the carry flag on the first call (to repeat the BOP), + * and clear it in the next, so that exactly one HLT occurs. + */ + setCF(!getCF()); +} + VOID WINAPI DosFastConOut(LPWORD Stack) { /* @@ -2070,10 +2079,13 @@ BOOLEAN DosKRNLInitialize(VOID) RegisterDosInt32(0x23, DosBreakInterrupt); // Ctrl-C / Ctrl-Break // RegisterDosInt32(0x24, DosInt24h ); // Critical Error RegisterDosInt32(0x27, DosInt27h ); // Terminate and Stay Resident + RegisterDosInt32(0x28, DosIdle ); // DOS Idle Interrupt RegisterDosInt32(0x29, DosFastConOut ); // DOS 2+ Fast Console Output RegisterDosInt32(0x2F, DosInt2Fh ); /* Unimplemented DOS interrupts */ + RegisterDosInt32(0x25, NULL); // Absolute Disk Read + RegisterDosInt32(0x26, NULL); // Absolute Disk Write RegisterDosInt32(0x2A, NULL); // Network - Installation Check /* Load the CON driver */ diff --git a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c index a5140777f4d..d1e22b1891e 100644 --- a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c +++ b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c @@ -212,8 +212,11 @@ VOID DosCreatePsp(WORD Segment, WORD ProgramSize) /* Set the parent PSP */ PspBlock->ParentPsp = Sda->CurrentPsp; - /* No environment block yet */ - PspBlock->EnvBlock = 0; + if (Sda->CurrentPsp != SYSTEM_PSP) + { + /* Link to the parent's environment block */ + PspBlock->EnvBlock = SEGMENT_TO_PSP(Sda->CurrentPsp)->EnvBlock; + } /* Copy the parent handle table */ DosCopyHandleTable(PspBlock->HandleTable);