no specific problems fixed

svn path=/trunk/; revision=33
This commit is contained in:
Rex Jolliff 1998-09-09 02:34:38 +00:00
parent 809b4b1eab
commit b903d86810
10 changed files with 745 additions and 722 deletions

View file

@ -262,6 +262,7 @@ BOOLEAN RtlTimeFieldsToTime(PTIME_FIELDS TimeFields, PLARGE_INTEGER Time);
VOID RtlTimeToTimeFields(PLARGE_INTEGER Time, PTIME_FIELDS TimeFields);
PWSTR RtlStrtok(PUNICODE_STRING _string, PWSTR _sep, PWSTR* temp);
VOID RtlGetCallersAddress(PVOID* CallersAddress);
VOID RtlZeroMemory(PVOID Destination, ULONG Length);
typedef struct {
ULONG Length;

File diff suppressed because it is too large Load diff

View file

@ -37,6 +37,12 @@ all: $(COMPONENTS) $(LOADERS) $(KERNEL_SERVICES)
#
# Device driver rules
#
ide-test: dummy
make -C services/ide-test
ide: dummy
make -C services/ide
test: dummy
make -C services/test

View file

@ -32,7 +32,7 @@
#include <internal/string.h>
#include <ddk/ntddk.h>
#define NDEBUG
//#define NDEBUG
#include <internal/debug.h>
/* FUNCTIONS ****************************************************************/

View file

@ -16,7 +16,7 @@
#include <internal/string.h>
#include <internal/objmgr.h>
#define NDEBUG
//#define NDEBUG
#include <internal/debug.h>
#ifndef NDEBUG
@ -37,6 +37,7 @@ NTSTATUS ZwReadFile(HANDLE FileHandle,
PLARGE_INTEGER ByteOffset,
PULONG Key)
{
NTSTATUS Status;
COMMON_BODY_HEADER* hdr = ObGetObjectByHandle(FileHandle);
PFILE_OBJECT FileObject = (PFILE_OBJECT)hdr;
PIRP Irp;
@ -107,13 +108,16 @@ NTSTATUS ZwReadFile(HANDLE FileHandle,
}
DPRINT("FileObject->DeviceObject %x\n",FileObject->DeviceObject);
IoCallDriver(FileObject->DeviceObject,Irp);
KeWaitForSingleObject(&Event,Executive,KernelMode,FALSE,NULL);
if (FileObject->DeviceObject->Flags&DO_BUFFERED_IO)
Status = IoCallDriver(FileObject->DeviceObject,Irp);
if (NT_SUCCESS(Status))
{
memcpy(Buffer,Irp->AssociatedIrp.SystemBuffer,Length);
KeWaitForSingleObject(&Event,Executive,KernelMode,FALSE,NULL);
if (FileObject->DeviceObject->Flags&DO_BUFFERED_IO)
{
memcpy(Buffer,Irp->AssociatedIrp.SystemBuffer,Length);
}
}
return(STATUS_SUCCESS);
return(Status);
}
NTSTATUS ZwWriteFile(HANDLE FileHandle,
@ -126,6 +130,7 @@ NTSTATUS ZwWriteFile(HANDLE FileHandle,
PLARGE_INTEGER ByteOffset,
PULONG Key)
{
NTSTATUS Status;
COMMON_BODY_HEADER* hdr = ObGetObjectByHandle(FileHandle);
PFILE_OBJECT FileObject = (PFILE_OBJECT)hdr;
PIRP Irp;
@ -194,7 +199,7 @@ NTSTATUS ZwWriteFile(HANDLE FileHandle,
}
DPRINT("FileObject->DeviceObject %x\n",FileObject->DeviceObject);
IoCallDriver(FileObject->DeviceObject,Irp);
return(STATUS_SUCCESS);
Status = IoCallDriver(FileObject->DeviceObject,Irp);
return(Status);
}

View file

@ -22,7 +22,7 @@
#include <internal/hal/page.h>
#include <internal/hal/segment.h>
#define NDEBUG
//#define NDEBUG
#include <internal/debug.h>
/* FUNCTIONS ****************************************************************/

View file

@ -21,7 +21,7 @@
#include <internal/mm.h>
#include <internal/module.h>
#define NDEBUG
//#define NDEBUG
#include <internal/debug.h>
/* FUNCTIONS **************************************************************/

View file

@ -14,11 +14,11 @@ RTL_OBJECTS = rtl/vsprintf.o rtl/lookas.o rtl/unicode.o rtl/strtok.o \
KE_OBJECTS = ke/main.o ke/timer.o ke/error.o ke/catch.o ke/exports.o \
ke/module.o ke/dpc.o ke/wait.o ke/kqueue.o ke/dispatch.o \
ke/sem.o ke/critical.o ke/event.o ke/apc.o ke/bug.o \
ke/mutex.o
ke/mutex.o ke/kernel.o
MM_OBJECTS = mm/mm.o mm/freelist.o mm/pool.o mm/pageflt.o mm/virtual.o \
mm/mdl.o mm/zone.o mm/cont.o mm/ncache.o mm/iospace.o \
mm/section.o
mm/mdl.o mm/zone.o mm/special.o \
mm/section.o mm/marea.o
IO_OBJECTS = io/iomgr.o io/create.o io/irp.o io/device.o io/rw.o \
@ -30,7 +30,7 @@ IO_OBJECTS = io/iomgr.o io/create.o io/irp.o io/device.o io/rw.o \
OB_OBJECTS = ob/object.o ob/handle.o ob/namespc.o
PS_OBJECTS = ps/psmgr.o ps/thread.o ps/process.o
PS_OBJECTS = ps/psmgr.o ps/thread.o ps/process.o ps/idle.o
EX_OBJECTS = ex/work.o ex/fmutex.o ex/resource.o ex/time.o ex/interlck.o \
ex/callback.o
@ -49,8 +49,6 @@ OBJECTS = $(HAL_OBJECTS) $(KE_OBJECTS) $(RTL_OBJECTS) $(MM_OBJECTS) \
$(IO_OBJECTS) $(OB_OBJECTS) $(PS_OBJECTS) $(EX_OBJECTS) \
$(SE_OBJECTS) $(CFG_OBJECTS) $(TST_OBJECTS) $(DBG_OBJECTS)
LIBS = d:/tools/djgpp/lib/gcc-lib/djgpp/2.81/libgcc.a
utils/export/export$(EXE_POSTFIX): utils/export/export.c
$(NATIVE_CC) -g utils/export/export.c -o utils/export/export$(EXE_POSTFIX)
@ -59,9 +57,9 @@ ke/exports.o: exports.lst utils/export/export$(EXE_POSTFIX)
$(CC) $(CFLAGS) -c ke/exports.c -o ke/exports.o
kimage: $(OBJECTS)
$(LD) --defsym _end=end --defsym _etext=etext --oformat=$(KERNEL_BFD_TARGET) -Ttext c0000000 $(LDFLAGS) $(OBJECTS) $(LIBS) -o kimage
$(LD) --defsym _end=end --defsym _etext=etext --oformat=$(KERNEL_BFD_TARGET) -Ttext c0000000 $(LDFLAGS) $(OBJECTS) libgcc.a -o kimage
$(NM) --numeric-sort kimage > kernel.sym
$(OBJCOPY) -O binary kimage kimage.bin
$(OBJCOPY) -S --gap-fill=0 -O binary kimage kimage.bin
dummy:

View file

@ -135,13 +135,13 @@ MEMORY_AREA* MmInternalOpenMemoryAreaByRegion(PLIST_ENTRY ListHead,
{
current = CONTAINING_RECORD(current_entry,MEMORY_AREA,Entry);
if (current->BaseAddress >= Address &&
current->BaseAddress < (Address+Length))
current->BaseAddress <= (Address+Length))
{
DPRINT("Finished MmInternalOpenMemoryAreaByRegion()\n",0);
return(current);
}
Extent = current->BaseAddress + current->Length;
if (Extent >= Address &&
if (Extent > Address &&
Extent < (Address+Length))
{
DPRINT("Finished MmInternalOpenMemoryAreaByRegion()\n",0);
@ -289,7 +289,7 @@ static ULONG MmFindGapWithoutLock(KPROCESSOR_MODE Mode, ULONG Length)
ListHead = &SystemAreaList;
}
else
{
{
ListHead = &(KeGetCurrentProcess()->MemoryAreaList);
}
@ -299,12 +299,12 @@ static ULONG MmFindGapWithoutLock(KPROCESSOR_MODE Mode, ULONG Length)
{
current = CONTAINING_RECORD(current_entry,MEMORY_AREA,Entry);
next = CONTAINING_RECORD(current_entry->Flink,MEMORY_AREA,Entry);
DPRINT("current %x current->BaseAddress %x\n",current,
DPRINT("current %x current->BaseAddress %x ",current,
current->BaseAddress);
DPRINT("current->Length %x\n",current->Length);
DPRINT("next %x next->BaseAddress %x\n",next,next->BaseAddress);
DPRINT("next %x next->BaseAddress %x ",next,next->BaseAddress);
Gap = (next->BaseAddress ) -(current->BaseAddress + current->Length);
DPRINT("Gap %x\n",Gap);
DPRINT("Base %x Gap %x\n",current->BaseAddress,Gap);
if (Gap >= Length)
{
return(current->BaseAddress + current->Length);
@ -312,10 +312,15 @@ static ULONG MmFindGapWithoutLock(KPROCESSOR_MODE Mode, ULONG Length)
current_entry = current_entry->Flink;
}
current = CONTAINING_RECORD(current_entry,MEMORY_AREA,Entry);
//DbgPrint("current %x returning %x\n",current,current->BaseAddress+
// current->Length);
return(current->BaseAddress + current->Length);
}
NTSTATUS MmInitMemoryAreas(VOID)
/*
* FUNCTION: Initialize the memory area list
*/
{
DPRINT("MmInitMemoryAreas()\n",0);
InitializeListHead(&SystemAreaList);
@ -366,11 +371,13 @@ NTSTATUS MmCreateMemoryArea(KPROCESSOR_MODE Mode,
DPRINT("MmCreateMemoryArea(Mode %x, Type %d, BaseAddress %x,"
"*BaseAddress %x, Length %x, Attributes %x, Result %x)\n",
Mode,Type,BaseAddress,*BaseAddress,Length,Attributes,Result);
// DbgPrint("Start1 %x\n",*((unsigned int *)0xc0017000));
MmLockMemoryAreaList(*BaseAddress,&oldlvl);
// DbgPrint("Start1 %x\n",*((unsigned int *)0xc0017000));
if ((*BaseAddress)==0)
{
*BaseAddress = MmFindGapWithoutLock(Mode,Length+(PAGESIZE*2));
*BaseAddress = MmFindGapWithoutLock(Mode,PAGE_ROUND_UP(Length)
+(PAGESIZE*2));
if ((*BaseAddress)==0)
{
MmUnlockMemoryAreaList(*BaseAddress,&oldlvl);
@ -387,16 +394,23 @@ NTSTATUS MmCreateMemoryArea(KPROCESSOR_MODE Mode,
}
}
// DbgPrint("Start1 %x\n",*((unsigned int *)0xc0017000));
*Result = ExAllocatePool(NonPagedPool,sizeof(MEMORY_AREA));
// DbgPrint("Start1 %x\n",*((unsigned int *)0xc0017000));
RtlZeroMemory(*Result,sizeof(MEMORY_AREA));
// DbgPrint("Start1 %x\n",*((unsigned int *)0xc0017000));
(*Result)->Type=Type;
(*Result)->BaseAddress=*BaseAddress;
(*Result)->Length=Length;
(*Result)->Attributes=Attributes;
DPRINT("&SystemAreaList %x ",&SystemAreaList);
DPRINT("SystemAreaList.Flink %x ",SystemAreaList.Flink);
// DbgPrint("Start1 %x\n",*((unsigned int *)0xc0017000));
MmInsertMemoryAreaWithoutLock(*Result);
// DbgPrint("(%s:%d) Start1 %x\n",__FILE__,__LINE__,
// *((unsigned int *)0xc0017000));
MmUnlockMemoryAreaList(*BaseAddress,&oldlvl);
// DbgPrint("Start1 %x\n",*((unsigned int *)0xc0017000));
DPRINT("SystemAreaList.Flink %x ",SystemAreaList.Flink);
DPRINT("(*Result)->Entry.Flink %x\n",(*Result)->Entry.Flink);
MmDumpMemoryAreas();

View file

@ -3,7 +3,6 @@
* PROJECT: ReactOS kernel
* FILE: kernel/rtl/largeint.c
* PURPOSE: Large integer operations
* PROGRAMMER: David Welch (welch@mcmail.com)
* UPDATE HISTORY:
* Created 22/05/98
* 08/30/98 RJJ Implemented several functions
@ -11,7 +10,7 @@
/* INCLUDES *****************************************************************/
#include <internal/kernel.h>
#include <internal/ke.h>
#include <internal/linkage.h>
#include <ddk/ntddk.h>