mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
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
This commit is contained in:
parent
aa0e827382
commit
d6ce9d647e
2 changed files with 0 additions and 176 deletions
|
@ -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
|
|
@ -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 <ddk/ntddk.h>
|
||||
#include <internal/halio.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* 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;i<Length;i++)
|
||||
{
|
||||
if ((i%512)==0)
|
||||
{
|
||||
DPRINT("Offset %x\n",
|
||||
Stack->Parameters.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;i<Length;i++)
|
||||
{
|
||||
if ((i%512)==0)
|
||||
{
|
||||
DPRINT("Offset %d\n",
|
||||
Stack->Parameters.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);
|
||||
}
|
||||
|
Loading…
Reference in a new issue