Author: aandrejevic
Date: Fri Jun 5 22:22:04 2015
New Revision: 68028
URL:
http://svn.reactos.org/svn/reactos?rev=68028&view=rev
Log:
[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.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Fri Jun 5
22:22:04 2015
@@ -825,8 +825,8 @@
{
setAX(LOWORD(SectorsPerCluster));
setCX(LOWORD(BytesPerSector));
- setBX(LOWORD(NumberOfFreeClusters));
- setDX(LOWORD(TotalNumberOfClusters));
+ setBX(min(NumberOfFreeClusters, 0xFFFF));
+ setDX(min(TotalNumberOfClusters, 0xFFFF));
}
else
{
@@ -1871,6 +1871,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 @@
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 */
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] Fri Jun 5
22:22:04 2015
@@ -212,8 +212,11 @@
/* 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);