mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTVDM]
- Implement the DOS idle interrupt. - Link to the parent's environment block by default in DosCreatePsp. - Fix INT 21h/36h (Get Free Space) to report 0xFFFF if the number of clusters is too high to fit in a word. svn path=/trunk/; revision=68028
This commit is contained in:
parent
44d853be5b
commit
50f36e7cb3
2 changed files with 19 additions and 4 deletions
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue