Author: ros-arm-bringup
Date: Tue Jul 22 00:31:24 2008
New Revision: 34655
URL:
http://svn.reactos.org/svn/reactos?rev=34655&view=rev
Log:
- Build vfatfs instead of CDFS.
- Load vfatfs instead of CDFS.
- Implement code in the ramdisk driver to handle both ISO and FAT ramdisks. Don't know
what the big deal with support ISO ramdisks was supposed to be, when our ramdisk is FAT,
and dealing with FAT is a lot easier than CDFS (no TOC emulation and other rubbish that
was added).
Modified:
trunk/reactos/ReactOS-arm.rbuild
trunk/reactos/boot/bootdata/hivesys_arm.inf
trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c
Modified: trunk/reactos/ReactOS-arm.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-arm.rbuild?rev=346…
==============================================================================
--- trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] (original)
+++ trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] Tue Jul 22 00:31:24 2008
@@ -153,8 +153,8 @@
</directory>
</directory>
<directory name="filesystems">
- <directory name="cdfs">
- <xi:include href="drivers/filesystems/cdfs/cdfs.rbuild" />
+ <directory name="fastfat">
+ <xi:include href="drivers/filesystems/fastfat/vfatfs.rbuild" />
</directory>
</directory>
<directory name="base">
Modified: trunk/reactos/boot/bootdata/hivesys_arm.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_arm.…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] Tue Jul 22 00:31:24 2008
@@ -762,12 +762,12 @@
; PNP Root device
HKLM,"SYSTEM\CurrentControlSet\Enum\HTREE\ROOT\0","",0x00000000,""
-; Cdfs (ISO96660) filesystem driver
-HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","ErrorControl",0x00010001,0x00000000
-HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","Group",0x00000000,"File
System"
-HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","ImagePath",0x00020000,"system32\drivers\cdfs.sys"
-HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","Start",0x00010001,0x00000000
-HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","Type",0x00010001,0x00000002
+; Virtual FAT filesystem driver
+HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","ErrorControl",0x00010001,0x00000000
+HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Group",0x00000000,"Boot
File System"
+HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","ImagePath",0x00020000,"system32\drivers\fastfat.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Start",0x00010001,0x00000000
+HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Type",0x00010001,0x00000002
; RAM Disk class driver
HKLM,"SYSTEM\CurrentControlSet\Services\Disk","ErrorControl",0x00010001,0x00000000
Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramd…
==============================================================================
--- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] Tue Jul 22 00:31:24
2008
@@ -23,6 +23,7 @@
#include <rtlfuncs.h>
#include <arc/arc.h>
#include <reactos/drivers/ntddrdsk.h>
+#include "../../../filesystems/fs_rec/fs_rec.h"
#include <stdio.h>
#define NDEBUG
#include <debug.h>
@@ -265,6 +266,31 @@
}
}
+PVOID
+NTAPI
+RamdiskMapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
+ IN LARGE_INTEGER Offset,
+ IN ULONG Length,
+ OUT PULONG OutputLength)
+{
+ DPRINT1("Mapping %lx bytes at %I64x\n", Length, Offset.QuadPart);
+ UNIMPLEMENTED;
+ while (TRUE);
+ return NULL;
+}
+
+PVOID
+NTAPI
+RamdiskUnmapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
+ IN PVOID BaseAddress,
+ IN LARGE_INTEGER Offset,
+ IN ULONG Length)
+{
+ UNIMPLEMENTED;
+ while (TRUE);
+ return NULL;
+}
+
NTSTATUS
NTAPI
RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
@@ -279,6 +305,10 @@
PVOID Buffer;
WCHAR LocalBuffer[16];
UNICODE_STRING SymbolicLinkName, DriveString, GuidString, DeviceName;
+ PPACKED_BIOS_PARAMETER_BLOCK Parameters;
+ ULONG BytesPerSector, SectorsPerTrack, Heads, BytesRead;
+ PVOID BaseAddress;
+ LARGE_INTEGER CurrentOffset;
//
// Check if we're a CDROM-type RAM disk
@@ -380,7 +410,8 @@
Status = IoCreateDevice(DeviceExtension->DeviceObject->DriverObject,
sizeof(RAMDISK_DRIVE_EXTENSION),
&DeviceName,
- FILE_DEVICE_CD_ROM,
+ (Input->Options.ExportAsCd) ?
+ FILE_DEVICE_CD_ROM : FILE_DEVICE_DISK,
0,
0,
&DeviceObject);
@@ -505,18 +536,86 @@
GuidString.Buffer = NULL;
//
- // Only support ISO stuff for now
- //
- ASSERT(Input->Options.ExportAsCd == TRUE);
- ASSERT(Input->DiskType == FILE_DEVICE_CD_ROM_FILE_SYSTEM);
-
- //
- // Setup partition parameters
- //
- DriveExtension->BytesPerSector = 2048; // 512 for Disk
- DriveExtension->SectorsPerTrack = 32; // 128 for disk
- DriveExtension->NumberOfHeads = 64; // 16 for disk
-
+ // Check if this is an ISO boot, or a registry ram drive
+ //
+ if (!(Input->Options.ExportAsCd) &&
+ (Input->DiskType == FILE_DEVICE_CD_ROM_FILE_SYSTEM))
+ {
+ //
+ // Not an ISO boot, but it's a boot FS -- map it to figure out the
+ // drive settings
+ //
+ CurrentOffset.QuadPart = 0;
+ BaseAddress = RamdiskMapPages(DriveExtension,
+ CurrentOffset,
+ PAGE_SIZE,
+ &BytesRead);
+ if (BaseAddress)
+ {
+ //
+ // Get the data
+ //
+ Parameters = (PPACKED_BIOS_PARAMETER_BLOCK)BaseAddress;
+ BytesPerSector = Parameters->BytesPerSector[0];
+ SectorsPerTrack = Parameters->SectorsPerTrack[0];
+ Heads = Parameters->Heads[0];
+
+ //
+ // Save it
+ //
+ DriveExtension->BytesPerSector = BytesPerSector;
+ DriveExtension->SectorsPerTrack = SectorsPerTrack;
+ DriveExtension->NumberOfHeads = Heads;
+
+ //
+ // Unmap now
+ //
+ CurrentOffset.QuadPart = 0;
+ RamdiskUnmapPages(DriveExtension,
+ BaseAddress,
+ CurrentOffset,
+ BytesRead);
+ }
+ else
+ {
+ //
+ // Fail
+ //
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto FailCreate;
+ }
+ }
+
+ //
+ // Check if the drive settings haven't been set yet
+ //
+ if ((DriveExtension->BytesPerSector == 0) ||
+ (DriveExtension->SectorsPerTrack == 0) ||
+ (DriveExtension->NumberOfHeads == 0))
+ {
+ //
+ // Check if this is a CD
+ //
+ if (Input->Options.ExportAsCd)
+ {
+ //
+ // Setup partition parameters default for ISO 9660
+ //
+ DriveExtension->BytesPerSector = 2048;
+ DriveExtension->SectorsPerTrack = 32;
+ DriveExtension->NumberOfHeads = 64;
+ }
+ else
+ {
+ //
+ // Setup partition parameters default for FAT
+ //
+ DriveExtension->BytesPerSector = 512;
+ DriveExtension->SectorsPerTrack = 128;
+ DriveExtension->NumberOfHeads = 16;
+ }
+ }
+
//
// Acquire the disk lock
//
@@ -832,31 +931,6 @@
}
}
-PVOID
-NTAPI
-RamdiskMapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
- IN LARGE_INTEGER Offset,
- IN ULONG Length,
- OUT PULONG OutputLength)
-{
- DPRINT1("Mapping %lx bytes at %I64x\n", Length, Offset.QuadPart);
- UNIMPLEMENTED;
- while (TRUE);
- return NULL;
-}
-
-PVOID
-NTAPI
-RamdiskUnmapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
- IN PVOID BaseAddress,
- IN LARGE_INTEGER Offset,
- IN ULONG Length)
-{
- UNIMPLEMENTED;
- while (TRUE);
- return NULL;
-}
-
NTSTATUS
NTAPI
RamdiskReadWriteReal(IN PIRP Irp,