From d6ce9d647e3171f989d3330d9de6f5f2bc29f460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 3 May 2005 13:14:59 +0000 Subject: [PATCH] Remove Disk driver for Bochs. It doesn't compile and shouldn't be usefull as we have a normal disk driver in drivers/storage/disk svn path=/trunk/; revision=14960 --- reactos/drivers/dd/sdisk/makefile | 13 --- reactos/drivers/dd/sdisk/sdisk.c | 163 ------------------------------ 2 files changed, 176 deletions(-) delete mode 100644 reactos/drivers/dd/sdisk/makefile delete mode 100644 reactos/drivers/dd/sdisk/sdisk.c diff --git a/reactos/drivers/dd/sdisk/makefile b/reactos/drivers/dd/sdisk/makefile deleted file mode 100644 index ed9697b50a4..00000000000 --- a/reactos/drivers/dd/sdisk/makefile +++ /dev/null @@ -1,13 +0,0 @@ -# $Id$ - -PATH_TO_TOP = ../../.. - -TARGET_TYPE = driver - -TARGET_NAME = sdisk - -TARGET_OBJECTS = sdisk.o - -include $(PATH_TO_TOP)/rules.mak - -include $(TOOLS_PATH)/helper.mk diff --git a/reactos/drivers/dd/sdisk/sdisk.c b/reactos/drivers/dd/sdisk/sdisk.c deleted file mode 100644 index d9635ffc515..00000000000 --- a/reactos/drivers/dd/sdisk/sdisk.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: services/sdisk/sdisk.c - * PURPOSE: Disk driver for Bochs - * PROGRAMMER: David Welch (welch@mcmail.com) - * UPDATE HISTORY: - */ - -/* INCLUDES ****************************************************************/ - -#include -#include - -#define NDEBUG -#include - -/* FUNCTIONS **************************************************************/ - -#define PORT (0x3ec) - -static VOID SdWriteOffset(ULONG Offset) -{ - outl_p(PORT,Offset); -} - -NTSTATUS STDCALL -Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) -/* - * FUNCTION: Handles user mode requests - * ARGUMENTS: - * DeviceObject = Device for request - * Irp = I/O request packet describing request - * RETURNS: Success or failure - */ -{ - PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp); - NTSTATUS status; - int i; - PCH Buffer; - ULONG Length; - ULONG Information = 0; - - switch (Stack->MajorFunction) - { - case IRP_MJ_CREATE: - DPRINT("Creating\n",0); - status = STATUS_SUCCESS; - break; - - case IRP_MJ_CLOSE: - status = STATUS_SUCCESS; - break; - - case IRP_MJ_WRITE: - DPRINT("Writing %d bytes\n", - Stack->Parameters.Write.Length); - Length = Stack->Parameters.Write.Length; - if ((Length%512)>0) - { - Length = Length - (Length%512); - } - Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress); - DPRINT("Buffer %x\n",Buffer); - #if 0 - for (i=0;iParameters.Write.ByteOffset.LowPart+i); - SdWriteOffset(Stack->Parameters.Write.ByteOffset.LowPart+i); - } - outb_p(PORT,Buffer[i]); - DbgPrint("%c",Buffer[i]); - } - #endif - for (i=0;i<(Length/512);i++) - { - DPRINT("Offset %x\n", - Stack->Parameters.Write.ByteOffset.LowPart+i); - SdWriteOffset(Stack->Parameters.Write.ByteOffset.LowPart+i); - outsb(PORT,Buffer,512); - } - status = STATUS_SUCCESS; - Information = Length; - break; - - case IRP_MJ_READ: - DPRINT("Reading %d bytes\n", - Stack->Parameters.Write.Length); - Length = Stack->Parameters.Write.Length; - if ((Length%512)>0) - { - Length = Length - (Length%512); - } - Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress); - for (i=0;iParameters.Write.ByteOffset.LowPart+i); - SdWriteOffset(Stack->Parameters.Write.ByteOffset.LowPart+i); - } - Buffer[i]=inb_p(PORT); - } - status = STATUS_SUCCESS; - break; - - default: - status = STATUS_NOT_IMPLEMENTED; - break; - } - - Irp->IoStatus.Status = status; - Irp->IoStatus.Information = Information; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(status); -} - -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) -/* - * FUNCTION: Called by the system to initalize the driver - * ARGUMENTS: - * DriverObject = object describing this driver - * RegistryPath = path to our configuration entries - * RETURNS: Success or failure - */ -{ - PDEVICE_OBJECT DeviceObject; - NTSTATUS ret; - ANSI_STRING astr; - UNICODE_STRING ustr; - ANSI_STRING asymlink; - UNICODE_STRING usymlink; - - DbgPrint("Simple Disk Driver 0.0.1\n"); - - RtlInitAnsiString(&astr,"\\Device\\SDisk"); - RtlAnsiStringToUnicodeString(&ustr,&astr,TRUE); - ret = IoCreateDevice(DriverObject,0,&ustr, - FILE_DEVICE_DISK,0,FALSE,&DeviceObject); - if (ret!=STATUS_SUCCESS) - { - return(ret); - } - - RtlInitAnsiString(&asymlink,"\\??\\C:"); - RtlAnsiStringToUnicodeString(&usymlink,&asymlink,TRUE); - IoCreateSymbolicLink(&usymlink,&ustr); - - DeviceObject->Flags=DO_DIRECT_IO; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = Dispatch; - DriverObject->MajorFunction[IRP_MJ_CREATE] = Dispatch; - DriverObject->MajorFunction[IRP_MJ_READ] = Dispatch; - DriverObject->MajorFunction[IRP_MJ_WRITE] = Dispatch; - DriverObject->DriverUnload = NULL; - - return(STATUS_SUCCESS); -} -