Author: hbelusca
Date: Mon Sep 28 22:15:06 2015
New Revision: 69411
URL:
http://svn.reactos.org/svn/reactos?rev=69411&view=rev
Log:
[NTVDM]
- Add floppy image automount support from the registry, as it was done for HDDs in r69390
(it's really copy-paste & adaptation of the existing code).
- Increase HDD number support from 1 to 4 (maximum) for INT 13h.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c
trunk/reactos/subsystems/mvdm/ntvdm/emulator.c
trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c
trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c [iso-8859-1] Mon Sep 28
22:15:06 2015
@@ -32,7 +32,7 @@
// they will be arrays of objects containing disk information needed by
// the BIOS only.
static PDISK_IMAGE FloppyDrive[2] = {NULL};
-static PDISK_IMAGE HardDrive[1] = {NULL};
+static PDISK_IMAGE HardDrive[4] = {NULL};
#pragma pack(push, 1)
@@ -689,6 +689,9 @@
FloppyDrive[0] = RetrieveDisk(FLOPPY_DISK, 0);
FloppyDrive[1] = RetrieveDisk(FLOPPY_DISK, 1);
HardDrive[0] = RetrieveDisk(HARD_DISK, 0);
+ HardDrive[1] = RetrieveDisk(HARD_DISK, 1);
+ HardDrive[2] = RetrieveDisk(HARD_DISK, 2);
+ HardDrive[3] = RetrieveDisk(HARD_DISK, 3);
return TRUE;
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emul…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] Mon Sep 28 22:15:06 2015
@@ -553,6 +553,17 @@
return FALSE;
}
+ /* Mount the available floppy disks */
+ for (i = 0; i < ARRAYSIZE(GlobalSettings.FloppyDisks); ++i)
+ {
+ if (GlobalSettings.FloppyDisks[i].Length != 0 &&
+ GlobalSettings.FloppyDisks[i].Buffer &&
+ GlobalSettings.FloppyDisks[i].Buffer != '\0')
+ {
+ MountDisk(FLOPPY_DISK, i, GlobalSettings.FloppyDisks[i].Buffer, FALSE);
+ }
+ }
+
/* Mount the available hard disks */
for (i = 0; i < ARRAYSIZE(GlobalSettings.HardDisks); ++i)
{
Modified: trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/ntvd…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c [iso-8859-1] Mon Sep 28 22:15:06 2015
@@ -335,6 +335,43 @@
static NTSTATUS
NTAPI
+NtVdmConfigureFloppy(IN PWSTR ValueName,
+ IN ULONG ValueType,
+ IN PVOID ValueData,
+ IN ULONG ValueLength,
+ IN PVOID Context,
+ IN PVOID EntryContext)
+{
+ PNTVDM_SETTINGS Settings = (PNTVDM_SETTINGS)Context;
+ UNICODE_STRING ValueString;
+ ULONG DiskNumber = (ULONG)EntryContext;
+
+ ASSERT(DiskNumber < ARRAYSIZE(Settings->FloppyDisks));
+
+ /* Check whether the Hard Disk entry was not already configured */
+ if (Settings->FloppyDisks[DiskNumber].Buffer != NULL)
+ {
+ DPRINT1("Floppy Disk %d -- '%Z' already configured\n",
DiskNumber, &Settings->FloppyDisks[DiskNumber]);
+ return STATUS_SUCCESS;
+ }
+
+ /* Check for the type of the value */
+ if (ValueType != REG_SZ)
+ {
+ RtlInitEmptyAnsiString(&Settings->FloppyDisks[DiskNumber], NULL, 0);
+ return STATUS_SUCCESS;
+ }
+
+ /* Convert the UNICODE string to ANSI and store it */
+ RtlInitEmptyUnicodeString(&ValueString, (PWCHAR)ValueData, ValueLength);
+ ValueString.Length = ValueString.MaximumLength;
+ RtlUnicodeStringToAnsiString(&Settings->FloppyDisks[DiskNumber],
&ValueString, TRUE);
+
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+NTAPI
NtVdmConfigureHDD(IN PWSTR ValueName,
IN ULONG ValueType,
IN PVOID ValueData,
@@ -388,6 +425,26 @@
RTL_QUERY_REGISTRY_NOEXPAND,
L"RomFiles",
NULL,
+ REG_NONE,
+ NULL,
+ 0
+ },
+
+ {
+ NtVdmConfigureFloppy,
+ 0,
+ L"FloppyDisk0",
+ (PVOID)0,
+ REG_NONE,
+ NULL,
+ 0
+ },
+
+ {
+ NtVdmConfigureFloppy,
+ 0,
+ L"FloppyDisk1",
+ (PVOID)1,
REG_NONE,
NULL,
0
@@ -480,6 +537,12 @@
if (Settings->RomFiles.Buffer)
RtlFreeAnsiString(&Settings->RomFiles);
+ for (i = 0; i < ARRAYSIZE(Settings->FloppyDisks); ++i)
+ {
+ if (Settings->FloppyDisks[i].Buffer)
+ RtlFreeAnsiString(&Settings->FloppyDisks[i]);
+ }
+
for (i = 0; i < ARRAYSIZE(Settings->HardDisks); ++i)
{
if (Settings->HardDisks[i].Buffer)
Modified: trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/ntvd…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h [iso-8859-1] Mon Sep 28 22:15:06 2015
@@ -76,6 +76,7 @@
{
ANSI_STRING BiosFileName;
ANSI_STRING RomFiles;
+ ANSI_STRING FloppyDisks[2];
ANSI_STRING HardDisks[4];
} NTVDM_SETTINGS, *PNTVDM_SETTINGS;