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); VOID RtlTimeToTimeFields(PLARGE_INTEGER Time, PTIME_FIELDS TimeFields);
PWSTR RtlStrtok(PUNICODE_STRING _string, PWSTR _sep, PWSTR* temp); PWSTR RtlStrtok(PUNICODE_STRING _string, PWSTR _sep, PWSTR* temp);
VOID RtlGetCallersAddress(PVOID* CallersAddress); VOID RtlGetCallersAddress(PVOID* CallersAddress);
VOID RtlZeroMemory(PVOID Destination, ULONG Length);
typedef struct { typedef struct {
ULONG Length; ULONG Length;

View file

@ -266,7 +266,7 @@ _load_file:
; ;
; Move onto the next position in prepartion for a future read ; Move onto the next position in prepartion for a future read
; ;
movzx eax,word [size_div_4k] mov eax,[size_div_4k]
mov bx,[size_mod_4k] mov bx,[size_mod_4k]
cmp bx,0 cmp bx,0
je l20 je l20
@ -373,7 +373,7 @@ size_mod_4k dw 0
; ;
; Size of the current file divided by 4k ; Size of the current file divided by 4k
; ;
size_div_4k dw 0 size_div_4k dd 0
; ;
; ;

View file

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

View file

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

View file

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

View file

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

View file

@ -21,7 +21,7 @@
#include <internal/mm.h> #include <internal/mm.h>
#include <internal/module.h> #include <internal/module.h>
#define NDEBUG //#define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
/* FUNCTIONS **************************************************************/ /* 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_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/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/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_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/mdl.o mm/zone.o mm/special.o \
mm/section.o mm/section.o mm/marea.o
IO_OBJECTS = io/iomgr.o io/create.o io/irp.o io/device.o io/rw.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 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_OBJECTS = ex/work.o ex/fmutex.o ex/resource.o ex/time.o ex/interlck.o \
ex/callback.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) \ $(IO_OBJECTS) $(OB_OBJECTS) $(PS_OBJECTS) $(EX_OBJECTS) \
$(SE_OBJECTS) $(CFG_OBJECTS) $(TST_OBJECTS) $(DBG_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 utils/export/export$(EXE_POSTFIX): utils/export/export.c
$(NATIVE_CC) -g utils/export/export.c -o utils/export/export$(EXE_POSTFIX) $(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 $(CC) $(CFLAGS) -c ke/exports.c -o ke/exports.o
kimage: $(OBJECTS) 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 $(NM) --numeric-sort kimage > kernel.sym
$(OBJCOPY) -O binary kimage kimage.bin $(OBJCOPY) -S --gap-fill=0 -O binary kimage kimage.bin
dummy: dummy:

View file

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

View file

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