mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Added multiboot support to ntoskrnl
Updated loadros to boot new kernel Corrected thread priority bugs Removed Linux port io Added system call entry/exit that updates PreviousMode Changes to allow ntoskrnl to be built without optimization Updated make system Added PCR Most components can be built without special spec file svn path=/trunk/; revision=1385
This commit is contained in:
parent
15b935ba7c
commit
a254e64d73
90 changed files with 3737 additions and 2090 deletions
|
@ -32,8 +32,8 @@ LOADERS = dos
|
|||
#
|
||||
# Select the device drivers and filesystems you want
|
||||
#
|
||||
DEVICE_DRIVERS = vidport vga blue ide keyboard null parallel serial floppy
|
||||
# DEVICE_DRIVERS = beep event floppy ide_test mouse sound test test1
|
||||
DEVICE_DRIVERS = vidport vga blue ide keyboard null floppy
|
||||
# DEVICE_DRIVERS = beep event floppy ide_test mouse sound test test1 parallel serial
|
||||
|
||||
FS_DRIVERS = vfat
|
||||
# FS_DRIVERS = minix ext2 template
|
||||
|
@ -66,20 +66,20 @@ clean: buildno_clean $(COMPONENTS:%=%_clean) $(DLLS:%=%_clean) $(LOADERS:%=%_cle
|
|||
|
||||
ifeq ($(HOST),mingw32-linux)
|
||||
rcopy$(EXE_POSTFIX): rcopy.c
|
||||
$(NATIVE_CC) -g -DUNIX_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
|
||||
$(HOST_CC) -g -DUNIX_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
|
||||
endif
|
||||
ifeq ($(HOST),mingw32-windows)
|
||||
rcopy$(EXE_POSTFIX): rcopy.c
|
||||
$(NATIVE_CC) -g -DDOS_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
|
||||
$(HOST_CC) -g -DDOS_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),mingw32-linux)
|
||||
rmkdir$(EXE_POSTFIX): rmkdir.c
|
||||
$(NATIVE_CC) -g -DUNIX_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
|
||||
$(HOST_CC) -g -DUNIX_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
|
||||
endif
|
||||
ifeq ($(HOST),mingw32-windows)
|
||||
rmkdir$(EXE_POSTFIX): rmkdir.c
|
||||
$(NATIVE_CC) -g -DDOS_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
|
||||
$(HOST_CC) -g -DDOS_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
|
||||
endif
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <windows.h>
|
||||
|
||||
extern VOID STDCALL GdiDllInitialize(PVOID hInstance, ULONG Event, PVOID Reserved);
|
||||
|
||||
int main (void)
|
||||
{
|
||||
|
|
|
@ -5,10 +5,9 @@ PATH_TO_TOP = ../..
|
|||
|
||||
PROGS = gditest
|
||||
|
||||
OBJECTS= ../common/crt0.o
|
||||
OBJECTS =
|
||||
LIBS= ../../lib/kernel32/kernel32.a ../../lib/gdi32/gdi32.a
|
||||
#LIBS= ../../lib/kernel32/kernel32.a ../../lib/crtdll/crtdll.a
|
||||
BASE_CFLAGS = -I../../include
|
||||
CFLAGS = -I../../include
|
||||
|
||||
all: $(PROGS:%=%.exe)
|
||||
|
||||
|
@ -26,23 +25,15 @@ clean: $(PROGS:%=%_clean)
|
|||
install: $(PROGS:%=$(FLOPPY_DIR)/apps/%.exe)
|
||||
|
||||
$(PROGS:%=$(FLOPPY_DIR)/apps/%.exe): $(FLOPPY_DIR)/apps/%.exe: %.exe
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $*.exe $(FLOPPY_DIR)\apps\$*.exe
|
||||
else
|
||||
$(CP) $*.exe $(FLOPPY_DIR)/apps/$*.exe
|
||||
endif
|
||||
|
||||
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%.exe)
|
||||
|
||||
$(PROGS:%=../../$(DIST_DIR)/apps/%.exe): ../../$(DIST_DIR)/apps/%.exe: %.exe
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $*.exe ..\..\$(DIST_DIR)\apps\$*.exe
|
||||
else
|
||||
$(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe
|
||||
endif
|
||||
|
||||
gditest.exe: gditest.c
|
||||
$(CC) -specs=../../specs gditest.c $(BASE_CFLAGS) $(OBJECTS) $(LIBS) -lgcc -o gditest.exe
|
||||
$(CC) gditest.c $(LIBS) -lgcc -o gditest.exe
|
||||
$(NM) --numeric-sort gditest.exe > gditest.sym
|
||||
|
||||
include ../../rules.mak
|
||||
|
|
|
@ -7,7 +7,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
printf("TEB dumpper\n");
|
||||
__asm__("movl %%fs:0x18, %0\n\t"
|
||||
: "=g" (x)
|
||||
: "=a" (x)
|
||||
: /* no inputs */);
|
||||
printf("fs[0x18] %x\n", x);
|
||||
return(0);
|
||||
|
|
|
@ -20,23 +20,14 @@ $(CLEAN_FILES:%=%_clean): %_clean:
|
|||
floppy: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
|
||||
|
||||
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $* $(FLOPPY_DIR)\apps\$*
|
||||
else
|
||||
$(CP) $* $(FLOPPY_DIR)/apps/$*
|
||||
endif
|
||||
|
||||
dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
|
||||
|
||||
$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $* ..\..\$(DIST_DIR)\apps\$*
|
||||
else
|
||||
$(CP) $* ../../$(DIST_DIR)/apps/$*
|
||||
endif
|
||||
|
||||
vmtest.exe: $(OBJECTS)
|
||||
$(CC) $(OBJECTS) -o vmtest.exe
|
||||
|
||||
BASE_CFLAGS = -I../../include
|
||||
include ../../rules.mak
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.7 2000/08/18 22:26:53 dwelch Exp $
|
||||
# $Id: Makefile,v 1.8 2000/10/07 13:41:44 dwelch Exp $
|
||||
#
|
||||
|
||||
PATH_TO_TOP = ../..
|
||||
|
@ -12,7 +12,7 @@ all: $(TARGETNAME)$(EXE_POSTFIX)
|
|||
|
||||
|
||||
$(TARGETNAME)$(EXE_POSTFIX): $(TARGETNAME).c ../../include/reactos/version.h
|
||||
$(NATIVE_CC) -o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).c
|
||||
$(HOST_CC) -o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).c
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
OBJECTS= ../common/crt0.o shell.o
|
||||
OBJECTS= shell.o
|
||||
PROGS= shell.exe
|
||||
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
|
||||
CLEAN_FILES= shell.o shell.exe shell.sym
|
||||
|
@ -38,7 +38,7 @@ else
|
|||
endif
|
||||
|
||||
shell.exe: $(OBJECTS) $(LIBS)
|
||||
$(CC) -specs=../../specs $(OBJECTS) $(LIBS) -lgcc -o shell.exe
|
||||
$(CC) $(OBJECTS) $(LIBS) -lgcc -o shell.exe
|
||||
$(NM) --numeric-sort shell.exe > shell.sym
|
||||
|
||||
include ../../rules.mak
|
||||
|
|
|
@ -1,100 +1,52 @@
|
|||
\input texinfo @c -*-texinfo-*-
|
||||
@c %**start of header
|
||||
@setfilename psmgr.info
|
||||
@settitle Process Manager Design and Implementation
|
||||
@settitle Reactos Process Manager: Design and Implementation
|
||||
@setchapternewpage odd
|
||||
@c %**end of header
|
||||
|
||||
@ifinfo
|
||||
This document describes the ReactOS process manager design and implementation
|
||||
This file documents the ReactOS Process Manager.
|
||||
|
||||
Copyright 2000 David Welch
|
||||
@end ifinfo
|
||||
|
||||
@titlepage
|
||||
@title Process Manager Design and Implementation
|
||||
@author David Welch <david.welch@seh.ox.ac.uk>
|
||||
@title ReactOS Process Manager: Design and Implementation
|
||||
@author David Welch
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1999 David Welch
|
||||
Copyright @copyright{} 2000 David Welch
|
||||
@end titlepage
|
||||
|
||||
@node Top, Overview, , (dir)
|
||||
@comment node-name, next, previous, up
|
||||
@node Top, Copyright, , (dir)
|
||||
|
||||
@ifinfo
|
||||
This document describes the design and implementation of the reactos process
|
||||
manager
|
||||
This document describes the ReactOS Process Manager.
|
||||
|
||||
This document applies to version 0.0.16.
|
||||
@end ifinfo
|
||||
|
||||
@menu
|
||||
* Overview:: Overview of this document
|
||||
* External Interfaces:: External Interfaces
|
||||
* Data Structures:: Data Structures
|
||||
* Concept Index:: This index has two entries
|
||||
* Copyright:: Your rights and freedoms
|
||||
* Overview:: Introduction
|
||||
@end menu
|
||||
|
||||
@node Overview, External Interfaces, top, top
|
||||
@comment node-name, next, previous, up
|
||||
@node Copyright, Overview, Top, Top
|
||||
@chapter Copyright
|
||||
@cindex Index entry for Copyright
|
||||
ReactOS is distributed under the terms of the GNU General Public License,
|
||||
this basically means that you can give it to anyone for any price as long
|
||||
as full source code is included; you also have the right to distribute
|
||||
modified copies in the same way. For the actual legalese see the file
|
||||
'COPYING' in the distribution.
|
||||
|
||||
@node Overview, ,Copyright, Top
|
||||
@chapter Overview
|
||||
@cindex Index entry for Overview
|
||||
|
||||
This document describes the design and implementation of the ReactOS process
|
||||
manager. ReactOS is a GPLed operating system that attempts to be compatible
|
||||
with Windows NT, for more information see @uref{http://www.reactos.com}.
|
||||
|
||||
@node External Interfaces, Data Structures, Overview, top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter External Interfaces
|
||||
|
||||
This chapter describes the external interfaces provided by the process
|
||||
manager both to user-mode and to the rest of the kernel.
|
||||
|
||||
@menu
|
||||
* NtCreateProcess:: Creates a new process
|
||||
@end menu
|
||||
|
||||
@node NtCreateProcess, , , External Interfaces
|
||||
@comment node-name, next, previous, up
|
||||
|
||||
@deftypefn Function NTSTATUS NtCreateProcess
|
||||
|
||||
The parameters are
|
||||
@itemize @bullet
|
||||
@item
|
||||
HANDLE ProcessHandle: Received a handle for the created process on return.
|
||||
@item
|
||||
ACCESS_MASK DesiredAccess: Specifies the requested types of access to
|
||||
the created process.
|
||||
@item
|
||||
POBJECT_ATTRIBUTES ObjectAttributes: Specifies various attributes for the
|
||||
created process.
|
||||
@item
|
||||
HANDLE ParentProcessHandle: Specifies the parent process for the created
|
||||
process.
|
||||
@item
|
||||
BOOLEAN InheritObjectTable: True if the new process such inherit its parent's
|
||||
handles.
|
||||
@item
|
||||
HANDLE SectionHandle: If this parameter is NULL then the new process's
|
||||
address space will be a copy of its parent's. Otherwise the new process's
|
||||
address space will contain a mapping of the section pointed to by this
|
||||
handle and NTDLL.
|
||||
@item
|
||||
HANDLE DebugPort: Specifies a handle that will receive debug messages
|
||||
associated with this process.
|
||||
@item
|
||||
HANDLE ExceptionPort: Specifies a handle that will receive exception messages
|
||||
associated with this process.
|
||||
@end itemize
|
||||
|
||||
The return value is either STATUS_SUCCESS or a value indicating the reason
|
||||
by failure.
|
||||
@end deftypefn
|
||||
|
||||
@node Data Structures, Concept Index, External Interfaces, top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Data Structures
|
||||
|
||||
@node Concept Index, ,Data Structures, Top
|
||||
@unnumbered Concept Index
|
||||
@printindex cp
|
||||
@contents
|
||||
@bye
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.3 2000/08/18 22:27:04 dwelch Exp $
|
||||
# $Id: Makefile,v 1.4 2000/10/07 13:41:54 dwelch Exp $
|
||||
#
|
||||
#
|
||||
PATH_TO_TOP = ../../..
|
||||
|
@ -7,7 +7,7 @@ TARGET=floppy
|
|||
|
||||
OBJECTS = $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a
|
||||
|
||||
BASE_CFLAGS = -I. -I../../../include
|
||||
CFLAGS = -I.
|
||||
|
||||
all: $(TARGET).sys
|
||||
|
||||
|
@ -26,47 +26,14 @@ clean:
|
|||
install: $(FLOPPY_DIR)/drivers/$(TARGET).sys
|
||||
|
||||
$(FLOPPY_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGET).sys $(FLOPPY_DIR)\drivers\$(TARGET).sys
|
||||
else
|
||||
$(CP) $(TARGET).sys $(FLOPPY_DIR)/drivers/$(TARGET).sys
|
||||
endif
|
||||
|
||||
dist: ../../../$(DIST_DIR)/drivers/$(TARGET).sys
|
||||
|
||||
../../../$(DIST_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGET).sys ..\..\..\$(DIST_DIR)\drivers\$(TARGET).sys
|
||||
else
|
||||
$(CP) $(TARGET).sys ../../../$(DIST_DIR)/drivers/$(TARGET).sys
|
||||
endif
|
||||
|
||||
$(TARGET).sys: $(OBJECTS)
|
||||
$(CC) \
|
||||
-specs=../../svc_specs \
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--defsym,_end=end \
|
||||
-Wl,--defsym,_edata=__data_end__ \
|
||||
-Wl,--defsym,_etext=etext \
|
||||
-Wl,--base-file,base.tmp $(OBJECTS)
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGET).sys \
|
||||
--base-file base.tmp \
|
||||
--output-exp temp.exp \
|
||||
--kill-at
|
||||
- $(RM) base.tmp
|
||||
$(CC) \
|
||||
--verbose \
|
||||
-Wl,--image-base,0x10000 \
|
||||
-Wl,-e,_DriverEntry@8 \
|
||||
-Wl,temp.exp \
|
||||
-specs=../../svc_specs \
|
||||
-mdll \
|
||||
-o $(TARGET).sys \
|
||||
$(OBJECTS)
|
||||
- $(RM) temp.exp
|
||||
|
||||
WITH_DEBUGGING=yes
|
||||
include ../../../rules.mak
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ide.c,v 1.35 2000/09/12 10:12:12 jean Exp $
|
||||
/* $Id: ide.c,v 1.36 2000/10/07 13:41:55 dwelch Exp $
|
||||
*
|
||||
* IDE.C - IDE Disk driver
|
||||
* written by Rex Jolliff
|
||||
|
@ -188,7 +188,7 @@ static VOID IDEIoTimer(PDEVICE_OBJECT DeviceObject, PVOID Context);
|
|||
|
||||
// ---------------------------------------------------------------- Inlines
|
||||
|
||||
extern inline void
|
||||
void
|
||||
IDESwapBytePairs(char *Buf,
|
||||
int Cnt)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.18 2000/09/12 10:12:12 jean Exp $
|
||||
# $Id: makefile,v 1.19 2000/10/07 13:41:55 dwelch Exp $
|
||||
#
|
||||
#
|
||||
PATH_TO_TOP = ../../..
|
||||
|
@ -7,7 +7,7 @@ TARGET=ide
|
|||
|
||||
OBJECTS = $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a
|
||||
|
||||
BASE_CFLAGS = -I. -I../../../include
|
||||
CFLAGS = -I.
|
||||
|
||||
all: $(TARGET).sys.unstripped $(TARGET).sys
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.13 2000/09/12 10:12:12 jean Exp $
|
||||
# $Id: makefile,v 1.14 2000/10/07 13:41:55 dwelch Exp $
|
||||
#
|
||||
#
|
||||
PATH_TO_TOP = ../../..
|
||||
|
@ -7,7 +7,7 @@ TARGET=keyboard
|
|||
|
||||
OBJECTS = $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a
|
||||
|
||||
BASE_CFLAGS = -I. -I../../../include
|
||||
CFLAGS = -O2 -I.
|
||||
|
||||
all: $(TARGET).sys $(TARGET).sys.unstripped
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# $Id: makefile,v 1.10 2000/08/18 22:27:08 dwelch Exp $
|
||||
# $Id: makefile,v 1.11 2000/10/07 13:41:55 dwelch Exp $
|
||||
#
|
||||
# Makefile for ReactOS vgaddi.dll
|
||||
#
|
||||
PATH_TO_TOP = ../../../..
|
||||
TARGET=vgaddi
|
||||
|
||||
BASE_CFLAGS = -I../../../../include -I.
|
||||
CFLAGS = -I.
|
||||
|
||||
ifneq ($(HOST),mingw32-windows)
|
||||
ifneq ($(HOST),mingw32-linux)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# $Id: makefile,v 1.3 2000/08/18 22:27:08 dwelch Exp $
|
||||
# $Id: makefile,v 1.4 2000/10/07 13:41:55 dwelch Exp $
|
||||
#
|
||||
#
|
||||
PATH_TO_TOP = ../../../..
|
||||
BASE_CFLAGS = -I../../../../include
|
||||
CFLAGS =
|
||||
|
||||
MP_OBJECTS = vgamp.o initvga.o vgavideo.o vgamp.coff ../../../../ntoskrnl/ntoskrnl.a ../../vidport/vidport.a
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
# $Id: makefile,v 1.21 2000/08/18 22:27:09 dwelch Exp $
|
||||
# $Id: makefile,v 1.22 2000/10/07 13:41:56 dwelch Exp $
|
||||
#
|
||||
#
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
TARGET=vfatfs
|
||||
|
||||
OBJECTS = blockdev.o close.o create.o dir.o dirwr.o iface.o string.o fat.o \
|
||||
rw.o finfo.o volume.o $(TARGET).coff
|
||||
LIBS = ../../../ntoskrnl/ntoskrnl.a
|
||||
|
||||
BASE_CFLAGS = -I. -I../../../include
|
||||
CFLAGS =
|
||||
|
||||
all: $(TARGET).nostrip.sys $(TARGET).sys
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# $Id: Makefile,v 1.2 2000/09/10 20:00:13 ea Exp $
|
||||
# $Id: Makefile,v 1.3 2000/10/07 13:41:56 dwelch Exp $
|
||||
#
|
||||
# NE2000.SYS build spec
|
||||
#
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGETNAME=ne2000
|
||||
TARGET = ne2000
|
||||
|
||||
BASE_CFLAGS = -I./include -I../../../../include -DNDIS_MINIPORT_DRIVER
|
||||
OBJECTS = ne2000/main.o ne2000/8390.o $(TARGET).coff $(PATH_TO_TOP)/ntoskrnl/ntoskrnl.a
|
||||
|
||||
RESOURCE_OBJECT = $(TARGETNAME).coff
|
||||
NE2000_OBJECTS = ne2000/main.o ne2000/8390.o $(RESOURCE_OBJECT)
|
||||
|
@ -61,58 +61,24 @@ $(TARGETNAME).sys: $(OBJECTS) $(TARGETNAME).def
|
|||
$(TARGETNAME).o \
|
||||
$(IMPORT_LIBS)
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGETNAME).sys \
|
||||
--base-file base.tmp \
|
||||
--output-exp temp.exp \
|
||||
--def $(TARGETNAME).def \
|
||||
--kill-at
|
||||
- $(RM) base.tmp
|
||||
$(CC) \
|
||||
-specs=../../../../specs \
|
||||
--subsystem=native \
|
||||
-mdll \
|
||||
--dll \
|
||||
-e _DriverEntry@8 \
|
||||
-o $(TARGETNAME).sys \
|
||||
-Wl,--image-base,0x0 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,--defsym,_end=end \
|
||||
-Wl,--defsym,_edata=__data_end__ \
|
||||
-Wl,--defsym,_etext=etext \
|
||||
-Wl,temp.exp \
|
||||
$(TARGETNAME).o \
|
||||
$(IMPORT_LIBS)
|
||||
- $(RM) temp.exp
|
||||
$(NM) --numeric-sort $(TARGETNAME).sys > $(TARGETNAME).sym
|
||||
- $(RM) $(TARGET).sys
|
||||
|
||||
clean: $(CLEAN_FILES:%=%_clean)
|
||||
.phony: clean
|
||||
|
||||
$(CLEAN_FILES:%=%_clean): %_clean:
|
||||
- $(RM) $*
|
||||
install: $(FLOPPY_DIR)/drivers/$(TARGET).sys
|
||||
|
||||
.PHONY: clean $(CLEAN_FILES:%=%_clean)
|
||||
$(FLOPPY_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
|
||||
$(CP) $(TARGET).sys $(FLOPPY_DIR)/drivers/$(TARGET).sys
|
||||
|
||||
install: $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
|
||||
dist: ../../../$(DIST_DIR)/drivers/$(TARGET).sys
|
||||
|
||||
$(FLOPPY_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGETNAME).sys $(FLOPPY_DIR)\drivers\$(TARGETNAME).sys
|
||||
else
|
||||
$(CP) $(TARGETNAME).sys $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
|
||||
endif
|
||||
../../../$(DIST_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
|
||||
$(CP) $(TARGET).sys ../../../$(DIST_DIR)/drivers/$(TARGET).sys
|
||||
|
||||
dist: $(DIST_DIR)/drivers/$(TARGETNAME).sys
|
||||
$(TARGET).sys: $(OBJECTS)
|
||||
|
||||
$(DIST_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGETNAME).sys ..\..\$(DIST_DIR)\drivers\$(TARGETNAME).sys
|
||||
else
|
||||
$(CP) $(TARGETNAME).sys ../../$(DIST_DIR)/drivers/$(TARGETNAME).sys
|
||||
endif
|
||||
|
||||
#WITH_DEBUGGING = yes
|
||||
#WIN32_LEAN_AND_MEAN = yes
|
||||
#WARNINGS_ARE_ERRORS = yes
|
||||
WITH_DEBUGGING=yes
|
||||
include ../../../../rules.mak
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# NDIS.SYS - NDIS library
|
||||
#
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
TARGETNAME=ndis
|
||||
|
||||
BASE_CFLAGS = -I./include -I../../../include -DNDIS_WRAPPER -DBINARY_COMPATIBLE=1
|
||||
CFLAGS = -I./include -DNDIS_WRAPPER -DBINARY_COMPATIBLE=1
|
||||
|
||||
RESOURCE_OBJECT = $(TARGETNAME).coff
|
||||
NDIS_OBJECTS = ndis/main.o ndis/40gone.o ndis/50gone.o ndis/buffer.o ndis/cl.o \
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# TCPIP.SYS - TCP/IP protocol driver
|
||||
#
|
||||
PATH_TO_TOP = ../../../
|
||||
|
||||
TARGETNAME=tcpip
|
||||
|
||||
BASE_CFLAGS = -I./include -I../../../include
|
||||
CFLAGS = -I./include -O2
|
||||
|
||||
RESOURCE_OBJECT = $(TARGETNAME).coff
|
||||
TCPIP_OBJECTS = tcpip/main.o tcpip/address.o tcpip/checksum.o \
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
# $Id: Makefile,v 1.8 2000/08/11 12:45:45 ekohl Exp $
|
||||
# $Id: Makefile,v 1.9 2000/10/07 13:41:57 dwelch Exp $
|
||||
#
|
||||
# TDI.SYS build spec
|
||||
#
|
||||
PATH_TO_TOP = ../../../
|
||||
|
||||
TARGETNAME=tdi
|
||||
|
||||
BASE_CFLAGS = -I../../../include
|
||||
CFLAGS =
|
||||
|
||||
OBJECTS_CTE = cte/stubs.o cte/string.o
|
||||
OBJECTS_TDI = tdi/stubs.o tdi/obsolete.o tdi/handler.o tdi/dereg.o
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# TDITEST.SYS - TDI test driver
|
||||
#
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
TARGETNAME=tditest
|
||||
|
||||
BASE_CFLAGS = -I./include -I../../../include
|
||||
CFLAGS = -I./include
|
||||
|
||||
RESOURCE_OBJECT = $(TARGETNAME).coff
|
||||
TDITEST_OBJECTS = tditest/tditest.o
|
||||
|
@ -63,22 +65,11 @@ $(CLEAN_FILES:%=%_clean): %_clean:
|
|||
install: $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
|
||||
|
||||
$(FLOPPY_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGETNAME).sys $(FLOPPY_DIR)\drivers\$(TARGETNAME).sys
|
||||
else
|
||||
$(CP) $(TARGETNAME).sys $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
|
||||
endif
|
||||
|
||||
dist: $(DIST_DIR)/drivers/$(TARGETNAME).sys
|
||||
|
||||
$(DIST_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGETNAME).sys ..\..\..\$(DIST_DIR)\drivers\$(TARGETNAME).sys
|
||||
else
|
||||
$(CP) $(TARGETNAME).sys ../../../$(DIST_DIR)/drivers/$(TARGETNAME).sys
|
||||
endif
|
||||
|
||||
#WITH_DEBUGGING = yes
|
||||
#WIN32_LEAN_AND_MEAN = yes
|
||||
#WARNINGS_ARE_ERRORS = yes
|
||||
include ../../../rules.mak
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.7 2000/08/18 22:26:58 dwelch Exp $
|
||||
# $Id: makefile,v 1.8 2000/10/07 13:41:45 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -35,7 +35,7 @@ BASE_CFLAGS = -I../../include
|
|||
all: $(SVC_FILES)
|
||||
|
||||
$(TARGETNAME)$(EXE_POSTFIX): $(TARGETNAME).c
|
||||
$(NATIVE_CC) \
|
||||
$(HOST_CC) \
|
||||
$(CFLAGS) \
|
||||
-o $(TARGETNAME) \
|
||||
-O2 \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.10 2000/08/18 22:26:58 dwelch Exp $
|
||||
# $Id: makefile,v 1.11 2000/10/07 13:41:45 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -28,9 +28,9 @@ $(NAPI_FILES): $(SYSTEM_CALLS_DB) $(TARGET)$(EXE_POSTFIX)
|
|||
$(KERNEL_SERVICE_TABLE) \
|
||||
$(KERNEL_ZW_CALLS)
|
||||
|
||||
# (rjj) i removed the following option from line below: -If:\gnu\mingw32\include
|
||||
# (rjj) i removed the following option from line below: -If:\gnu\mingw32\include
|
||||
$(TARGET)$(EXE_POSTFIX): $(TARGET).c
|
||||
$(NATIVE_CC) -g $(TARGET).c -o $(TARGET)$(EXE_POSTFIX)
|
||||
$(HOST_CC) -g $(TARGET).c -o $(TARGET)$(EXE_POSTFIX)
|
||||
|
||||
clean:
|
||||
- $(RM) $(TARGET)$(EXE_POSTFIX)
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
/* GENERAL DEFINITIONS ****************************************************/
|
||||
|
||||
#ifndef __ASM__
|
||||
|
||||
#define _WIN32_WINNT 0x0400
|
||||
|
||||
#include <ddk/kedef.h>
|
||||
|
@ -207,11 +209,6 @@ enum
|
|||
IRP_MN_POWER_SEQUENCE,
|
||||
};
|
||||
|
||||
|
||||
/* Values returned by KeGetPreviousMode() */
|
||||
#define KernelMode (0)
|
||||
#define UserMode (1)
|
||||
|
||||
/*
|
||||
* PURPOSE: Arguments to MmProbeAndLockPages
|
||||
*/
|
||||
|
@ -251,4 +248,10 @@ enum
|
|||
#define SYNCH_LEVEL (IPI_LEVEL-1) // synchronization level
|
||||
#endif
|
||||
|
||||
#endif /* __ASM__ */
|
||||
|
||||
/* Values returned by KeGetPreviousMode() */
|
||||
#define KernelMode (0)
|
||||
#define UserMode (1)
|
||||
|
||||
#endif /* ndef _DDK_DEFINES_H */
|
||||
|
|
|
@ -3,7 +3,46 @@
|
|||
#ifndef __INCLUDE_DDK_KETYPES_H
|
||||
#define __INCLUDE_DDK_KETYPES_H
|
||||
|
||||
#define MB_FLAGS_MEM_INFO (0x1)
|
||||
#define MB_FLAGS_BOOT_DEVICE (0x2)
|
||||
#define MB_FLAGS_COMMAND_LINE (0x4)
|
||||
#define MB_FLAGS_MODULE_INFO (0x8)
|
||||
#define MB_FLAGS_AOUT_SYMS (0x10)
|
||||
#define MB_FLAGS_ELF_SYMS (0x20)
|
||||
#define MB_FLAGS_MMAP_INFO (0x40)
|
||||
#define MB_FLAGS_DRIVES_INFO (0x80)
|
||||
#define MB_FLAGS_CONFIG_TABLE (0x100)
|
||||
#define MB_FLAGS_BOOT_LOADER_NAME (0x200)
|
||||
#define MB_FLAGS_APM_TABLE (0x400)
|
||||
#define MB_FLAGS_GRAPHICS_TABLE (0x800)
|
||||
|
||||
typedef struct _LOADER_MODULE
|
||||
{
|
||||
ULONG ModStart;
|
||||
ULONG ModEnd;
|
||||
ULONG String;
|
||||
ULONG Reserved;
|
||||
} LOADER_MODULE, *PLOADER_MODULE;
|
||||
|
||||
typedef struct _LOADER_PARAMETER_BLOCK
|
||||
{
|
||||
ULONG Flags;
|
||||
ULONG MemLower;
|
||||
ULONG MemHigher;
|
||||
ULONG BootDevice;
|
||||
ULONG CommandLine;
|
||||
ULONG ModsCount;
|
||||
ULONG ModsAddr;
|
||||
UCHAR Syms[12];
|
||||
ULONG MmapLength;
|
||||
ULONG MmapAddr;
|
||||
ULONG DrivesCount;
|
||||
ULONG DrivesAddr;
|
||||
ULONG ConfigTable;
|
||||
ULONG BootLoaderName;
|
||||
} LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK;
|
||||
|
||||
#if 0
|
||||
typedef struct _LOADER_PARAMETER_BLOCK
|
||||
{
|
||||
/*
|
||||
|
@ -39,6 +78,7 @@ typedef struct _LOADER_PARAMETER_BLOCK
|
|||
char kernel_parameters[256];
|
||||
|
||||
} LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK;
|
||||
#endif
|
||||
|
||||
#ifdef __NTOSKRNL__
|
||||
extern CHAR EXPORTED KeNumberProcessors;
|
||||
|
@ -158,8 +198,8 @@ typedef struct _KAPC
|
|||
PVOID SystemArgument2;
|
||||
CCHAR ApcStateIndex;
|
||||
KPROCESSOR_MODE ApcMode;
|
||||
BOOLEAN Inserted;
|
||||
} KAPC, *PKAPC;
|
||||
USHORT Inserted;
|
||||
} __attribute__((packed)) KAPC, *PKAPC;
|
||||
|
||||
typedef struct _KBUGCHECK_CALLBACK_RECORD
|
||||
{
|
||||
|
@ -181,7 +221,7 @@ typedef struct _KMUTEX
|
|||
UCHAR ApcDisable;
|
||||
} KMUTEX, *PKMUTEX, KMUTANT, *PKMUTANT;
|
||||
|
||||
typedef struct
|
||||
typedef struct _KSEMAPHORE
|
||||
{
|
||||
DISPATCHER_HEADER Header;
|
||||
LONG Limit;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _INCLUDE_DDK_MMFUNCS_H
|
||||
#define _INCLUDE_DDK_MMFUNCS_H
|
||||
/* $Id: mmfuncs.h,v 1.7 2000/07/02 17:30:31 ekohl Exp $ */
|
||||
/* $Id: mmfuncs.h,v 1.8 2000/10/07 13:41:46 dwelch Exp $ */
|
||||
/* MEMORY MANAGMENT ******************************************************/
|
||||
|
||||
#include <ddk/i386/pagesize.h>
|
||||
|
@ -36,6 +36,7 @@
|
|||
* Size = Size of range
|
||||
* RETURNS: The number of pages
|
||||
*/
|
||||
#if 0
|
||||
extern inline unsigned int ADDRESS_AND_SIZE_TO_SPAN_PAGES(PVOID Va,
|
||||
ULONG Size)
|
||||
{
|
||||
|
@ -46,6 +47,10 @@ extern inline unsigned int ADDRESS_AND_SIZE_TO_SPAN_PAGES(PVOID Va,
|
|||
LowestAddr = PAGE_ROUND_DOWN((ULONG)Va);
|
||||
return((HighestAddr - LowestAddr) / PAGESIZE);
|
||||
}
|
||||
#endif
|
||||
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va, Size) \
|
||||
(ULONG)((PAGE_ROUND_UP((Size) + ((ULONG)(Va))) - \
|
||||
PAGE_ROUND_DOWN((ULONG)(Va))) / PAGESIZE)
|
||||
|
||||
/*
|
||||
* FUNCTION: Returns FALSE is the pointer is NULL, TRUE otherwise
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: rtl.h,v 1.40 2000/07/04 08:52:34 dwelch Exp $
|
||||
/* $Id: rtl.h,v 1.41 2000/10/07 13:41:46 dwelch Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -275,13 +275,15 @@ extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG;
|
|||
#define InsertTailList(ListHead, ListEntry) \
|
||||
{ \
|
||||
PLIST_ENTRY OldBlink; \
|
||||
assert((ListEntry)->Blink == NULL); \
|
||||
assert((ListEntry)->Flink == NULL); \
|
||||
OldBlink = (ListHead)->Blink; \
|
||||
(ListEntry)->Flink = (ListHead); \
|
||||
(ListEntry)->Blink = OldBlink; \
|
||||
OldBlink->Flink = (ListEntry); \
|
||||
(ListHead)->Blink = (ListEntry); \
|
||||
assert((ListEntry) != NULL); \
|
||||
assert((ListEntry)->Blink!=NULL); \
|
||||
assert((ListEntry)->Blink != NULL); \
|
||||
assert((ListEntry)->Blink->Flink == (ListEntry)); \
|
||||
assert((ListEntry)->Flink != NULL); \
|
||||
assert((ListEntry)->Flink->Blink == (ListEntry)); \
|
||||
|
@ -398,6 +400,8 @@ PushEntryList (
|
|||
OldBlink = (ListEntry)->Blink; \
|
||||
OldFlink->Blink = OldBlink; \
|
||||
OldBlink->Flink = OldFlink; \
|
||||
(ListEntry)->Flink = NULL; \
|
||||
(ListEntry)->Blink = NULL; \
|
||||
}
|
||||
|
||||
|
||||
|
@ -445,7 +449,12 @@ RemoveHeadList (
|
|||
OldBlink = ListHead->Flink->Blink;
|
||||
OldFlink->Blink = OldBlink;
|
||||
OldBlink->Flink = OldFlink;
|
||||
|
||||
if (Old != ListHead)
|
||||
{
|
||||
Old->Flink = NULL;
|
||||
Old->Blink = NULL;
|
||||
}
|
||||
|
||||
return(Old);
|
||||
}
|
||||
|
||||
|
@ -494,13 +503,17 @@ RemoveTailList (
|
|||
OldBlink = ListHead->Blink->Blink;
|
||||
OldFlink->Blink = OldBlink;
|
||||
OldBlink->Flink = OldFlink;
|
||||
|
||||
if (Old != ListHead)
|
||||
{
|
||||
Old->Flink = NULL;
|
||||
Old->Blink = NULL;
|
||||
}
|
||||
|
||||
return(Old);
|
||||
}
|
||||
|
||||
|
||||
PVOID
|
||||
STDCALL
|
||||
PVOID STDCALL
|
||||
RtlAllocateHeap (
|
||||
HANDLE Heap,
|
||||
ULONG Flags,
|
||||
|
|
|
@ -227,7 +227,7 @@ static inline PNT_TEB NtCurrentTeb(VOID)
|
|||
int x;
|
||||
|
||||
__asm__ __volatile__("movl %%fs:0x18, %0\n\t"
|
||||
: "=g" (x)
|
||||
: "=r" (x) /* can't have two memory operands */
|
||||
: /* no inputs */
|
||||
);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: include/ps.h
|
||||
* FILE: include/ntos/ps.h
|
||||
* PURPOSE: Process/thread declarations used by all the parts of the
|
||||
* system
|
||||
* PROGRAMMER: David Welch <welch@cwcom.net>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.14 2000/08/18 22:26:59 dwelch Exp $
|
||||
# $Id: makefile,v 1.15 2000/10/07 13:41:46 dwelch Exp $
|
||||
#
|
||||
# Makefile for ReactOS advapi32.dll
|
||||
#
|
||||
|
@ -57,7 +57,7 @@ $(TARGETNAME).dll: $(DLLMAIN) $(OBJECTS) $(TARGETNAME).def
|
|||
$(TARGETNAME).o \
|
||||
../ntdll/ntdll.a \
|
||||
../kernel32/kernel32.a \
|
||||
-specs=$(TARGETNAME)_specs \
|
||||
-nostartfiles -nostdlib -Wl,--entry=_DllMain@12\
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--base-file,base.tmp
|
||||
|
@ -72,10 +72,10 @@ $(TARGETNAME).dll: $(DLLMAIN) $(OBJECTS) $(TARGETNAME).def
|
|||
$(TARGETNAME).o \
|
||||
../ntdll/ntdll.a \
|
||||
../kernel32/kernel32.a \
|
||||
-specs=$(TARGETNAME)_specs \
|
||||
-nostartfiles -nostdlib -Wl,--entry=_DllMain@12\
|
||||
-mdll \
|
||||
-o $(TARGETNAME).dll \
|
||||
-Wl,--image-base,0x20000000 \
|
||||
-Wl,--image-base,0x77dc0000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp
|
||||
|
@ -93,20 +93,12 @@ $(CLEAN_FILES:%=%_clean): %_clean:
|
|||
install: $(FLOPPY_DIR)/dlls/$(TARGETNAME).dll
|
||||
|
||||
$(FLOPPY_DIR)/dlls/$(TARGETNAME).dll: $(TARGETNAME).dll
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGETNAME).dll $(FLOPPY_DIR)\dlls\$(TARGETNAME).dll
|
||||
else
|
||||
$(CP) $(TARGETNAME).dll $(FLOPPY_DIR)/dlls/$(TARGETNAME).dll
|
||||
endif
|
||||
|
||||
dist: $(DIST_DIR)/dlls/$(TARGETNAME).dll
|
||||
|
||||
$(DIST_DIR)/dlls/$(TARGETNAME).dll: $(TARGETNAME).dll
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGETNAME).dll ..\..\$(DIST_DIR)\dlls\$(TARGETNAME).dll
|
||||
else
|
||||
$(CP) $(TARGETNAME).dll ../../$(DIST_DIR)/dlls/$(TARGETNAME).dll
|
||||
endif
|
||||
|
||||
include ../../rules.mak
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.38 2000/08/18 22:26:59 dwelch Exp $
|
||||
# $Id: makefile,v 1.39 2000/10/07 13:41:47 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -8,7 +8,7 @@ TARGET=crtdll
|
|||
DLLTARGET=$(TARGET).dll
|
||||
|
||||
|
||||
BASE_CFLAGS = -I../../include
|
||||
CFLAGS =
|
||||
|
||||
all: $(DLLTARGET)
|
||||
|
||||
|
@ -173,12 +173,12 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
--def $(TARGET).def \
|
||||
--output-lib $(TARGET).a
|
||||
$(CC) \
|
||||
-specs=crt_specs \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--base-file,base.tmp \
|
||||
$(TARGET).o \
|
||||
../kernel32/kernel32.a
|
||||
../kernel32/kernel32.a -lgcc
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGET).dll \
|
||||
|
@ -187,11 +187,11 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
--def $(TARGET).def
|
||||
- $(RM) base.tmp
|
||||
$(CC) \
|
||||
-specs=crt_specs \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o $(TARGET).dll \
|
||||
$(TARGET).o \
|
||||
../kernel32/kernel32.a \
|
||||
../kernel32/kernel32.a -lgcc \
|
||||
-Wl,--image-base,0x77630000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.9 2000/08/18 22:26:59 dwelch Exp $
|
||||
# $Id: makefile,v 1.10 2000/10/07 13:41:47 dwelch Exp $
|
||||
#
|
||||
# Makefile for fmifs.dll
|
||||
#
|
||||
|
@ -51,7 +51,7 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
-mdll \
|
||||
-o $(TARGET).dll \
|
||||
$(TARGET).o \
|
||||
-Wl,--image-base,0x70000000 \
|
||||
-Wl,--image-base,0x76df0000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.15 2000/08/18 22:27:00 dwelch Exp $
|
||||
# $Id: makefile,v 1.16 2000/10/07 13:41:48 dwelch Exp $
|
||||
#
|
||||
# Makefile for ReactOS gdi32.dll
|
||||
#
|
||||
|
@ -54,7 +54,7 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
-mdll \
|
||||
-o $(TARGET).dll \
|
||||
-Wl,--entry,_DllMain@12 \
|
||||
-Wl,--image-base,0x70000000 \
|
||||
-Wl,--image-base,0x77ed0000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
# $Id: makefile,v 1.39 2000/08/18 22:27:00 dwelch Exp $
|
||||
# $Id: makefile,v 1.40 2000/10/07 13:41:48 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
TARGET=kernel32
|
||||
TARGET = kernel32
|
||||
|
||||
KERNEL32_BASE = 0x77f00000
|
||||
|
||||
BASE_CFLAGS = -I../../include
|
||||
|
||||
CFLAGS = $(CFLAGS) -DKERNEL32_BASE=$(KERNEL32_BASE)
|
||||
CFLAGS = -DKERNEL32_BASE=$(KERNEL32_BASE)
|
||||
|
||||
DLLTARGET=$(TARGET).dll
|
||||
|
||||
|
@ -102,12 +100,12 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
--kill-at \
|
||||
--output-lib $(TARGET).a
|
||||
$(CC) \
|
||||
-specs=k32_specs \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--base-file,base.tmp \
|
||||
$(TARGET).o \
|
||||
../ntdll/ntdll.a
|
||||
../ntdll/ntdll.a -lgcc
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGET).dll \
|
||||
|
@ -116,11 +114,11 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
--def $(TARGET).edf
|
||||
- $(RM) base.tmp
|
||||
$(CC) \
|
||||
-specs=k32_specs \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o $(TARGET).dll \
|
||||
$(TARGET).o \
|
||||
../ntdll/ntdll.a \
|
||||
../ntdll/ntdll.a -lgcc \
|
||||
-Wl,--image-base,$(KERNEL32_BASE) \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.3 2000/08/18 22:27:00 dwelch Exp $
|
||||
# $Id: Makefile,v 1.4 2000/10/07 13:41:48 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -82,7 +82,7 @@ $(TARGET_NAME).dll: $(DLLMAIN) $(OBJECTS) misc/$(TARGET_NAME).def
|
|||
-o $(TARGET_NAME).dll \
|
||||
$(TARGET_NAME).o \
|
||||
../kernel32/kernel32.a \
|
||||
-Wl,--image-base,0x77630000 \
|
||||
-Wl,--image-base,0x78000000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.53 2000/09/04 19:03:46 ekohl Exp $
|
||||
# $Id: makefile,v 1.54 2000/10/07 13:41:48 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -6,7 +6,7 @@ PATH_TO_TOP = ../..
|
|||
|
||||
TARGET = ntdll
|
||||
|
||||
BASE_CFLAGS = -I../../include -D__NTDLL__
|
||||
CFLAGS = -D__NTDLL__ -g
|
||||
|
||||
IMAGE_BASE = 0x77f60000
|
||||
|
||||
|
@ -74,11 +74,11 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) def/ntdll.def def/ntdll.edf
|
|||
--kill-at \
|
||||
--output-lib $(TARGET).a
|
||||
$(CC) \
|
||||
-specs=$(TARGET)_specs \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--base-file,base.tmp \
|
||||
$(TARGET).o
|
||||
$(TARGET).o -lgcc
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGET).dll \
|
||||
|
@ -87,11 +87,11 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) def/ntdll.def def/ntdll.edf
|
|||
--def def/$(TARGET).edf
|
||||
- $(RM) base.tmp
|
||||
$(CC) \
|
||||
-specs=$(TARGET)_specs \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o $(TARGET).dll \
|
||||
$(TARGET).o \
|
||||
-Wl,--entry=0x00000000 \
|
||||
$(TARGET).o -lgcc \
|
||||
-Wl,--entry=_LdrInitializeThunk@16 \
|
||||
-Wl,--image-base,$(IMAGE_BASE) \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
|
@ -125,6 +125,4 @@ else
|
|||
$(CP) $(TARGET).dll ../../$(DIST_DIR)/dlls/$(TARGET).dll
|
||||
endif
|
||||
|
||||
#WITH_DEBUGGING = yes
|
||||
#WARNINGS_ARE_ERRORS = yes
|
||||
include ../../rules.mak
|
||||
|
|
|
@ -1,33 +1,24 @@
|
|||
# $Id: Makefile,v 1.3 2000/08/29 20:10:49 ea Exp $
|
||||
# $Id: Makefile,v 1.4 2000/10/07 13:41:49 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
CFLAGS = -Iinclude -D__SECUR32__ -DDBG -g -Wall -Werror
|
||||
|
||||
TARGET = secur32
|
||||
|
||||
SECUR32_BASE = 0x10000000
|
||||
|
||||
BASE_CFLAGS = -I../../include
|
||||
|
||||
CFLAGS = $(CFLAGS)
|
||||
|
||||
include ../../rules.mak
|
||||
DLLTARGET=$(TARGET).dll
|
||||
|
||||
all: $(DLLTARGET)
|
||||
|
||||
OBJECTS = lsa.o dllmain.o $(TARGET).coff
|
||||
|
||||
ifeq ($(DOSCLI),yes)
|
||||
CLEAN_FILES = $(OBJECTS) \
|
||||
$(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp \
|
||||
$(TARGET).dll $(TARGET).sym $(TARGET).coff
|
||||
else
|
||||
CLEAN_FILES = $(OBJECTS) \
|
||||
$(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp \
|
||||
$(TARGET).dll $(TARGET).sym $(TARGET).coff
|
||||
endif
|
||||
|
||||
$(TARGET).coff: $(TARGET).rc ../../include/reactos/resource.h
|
||||
|
||||
|
@ -75,5 +66,5 @@ $(CLEAN_FILES:%=%_clean): %_clean:
|
|||
|
||||
.PHONY: clean $(CLEAN_FILES:%=%_clean)
|
||||
|
||||
WARNINGS_ARE_ERRORS = yes
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile_rex,v 1.12 2000/09/10 10:14:39 ea Exp $
|
||||
# $Id: makefile_rex,v 1.13 2000/10/07 13:41:49 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -99,10 +99,10 @@ OBJECTS = $(MISC_OBJECTS) $(INTERNAL_OBJECTS) $(GRAPHICS_OBJECTS) $(RESOURCE_OBJ
|
|||
$(CONTROLS_OBJECTS) $(WINDOWS_OBJECTS)
|
||||
|
||||
ifeq ($(DOSCLI),yes)
|
||||
CLEAN_FILES = misc\*.o \
|
||||
CLEAN_FILES = misc\*.o windows\*.o internal\*.o controls\*.o graphics\*.o resources\*.o \
|
||||
$(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp $(TARGET).dll $(TARGET).sym
|
||||
else
|
||||
CLEAN_FILES = misc/*.o \
|
||||
CLEAN_FILES = misc/*.o windows/*.o internal/*.o controls/*.o graphics/*.o resources/*.o \
|
||||
$(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp $(TARGET).dll $(TARGET).sym
|
||||
endif
|
||||
|
||||
|
@ -140,7 +140,7 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
-specs=$(TARGET)_specs \
|
||||
-mdll \
|
||||
-o $(TARGET).dll \
|
||||
-Wl,--image-base,0x70000000 \
|
||||
-Wl,--image-base,0x77e70000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.4 2000/08/18 22:27:02 dwelch Exp $
|
||||
# $Id: makefile,v 1.5 2000/10/07 13:41:49 dwelch Exp $
|
||||
#
|
||||
# Makefile for ReactOS version.dll
|
||||
#
|
||||
|
@ -50,7 +50,7 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
|
|||
-mdll \
|
||||
-o $(TARGET).dll \
|
||||
-Wl,--entry,_DllMain@12 \
|
||||
-Wl,--image-base,0x70000000 \
|
||||
-Wl,--image-base,0x77a90000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp
|
||||
|
|
File diff suppressed because it is too large
Load diff
552
reactos/ntoskrnl/Makefile
Normal file
552
reactos/ntoskrnl/Makefile
Normal file
|
@ -0,0 +1,552 @@
|
|||
# $Id: Makefile,v 1.1 2000/10/07 13:41:50 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
PATH_TO_TOP = ..
|
||||
|
||||
TARGETNAME = ntoskrnl
|
||||
|
||||
OBJECTS_PATH = objects
|
||||
|
||||
ASFLAGS = -Iinclude
|
||||
CFLAGS = -Iinclude -D__NTOSKRNL__ -DDBG -g -Wall -Werror
|
||||
|
||||
all: \
|
||||
$(OBJECTS_PATH) \
|
||||
$(TARGETNAME).nostrip.exe \
|
||||
$(TARGETNAME).exe
|
||||
|
||||
# Hardware Abstraction Layer (Hal)
|
||||
# Defines $(OBJECTS_HAL)
|
||||
#
|
||||
include hal/x86/sources
|
||||
|
||||
# System API (Nt/Zw)
|
||||
OBJECTS_NT = \
|
||||
nt/atom.o \
|
||||
nt/channel.o \
|
||||
nt/evtpair.o \
|
||||
nt/mutant.o \
|
||||
nt/misc.o \
|
||||
nt/nt.o \
|
||||
nt/ntevent.o \
|
||||
nt/ntsem.o \
|
||||
nt/nttimer.o \
|
||||
nt/plugplay.o \
|
||||
nt/profile.o \
|
||||
nt/zw.o
|
||||
|
||||
# Run-Time Library (Rtl)
|
||||
OBJECTS_RTL = \
|
||||
rtl/bitmap.o \
|
||||
rtl/ctype.o \
|
||||
rtl/error.o \
|
||||
rtl/interlck.o \
|
||||
rtl/largeint.o \
|
||||
rtl/mem.o \
|
||||
rtl/memchr.o \
|
||||
rtl/memcpy.o \
|
||||
rtl/memmove.o \
|
||||
rtl/memset.o \
|
||||
rtl/nls.o \
|
||||
rtl/qsort.o \
|
||||
rtl/regio.o \
|
||||
rtl/sprintf.o \
|
||||
rtl/stdlib.o \
|
||||
rtl/string.o \
|
||||
rtl/swprintf.o \
|
||||
rtl/time.o \
|
||||
rtl/unicode.o \
|
||||
rtl/wstring.o \
|
||||
rtl/bitops.o \
|
||||
rtl/memcmp.o
|
||||
|
||||
# Kernel (Ke)
|
||||
# Note: head.o MUST be the first file!!!
|
||||
OBJECTS_KE = \
|
||||
ke/multiboot.o \
|
||||
ke/apc.o \
|
||||
ke/bug.o \
|
||||
ke/catch.o \
|
||||
ke/critical.o \
|
||||
ke/dpc.o \
|
||||
ke/error.o \
|
||||
ke/event.o \
|
||||
ke/gdt.o \
|
||||
ke/idt.o \
|
||||
ke/kernel.o \
|
||||
ke/kqueue.o \
|
||||
ke/ldt.o \
|
||||
ke/main.o \
|
||||
ke/mutex.o \
|
||||
ke/process.o \
|
||||
ke/sem.o \
|
||||
ke/spinlock.o \
|
||||
ke/timer.o \
|
||||
ke/wait.o \
|
||||
ke/kthread.o
|
||||
|
||||
OBJECTS_KE_I386 = \
|
||||
ke/i386/exp.o \
|
||||
ke/i386/irq.o \
|
||||
ke/i386/irqhand.o \
|
||||
ke/i386/thread.o \
|
||||
ke/i386/usercall.o \
|
||||
ke/i386/trap.o
|
||||
|
||||
# Memory Manager (Mm)
|
||||
OBJECTS_MM = \
|
||||
mm/aspace.o \
|
||||
mm/cont.o \
|
||||
mm/freelist.o \
|
||||
mm/iospace.o \
|
||||
mm/marea.o \
|
||||
mm/mdl.o \
|
||||
mm/mm.o \
|
||||
mm/ncache.o \
|
||||
mm/npool.o \
|
||||
mm/pagfault.o \
|
||||
mm/pagefile.o \
|
||||
mm/paging.o \
|
||||
mm/pool.o \
|
||||
mm/ppool.o \
|
||||
mm/section.o \
|
||||
mm/virtual.o \
|
||||
mm/pager.o \
|
||||
mm/wset.o \
|
||||
mm/mminit.o \
|
||||
mm/kmap.o \
|
||||
mm/mpw.o
|
||||
|
||||
OBJECTS_MM_I386 = \
|
||||
mm/i386/memsafe.o \
|
||||
mm/i386/page.o \
|
||||
mm/i386/pfault.o
|
||||
|
||||
# I/O Subsystem (Io)
|
||||
OBJECTS_IO = \
|
||||
io/adapter.o \
|
||||
io/buildirp.o \
|
||||
io/cancel.o \
|
||||
io/cleanup.o \
|
||||
io/cntrller.o \
|
||||
io/create.o \
|
||||
io/device.o \
|
||||
io/dir.o \
|
||||
io/drvlck.o \
|
||||
io/errlog.o \
|
||||
io/error.o \
|
||||
io/event.o \
|
||||
io/file.o \
|
||||
io/flush.o \
|
||||
io/fs.o \
|
||||
io/iocomp.o \
|
||||
io/ioctrl.o \
|
||||
io/iomgr.o \
|
||||
io/irp.o \
|
||||
io/lock.o \
|
||||
io/mailslot.o \
|
||||
io/mdl.o \
|
||||
io/npipe.o \
|
||||
io/page.o \
|
||||
io/process.o \
|
||||
io/queue.o \
|
||||
io/resource.o \
|
||||
io/rw.o \
|
||||
io/share.o \
|
||||
io/shutdown.o \
|
||||
io/symlink.o \
|
||||
io/timer.o \
|
||||
io/vpb.o \
|
||||
io/xhaldisp.o \
|
||||
io/xhaldrv.o
|
||||
|
||||
# Object Manager (Ob)
|
||||
OBJECTS_OB = \
|
||||
ob/dirobj.o \
|
||||
ob/handle.o \
|
||||
ob/namespc.o \
|
||||
ob/ntobj.o \
|
||||
ob/object.o \
|
||||
ob/security.o
|
||||
|
||||
# Process Manager (Ps)
|
||||
OBJECTS_PS = \
|
||||
ps/create.o \
|
||||
ps/idle.o \
|
||||
ps/kill.o \
|
||||
ps/process.o \
|
||||
ps/psmgr.o \
|
||||
ps/thread.o \
|
||||
ps/tinfo.o
|
||||
|
||||
# Executive Subsystem (Ex)
|
||||
OBJECTS_EX = \
|
||||
ex/callback.o \
|
||||
ex/fmutex.o \
|
||||
ex/init.o \
|
||||
ex/interlck.o \
|
||||
ex/list.o \
|
||||
ex/locale.o \
|
||||
ex/lookas.o \
|
||||
ex/napi.o \
|
||||
ex/power.o \
|
||||
ex/resource.o \
|
||||
ex/time.o \
|
||||
ex/sysinfo.o \
|
||||
ex/work.o \
|
||||
ex/zone.o
|
||||
|
||||
# Installable File System Run-Time Library (FsRtl)
|
||||
OBJECTS_FS = \
|
||||
fs/dbcsname.o \
|
||||
fs/filelock.o \
|
||||
fs/mcb.o \
|
||||
fs/mdl.o \
|
||||
fs/name.o \
|
||||
fs/notify.o \
|
||||
fs/oplock.o \
|
||||
fs/pool.o \
|
||||
fs/tunnel.o \
|
||||
fs/unc.o \
|
||||
fs/util.o
|
||||
|
||||
# Security Subsystem
|
||||
OBJECTS_SE = \
|
||||
se/access.o \
|
||||
se/acl.o \
|
||||
se/luid.o \
|
||||
se/priv.o \
|
||||
se/sd.o \
|
||||
se/semgr.o \
|
||||
se/sid.o \
|
||||
se/token.o
|
||||
|
||||
# Configuration Manager (Registry)
|
||||
OBJECTS_CM = \
|
||||
cm/registry.o
|
||||
|
||||
# Debugger Support (Dbg)
|
||||
OBJECTS_DBG = \
|
||||
dbg/brkpoint.o \
|
||||
dbg/errinfo.o \
|
||||
dbg/print.o
|
||||
|
||||
# Loader
|
||||
OBJECTS_LDR = \
|
||||
ldr/init.o \
|
||||
ldr/loader.o \
|
||||
ldr/resource.o \
|
||||
ldr/rtl.o \
|
||||
ldr/sysdll.o \
|
||||
ldr/userldr.o
|
||||
|
||||
# Local Procedure Call (Lpc)
|
||||
OBJECTS_LPC = \
|
||||
lpc/close.o \
|
||||
lpc/complete.o \
|
||||
lpc/connect.o \
|
||||
lpc/create.o \
|
||||
lpc/listen.o \
|
||||
lpc/port.o \
|
||||
lpc/query.o \
|
||||
lpc/queue.o \
|
||||
lpc/receive.o \
|
||||
lpc/reply.o \
|
||||
lpc/send.o
|
||||
|
||||
# Nation Language Support Library (Nls)
|
||||
OBJECTS_NLS = nls/nls.o
|
||||
|
||||
# Power Management (Po)
|
||||
OBJECTS_PO = po/power.o
|
||||
|
||||
# Cache Manager (Cc)
|
||||
OBJECTS_CC = \
|
||||
cc/cacheman.o \
|
||||
cc/view.o
|
||||
|
||||
# Kernel Debugger Support (Kd)
|
||||
OBJECTS_KD = \
|
||||
kd/kdebug.o \
|
||||
kd/service.o
|
||||
|
||||
# Resources
|
||||
OBJECTS_RESOURCE = \
|
||||
$(TARGETNAME).coff
|
||||
|
||||
# IMPORTS/EXPORTS
|
||||
IE_DATA = \
|
||||
$(TARGETNAME).def \
|
||||
$(TARGETNAME).edf
|
||||
|
||||
$(OBJECTS_PATH):
|
||||
mkdir $(OBJECTS_PATH)
|
||||
|
||||
#
|
||||
# Build subsystem intermediate objects
|
||||
#
|
||||
$(OBJECTS_PATH)/hal.o: $(OBJECTS_HAL)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/hal.o \
|
||||
$(OBJECTS_HAL)
|
||||
|
||||
$(OBJECTS_PATH)/io.o: $(OBJECTS_IO)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/io.o \
|
||||
$(OBJECTS_IO)
|
||||
|
||||
$(OBJECTS_PATH)/ke.o: $(OBJECTS_KE) $(OBJECTS_KE_I386)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/ke.o \
|
||||
$(OBJECTS_KE) \
|
||||
$(OBJECTS_KE_I386)
|
||||
|
||||
$(OBJECTS_PATH)/rtl.o: $(OBJECTS_RTL)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/rtl.o \
|
||||
$(OBJECTS_RTL)
|
||||
|
||||
$(OBJECTS_PATH)/mm.o: $(OBJECTS_MM) $(OBJECTS_MM_I386)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/mm.o \
|
||||
$(OBJECTS_MM) \
|
||||
$(OBJECTS_MM_I386)
|
||||
|
||||
$(OBJECTS_PATH)/ob.o: $(OBJECTS_OB)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/ob.o \
|
||||
$(OBJECTS_OB)
|
||||
|
||||
$(OBJECTS_PATH)/ps.o: $(OBJECTS_PS)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/ps.o \
|
||||
$(OBJECTS_PS)
|
||||
|
||||
$(OBJECTS_PATH)/ex.o: $(OBJECTS_EX)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/ex.o \
|
||||
$(OBJECTS_EX)
|
||||
|
||||
$(OBJECTS_PATH)/fs.o: $(OBJECTS_FS)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/fs.o \
|
||||
$(OBJECTS_FS)
|
||||
|
||||
$(OBJECTS_PATH)/se.o: $(OBJECTS_SE)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/se.o \
|
||||
$(OBJECTS_SE)
|
||||
|
||||
$(OBJECTS_PATH)/cm.o: $(OBJECTS_CM)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/cm.o \
|
||||
$(OBJECTS_CM)
|
||||
|
||||
$(OBJECTS_PATH)/dbg.o: $(OBJECTS_DBG)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/dbg.o \
|
||||
$(OBJECTS_DBG)
|
||||
|
||||
$(OBJECTS_PATH)/ldr.o: $(OBJECTS_LDR)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/ldr.o \
|
||||
$(OBJECTS_LDR)
|
||||
|
||||
$(OBJECTS_PATH)/lpc.o: $(OBJECTS_LPC)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/lpc.o \
|
||||
$(OBJECTS_LPC)
|
||||
|
||||
$(OBJECTS_PATH)/nls.o: $(OBJECTS_NLS)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/nls.o \
|
||||
$(OBJECTS_NLS)
|
||||
|
||||
$(OBJECTS_PATH)/nt.o: $(OBJECTS_NT)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/nt.o \
|
||||
$(OBJECTS_NT)
|
||||
|
||||
$(OBJECTS_PATH)/po.o: $(OBJECTS_PO)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/po.o \
|
||||
$(OBJECTS_PO)
|
||||
|
||||
$(OBJECTS_PATH)/cc.o: $(OBJECTS_CC)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/cc.o \
|
||||
$(OBJECTS_CC)
|
||||
|
||||
$(OBJECTS_PATH)/kd.o: $(OBJECTS_KD)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(OBJECTS_PATH)/kd.o \
|
||||
$(OBJECTS_KD)
|
||||
|
||||
$(TARGETNAME).coff: $(TARGETNAME).rc ../include/reactos/resource.h
|
||||
|
||||
|
||||
# Note: ke.o MUST be the first file!!!
|
||||
OBJECTS = \
|
||||
$(OBJECTS_PATH)/ke.o \
|
||||
$(OBJECTS_PATH)/hal.o \
|
||||
$(OBJECTS_PATH)/cc.o \
|
||||
$(OBJECTS_PATH)/cm.o \
|
||||
$(OBJECTS_PATH)/dbg.o \
|
||||
$(OBJECTS_PATH)/ex.o \
|
||||
$(OBJECTS_PATH)/lpc.o \
|
||||
$(OBJECTS_PATH)/fs.o \
|
||||
$(OBJECTS_PATH)/io.o \
|
||||
$(OBJECTS_PATH)/kd.o \
|
||||
$(OBJECTS_PATH)/ldr.o \
|
||||
$(OBJECTS_PATH)/mm.o \
|
||||
$(OBJECTS_PATH)/nls.o \
|
||||
$(OBJECTS_PATH)/nt.o \
|
||||
$(OBJECTS_PATH)/ob.o \
|
||||
$(OBJECTS_PATH)/po.o \
|
||||
$(OBJECTS_PATH)/ps.o \
|
||||
$(OBJECTS_PATH)/rtl.o \
|
||||
$(OBJECTS_PATH)/se.o \
|
||||
$(OBJECTS_RESOURCE)
|
||||
|
||||
|
||||
ifeq ($(DOSCLI),yes)
|
||||
CLEAN_FILES = $(OBJECTS_PATH)\*.o cc\*.o cm\*.o dbg\*.o ex\*.o hal\x86\*.o io\*.o \
|
||||
ke\*.o ldr\*.o mm\*.o nt\*.o ob\*.o ps\*.o rtl\*.o se\*.o \
|
||||
ke\i386\*.o mm\i386\*.o fs\*.o po\*.o nls\*.o lpc\*.o \
|
||||
kd\*.o $(TARGETNAME).o $(TARGETNAME).a junk.tmp base.tmp temp.exp \
|
||||
$(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym $(TARGETNAME).coff
|
||||
else
|
||||
CLEAN_FILES = $(OBJECTS_PATH)/*.o cc/*.o cm/*.o dbg/*.o ex/*.o hal/x86/*.o io/*.o \
|
||||
ke/*.o ldr/*.o mm/*.o nt/*.o ob/*.o ps/*.o rtl/*.o se/*.o \
|
||||
ke/i386/*.o mm/i386/*.o fs/*.o po/*.o nls/*.o lpc/*.o \
|
||||
kd/*.o $(TARGETNAME).o $(TARGETNAME).a junk.tmp base.tmp temp.exp \
|
||||
$(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym $(TARGETNAME).coff
|
||||
endif
|
||||
|
||||
|
||||
$(TARGETNAME).nostrip.exe: $(TARGETNAME).o $(TARGETNAME).a $(IE_DATA)
|
||||
$(CC) \
|
||||
-Wl,-T,ntoskrnl.lnk \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--image-base,0xc0000000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,--base-file,base.tmp \
|
||||
$(TARGETNAME).o -lgcc
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGETNAME).exe \
|
||||
--base-file base.tmp \
|
||||
--output-exp temp.exp \
|
||||
--def $(TARGETNAME).edf \
|
||||
--kill-at
|
||||
- $(RM) base.tmp
|
||||
$(CC) \
|
||||
-nostartfiles -nostdlib \
|
||||
-Wl,-T,ntoskrnl.lnk \
|
||||
-mdll \
|
||||
-o $(TARGETNAME).nostrip.exe \
|
||||
-Wl,--image-base,0xc0000000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp \
|
||||
$(TARGETNAME).o -lgcc
|
||||
- $(RM) temp.exp
|
||||
|
||||
$(TARGETNAME).exe: $(TARGETNAME).o $(TARGETNAME).a
|
||||
$(STRIP) \
|
||||
--strip-debug \
|
||||
$(TARGETNAME).o
|
||||
$(CC) -Wl,-T,ntoskrnl.lnk \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--image-base,0xc0000000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,--base-file,base.tmp \
|
||||
$(TARGETNAME).o -lgcc
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGETNAME).exe \
|
||||
--base-file base.tmp \
|
||||
--output-exp temp.exp \
|
||||
--def $(TARGETNAME).edf \
|
||||
--kill-at
|
||||
- $(RM) base.tmp
|
||||
$(CC) -Wl,-T,ntoskrnl.lnk \
|
||||
-nostartfiles -nostdlib \
|
||||
-mdll \
|
||||
-o $(TARGETNAME).exe \
|
||||
-Wl,--image-base,0xc0000000 \
|
||||
-Wl,--file-alignment,0x1000 \
|
||||
-Wl,--section-alignment,0x1000 \
|
||||
-Wl,temp.exp \
|
||||
$(TARGETNAME).o -lgcc
|
||||
- $(RM) temp.exp
|
||||
$(NM) --numeric-sort $(TARGETNAME).exe > $(TARGETNAME).sym
|
||||
|
||||
|
||||
$(TARGETNAME).o: $(OBJECTS)
|
||||
$(LD) \
|
||||
-r \
|
||||
-o $(TARGETNAME).o \
|
||||
$(OBJECTS)
|
||||
|
||||
$(TARGETNAME).a: $(TARGETNAME).def
|
||||
$(DLLTOOL) \
|
||||
--dllname $(TARGETNAME).exe \
|
||||
--def $(TARGETNAME).def \
|
||||
--output-lib $(TARGETNAME).a \
|
||||
--kill-at
|
||||
|
||||
clean: $(CLEAN_FILES:%=%_clean)
|
||||
|
||||
$(CLEAN_FILES:%=%_clean): %_clean:
|
||||
- $(RM) $*
|
||||
|
||||
.PHONY: clean $(CLEAN_FILES:%=%_clean)
|
||||
|
||||
install: $(FLOPPY_DIR)/$(TARGETNAME).exe
|
||||
|
||||
$(FLOPPY_DIR)/$(TARGETNAME).exe: $(TARGETNAME).exe
|
||||
$(CP) $(TARGETNAME).exe $(FLOPPY_DIR)/$(TARGETNAME).exe
|
||||
|
||||
.PHONY: dist
|
||||
|
||||
dist: ../$(DIST_DIR)/$(TARGETNAME).exe
|
||||
|
||||
../$(DIST_DIR)/$(TARGETNAME).exe: $(TARGETNAME).exe
|
||||
$(CP) $(TARGETNAME).exe ../$(DIST_DIR)/$(TARGETNAME).exe
|
||||
|
||||
.PHONY: dist
|
||||
|
||||
ex/napi.o: ex/napi.c ../include/ntdll/napi.h
|
||||
|
||||
ke/main.o: ke/main.c ../include/reactos/buildno.h
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
# EOF
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: list.c,v 1.1 2000/07/02 10:48:31 ekohl Exp $
|
||||
/* $Id: list.c,v 1.2 2000/10/07 13:41:50 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -18,8 +18,7 @@
|
|||
/* FUNCTIONS *************************************************************/
|
||||
|
||||
|
||||
PLIST_ENTRY
|
||||
STDCALL
|
||||
PLIST_ENTRY STDCALL
|
||||
ExInterlockedInsertHeadList (
|
||||
PLIST_ENTRY ListHead,
|
||||
PLIST_ENTRY ListEntry,
|
||||
|
@ -53,8 +52,7 @@ ExInterlockedInsertHeadList (
|
|||
}
|
||||
|
||||
|
||||
PLIST_ENTRY
|
||||
STDCALL
|
||||
PLIST_ENTRY STDCALL
|
||||
ExInterlockedInsertTailList (
|
||||
PLIST_ENTRY ListHead,
|
||||
PLIST_ENTRY ListEntry,
|
||||
|
@ -80,8 +78,7 @@ ExInterlockedInsertTailList (
|
|||
}
|
||||
|
||||
|
||||
PLIST_ENTRY
|
||||
STDCALL
|
||||
PLIST_ENTRY STDCALL
|
||||
ExInterlockedRemoveHeadList (
|
||||
PLIST_ENTRY Head,
|
||||
PKSPIN_LOCK Lock
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: work.c,v 1.8 2000/07/30 18:22:33 dwelch Exp $
|
||||
/* $Id: work.c,v 1.9 2000/10/07 13:41:50 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -31,7 +31,7 @@ typedef struct _WORK_QUEUE
|
|||
LIST_ENTRY Head;
|
||||
|
||||
/*
|
||||
* PURPOSE: Sychronize access to the access
|
||||
* PURPOSE: Sychronize access to the work queue
|
||||
*/
|
||||
KSPIN_LOCK Lock;
|
||||
|
||||
|
@ -89,6 +89,7 @@ static NTSTATUS ExWorkerThreadEntryPoint(PVOID context)
|
|||
KernelMode,
|
||||
FALSE,
|
||||
NULL);
|
||||
DPRINT1("Woke from wait\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,12 +37,15 @@ HalMakeBeep (
|
|||
ULONG Frequency
|
||||
)
|
||||
{
|
||||
UCHAR b;
|
||||
|
||||
/* save flags and disable interrupts */
|
||||
__asm__("pushf\n\t" \
|
||||
"cli\n\t");
|
||||
|
||||
/* speaker off */
|
||||
outb_p(PORT_B, inb_p(PORT_B) & 0xFC);
|
||||
b = inb_p(PORT_B);
|
||||
outb_p(PORT_B, b & 0xFC);
|
||||
|
||||
if (Frequency)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: display.c,v 1.9 2000/09/29 15:03:21 jean Exp $
|
||||
/* $Id: display.c,v 1.10 2000/10/07 13:41:50 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -15,7 +15,6 @@
|
|||
/* only needed for screen synchronization */
|
||||
#include <internal/halio.h>
|
||||
|
||||
|
||||
#define SCREEN_SYNCHRONIZATION
|
||||
|
||||
|
||||
|
@ -113,8 +112,10 @@ HalInitializeDisplay (PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
// VideoBuffer = HalMapPhysicalMemory (0xb8000, 2);
|
||||
|
||||
/* Set cursor position */
|
||||
CursorX = LoaderBlock->cursorx;
|
||||
CursorY = LoaderBlock->cursory;
|
||||
// CursorX = LoaderBlock->cursorx;
|
||||
// CursorY = LoaderBlock->cursory;
|
||||
CursorX = 0;
|
||||
CursorY = 0;
|
||||
|
||||
/* read screen size from the crtc */
|
||||
/* FIXME: screen size should be read from the boot paramseters */
|
||||
|
|
|
@ -36,9 +36,22 @@ static VOID KeSetCurrentIrql(KIRQL newlvl);
|
|||
|
||||
VOID HalpInitPICs(VOID)
|
||||
{
|
||||
/* Initialization sequence */
|
||||
WRITE_PORT_UCHAR((PUCHAR)0x20, 0x11);
|
||||
WRITE_PORT_UCHAR((PUCHAR)0xa0, 0x11);
|
||||
/* Start of hardware irqs (0x20) */
|
||||
WRITE_PORT_UCHAR((PUCHAR)0x21, 0x40);
|
||||
WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x48);
|
||||
/* 8259-1 is master */
|
||||
WRITE_PORT_UCHAR((PUCHAR)0x21, 0x4);
|
||||
/* 8259-2 is slave */
|
||||
WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x2);
|
||||
/* 8086 mode */
|
||||
WRITE_PORT_UCHAR((PUCHAR)0x21, 0x1);
|
||||
WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x1);
|
||||
/* Mask off all interrupts from PICs */
|
||||
outb(0x21,0xff);
|
||||
outb(0xa1,0xff);
|
||||
WRITE_PORT_UCHAR((PUCHAR)0x21, 0xff);
|
||||
WRITE_PORT_UCHAR((PUCHAR)0xa1, 0xff);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: portio.c,v 1.3 2000/03/04 20:45:34 ea Exp $
|
||||
/* $Id: portio.c,v 1.4 2000/10/07 13:41:50 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -10,119 +10,179 @@
|
|||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <internal/halio.h>
|
||||
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
/*
|
||||
* This file contains the definitions for the x86 IO instructions
|
||||
* inb/inw/inl/outb/outw/outl and the "string versions" of the same
|
||||
* (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
|
||||
* versions of the single-IO instructions (inb_p/inw_p/..).
|
||||
*
|
||||
* This file is not meant to be obfuscating: it's just complicated
|
||||
* to (a) handle it all in a way that makes gcc able to optimize it
|
||||
* as well as possible and (b) trying to avoid writing the same thing
|
||||
* over and over again with slight variations and possibly making a
|
||||
* mistake somewhere.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Thanks to James van Artsdalen for a better timing-fix than
|
||||
* the two short jumps: using outb's to a nonexistent port seems
|
||||
* to guarantee better timings even on fast machines.
|
||||
*
|
||||
* On the other hand, I'd like to be sure of a non-existent port:
|
||||
* I feel a bit unsafe about using 0x80 (should be safe, though)
|
||||
*
|
||||
* Linus
|
||||
*/
|
||||
|
||||
#ifdef SLOW_IO_BY_JUMPING
|
||||
#define __SLOW_DOWN_IO __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:")
|
||||
#else
|
||||
#define __SLOW_DOWN_IO __asm__ __volatile__("outb %al,$0x80")
|
||||
#endif
|
||||
|
||||
#ifdef REALLY_SLOW_IO
|
||||
#define SLOW_DOWN_IO { __SLOW_DOWN_IO; __SLOW_DOWN_IO; __SLOW_DOWN_IO; __SLOW_DOWN_IO; }
|
||||
#else
|
||||
#define SLOW_DOWN_IO __SLOW_DOWN_IO
|
||||
#endif
|
||||
|
||||
VOID STDCALL
|
||||
READ_PORT_BUFFER_UCHAR (PUCHAR Port,
|
||||
PUCHAR Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
insb ((ULONG)Port, Buffer, Count);
|
||||
__asm__ __volatile__ ("cld ; rep ; insb\n\t"
|
||||
: "=D" (Buffer), "=c" (Count)
|
||||
: "d" (Port),"0" (Buffer),"1" (Count));
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
READ_PORT_BUFFER_ULONG (PULONG Port,
|
||||
PULONG Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
insl ((ULONG)Port, Buffer, Count);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
VOID STDCALL
|
||||
READ_PORT_BUFFER_USHORT (PUSHORT Port,
|
||||
PUSHORT Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
insw ((ULONG)Port, Buffer, Count);
|
||||
__asm__ __volatile__ ("cld ; rep ; insw"
|
||||
: "=D" (Buffer), "=c" (Count)
|
||||
: "d" (Port),"0" (Buffer),"1" (Count));
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
READ_PORT_BUFFER_ULONG (PULONG Port,
|
||||
PULONG Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; insl"
|
||||
: "=D" (Buffer), "=c" (Count)
|
||||
: "d" (Port),"0" (Buffer),"1" (Count));
|
||||
}
|
||||
|
||||
UCHAR
|
||||
STDCALL
|
||||
UCHAR STDCALL
|
||||
READ_PORT_UCHAR (PUCHAR Port)
|
||||
{
|
||||
return inb_p ((ULONG)Port);
|
||||
UCHAR Value;
|
||||
|
||||
__asm__("inb %w1, %0\n\t"
|
||||
: "=a" (Value)
|
||||
: "d" (Port)
|
||||
: "eax", "dx");
|
||||
SLOW_DOWN_IO;
|
||||
return(Value);
|
||||
}
|
||||
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
READ_PORT_ULONG (PULONG Port)
|
||||
{
|
||||
return inl_p ((ULONG)Port);
|
||||
}
|
||||
|
||||
|
||||
USHORT
|
||||
STDCALL
|
||||
USHORT STDCALL
|
||||
READ_PORT_USHORT (PUSHORT Port)
|
||||
{
|
||||
return inw_p ((ULONG)Port);
|
||||
USHORT Value;
|
||||
|
||||
__asm__("inw %w1, %0\n\t"
|
||||
: "=a" (Value)
|
||||
: "d" (Port)
|
||||
: "eax", "dx");
|
||||
SLOW_DOWN_IO;
|
||||
return(Value);
|
||||
}
|
||||
|
||||
ULONG STDCALL
|
||||
READ_PORT_ULONG (PULONG Port)
|
||||
{
|
||||
ULONG Value;
|
||||
|
||||
__asm__("inl %w1, %0\n\t"
|
||||
: "=a" (Value)
|
||||
: "d" (Port)
|
||||
: "eax", "dx");
|
||||
SLOW_DOWN_IO;
|
||||
return(Value);
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
VOID STDCALL
|
||||
WRITE_PORT_BUFFER_UCHAR (PUCHAR Port,
|
||||
PUCHAR Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
outsb ((ULONG)Port, Buffer, Count);
|
||||
__asm__ __volatile__ ("cld ; rep ; outsb"
|
||||
: "=S" (Buffer), "=c" (Count)
|
||||
: "d" (Port),"0" (Buffer),"1" (Count));
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_BUFFER_ULONG (PULONG Port,
|
||||
PULONG Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
outsl ((ULONG)Port, Buffer, Count);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
VOID STDCALL
|
||||
WRITE_PORT_BUFFER_USHORT (PUSHORT Port,
|
||||
PUSHORT Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
outsw ((ULONG)Port, Buffer, Count);
|
||||
__asm__ __volatile__ ("cld ; rep ; outsw"
|
||||
: "=S" (Buffer), "=c" (Count)
|
||||
: "d" (Port),"0" (Buffer),"1" (Count));
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
WRITE_PORT_BUFFER_ULONG (PULONG Port,
|
||||
PULONG Buffer,
|
||||
ULONG Count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; outsl"
|
||||
: "=S" (Buffer), "=c" (Count)
|
||||
: "d" (Port),"0" (Buffer),"1" (Count));
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
VOID STDCALL
|
||||
WRITE_PORT_UCHAR (PUCHAR Port,
|
||||
UCHAR Value)
|
||||
{
|
||||
outb_p ((ULONG)Port, Value);
|
||||
__asm__("outb %0, %w1\n\t"
|
||||
:
|
||||
: "a" (Value),
|
||||
"d" (Port)
|
||||
: "eax", "dx");
|
||||
SLOW_DOWN_IO;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_ULONG (PULONG Port,
|
||||
ULONG Value)
|
||||
{
|
||||
outl_p ((ULONG)Port, Value);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
VOID STDCALL
|
||||
WRITE_PORT_USHORT (PUSHORT Port,
|
||||
USHORT Value)
|
||||
{
|
||||
outw_p ((ULONG)Port, Value);
|
||||
__asm__("outw %0, %w1\n\t"
|
||||
:
|
||||
: "a" (Value),
|
||||
"d" (Port)
|
||||
: "eax", "dx");
|
||||
SLOW_DOWN_IO;
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
WRITE_PORT_ULONG (PULONG Port,
|
||||
ULONG Value)
|
||||
{
|
||||
__asm__("outl %0, %w1\n\t"
|
||||
:
|
||||
: "a" (Value),
|
||||
"d" (Port)
|
||||
: "eax", "dx");
|
||||
SLOW_DOWN_IO;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: spinlock.c,v 1.11 2000/06/09 22:22:32 ea Exp $
|
||||
/* $Id: spinlock.c,v 1.12 2000/10/07 13:41:50 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -23,8 +23,7 @@
|
|||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
VOID STDCALL
|
||||
KeAcquireSpinLock (
|
||||
PKSPIN_LOCK SpinLock,
|
||||
PKIRQL OldIrql
|
||||
|
@ -40,8 +39,7 @@ KeAcquireSpinLock (
|
|||
KeAcquireSpinLockAtDpcLevel(SpinLock);
|
||||
}
|
||||
|
||||
KIRQL
|
||||
FASTCALL
|
||||
KIRQL FASTCALL
|
||||
KeAcquireSpinLockRaiseToSynch (
|
||||
PKSPIN_LOCK SpinLock
|
||||
)
|
||||
|
@ -49,8 +47,7 @@ KeAcquireSpinLockRaiseToSynch (
|
|||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
VOID STDCALL
|
||||
KeReleaseSpinLock (
|
||||
PKSPIN_LOCK SpinLock,
|
||||
KIRQL NewIrql
|
||||
|
@ -66,8 +63,7 @@ KeReleaseSpinLock (
|
|||
KeLowerIrql(NewIrql);
|
||||
}
|
||||
|
||||
KIRQL
|
||||
FASTCALL
|
||||
KIRQL FASTCALL
|
||||
KfAcquireSpinLock (
|
||||
PKSPIN_LOCK SpinLock
|
||||
)
|
||||
|
@ -80,8 +76,7 @@ KfAcquireSpinLock (
|
|||
return OldIrql;
|
||||
}
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
VOID FASTCALL
|
||||
KfReleaseSpinLock (
|
||||
PKSPIN_LOCK SpinLock,
|
||||
KIRQL NewIrql
|
||||
|
|
|
@ -1,12 +1,27 @@
|
|||
/* $Id: udelay.c,v 1.2 2000/08/30 19:33:28 dwelch Exp $
|
||||
/* $Id: udelay.c,v 1.3 2000/10/07 13:41:50 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/hal/x86/udelay.c
|
||||
* PURPOSE: Busy waiting
|
||||
* PROGRAMMER: David Welch (david.welch@seh.ox.ac.uk)
|
||||
* UPDATE HISTORY:
|
||||
* 06/11/99 Created
|
||||
*
|
||||
* This software is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write
|
||||
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
|
||||
* MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/* INCLUDES ***************************************************************/
|
||||
|
@ -17,7 +32,6 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
|
||||
/* GLOBALS ******************************************************************/
|
||||
|
||||
static unsigned int delay_count = 1;
|
||||
|
@ -122,6 +136,7 @@ VOID HalpCalibrateStallExecution(VOID)
|
|||
delay_count >>= 1; /* Get bottom value for delay */
|
||||
|
||||
/* Stage 2: Fine calibration */
|
||||
DbgPrint("delay_count: %d\n", delay_count);
|
||||
|
||||
calib_bit = delay_count; /* Which bit are we going to test */
|
||||
|
||||
|
|
|
@ -13,12 +13,6 @@
|
|||
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
|
||||
*/
|
||||
|
||||
#ifdef __SMP__
|
||||
#define LOCK_PREFIX "lock ; "
|
||||
#else
|
||||
#define LOCK_PREFIX ""
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function prototypes to keep gcc -Wall happy
|
||||
*/
|
||||
|
@ -28,209 +22,9 @@ extern void change_bit(int nr, volatile void * addr);
|
|||
extern int test_and_set_bit(int nr, volatile void * addr);
|
||||
extern int test_and_clear_bit(int nr, volatile void * addr);
|
||||
extern int test_and_change_bit(int nr, volatile void * addr);
|
||||
extern int __constant_test_bit(int nr, const volatile void * addr);
|
||||
extern int __test_bit(int nr, volatile void * addr);
|
||||
extern int test_bit(int nr, volatile void * addr);
|
||||
extern int find_first_zero_bit(void * addr, unsigned size);
|
||||
extern int find_next_zero_bit (void * addr, int size, int offset);
|
||||
extern unsigned long ffz(unsigned long word);
|
||||
|
||||
/*
|
||||
* Some hacks to defeat gcc over-optimizations..
|
||||
*/
|
||||
struct __dummy { unsigned long a[100]; };
|
||||
#define ADDR (*(volatile struct __dummy *) addr)
|
||||
#define CONST_ADDR (*(volatile const struct __dummy *) addr)
|
||||
|
||||
extern __inline__ void set_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btsl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
extern __inline__ void clear_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btrl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
extern __inline__ void change_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btcl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btsl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btrl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btcl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine doesn't need to be atomic.
|
||||
*/
|
||||
extern __inline__ int __constant_test_bit(int nr, const volatile void * addr)
|
||||
{
|
||||
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
|
||||
}
|
||||
|
||||
extern __inline__ int __test_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"btl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit)
|
||||
:"m" (ADDR),"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
#define test_bit(nr,addr) \
|
||||
(__builtin_constant_p(nr) ? \
|
||||
__constant_test_bit((nr),(addr)) : \
|
||||
__test_bit((nr),(addr)))
|
||||
|
||||
/*
|
||||
* Find-bit routines..
|
||||
*/
|
||||
extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
|
||||
{
|
||||
int d0, d1, d2;
|
||||
int res;
|
||||
|
||||
if (!size)
|
||||
return 0;
|
||||
__asm__("cld\n\t"
|
||||
"movl $-1,%%eax\n\t"
|
||||
"xorl %%edx,%%edx\n\t"
|
||||
"repe; scasl\n\t"
|
||||
"je 1f\n\t"
|
||||
"xorl -4(%%edi),%%eax\n\t"
|
||||
"subl $4,%%edi\n\t"
|
||||
"bsfl %%eax,%%edx\n"
|
||||
"1:\tsubl %%ebx,%%edi\n\t"
|
||||
"shll $3,%%edi\n\t"
|
||||
"addl %%edi,%%edx"
|
||||
:"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
|
||||
:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
|
||||
return res;
|
||||
}
|
||||
|
||||
extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
|
||||
{
|
||||
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
|
||||
int set = 0, bit = offset & 31, res;
|
||||
|
||||
if (bit) {
|
||||
/*
|
||||
* Look for zero in first byte
|
||||
*/
|
||||
__asm__("bsfl %1,%0\n\t"
|
||||
"jne 1f\n\t"
|
||||
"movl $32, %0\n"
|
||||
"1:"
|
||||
: "=r" (set)
|
||||
: "r" (~(*p >> bit)));
|
||||
if (set < (32 - bit))
|
||||
return set + offset;
|
||||
set = 32 - bit;
|
||||
p++;
|
||||
}
|
||||
/*
|
||||
* No zero yet, search remaining full bytes for a zero
|
||||
*/
|
||||
res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
|
||||
return (offset + set + res);
|
||||
}
|
||||
|
||||
/*
|
||||
* ffz = Find First Zero in word. Undefined if no zero exists,
|
||||
* so code should check against ~0UL first..
|
||||
*/
|
||||
extern __inline__ unsigned long ffz(unsigned long word)
|
||||
{
|
||||
__asm__("bsfl %1,%0"
|
||||
:"=r" (word)
|
||||
:"r" (~word));
|
||||
return word;
|
||||
}
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* ffs: find first bit set. This is defined the same way as
|
||||
* the libc and compiler builtin ffs routines, therefore
|
||||
* differs in spirit from the above ffz (man ffs).
|
||||
*/
|
||||
|
||||
extern __inline__ int ffs(int x)
|
||||
{
|
||||
int r;
|
||||
|
||||
__asm__("bsfl %1,%0\n\t"
|
||||
"jnz 1f\n\t"
|
||||
"movl $-1,%0\n"
|
||||
"1:" : "=r" (r) : "g" (x));
|
||||
return r+1;
|
||||
}
|
||||
|
||||
/*
|
||||
* hweightN: returns the hamming weight (i.e. the number
|
||||
* of bits set) of a N-bit word
|
||||
*/
|
||||
|
||||
#define hweight32(x) generic_hweight32(x)
|
||||
#define hweight16(x) generic_hweight16(x)
|
||||
#define hweight8(x) generic_hweight8(x)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define ext2_set_bit test_and_set_bit
|
||||
#define ext2_clear_bit test_and_clear_bit
|
||||
#define ext2_test_bit test_bit
|
||||
#define ext2_find_first_zero_bit find_first_zero_bit
|
||||
#define ext2_find_next_zero_bit find_next_zero_bit
|
||||
|
||||
/* Bitmap functions for the minix filesystem. */
|
||||
#define minix_set_bit(nr,addr) test_and_set_bit(nr,addr)
|
||||
#define minix_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
|
||||
#define minix_test_bit(nr,addr) test_bit(nr,addr)
|
||||
#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _I386_BITOPS_H */
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
#ifndef _ASM_IO_H
|
||||
#define _ASM_IO_H
|
||||
|
||||
#define outb(port, val) WRITE_PORT_UCHAR((PUCHAR)port, val)
|
||||
#define outb_p(port, val) WRITE_PORT_UCHAR((PUCHAR)port, val)
|
||||
#define outw(port, val) WRITE_PORT_USHORT((PUSHORT)port, val)
|
||||
#define outw_p(port, val) WRITE_PORT_USHORT((PUSHORT)port, val)
|
||||
#define outl(port, val) WRITE_PORT_ULONG((PULONG)port, val)
|
||||
#define outl_p(port, val) WRITE_PORT_ULONG((PULONG)port, val)
|
||||
|
||||
#define inb(port) READ_PORT_UCHAR((PUCHAR)port)
|
||||
#define inb_p(port) READ_PORT_UCHAR((PUCHAR)port)
|
||||
#define inw(port) READ_PORT_USHORT((PUSHORT)port)
|
||||
#define inw_p(port) READ_PORT_USHORT((PUSHORT)port)
|
||||
#define inl(port) READ_PORT_ULONG((PULONG)port)
|
||||
#define inl_p(port) READ_PORT_ULONG((PULONG)port)
|
||||
|
||||
#if 0
|
||||
|
||||
/*
|
||||
* This file contains the definitions for the x86 IO instructions
|
||||
* inb/inw/inl/outb/outw/outl and the "string versions" of the same
|
||||
|
@ -165,5 +181,6 @@ __OUTS(l)
|
|||
__inl_p(port))
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@ PULONG MmGetPageEntry(PVOID Address);
|
|||
|
||||
#define FLUSH_TLB __asm__("movl %cr3,%eax\n\tmovl %eax,%cr3\n\t")
|
||||
|
||||
PULONG MmGetPageDirectory(VOID);
|
||||
|
||||
#if 0
|
||||
extern inline PULONG get_page_directory(void)
|
||||
{
|
||||
unsigned int page_dir=0;
|
||||
|
@ -37,6 +40,7 @@ extern inline PULONG get_page_directory(void)
|
|||
: "=r" (page_dir));
|
||||
return((PULONG)page_dir);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,12 +1,46 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/include/internal/i386/segment.h
|
||||
* PURPOSE: Segment selector definitions
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created ??/??/??
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_INTERNAL_I386_SEGMENT_H
|
||||
#define __INCLUDE_INTERNAL_i386_SEGMENT_H
|
||||
|
||||
#define NULL_SELECTOR (0x0)
|
||||
#define KERNEL_CS (0x8)
|
||||
#define KERNEL_DS (0x10)
|
||||
#define USER_CS (0x18 + 0x3)
|
||||
#define USER_DS (0x20 + 0x3)
|
||||
/*
|
||||
* FIXME: We actually have one TSS per thread
|
||||
*/
|
||||
#define RESERVED_FOR_TSS (0x28)
|
||||
#define PCR_SELECTOR (0x30)
|
||||
#define TEB_SELECTOR (0x38 + 0x3)
|
||||
#define RESERVED1_SELECTOR (0x40)
|
||||
#define LDT_SELECTOR (0x48)
|
||||
|
||||
#endif /* __INCLUDE_INTERNAL_I386_SEGMENT_H */
|
||||
|
|
|
@ -60,7 +60,7 @@ typedef struct _KTRAP_FRAME
|
|||
USHORT Reserved8;
|
||||
USHORT V86_Gs;
|
||||
USHORT Reserved9;
|
||||
} KTRAP_FRAME;
|
||||
} KTRAP_FRAME, *PKTRAP_FRAME;
|
||||
|
||||
VOID KiUpdateSystemTime (VOID);
|
||||
|
||||
|
@ -78,7 +78,7 @@ VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
|
|||
VOID KeDumpStackFrames(PVOID Stack, ULONG NrFrames);
|
||||
ULONG KeAllocateGdtSelector(ULONG Desc[2]);
|
||||
VOID KeFreeGdtSelector(ULONG Entry);
|
||||
BOOLEAN KiTestAlert(struct _KTHREAD* Thread, PCONTEXT UserContext);
|
||||
BOOLEAN KiTestAlert(VOID);
|
||||
VOID KeRemoveAllWaitsThread(struct _ETHREAD* Thread, NTSTATUS WaitStatus);
|
||||
PULONG KeGetStackTopThread(struct _ETHREAD* Thread);
|
||||
|
||||
|
@ -96,4 +96,6 @@ VOID KeInitializeBugCheck(VOID);
|
|||
VOID KeInit1(VOID);
|
||||
VOID KeInit2(VOID);
|
||||
|
||||
BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -248,7 +248,9 @@ VOID MmDereserveSwapPages(ULONG Nr);
|
|||
SWAPENTRY MmAllocSwapPage(VOID);
|
||||
VOID MmFreeSwapPage(SWAPENTRY Entry);
|
||||
|
||||
VOID MmInit1(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress);
|
||||
VOID MmInit1(ULONG FirstKernelPhysAddress,
|
||||
ULONG LastKernelPhysAddress,
|
||||
ULONG LastKernelAddress);
|
||||
VOID MmInit2(VOID);
|
||||
VOID MmInit3(VOID);
|
||||
NTSTATUS MmInitPagerThread(VOID);
|
||||
|
@ -295,6 +297,9 @@ VOID MmSetCleanPage(struct _EPROCESS* Process, PVOID Address);
|
|||
VOID MmLockPage(PVOID PhysicalPage);
|
||||
VOID MmUnlockPage(PVOID PhysicalPage);
|
||||
|
||||
NTSTATUS MmSafeCopyFromUser(PVOID Dest, PVOID Src, ULONG Count);
|
||||
NTSTATUS MmSafeCopyToUser(PVOID Dest, PVOID Src, ULONG Count);
|
||||
|
||||
#define MM_PHYSICAL_PAGE_MPW_PENDING (0x8)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -67,16 +67,8 @@ NTSTATUS ObPerformRetentionChecks(POBJECT_HEADER Header);
|
|||
*/
|
||||
VOID ObCreateEntry(PDIRECTORY_OBJECT parent, POBJECT_HEADER object);
|
||||
|
||||
extern inline POBJECT_HEADER BODY_TO_HEADER(PVOID body)
|
||||
{
|
||||
PCOMMON_BODY_HEADER chdr = (PCOMMON_BODY_HEADER)body;
|
||||
return(CONTAINING_RECORD((&(chdr->Type)),OBJECT_HEADER,Type));
|
||||
}
|
||||
|
||||
extern inline PVOID HEADER_TO_BODY(POBJECT_HEADER obj)
|
||||
{
|
||||
return(((void *)obj)+sizeof(OBJECT_HEADER)-sizeof(COMMON_BODY_HEADER));
|
||||
}
|
||||
POBJECT_HEADER BODY_TO_HEADER(PVOID body);
|
||||
PVOID HEADER_TO_BODY(POBJECT_HEADER obj);
|
||||
|
||||
#define OBJECT_ALLOC_SIZE(type) (type->NonpagedPoolCharge+sizeof(OBJECT_HEADER)-sizeof(COMMON_BODY_HEADER))
|
||||
|
||||
|
|
|
@ -1,93 +1,161 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/kthread.c
|
||||
* PURPOSE: Process manager definitions
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 22/05/98
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDE_INTERNAL_PS_H
|
||||
#define __INCLUDE_INTERNAL_PS_H
|
||||
|
||||
/*
|
||||
* Defines for accessing KPCR and KTHREAD structure members
|
||||
*/
|
||||
#define KTHREAD_PREVIOUS_MODE 0x137
|
||||
#define KTHREAD_TRAP_FRAME 0x128
|
||||
|
||||
#define KPCR_BASE 0xFFDFF000
|
||||
|
||||
#define KPCR_EXCEPTION_LIST 0x0
|
||||
#define KPCR_CURRENT_THREAD 0x124
|
||||
|
||||
#ifndef __ASM__
|
||||
|
||||
#include <internal/hal.h>
|
||||
#include <internal/mm.h>
|
||||
|
||||
struct _KTHREAD;
|
||||
struct _KTRAPFRAME;
|
||||
|
||||
/*
|
||||
* Processor Control Region
|
||||
*/
|
||||
typedef struct _KPCR
|
||||
{
|
||||
PVOID ExceptionList; /* 00 */
|
||||
PVOID StackBase; /* 04 */
|
||||
PVOID StackLimit; /* 08 */
|
||||
PVOID SubSystemTib; /* 0C */
|
||||
PVOID Reserved1; /* 10 */
|
||||
PVOID ArbitraryUserPointer; /* 14 */
|
||||
struct _KPCR* Self; /* 18 */
|
||||
UCHAR Reserved2[0x108]; /* 1C */
|
||||
struct _KTHREAD* CurrentThread; /* 124 */
|
||||
} KPCR, *PKPCR;
|
||||
|
||||
#define CURRENT_KPCR ((PKPCR)KPCR_BASE)
|
||||
|
||||
extern HANDLE SystemProcessHandle;
|
||||
|
||||
typedef struct _KAPC_STATE
|
||||
{
|
||||
LIST_ENTRY ApcListHead[2];
|
||||
struct _KPROCESS* Process;
|
||||
ULONG KernelApcInProgress;
|
||||
ULONG KernelApcPending;
|
||||
UCHAR KernelApcInProgress;
|
||||
UCHAR KernelApcPending;
|
||||
USHORT UserApcPending;
|
||||
} KAPC_STATE, *PKAPC_STATE;
|
||||
} __attribute__((packed)) KAPC_STATE, *PKAPC_STATE;
|
||||
|
||||
typedef struct _KTHREAD
|
||||
{
|
||||
DISPATCHER_HEADER DispatcherHeader; // For waiting for the thread
|
||||
LIST_ENTRY MutantListHead;
|
||||
PVOID InitialStack;
|
||||
ULONG StackLimit;
|
||||
NT_TEB* Teb;
|
||||
PVOID TlsArray;
|
||||
PVOID KernelStack;
|
||||
UCHAR DebugActive;
|
||||
UCHAR State;
|
||||
UCHAR Alerted[2];
|
||||
UCHAR Iopl;
|
||||
UCHAR NpxState;
|
||||
UCHAR Saturation;
|
||||
KPRIORITY Priority;
|
||||
KAPC_STATE ApcState;
|
||||
ULONG ContextSwitches;
|
||||
ULONG WaitStatus;
|
||||
KIRQL WaitIrql;
|
||||
ULONG WaitMode;
|
||||
UCHAR WaitNext;
|
||||
UCHAR WaitReason;
|
||||
PKWAIT_BLOCK WaitBlockList;
|
||||
LIST_ENTRY WaitListEntry;
|
||||
ULONG WaitTime;
|
||||
KPRIORITY BasePriority;
|
||||
UCHAR DecrementCount;
|
||||
UCHAR PriorityDecrement;
|
||||
UCHAR Quantum;
|
||||
KWAIT_BLOCK WaitBlock[4];
|
||||
PVOID LegoData; // ??
|
||||
LONG KernelApcDisable;
|
||||
KAFFINITY UserAffinity;
|
||||
UCHAR SystemAffinityActive;
|
||||
UCHAR Pad;
|
||||
PKQUEUE Queue;
|
||||
KSPIN_LOCK ApcQueueLock;
|
||||
KTIMER Timer;
|
||||
LIST_ENTRY QueueListEntry;
|
||||
KAFFINITY Affinity;
|
||||
UCHAR Preempted;
|
||||
UCHAR ProcessReadyQueue;
|
||||
UCHAR KernelStackResident;
|
||||
UCHAR NextProcessor;
|
||||
PVOID CallbackStack;
|
||||
BOOL Win32Thread;
|
||||
PVOID TrapFrame;
|
||||
PVOID ApcStatePointer; // Is actually eight bytes
|
||||
UCHAR EnableStackSwap;
|
||||
UCHAR LargeStack;
|
||||
UCHAR ResourceIndex;
|
||||
UCHAR PreviousMode;
|
||||
TIME KernelTime;
|
||||
TIME UserTime;
|
||||
KAPC_STATE SavedApcState;
|
||||
UCHAR Alertable;
|
||||
UCHAR ApcQueueable;
|
||||
ULONG AutoAlignment;
|
||||
PVOID StackBase;
|
||||
KAPC SuspendApc;
|
||||
KSEMAPHORE SuspendSemaphore;
|
||||
LIST_ENTRY ThreadListEntry;
|
||||
CHAR FreezeCount;
|
||||
ULONG SuspendCount;
|
||||
UCHAR IdealProcessor;
|
||||
UCHAR DisableBoost;
|
||||
LIST_ENTRY ProcessThreadListEntry; // Added by Phillip Susi for list of threads in a process
|
||||
DISPATCHER_HEADER DispatcherHeader; /* 00 */
|
||||
LIST_ENTRY MutantListHead; /* 10 */
|
||||
PVOID InitialStack; /* 18 */
|
||||
ULONG StackLimit; /* 1C */
|
||||
NT_TEB* Teb; /* 20 */
|
||||
PVOID TlsArray; /* 24 */
|
||||
PVOID KernelStack; /* 28 */
|
||||
UCHAR DebugActive; /* 2C */
|
||||
UCHAR State; /* 2D */
|
||||
UCHAR Alerted[2]; /* 2E */
|
||||
UCHAR Iopl; /* 30 */
|
||||
UCHAR NpxState; /* 31 */
|
||||
UCHAR Saturation; /* 32 */
|
||||
CHAR Priority; /* 33 */
|
||||
KAPC_STATE ApcState; /* 34 */
|
||||
ULONG ContextSwitches; /* 4C */
|
||||
ULONG WaitStatus; /* 50 */
|
||||
KIRQL WaitIrql; /* 54 */
|
||||
UCHAR WaitMode; /* 55 */
|
||||
UCHAR WaitNext; /* 56 */
|
||||
UCHAR WaitReason; /* 57 */
|
||||
PKWAIT_BLOCK WaitBlockList; /* 58 */
|
||||
LIST_ENTRY WaitListEntry; /* 5C */
|
||||
ULONG WaitTime; /* 64 */
|
||||
CHAR BasePriority; /* 68 */
|
||||
UCHAR DecrementCount; /* 69 */
|
||||
UCHAR PriorityDecrement; /* 6A */
|
||||
UCHAR Quantum; /* 6B */
|
||||
KWAIT_BLOCK WaitBlock[4]; /* 6C */
|
||||
PVOID LegoData; /* CC */
|
||||
LONG KernelApcDisable; /* D0 */
|
||||
KAFFINITY UserAffinity; /* D4 */
|
||||
UCHAR SystemAffinityActive;/* D8 */
|
||||
UCHAR Pad[7]; /* D9 */
|
||||
PKQUEUE Queue; /* E0 */
|
||||
KSPIN_LOCK ApcQueueLock; /* E4 */
|
||||
KTIMER Timer; /* E8 */
|
||||
LIST_ENTRY QueueListEntry; /* 110 */
|
||||
KAFFINITY Affinity; /* 118 */
|
||||
UCHAR Preempted; /* 11C */
|
||||
UCHAR ProcessReadyQueue; /* 11D */
|
||||
UCHAR KernelStackResident; /* 11E */
|
||||
UCHAR NextProcessor; /* 11F */
|
||||
PVOID CallbackStack; /* 120 */
|
||||
BOOL Win32Thread; /* 124 */
|
||||
struct _KTRAP_FRAME* TrapFrame; /* 128 */
|
||||
PVOID ApcStatePointer[2]; /* 12C */
|
||||
UCHAR EnableStackSwap; /* 134 */
|
||||
UCHAR LargeStack; /* 135 */
|
||||
UCHAR ResourceIndex; /* 136 */
|
||||
UCHAR PreviousMode; /* 137 */
|
||||
TIME KernelTime; /* 138 */
|
||||
TIME UserTime; /* 13C */
|
||||
KAPC_STATE SavedApcState; /* 140 */
|
||||
UCHAR Alertable; /* 158 */
|
||||
UCHAR ApcStateIndex; /* 159 */
|
||||
UCHAR ApcQueueable; /* 15A */
|
||||
UCHAR AutoAlignment; /* 15B */
|
||||
PVOID StackBase; /* 15C */
|
||||
KAPC SuspendApc; /* 160 */
|
||||
KSEMAPHORE SuspendSemaphore; /* 190 */
|
||||
LIST_ENTRY ThreadListEntry; /* 1A4 */
|
||||
CHAR FreezeCount; /* 1AC */
|
||||
UCHAR SuspendCount; /* 1AD */
|
||||
UCHAR IdealProcessor; /* 1AE */
|
||||
UCHAR DisableBoost; /* 1AF */
|
||||
|
||||
/*
|
||||
* Below here are thread structure members that are specific to ReactOS
|
||||
*/
|
||||
|
||||
/* Added by Phillip Susi for list of threads in a process */
|
||||
LIST_ENTRY ProcessThreadListEntry;
|
||||
|
||||
/* Provisionally added by David Welch */
|
||||
hal_thread_state Context;
|
||||
KDPC TimerDpc; // Added by Phillip Susi for internal KeAddThreadTimeout() impl.
|
||||
} KTHREAD, *PKTHREAD;
|
||||
/* Added by Phillip Susi for internal KeAddThreadTimeout() implementation */
|
||||
KDPC TimerDpc;
|
||||
} __attribute__((packed)) KTHREAD, *PKTHREAD;
|
||||
|
||||
// According to documentation the stack should have a commited [ 1 page ] and
|
||||
// a reserved part [ 1 M ] but can be specified otherwise in the image file.
|
||||
|
@ -316,8 +384,10 @@ ULONG PsResumeThread(PETHREAD Thread,
|
|||
#define THREAD_STATE_MAX (7)
|
||||
|
||||
|
||||
// Internal thread priorities, added by Phillip Susi
|
||||
// TODO: rebalence these to make use of all priorities... the ones above 16 can not all be used right now
|
||||
/*
|
||||
* Internal thread priorities, added by Phillip Susi
|
||||
* TODO: rebalence these to make use of all priorities... the ones above 16 can not all be used right now
|
||||
*/
|
||||
|
||||
#define PROCESS_PRIO_IDLE 3
|
||||
#define PROCESS_PRIO_NORMAL 8
|
||||
|
@ -328,6 +398,9 @@ ULONG PsResumeThread(PETHREAD Thread,
|
|||
* Functions the HAL must provide
|
||||
*/
|
||||
|
||||
VOID
|
||||
KeInitializeThread(PKPROCESS Process, PKTHREAD Thread);
|
||||
|
||||
void HalInitFirstTask(PETHREAD thread);
|
||||
NTSTATUS HalInitTask(PETHREAD thread, PKSTART_ROUTINE fn, PVOID StartContext);
|
||||
void HalTaskSwitch(PKTHREAD thread);
|
||||
|
@ -341,4 +414,6 @@ VOID PsFreezeProcessThreads(PEPROCESS Process);
|
|||
VOID PsUnfreezeProcessThreads(PEPROCESS Process);
|
||||
PEPROCESS PsGetNextProcess(PEPROCESS OldProcess);
|
||||
|
||||
#endif /* ASSEMBLER */
|
||||
|
||||
#endif /* __INCLUDE_INTERNAL_PS_H */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: create.c,v 1.31 2000/07/30 18:22:34 dwelch Exp $
|
||||
/* $Id: create.c,v 1.32 2000/10/07 13:41:51 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -81,12 +81,12 @@ IopCreateFile (
|
|||
DPRINT("DeviceObject was NULL\n");
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
if (IoDeviceObjectType != BODY_TO_HEADER(Parent)->ObjectType)
|
||||
{
|
||||
DPRINT ("Parent is not a device type\n");
|
||||
return (STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
Status = ObReferenceObjectByPointer (
|
||||
if (IoDeviceObjectType != BODY_TO_HEADER(Parent)->ObjectType)
|
||||
{
|
||||
DPRINT ("Parent is not a device type\n");
|
||||
return (STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
Status = ObReferenceObjectByPointer (
|
||||
DeviceObject,
|
||||
STANDARD_RIGHTS_REQUIRED,
|
||||
IoDeviceObjectType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: process.c,v 1.10 2000/07/30 18:22:34 dwelch Exp $
|
||||
/* $Id: process.c,v 1.11 2000/10/07 13:41:51 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -62,11 +62,11 @@ IoGetRequestorProcess (IN PIRP Irp)
|
|||
* processing policy.
|
||||
*/
|
||||
BOOLEAN STDCALL EXPORTED
|
||||
IoSetThreadHardErrorMode (IN BOOLEAN HardErrorEnabled)
|
||||
IoSetThreadHardErrorMode (IN BOOLEAN HardErrorEnabled)
|
||||
{
|
||||
BOOLEAN PreviousHEM = NtCurrentTeb ()->HardErrorDisabled;
|
||||
BOOLEAN PreviousHEM = NtCurrentTeb ()->HardErrorDisabled;
|
||||
|
||||
NtCurrentTeb ()->HardErrorDisabled = (
|
||||
NtCurrentTeb ()->HardErrorDisabled = (
|
||||
(TRUE == HardErrorEnabled)
|
||||
? FALSE
|
||||
: TRUE
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: kdebug.c,v 1.14 2000/08/30 19:33:28 dwelch Exp $
|
||||
/* $Id: kdebug.c,v 1.15 2000/10/07 13:41:51 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -81,7 +81,7 @@ KdInitSystem (
|
|||
*/
|
||||
|
||||
/* check for 'DEBUGPORT' */
|
||||
p1 = LoaderBlock->kernel_parameters;
|
||||
p1 = (PCHAR)LoaderBlock->CommandLine;
|
||||
while (p1 && (p2 = strchr (p1, '/')))
|
||||
{
|
||||
p2++;
|
||||
|
@ -120,7 +120,7 @@ KdInitSystem (
|
|||
}
|
||||
|
||||
/* check for 'BAUDRATE' */
|
||||
p1 = LoaderBlock->kernel_parameters;
|
||||
p1 = (PCHAR)LoaderBlock->CommandLine;
|
||||
while (p1 && (p2 = strchr (p1, '/')))
|
||||
{
|
||||
p2++;
|
||||
|
@ -143,7 +143,7 @@ KdInitSystem (
|
|||
}
|
||||
|
||||
/* Check for 'DEBUG'. Dont' accept 'DEBUGPORT'!*/
|
||||
p1 = LoaderBlock->kernel_parameters;
|
||||
p1 = (PCHAR)LoaderBlock->CommandLine;
|
||||
while (p1 && (p2 = strchr (p1, '/')))
|
||||
{
|
||||
p2++;
|
||||
|
@ -159,7 +159,7 @@ KdInitSystem (
|
|||
}
|
||||
|
||||
/* Check for 'NODEBUG' */
|
||||
p1 = LoaderBlock->kernel_parameters;
|
||||
p1 = (PCHAR)LoaderBlock->CommandLine;
|
||||
while (p1 && (p2 = strchr (p1, '/')))
|
||||
{
|
||||
p2++;
|
||||
|
@ -173,7 +173,7 @@ KdInitSystem (
|
|||
}
|
||||
|
||||
/* Check for 'CRASHDEBUG' */
|
||||
p1 = LoaderBlock->kernel_parameters;
|
||||
p1 = (PCHAR)LoaderBlock->CommandLine;
|
||||
while (p1 && (p2 = strchr (p1, '/')))
|
||||
{
|
||||
p2++;
|
||||
|
@ -187,7 +187,7 @@ KdInitSystem (
|
|||
}
|
||||
|
||||
/* Check for 'BREAK' */
|
||||
p1 = LoaderBlock->kernel_parameters;
|
||||
p1 = (PCHAR)LoaderBlock->CommandLine;
|
||||
while (p1 && (p2 = strchr (p1, '/')))
|
||||
{
|
||||
p2++;
|
||||
|
|
|
@ -45,8 +45,26 @@ VOID KeCallKernelRoutineApc(PKAPC Apc)
|
|||
DPRINT("Finished KeCallKernelRoutineApc()\n");
|
||||
}
|
||||
|
||||
BOOLEAN KiTestAlert(PKTHREAD Thread,
|
||||
PCONTEXT UserContext)
|
||||
BOOLEAN KiTestAlert(VOID)
|
||||
/*
|
||||
* FUNCTION: Tests whether there are any pending APCs for the curren thread
|
||||
* and if so the APCs will be delivered on exit from kernel mode
|
||||
*/
|
||||
{
|
||||
KIRQL oldIrql;
|
||||
|
||||
KeAcquireSpinLock(&PiApcLock, &oldIrql);
|
||||
if (IsListEmpty(&KeGetCurrentThread()->ApcState.ApcListHead[1]))
|
||||
{
|
||||
KeReleaseSpinLock(&PiApcLock, oldIrql);
|
||||
return(FALSE);
|
||||
}
|
||||
KeGetCurrentThread()->ApcState.UserApcPending = 1;
|
||||
KeReleaseSpinLock(&PiApcLock, oldIrql);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame)
|
||||
/*
|
||||
* FUNCTION: Tests whether there are any pending APCs for the current thread
|
||||
* and if so the APCs will be delivered on exit from kernel mode.
|
||||
|
@ -55,6 +73,7 @@ BOOLEAN KiTestAlert(PKTHREAD Thread,
|
|||
* UserContext = The user context saved on entry to kernel mode
|
||||
*/
|
||||
{
|
||||
#if 0
|
||||
PLIST_ENTRY current_entry;
|
||||
PKAPC Apc;
|
||||
PULONG Esp;
|
||||
|
@ -63,8 +82,10 @@ BOOLEAN KiTestAlert(PKTHREAD Thread,
|
|||
ULONG Top;
|
||||
BOOL ret = FALSE;
|
||||
PETHREAD EThread;
|
||||
PKTHREAD Thread;
|
||||
|
||||
DPRINT("KiTestAlert(Thread %x, UserContext %x)\n");
|
||||
DPRINT("KiDeliverUserApc(TrapFrame %x)\n", TrapFrame);
|
||||
Thread = KeGetCurrentThread();
|
||||
while(1)
|
||||
{
|
||||
KeAcquireSpinLock(&PiApcLock, &oldlvl);
|
||||
|
@ -119,6 +140,8 @@ BOOLEAN KiTestAlert(PKTHREAD Thread,
|
|||
KeReleaseSpinLock(&PiThreadListLock, oldlvl);
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
VOID STDCALL KiDeliverApc(ULONG Unknown1,
|
||||
|
@ -315,7 +338,7 @@ NTSTATUS STDCALL NtQueueApcThread(HANDLE ThreadHandle,
|
|||
|
||||
NTSTATUS STDCALL NtTestAlert(VOID)
|
||||
{
|
||||
KiTestAlert(KeGetCurrentThread(),NULL);
|
||||
KiTestAlert();
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,22 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/gdt.c
|
||||
* PURPOSE: GDT managment
|
||||
|
@ -19,14 +36,17 @@
|
|||
|
||||
#define NR_TASKS 128
|
||||
|
||||
USHORT KiGdt[(8 + NR_TASKS) * 4] = {0x0, 0x0, 0x0, 0x0,
|
||||
0xffff, 0x0, 0x9a00, 0xcf,
|
||||
0xffff, 0x0, 0x9200, 0xcf,
|
||||
0x0, 0x0, 0xfa00, 0xcc,
|
||||
0x0, 0x0, 0xf200, 0xcc,
|
||||
0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0,
|
||||
0x1000, 0x0, 0xf200, 0x0};
|
||||
USHORT KiGdt[(8 + NR_TASKS) * 4] =
|
||||
{
|
||||
0x0, 0x0, 0x0, 0x0, /* Null */
|
||||
0xffff, 0x0, 0x9a00, 0xcf, /* Kernel CS */
|
||||
0xffff, 0x0, 0x9200, 0xcf, /* Kernel DS */
|
||||
0x0, 0x0, 0xfa00, 0xcc, /* User CS */
|
||||
0x0, 0x0, 0xf200, 0xcc, /* User DS */
|
||||
0x0, 0x0, 0x0, 0x0, /* TSS */
|
||||
0x1000, 0xf000, 0x92df, 0xff00, /* PCR */
|
||||
0x1000, 0x0, 0xf200, 0x0}; /* TEB */
|
||||
|
||||
static KSPIN_LOCK GdtLock;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
@ -64,6 +84,33 @@ VOID KeSetBaseGdtSelector(ULONG Entry,
|
|||
|
||||
VOID KeDumpGdtSelector(ULONG Entry)
|
||||
{
|
||||
USHORT a, b, c, d;
|
||||
ULONG RawLimit;
|
||||
|
||||
a = KiGdt[Entry*4];
|
||||
b = KiGdt[Entry*4 + 1];
|
||||
c = KiGdt[Entry*4 + 2];
|
||||
d = KiGdt[Entry*4 + 3];
|
||||
|
||||
DbgPrint("Base: %x\n", b + ((c & 0xff) * (1 << 16)) +
|
||||
((d & 0xff00) * (1 << 16)));
|
||||
RawLimit = a + ((d & 0xf) * (1 << 16));
|
||||
if (d & 0x80)
|
||||
{
|
||||
DbgPrint("Limit: %x\n", RawLimit * 4096);
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgPrint("Limit: %x\n", RawLimit);
|
||||
}
|
||||
DbgPrint("Accessed: %d\n", (c & 0x100) >> 8);
|
||||
DbgPrint("Type: %x\n", (c & 0xe00) >> 9);
|
||||
DbgPrint("System: %d\n", (c & 0x1000) >> 12);
|
||||
DbgPrint("DPL: %d\n", (c & 0x6000) >> 13);
|
||||
DbgPrint("Present: %d\n", (c & 0x8000) >> 15);
|
||||
DbgPrint("AVL: %x\n", (d & 0x10) >> 4);
|
||||
DbgPrint("D: %d\n", (d & 0x40) >> 6);
|
||||
DbgPrint("G: %d\n", (d & 0x80) >> 7);
|
||||
}
|
||||
|
||||
VOID KeFreeGdtSelector(ULONG Entry)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#define NR_TASKS 128
|
||||
|
||||
.globl _stext
|
||||
.globl _start
|
||||
.globl _mainCRTStartup
|
||||
.globl start
|
||||
|
@ -38,13 +37,10 @@ _gdt_descr:
|
|||
.word ((8+NR_TASKS)*8)-1
|
||||
.long _KiGdt
|
||||
|
||||
.text
|
||||
|
||||
.align 8
|
||||
_init_stack:
|
||||
.fill MM_STACK_SIZE,1,0
|
||||
_init_stack_top:
|
||||
|
||||
_stext:
|
||||
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ extern ULONG init_stack_top;
|
|||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
extern unsigned int stext, etext;
|
||||
extern unsigned int _text_start__, _text_end__;
|
||||
|
||||
static void print_address(PVOID address)
|
||||
{
|
||||
|
@ -229,7 +229,7 @@ static void print_address(PVOID address)
|
|||
DbgPrint("Frames:\n");
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
if (stack[i] > ((unsigned int) &stext) &&
|
||||
if (stack[i] > ((unsigned int) &_text_start__) &&
|
||||
!(stack[i] >= ((ULONG)&init_stack) &&
|
||||
stack[i] <= ((ULONG)&init_stack_top)))
|
||||
{
|
||||
|
|
|
@ -47,51 +47,51 @@ VOID HalTaskSwitch(PKTHREAD thread)
|
|||
* again (possibly never)
|
||||
*/
|
||||
{
|
||||
// PETHREAD Thread;
|
||||
// PVOID Teb;
|
||||
if (KeGetCurrentIrql() != DISPATCH_LEVEL)
|
||||
{
|
||||
DPRINT1("HalTaskSwitch: Bad IRQL on entry\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
|
||||
/* Set the base of the TEB selector to the base of the TEB for the
|
||||
* new thread
|
||||
/*
|
||||
* This sequence must be atomic with respect to interrupts on the local
|
||||
* processor because an interrupt handler might want to use current thread
|
||||
* information in the PCR. We wouldn't switch processors because we are
|
||||
* at DISPATCH_LEVEL.
|
||||
*/
|
||||
__asm__("cli\n\t");
|
||||
|
||||
/*
|
||||
* Set the base of the TEB selector to the base of the TEB for the
|
||||
* new thread. This can't be done on the other side of the TSS jump
|
||||
* because the new thread might be starting at different point.
|
||||
*/
|
||||
KeSetBaseGdtSelector(TEB_SELECTOR, thread->Teb);
|
||||
// DPRINT1("esp0 %x esp %x tid %d\n",
|
||||
// thread->Context.esp0,
|
||||
// thread->Context.esp,
|
||||
// ((PETHREAD)thread)->Cid.UniqueThread);
|
||||
/*
|
||||
* Set the current thread information in the PCR.
|
||||
*/
|
||||
CURRENT_KPCR->CurrentThread = (PVOID)thread;
|
||||
/* Switch to the new thread's context and stack */
|
||||
__asm__("pushfl\n\t"
|
||||
"cli\n\t"
|
||||
"ljmp %0\n\t"
|
||||
"popfl\n\t"
|
||||
__asm__("ljmp %0\n\t"
|
||||
: /* No outputs */
|
||||
: "m" (*(((unsigned char *)(&(thread->Context.nr)))-4) )
|
||||
: "ax","dx");
|
||||
/* Reload the TEB selector */
|
||||
/*
|
||||
* Load the PCR selector.
|
||||
*/
|
||||
__asm__("movw %0, %%ax\n\t"
|
||||
"movw %%ax, %%fs\n\t"
|
||||
: /* No outputs */
|
||||
: "i" (TEB_SELECTOR)
|
||||
: "i" (PCR_SELECTOR)
|
||||
: "ax");
|
||||
/*
|
||||
* Allow the new thread to use the FPU
|
||||
*/
|
||||
__asm__("clts\n\t");
|
||||
|
||||
#if 0
|
||||
Thread = PsGetCurrentThread();
|
||||
if (Thread->Cid.UniqueThread != (HANDLE)1)
|
||||
{
|
||||
// DbgPrint("Scheduling thread %x (id %d) teb %x\n",Thread,
|
||||
// Thread->Cid.UniqueThread, Thread->Tcb.Teb);
|
||||
}
|
||||
|
||||
if (Thread->Tcb.Teb != NULL)
|
||||
{
|
||||
// DbgPrint("cr3 %x\n", Thread->ThreadsProcess->Pcb.PageTableDirectory);
|
||||
__asm__("movl %%fs:0x18, %0\n\t"
|
||||
: "=g" (Teb)
|
||||
: /* No inputs */
|
||||
);
|
||||
// DbgPrint("Teb %x\n", Teb);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Allow local interrupts again
|
||||
*/
|
||||
__asm__("sti\n\t");
|
||||
}
|
||||
|
||||
#define FLAG_NT (1<<14)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: trap.s,v 1.2 2000/07/06 14:34:50 dwelch Exp $
|
||||
/* $Id: trap.s,v 1.3 2000/10/07 13:41:52 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -29,7 +31,9 @@ _PsBeginThreadWithContextInternal:
|
|||
popl %eax
|
||||
addl $112,%esp
|
||||
popl %gs
|
||||
popl %fs
|
||||
; popl %fs
|
||||
movl $TEB_SELECTOR, %ax
|
||||
movl %ax, %fs
|
||||
popl %es
|
||||
popl %ds
|
||||
popl %edi
|
||||
|
@ -40,13 +44,229 @@ _PsBeginThreadWithContextInternal:
|
|||
popl %eax
|
||||
popl %ebp
|
||||
iret
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
.globl _interrupt_handler2e
|
||||
_interrupt_handler2e:
|
||||
|
||||
/* Construct a trap frame on the stack */
|
||||
|
||||
/* Error code */
|
||||
pushl $0
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushl %fs
|
||||
/* Load PCR selector into fs */
|
||||
movl $PCR_SELECTOR, %ebx
|
||||
movl %ebx, %fs
|
||||
|
||||
/* Save the old exception list */
|
||||
movl %fs:KPCR_EXCEPTION_LIST, %ebx
|
||||
pushl %ebx
|
||||
/* Put the exception handler chain terminator */
|
||||
movl $0xffffffff, %fs:KPCR_EXCEPTION_LIST
|
||||
/* Get a pointer to the current thread */
|
||||
movl %fs:KPCR_CURRENT_THREAD, %esi
|
||||
/* Save the old previous mode */
|
||||
movl $0, %ebx
|
||||
movb %ss:KTHREAD_PREVIOUS_MODE(%esi), %bl
|
||||
pushl %ebx
|
||||
/* Set the new previous mode based on the saved CS selector */
|
||||
movl 0x24(%esp), %ebx
|
||||
cmpl $KERNEL_CS, %ebx
|
||||
jne L1
|
||||
movb $KernelMode, %ss:KTHREAD_PREVIOUS_MODE(%esi)
|
||||
jmp L3
|
||||
L1:
|
||||
movb $UserMode, %ss:KTHREAD_PREVIOUS_MODE(%esi)
|
||||
L3:
|
||||
|
||||
/* Save other registers */
|
||||
pushl %eax
|
||||
pushl %ecx
|
||||
pushl %edx
|
||||
pushl %ds
|
||||
pushl %es
|
||||
pushl %gs
|
||||
pushl $0 /* DR7 */
|
||||
pushl $0 /* DR6 */
|
||||
pushl $0 /* DR3 */
|
||||
pushl $0 /* DR2 */
|
||||
pushl $0 /* DR1 */
|
||||
pushl $0 /* DR0 */
|
||||
pushl $0 /* XXX: TempESP */
|
||||
pushl $0 /* XXX: TempCS */
|
||||
pushl $0 /* XXX: DebugPointer */
|
||||
pushl $0 /* XXX: DebugArgMark */
|
||||
pushl $0 /* XXX: DebugEIP */
|
||||
pushl $0 /* XXX: DebugEBP */
|
||||
|
||||
/* Load the segment registers */
|
||||
movl $KERNEL_DS, %ebx
|
||||
movl %ebx, %ds
|
||||
movl %ebx, %es
|
||||
movl %ebx, %gs
|
||||
|
||||
/* Save the old trap frame pointer (over the EDX register??) */
|
||||
movl KTHREAD_TRAP_FRAME(%esi), %ebx
|
||||
movl %ebx, 0x3C(%esp)
|
||||
|
||||
/* Save a pointer to the trap frame in the TCB */
|
||||
movl %esp, KTHREAD_TRAP_FRAME(%esi)
|
||||
|
||||
/* Set ES to kernel segment */
|
||||
movw $KERNEL_DS,%bx
|
||||
movw %bx,%es
|
||||
|
||||
/* Allocate new Kernel stack frame */
|
||||
movl %esp,%ebp
|
||||
|
||||
/* Users's current stack frame pointer is source */
|
||||
movl %edx,%esi
|
||||
|
||||
/* Determine system service table to use */
|
||||
cmpl $0x0fff, %eax
|
||||
ja new_useShadowTable
|
||||
|
||||
/* Check to see if EAX is valid/inrange */
|
||||
cmpl %es:_KeServiceDescriptorTable + 8, %eax
|
||||
jbe new_serviceInRange
|
||||
movl $STATUS_INVALID_SYSTEM_SERVICE, %eax
|
||||
jmp new_done
|
||||
|
||||
new_serviceInRange:
|
||||
|
||||
/* Allocate room for argument list from kernel stack */
|
||||
movl %es:_KeServiceDescriptorTable + 12, %ecx
|
||||
movl %es:(%ecx, %eax, 4), %ecx
|
||||
subl %ecx, %esp
|
||||
|
||||
/* Copy the arguments from the user stack to the kernel stack */
|
||||
movl %esp,%edi
|
||||
rep movsb
|
||||
|
||||
/* DS is now also kernel segment */
|
||||
movw %bx, %ds
|
||||
|
||||
/* Call system call hook */
|
||||
pushl %eax
|
||||
call _KiSystemCallHook
|
||||
popl %eax
|
||||
|
||||
/* Make the system service call */
|
||||
movl %es:_KeServiceDescriptorTable, %ecx
|
||||
movl %es:(%ecx, %eax, 4), %eax
|
||||
call *%eax
|
||||
|
||||
#if CHECKED
|
||||
/* Bump Service Counter */
|
||||
#endif
|
||||
|
||||
/* Deallocate the kernel stack frame */
|
||||
movl %ebp,%esp
|
||||
|
||||
/* Call the post system call hook and deliver any pending APCs */
|
||||
pushl %esp
|
||||
pushl %eax
|
||||
call _KiAfterSystemCallHook
|
||||
addl $8,%esp
|
||||
|
||||
jmp new_done
|
||||
|
||||
new_useShadowTable:
|
||||
|
||||
subl $0x1000, %eax
|
||||
|
||||
/* Check to see if EAX is valid/inrange */
|
||||
cmpl %es:_KeServiceDescriptorTableShadow + 24, %eax
|
||||
jbe new_shadowServiceInRange
|
||||
movl $STATUS_INVALID_SYSTEM_SERVICE, %eax
|
||||
jmp new_done
|
||||
|
||||
new_shadowServiceInRange:
|
||||
|
||||
/* Allocate room for argument list from kernel stack */
|
||||
movl %es:_KeServiceDescriptorTableShadow + 28, %ecx
|
||||
movl %es:(%ecx, %eax, 4), %ecx
|
||||
subl %ecx, %esp
|
||||
|
||||
/* Copy the arguments from the user stack to the kernel stack */
|
||||
movl %esp,%edi
|
||||
rep movsb
|
||||
|
||||
/* DS is now also kernel segment */
|
||||
movw %bx,%ds
|
||||
|
||||
/* Call system call hook */
|
||||
pushl %eax
|
||||
call _KiSystemCallHook
|
||||
popl %eax
|
||||
|
||||
/* Make the system service call */
|
||||
movl %es:_KeServiceDescriptorTableShadow + 16, %ecx
|
||||
movl %es:(%ecx, %eax, 4), %eax
|
||||
call *%eax
|
||||
|
||||
#if CHECKED
|
||||
/* Bump Service Counter */
|
||||
#endif
|
||||
|
||||
/* Deallocate the kernel stack frame */
|
||||
movl %ebp,%esp
|
||||
|
||||
/* Call the post system call hook and deliver any pending APCs */
|
||||
pushl %esp
|
||||
pushl %eax
|
||||
call _KiAfterSystemCallHook
|
||||
addl $8,%esp
|
||||
|
||||
new_done:
|
||||
|
||||
/* Restore the user context */
|
||||
/* Get a pointer to the current thread */
|
||||
movl %fs:0x124, %esi
|
||||
|
||||
/* Restore the old trap frame pointer */
|
||||
movl 0x3c(%esp), %ebx
|
||||
movl %ebx, KTHREAD_TRAP_FRAME(%esi)
|
||||
|
||||
/* Skip debug information and unsaved registers */
|
||||
addl $0x30, %esp
|
||||
popl %gs
|
||||
popl %es
|
||||
popl %ds
|
||||
popl %edx
|
||||
popl %ecx
|
||||
addl $0x4, %esp /* Don't restore eax */
|
||||
|
||||
/* Restore the old previous mode */
|
||||
popl %ebx
|
||||
movb %bl, %ss:KTHREAD_PREVIOUS_MODE(%esi)
|
||||
|
||||
/* Restore the old exception handler list */
|
||||
popl %ebx
|
||||
movl %ebx, %fs:KPCR_EXCEPTION_LIST
|
||||
|
||||
popl %ebx
|
||||
movl %ebx, %fs
|
||||
/* popl %fs */
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
addl $0x4, %esp /* Ignore error code */
|
||||
|
||||
iret
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
.globl _interrupt_handler2e
|
||||
_interrupt_handler2e:
|
||||
.globl _old_interrupt_handler2e
|
||||
_old_interrupt_handler2e:
|
||||
|
||||
/* Save the user context */
|
||||
pushl %ebp /* Ebp */
|
||||
|
@ -110,7 +330,7 @@ serviceInRange:
|
|||
|
||||
/* DS is now also kernel segment */
|
||||
movw %bx, %ds
|
||||
|
||||
|
||||
/* Call system call hook */
|
||||
pushl %eax
|
||||
call _KiSystemCallHook
|
||||
|
@ -203,6 +423,7 @@ done:
|
|||
|
||||
iret
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: usercall.c,v 1.14 2000/07/04 08:52:41 dwelch Exp $
|
||||
/* $Id: usercall.c,v 1.15 2000/10/07 13:41:52 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -20,42 +20,7 @@
|
|||
#include <ddk/service.h>
|
||||
|
||||
#include <ddk/defines.h>
|
||||
|
||||
|
||||
|
||||
#define _STR(x) #x
|
||||
#define STR(x) _STR(x)
|
||||
|
||||
#if 0
|
||||
void PsBeginThreadWithContextInternal(void);
|
||||
__asm__(
|
||||
"\n\t.global _PsBeginThreadWithContextInternal\n\t"
|
||||
"_PsBeginThreadWithContextInternal:\n\t"
|
||||
// "pushl $1\n\t"
|
||||
// "call _KeLowerIrql\n\t"
|
||||
"call _PiBeforeBeginThread\n\t"
|
||||
// "popl %eax\n\t"
|
||||
"popl %eax\n\t"
|
||||
"popl %eax\n\t"
|
||||
"popl %eax\n\t"
|
||||
"popl %eax\n\t"
|
||||
"popl %eax\n\t"
|
||||
"popl %eax\n\t"
|
||||
"popl %eax\n\t"
|
||||
"addl $112,%esp\n\t"
|
||||
"popl %gs\n\t"
|
||||
"popl %fs\n\t"
|
||||
"popl %es\n\t"
|
||||
"popl %ds\n\t"
|
||||
"popl %edi\n\t"
|
||||
"popl %esi\n\t"
|
||||
"popl %ebx\n\t"
|
||||
"popl %edx\n\t"
|
||||
"popl %ecx\n\t"
|
||||
"popl %eax\n\t"
|
||||
"popl %ebp\n\t"
|
||||
"iret\n\t");
|
||||
#endif
|
||||
#include <internal/ps.h>
|
||||
|
||||
VOID KiSystemCallHook(ULONG Nr, ...)
|
||||
{
|
||||
|
@ -77,21 +42,20 @@ VOID KiSystemCallHook(ULONG Nr, ...)
|
|||
#endif
|
||||
}
|
||||
|
||||
ULONG KiAfterSystemCallHook(ULONG NtStatus, PCONTEXT Context)
|
||||
ULONG KiAfterSystemCallHook(ULONG NtStatus, PKTRAP_FRAME TrapFrame)
|
||||
{
|
||||
if (NtStatus != STATUS_USER_APC)
|
||||
if (KeGetCurrentThread()->ApcState.UserApcPending == 0)
|
||||
{
|
||||
return(NtStatus);
|
||||
}
|
||||
KiTestAlert(KeGetCurrentThread(), Context);
|
||||
KiDeliverUserApc(TrapFrame);
|
||||
return(NtStatus);
|
||||
}
|
||||
|
||||
// This function should be used by win32k.sys to add its own user32/gdi32 services
|
||||
// TableIndex is 0 based
|
||||
// ServiceCountTable its not used at the moment
|
||||
BOOLEAN
|
||||
STDCALL
|
||||
BOOLEAN STDCALL
|
||||
KeAddSystemServiceTable (
|
||||
PSSDT SSDT,
|
||||
PULONG ServiceCounterTable,
|
||||
|
@ -126,165 +90,4 @@ KeAddSystemServiceTable (
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void interrupt_handler2e(void);
|
||||
__asm__("\n\t.global _interrupt_handler2e\n\t"
|
||||
"_interrupt_handler2e:\n\t"
|
||||
|
||||
/* Save the user context */
|
||||
"pushl %ebp\n\t" /* Ebp */
|
||||
|
||||
"pushl %eax\n\t" /* Eax */
|
||||
"pushl %ecx\n\t" /* Ecx */
|
||||
"pushl %edx\n\t" /* Edx */
|
||||
"pushl %ebx\n\t" /* Ebx */
|
||||
"pushl %esi\n\t" /* Esi */
|
||||
"pushl %edi\n\t" /* Edi */
|
||||
|
||||
"pushl %ds\n\t" /* SegDs */
|
||||
"pushl %es\n\t" /* SegEs */
|
||||
"pushl %fs\n\t" /* SegFs */
|
||||
"pushl %gs\n\t" /* SegGs */
|
||||
|
||||
"subl $112,%esp\n\t" /* FloatSave */
|
||||
|
||||
"pushl $0\n\t" /* Dr7 */
|
||||
"pushl $0\n\t" /* Dr6 */
|
||||
"pushl $0\n\t" /* Dr3 */
|
||||
"pushl $0\n\t" /* Dr2 */
|
||||
"pushl $0\n\t" /* Dr1 */
|
||||
"pushl $0\n\t" /* Dr0 */
|
||||
|
||||
"pushl $0\n\t" /* ContextFlags */
|
||||
|
||||
/* Set ES to kernel segment */
|
||||
"movw $"STR(KERNEL_DS)",%bx\n\t"
|
||||
"movw %bx,%es\n\t"
|
||||
|
||||
/* Save pointer to user context as argument to system call */
|
||||
"pushl %esp\n\t"
|
||||
|
||||
/* Allocate new Kernel stack frame */
|
||||
"movl %esp,%ebp\n\t"
|
||||
|
||||
/* Users's current stack frame pointer is source */
|
||||
"movl %edx,%esi\n\t"
|
||||
|
||||
/* Determine system service table to use */
|
||||
"cmpl $0x0fff, %eax\n\t"
|
||||
"ja useShadowTable\n\t"
|
||||
|
||||
/* Check to see if EAX is valid/inrange */
|
||||
"cmpl %es:_KeServiceDescriptorTable + 8, %eax\n\t"
|
||||
"jbe serviceInRange\n\t"
|
||||
"movl $"STR(STATUS_INVALID_SYSTEM_SERVICE)", %eax\n\t"
|
||||
"jmp done\n\t"
|
||||
|
||||
"serviceInRange:\n\t"
|
||||
|
||||
/* Allocate room for argument list from kernel stack */
|
||||
"movl %es:_KeServiceDescriptorTable + 12, %ecx\n\t"
|
||||
"movl %es:(%ecx, %eax, 4), %ecx\n\t"
|
||||
"subl %ecx, %esp\n\t"
|
||||
|
||||
/* Copy the arguments from the user stack to the kernel stack */
|
||||
"movl %esp,%edi\n\t"
|
||||
"rep\n\tmovsb\n\t"
|
||||
|
||||
/* DS is now also kernel segment */
|
||||
"movw %bx, %ds\n\t"
|
||||
|
||||
/* Call system call hook */
|
||||
"pushl %eax\n\t"
|
||||
"call _KiSystemCallHook\n\t"
|
||||
"popl %eax\n\t"
|
||||
|
||||
/* Make the system service call */
|
||||
"movl %es:_KeServiceDescriptorTable, %ecx\n\t"
|
||||
"movl %es:(%ecx, %eax, 4), %eax\n\t"
|
||||
"call *%eax\n\t"
|
||||
|
||||
#if CHECKED
|
||||
/* Bump Service Counter */
|
||||
#endif
|
||||
|
||||
/* Deallocate the kernel stack frame */
|
||||
"movl %ebp,%esp\n\t"
|
||||
|
||||
/* Call the post system call hook and deliver any pending APCs */
|
||||
"pushl %eax\n\t"
|
||||
"call _KiAfterSystemCallHook\n\t"
|
||||
"addl $8,%esp\n\t"
|
||||
|
||||
"jmp done\n\t"
|
||||
|
||||
"useShadowTable:\n\t"
|
||||
|
||||
"subl $0x1000, %eax\n\t"
|
||||
|
||||
/* Check to see if EAX is valid/inrange */
|
||||
"cmpl %es:_KeServiceDescriptorTableShadow + 24, %eax\n\t"
|
||||
"jbe shadowServiceInRange\n\t"
|
||||
"movl $"STR(STATUS_INVALID_SYSTEM_SERVICE)", %eax\n\t"
|
||||
"jmp done\n\t"
|
||||
|
||||
"shadowServiceInRange:\n\t"
|
||||
|
||||
/* Allocate room for argument list from kernel stack */
|
||||
"movl %es:_KeServiceDescriptorTableShadow + 28, %ecx\n\t"
|
||||
"movl %es:(%ecx, %eax, 4), %ecx\n\t"
|
||||
"subl %ecx, %esp\n\t"
|
||||
|
||||
/* Copy the arguments from the user stack to the kernel stack */
|
||||
"movl %esp,%edi\n\t"
|
||||
"rep\n\tmovsb\n\t"
|
||||
|
||||
/* DS is now also kernel segment */
|
||||
"movw %bx,%ds\n\t"
|
||||
|
||||
/* Call system call hook */
|
||||
"pushl %eax\n\t"
|
||||
"call _KiSystemCallHook\n\t"
|
||||
"popl %eax\n\t"
|
||||
|
||||
/* Make the system service call */
|
||||
"movl %es:_KeServiceDescriptorTableShadow + 16, %ecx\n\t"
|
||||
"movl %es:(%ecx, %eax, 4), %eax\n\t"
|
||||
"call *%eax\n\t"
|
||||
|
||||
#if CHECKED
|
||||
/* Bump Service Counter */
|
||||
#endif
|
||||
|
||||
/* Deallocate the kernel stack frame */
|
||||
"movl %ebp,%esp\n\t"
|
||||
|
||||
/* Call the post system call hook and deliver any pending APCs */
|
||||
"pushl %eax\n\t"
|
||||
"call _KiAfterSystemCallHook\n\t"
|
||||
"addl $8,%esp\n\t"
|
||||
|
||||
"done:\n\t"
|
||||
|
||||
/* Restore the user context */
|
||||
"addl $4,%esp\n\t" /* UserContext */
|
||||
"addl $24,%esp\n\t" /* Dr[0-3,6-7] */
|
||||
"addl $112,%esp\n\t" /* FloatingSave */
|
||||
"popl %gs\n\t" /* SegGs */
|
||||
"popl %fs\n\t" /* SegFs */
|
||||
"popl %es\n\t" /* SegEs */
|
||||
"popl %ds\n\t" /* SegDs */
|
||||
|
||||
"popl %edi\n\t" /* Edi */
|
||||
"popl %esi\n\t" /* Esi */
|
||||
"popl %ebx\n\t" /* Ebx */
|
||||
"popl %edx\n\t" /* Edx */
|
||||
"popl %ecx\n\t" /* Ecx */
|
||||
"addl $4,%esp\n\t" /* Eax (Not restored) */
|
||||
|
||||
"popl %ebp\n\t" /* Ebp */
|
||||
|
||||
"iret\n\t");
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <internal/ke.h>
|
||||
#include <internal/mm.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
@ -42,8 +44,7 @@ VOID KiCheckFPU(VOID)
|
|||
return;
|
||||
}
|
||||
/* FIXME: Do fsetpm */
|
||||
HardwareMathSupport = 1;
|
||||
|
||||
HardwareMathSupport = 1;
|
||||
}
|
||||
|
||||
VOID KeInit1(VOID)
|
||||
|
@ -56,8 +57,26 @@ VOID KeInit1(VOID)
|
|||
|
||||
VOID KeInit2(VOID)
|
||||
{
|
||||
PVOID PcrPage;
|
||||
|
||||
KeInitDpc();
|
||||
KeInitializeBugCheck();
|
||||
KeInitializeDispatcher();
|
||||
KeInitializeTimerImpl();
|
||||
|
||||
/*
|
||||
* Initialize the PCR region.
|
||||
* FIXME: This should be per-processor.
|
||||
*/
|
||||
PcrPage = MmAllocPage(0);
|
||||
if (PcrPage == NULL)
|
||||
{
|
||||
DPRINT1("No memory for PCR page\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
MmCreateVirtualMapping(NULL,
|
||||
(PVOID)KPCR_BASE,
|
||||
PAGE_READWRITE,
|
||||
(ULONG)PcrPage);
|
||||
memset((PVOID)KPCR_BASE, 0, 4096);
|
||||
}
|
||||
|
|
157
reactos/ntoskrnl/ke/kthread.c
Normal file
157
reactos/ntoskrnl/ke/kthread.c
Normal file
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/kthread.c
|
||||
* PURPOSE: Microkernel thread support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 22/05/98
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <internal/ke.h>
|
||||
#include <internal/ps.h>
|
||||
#include <internal/id.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* EXTERN ********************************************************************/
|
||||
|
||||
extern VOID
|
||||
PiTimeoutThread(struct _KDPC Dpc, PVOID Context, PVOID Arg1, PVOID Arg2);
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
VOID
|
||||
KeInitializeThread(PKPROCESS Process, PKTHREAD Thread)
|
||||
/*
|
||||
* FUNCTION: Initialize the microkernel state of the thread
|
||||
*/
|
||||
{
|
||||
PVOID KernelStack;
|
||||
|
||||
#if 0
|
||||
DbgPrint("Thread %x &Thread->MutantListHead %x &Thread->TrapFrame %x "
|
||||
"&Thread->PreviousMode %x &Thread->DisableBoost %x\n",
|
||||
Thread, &Thread->MutantListHead, &Thread->TrapFrame,
|
||||
&Thread->PreviousMode, &Thread->DisableBoost);
|
||||
#endif
|
||||
|
||||
KeInitializeDispatcherHeader(&Thread->DispatcherHeader,
|
||||
InternalThreadType,
|
||||
sizeof(ETHREAD),
|
||||
FALSE);
|
||||
InitializeListHead(&Thread->MutantListHead);
|
||||
KernelStack = ExAllocatePool(NonPagedPool, MM_STACK_SIZE);
|
||||
Thread->InitialStack = KernelStack + MM_STACK_SIZE;
|
||||
Thread->StackLimit = (ULONG)KernelStack;
|
||||
/*
|
||||
* The Native API function will initialize the TEB field later
|
||||
*/
|
||||
Thread->Teb = NULL;
|
||||
Thread->TlsArray = NULL;
|
||||
Thread->KernelStack = KernelStack + MM_STACK_SIZE;
|
||||
Thread->DebugActive = 0;
|
||||
Thread->State = THREAD_STATE_SUSPENDED;
|
||||
Thread->Alerted[0] = 0;
|
||||
Thread->Alerted[1] = 0;
|
||||
Thread->Iopl = 0;
|
||||
/*
|
||||
* FIXME: Think how this might work
|
||||
*/
|
||||
Thread->NpxState = 0;
|
||||
Thread->Saturation = 0;
|
||||
Thread->Priority = 0;
|
||||
InitializeListHead(&Thread->ApcState.ApcListHead[0]);
|
||||
InitializeListHead(&Thread->ApcState.ApcListHead[1]);
|
||||
Thread->ApcState.Process = Process;
|
||||
Thread->ApcState.KernelApcInProgress = 0;
|
||||
Thread->ApcState.KernelApcPending = 0;
|
||||
Thread->ApcState.UserApcPending = 0;
|
||||
Thread->ContextSwitches = 0;
|
||||
Thread->WaitStatus = STATUS_SUCCESS;
|
||||
Thread->WaitIrql = 0;
|
||||
Thread->WaitMode = 0;
|
||||
Thread->WaitNext = 0;
|
||||
Thread->WaitBlockList = NULL;
|
||||
Thread->WaitListEntry.Flink = NULL;
|
||||
Thread->WaitListEntry.Blink = NULL;
|
||||
Thread->WaitTime = 0;
|
||||
Thread->BasePriority = 0;
|
||||
Thread->DecrementCount = 0;
|
||||
Thread->PriorityDecrement = 0;
|
||||
Thread->Quantum = 0;
|
||||
memset(Thread->WaitBlock, 0, sizeof(KWAIT_BLOCK)*4);
|
||||
Thread->LegoData = 0;
|
||||
/*
|
||||
* FIXME: Why this?
|
||||
*/
|
||||
Thread->KernelApcDisable = 1;
|
||||
Thread->UserAffinity = 0;
|
||||
Thread->SystemAffinityActive = 0;
|
||||
Thread->Queue = NULL;
|
||||
KeInitializeSpinLock(&Thread->ApcQueueLock);
|
||||
memset(&Thread->Timer, 0, sizeof(KTIMER));
|
||||
Thread->QueueListEntry.Flink = NULL;
|
||||
Thread->QueueListEntry.Blink = NULL;
|
||||
Thread->Affinity = 0;
|
||||
Thread->Preempted = 0;
|
||||
Thread->ProcessReadyQueue = 0;
|
||||
Thread->KernelStackResident = 1;
|
||||
Thread->NextProcessor = 0;
|
||||
Thread->CallbackStack = NULL;
|
||||
Thread->Win32Thread = 0;
|
||||
Thread->TrapFrame = NULL;
|
||||
Thread->ApcStatePointer[0] = NULL;
|
||||
Thread->ApcStatePointer[1] = NULL;
|
||||
Thread->EnableStackSwap = 0;
|
||||
Thread->LargeStack = 0;
|
||||
Thread->ResourceIndex = 0;
|
||||
Thread->PreviousMode = KernelMode;
|
||||
Thread->KernelTime.QuadPart = 0;
|
||||
Thread->UserTime.QuadPart = 0;
|
||||
memset(&Thread->SavedApcState, 0, sizeof(KAPC_STATE));
|
||||
Thread->Alertable = 1;
|
||||
Thread->ApcStateIndex = 0;
|
||||
Thread->ApcQueueable = 0;
|
||||
Thread->AutoAlignment = 0;
|
||||
Thread->StackBase = KernelStack;
|
||||
memset(&Thread->SuspendApc, 0, sizeof(KAPC));
|
||||
KeInitializeSemaphore(&Thread->SuspendSemaphore, 0, 255);
|
||||
Thread->ThreadListEntry.Flink = NULL;
|
||||
Thread->ThreadListEntry.Blink = NULL;
|
||||
Thread->FreezeCount = 1;
|
||||
Thread->SuspendCount = 0;
|
||||
|
||||
/*
|
||||
* Initialize ReactOS specific members
|
||||
*/
|
||||
Thread->ProcessThreadListEntry.Flink = NULL;
|
||||
Thread->ProcessThreadListEntry.Blink = NULL;
|
||||
KeInitializeDpc(&Thread->TimerDpc, (PKDEFERRED_ROUTINE)PiTimeoutThread,
|
||||
Thread);
|
||||
|
||||
/*
|
||||
* Do x86 specific part
|
||||
*/
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: main.c,v 1.62 2000/09/13 10:29:48 jean Exp $
|
||||
/* $Id: main.c,v 1.63 2000/10/07 13:41:52 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -32,12 +32,15 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* DATA *********************************************************************/
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
ULONG EXPORTED NtBuildNumber = KERNEL_VERSION_BUILD;
|
||||
ULONG EXPORTED NtGlobalFlag = 0;
|
||||
CHAR EXPORTED KeNumberProcessors = 1;
|
||||
LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock;
|
||||
static LOADER_MODULE KeLoaderModules[64];
|
||||
static UCHAR KeLoaderModuleStrings[64][256];
|
||||
static UCHAR KeLoaderCommandLine[256];
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
|
@ -345,31 +348,46 @@ InitSystemSharedUserPage (PCSZ ParameterLine)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void _main (PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||
void _main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock)
|
||||
/*
|
||||
* FUNCTION: Called by the boot loader to start the kernel
|
||||
* ARGUMENTS:
|
||||
* LoaderBlock = Pointer to boot parameters initialized by the boot loader
|
||||
* LoaderBlock = Pointer to boot parameters initialized by the boot
|
||||
* loader
|
||||
* NOTE: The boot parameters are stored in low memory which will become
|
||||
* invalid after the memory managment is initialized so we make a local copy.
|
||||
*/
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int last_kernel_address;
|
||||
ULONG start, start1;
|
||||
ULONG i;
|
||||
ULONG last_kernel_address;
|
||||
ULONG start;
|
||||
|
||||
/*
|
||||
* Copy the parameters to a local buffer because lowmem will go away
|
||||
*/
|
||||
memcpy (&KeLoaderBlock, LoaderBlock, sizeof(LOADER_PARAMETER_BLOCK));
|
||||
|
||||
memcpy (&KeLoaderBlock, _LoaderBlock, sizeof(LOADER_PARAMETER_BLOCK));
|
||||
memcpy (&KeLoaderModules, (PVOID)KeLoaderBlock.ModsAddr,
|
||||
sizeof(LOADER_MODULE) * KeLoaderBlock.ModsCount);
|
||||
KeLoaderBlock.ModsAddr = (ULONG)&KeLoaderModules;
|
||||
strcpy (KeLoaderCommandLine, (PUCHAR)KeLoaderBlock.CommandLine);
|
||||
KeLoaderBlock.CommandLine = (ULONG)KeLoaderCommandLine;
|
||||
for (i = 0; i < KeLoaderBlock.ModsCount; i++)
|
||||
{
|
||||
strcpy(KeLoaderModuleStrings[i], (PUCHAR)KeLoaderModules[i].String);
|
||||
KeLoaderModules[i].ModStart -= 0x200000;
|
||||
KeLoaderModules[i].ModStart += 0xc0000000;
|
||||
KeLoaderModules[i].ModEnd -= 0x200000;
|
||||
KeLoaderModules[i].ModEnd += 0xc0000000;
|
||||
KeLoaderModules[i].String = (ULONG)KeLoaderModuleStrings[i];
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
* FIXME: Preliminary hack!!!!
|
||||
* Initializes the kernel parameter line.
|
||||
* This should be done by the boot loader.
|
||||
*/
|
||||
strcpy (KeLoaderBlock.kernel_parameters,
|
||||
strcpy (KeLoaderBlock.CommandLine,
|
||||
"multi(0)disk(0)rdisk(0)partition(1)\\reactos /DEBUGPORT=SCREEN");
|
||||
|
||||
/*
|
||||
|
@ -389,14 +407,11 @@ void _main (PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
HalDisplayString("conditions.\n");
|
||||
HalDisplayString("There is absolutely no warranty for ReactOS.\n");
|
||||
|
||||
last_kernel_address = KERNEL_BASE;
|
||||
for (i=0; i <= KeLoaderBlock.nr_files; i++)
|
||||
{
|
||||
last_kernel_address = last_kernel_address +
|
||||
PAGE_ROUND_UP(KeLoaderBlock.module_length[i]);
|
||||
}
|
||||
last_kernel_address = KeLoaderModules[KeLoaderBlock.ModsCount - 1].ModEnd;
|
||||
|
||||
MmInit1((PLOADER_PARAMETER_BLOCK)&KeLoaderBlock, last_kernel_address);
|
||||
MmInit1(KeLoaderModules[0].ModStart - 0xc0000000 + 0x200000,
|
||||
last_kernel_address - 0xc0000000 + 0x200000,
|
||||
last_kernel_address);
|
||||
|
||||
/*
|
||||
* Initialize the kernel debugger
|
||||
|
@ -435,35 +450,32 @@ void _main (PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
/*
|
||||
* Initalize services loaded at boot time
|
||||
*/
|
||||
DPRINT1("%d files loaded\n",KeLoaderBlock.nr_files);
|
||||
DPRINT1("%d files loaded\n",KeLoaderBlock.ModsCount);
|
||||
|
||||
/* Pass 1: load registry chunks passed in */
|
||||
start = KERNEL_BASE + PAGE_ROUND_UP(KeLoaderBlock.module_length[0]);
|
||||
for (i = 1; i < KeLoaderBlock.nr_files; i++)
|
||||
{
|
||||
if (!strcmp ((PCHAR) start, "REGEDIT4"))
|
||||
{
|
||||
DPRINT1("process registry chunk at %08lx\n", start);
|
||||
CmImportHive((PCHAR) start);
|
||||
}
|
||||
start = start + KeLoaderBlock.module_length[i];
|
||||
}
|
||||
/* Pass 1: load registry chunks passed in */
|
||||
for (i = 1; i < KeLoaderBlock.ModsCount; i++)
|
||||
{
|
||||
start = KeLoaderModules[i].ModStart;
|
||||
if (strcmp ((PCHAR) start, "REGEDIT4") == 0)
|
||||
{
|
||||
DPRINT1("process registry chunk at %08lx\n", start);
|
||||
CmImportHive((PCHAR) start);
|
||||
}
|
||||
}
|
||||
|
||||
/* Pass 2: process boot loaded drivers */
|
||||
start = KERNEL_BASE + PAGE_ROUND_UP(KeLoaderBlock.module_length[0]);
|
||||
start1 = start + KeLoaderBlock.module_length[1];
|
||||
for (i=1;i<KeLoaderBlock.nr_files;i++)
|
||||
{
|
||||
if (strcmp ((PCHAR) start, "REGEDIT4"))
|
||||
{
|
||||
DPRINT1("process module at %08lx\n", start);
|
||||
LdrProcessDriver((PVOID)start);
|
||||
}
|
||||
start = start + KeLoaderBlock.module_length[i];
|
||||
}
|
||||
/* Pass 2: process boot loaded drivers */
|
||||
for (i=1; i < KeLoaderBlock.ModsCount; i++)
|
||||
{
|
||||
start = KeLoaderModules[i].ModStart;
|
||||
if (strcmp ((PCHAR) start, "REGEDIT4") != 0)
|
||||
{
|
||||
DPRINT1("process module at %08lx\n", start);
|
||||
LdrProcessDriver((PVOID)start);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create the SystemRoot symbolic link */
|
||||
CreateSystemRootLink (KeLoaderBlock.kernel_parameters);
|
||||
CreateSystemRootLink (KeLoaderBlock.CommandLine);
|
||||
|
||||
CmInitializeRegistry2();
|
||||
/*
|
||||
|
@ -483,7 +495,7 @@ void _main (PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
* Initialize shared user page:
|
||||
* - set dos system path, dos device map, etc.
|
||||
*/
|
||||
InitSystemSharedUserPage (KeLoaderBlock.kernel_parameters);
|
||||
InitSystemSharedUserPage (KeLoaderBlock.CommandLine);
|
||||
|
||||
/*
|
||||
* Launch initial process
|
||||
|
@ -495,3 +507,4 @@ void _main (PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
|
721
reactos/ntoskrnl/ke/multiboot.S
Normal file
721
reactos/ntoskrnl/ke/multiboot.S
Normal file
|
@ -0,0 +1,721 @@
|
|||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
|
||||
#define KERNEL_BASE (0xc0000000)
|
||||
|
||||
#define NR_TASKS (128)
|
||||
|
||||
#define MULTIBOOT_HEADER_MAGIC (0x1BADB002)
|
||||
|
||||
#define MULTIBOOT_HEADER_FLAGS (0x00010003)
|
||||
|
||||
.globl _start
|
||||
.globl _init_stack
|
||||
.globl _init_stack_top
|
||||
|
||||
/*
|
||||
* This is called by the realmode loader, with protected mode
|
||||
* enabled, paging disabled and the segment registers pointing
|
||||
* a 4Gb, 32-bit segment starting at zero.
|
||||
*
|
||||
* EBX = Points to a structure in lowmem with data from the
|
||||
* loader
|
||||
*/
|
||||
_start:
|
||||
jmp _multiboot_entry
|
||||
|
||||
/* Align 32 bits boundary */
|
||||
.align 4
|
||||
|
||||
/* Multiboot header */
|
||||
multiboot_header:
|
||||
/* magic */
|
||||
.long MULTIBOOT_HEADER_MAGIC
|
||||
/* flags */
|
||||
.long MULTIBOOT_HEADER_FLAGS
|
||||
/* checksum */
|
||||
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
|
||||
/* header_addr */
|
||||
.long (0x200000 + multiboot_header - KERNEL_BASE)
|
||||
/* load_addr */
|
||||
.long 0x200000
|
||||
/* load_end_addr */
|
||||
.long (__bss_start__ + 0x200000 - KERNEL_BASE)
|
||||
/* bss_end_addr */
|
||||
.long (__bss_end__ + 0x200000 - KERNEL_BASE)
|
||||
/* entry_addr */
|
||||
.long (0x200000 + _start - KERNEL_BASE)
|
||||
|
||||
_multiboot_entry:
|
||||
/*
|
||||
* This must be PIC because we haven't set up paging yet
|
||||
*/
|
||||
movl $(startup_pagedirectory - 0xc0000000 + 0x200000), %edx
|
||||
movl %edx, %cr3
|
||||
|
||||
/*
|
||||
* Enable paging
|
||||
*/
|
||||
movl %cr0, %edx
|
||||
orl $0x80000000, %edx
|
||||
movl %edx, %cr0
|
||||
movl $l2, %edx
|
||||
jmp *%edx
|
||||
l2:
|
||||
/*
|
||||
* Load the GDTR and IDTR with new tables located above
|
||||
* 0xc0000000
|
||||
*/
|
||||
lgdt _gdt_descr
|
||||
lidt _idt_descr
|
||||
|
||||
/*
|
||||
* Reload the data segment registers
|
||||
*/
|
||||
movl $KERNEL_DS, %edx
|
||||
movl %edx, %ds
|
||||
movl %edx, %es
|
||||
movl %edx, %fs
|
||||
movl %edx, %gs
|
||||
movl %edx, %ss
|
||||
|
||||
/*
|
||||
* Load the initial ring0 stack
|
||||
*/
|
||||
movl $_init_stack_top, %esp
|
||||
|
||||
/*
|
||||
* Initialize EFLAGS
|
||||
*/
|
||||
pushl $0
|
||||
popfl
|
||||
|
||||
/*
|
||||
* Gcc expects this at all times
|
||||
*/
|
||||
cld
|
||||
|
||||
/*
|
||||
* Zero the BSS
|
||||
*/
|
||||
movl %eax, %edx
|
||||
movl $0, %eax
|
||||
movl $__bss_end__, %ecx
|
||||
subl $__bss_start__, %ecx
|
||||
movl $__bss_start__, %edi
|
||||
rep
|
||||
stosl
|
||||
|
||||
/*
|
||||
* Call the main ring0 initialization
|
||||
*/
|
||||
pushl %ebx
|
||||
pushl %edx
|
||||
pushl $0
|
||||
pushl $KERNEL_CS
|
||||
pushl $__main
|
||||
lret
|
||||
|
||||
/*
|
||||
* This needs to be page aligned so put it at the beginning of the data
|
||||
* segment
|
||||
*/
|
||||
.data
|
||||
startup_pagedirectory:
|
||||
/* 0x00000000 */
|
||||
.long lowmem_pagetable - 0xc0000000 + 0x200000 + 0x7,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x02000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x04000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x06000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x08000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x0A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x0C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x0E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x10000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x12000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x14000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x16000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x18000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x1A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x1C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x1E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x20000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x22000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x24000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x26000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x28000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x2A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x2C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x2E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x30000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x32000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x34000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x36000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x38000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x3A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x3C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x3E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x40000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x42000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x44000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x46000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x48000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x4A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x4C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x4E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x50000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x52000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x54000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x56000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x58000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x5A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x5C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x5E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x60000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x62000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x64000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x66000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x68000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x6A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x6C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x6E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x70000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x72000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x74000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x76000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x78000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x7A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x7C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x7E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x80000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x82000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x84000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x86000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x88000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x8A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x8C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x8E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x90000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x92000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x94000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x96000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x98000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x9A000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x9C000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0x9E000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xA0000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xA2000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xA4000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xA6000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xA8000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xAA000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xAC000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xAE000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xB0000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xB2000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xB4000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xB6000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xB8000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xBA000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xBC000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xBE000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xC0000000 */
|
||||
.long kernel_pagetable - 0xc0000000 + 0x200000 + 0x7,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xC2000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xC4000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xC6000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xC8000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xCA000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xCC000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xCE000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xD0000000 */
|
||||
.long lowmem_pagetable - 0xc0000000 + 0x200000 + 0x7,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xD2000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xD4000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xD6000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xD8000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xDA000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xDC000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xDE000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xE0000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xE2000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xE4000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xE6000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xE8000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xEA000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xEC000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xEE000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xF0000000 */
|
||||
.long startup_pagedirectory - 0xc0000000 + 0x200000 + 0x7,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xF2000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xF4000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xF6000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xF8000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xFA000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xFC000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
/* 0xFE000000 */
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
|
||||
|
||||
kernel_pagetable:
|
||||
.long 0x200007,0x201007,0x202007,0x203007,0x204007,0x205007,0x206007,0x207007
|
||||
.long 0x208007,0x209007,0x20a007,0x20b007,0x20c007,0x20d007,0x20e007,0x20f007
|
||||
.long 0x210007,0x211007,0x212007,0x213007,0x214007,0x215007,0x216007,0x217007
|
||||
.long 0x218007,0x219007,0x21a007,0x21b007,0x21c007,0x21d007,0x21e007,0x21f007
|
||||
.long 0x220007,0x221007,0x222007,0x223007,0x224007,0x225007,0x226007,0x227007
|
||||
.long 0x228007,0x229007,0x22a007,0x22b007,0x22c007,0x22d007,0x22e007,0x22f007
|
||||
.long 0x230007,0x231007,0x232007,0x233007,0x234007,0x235007,0x236007,0x237007
|
||||
.long 0x238007,0x239007,0x23a007,0x23b007,0x23c007,0x23d007,0x23e007,0x23f007
|
||||
.long 0x240007,0x241007,0x242007,0x243007,0x244007,0x245007,0x246007,0x247007
|
||||
.long 0x248007,0x249007,0x24a007,0x24b007,0x24c007,0x24d007,0x24e007,0x24f007
|
||||
.long 0x250007,0x251007,0x252007,0x253007,0x254007,0x255007,0x256007,0x257007
|
||||
.long 0x258007,0x259007,0x25a007,0x25b007,0x25c007,0x25d007,0x25e007,0x25f007
|
||||
.long 0x260007,0x261007,0x262007,0x263007,0x264007,0x265007,0x266007,0x267007
|
||||
.long 0x268007,0x269007,0x26a007,0x26b007,0x26c007,0x26d007,0x26e007,0x26f007
|
||||
.long 0x270007,0x271007,0x272007,0x273007,0x274007,0x275007,0x276007,0x277007
|
||||
.long 0x278007,0x279007,0x27a007,0x27b007,0x27c007,0x27d007,0x27e007,0x27f007
|
||||
.long 0x280007,0x281007,0x282007,0x283007,0x284007,0x285007,0x286007,0x287007
|
||||
.long 0x288007,0x289007,0x28a007,0x28b007,0x28c007,0x28d007,0x28e007,0x28f007
|
||||
.long 0x290007,0x291007,0x292007,0x293007,0x294007,0x295007,0x296007,0x297007
|
||||
.long 0x298007,0x299007,0x29a007,0x29b007,0x29c007,0x29d007,0x29e007,0x29f007
|
||||
.long 0x2a0007,0x2a1007,0x2a2007,0x2a3007,0x2a4007,0x2a5007,0x2a6007,0x2a7007
|
||||
.long 0x2a8007,0x2a9007,0x2aa007,0x2ab007,0x2ac007,0x2ad007,0x2ae007,0x2af007
|
||||
.long 0x2b0007,0x2b1007,0x2b2007,0x2b3007,0x2b4007,0x2b5007,0x2b6007,0x2b7007
|
||||
.long 0x2b8007,0x2b9007,0x2ba007,0x2bb007,0x2bc007,0x2bd007,0x2be007,0x2bf007
|
||||
.long 0x2c0007,0x2c1007,0x2c2007,0x2c3007,0x2c4007,0x2c5007,0x2c6007,0x2c7007
|
||||
.long 0x2c8007,0x2c9007,0x2ca007,0x2cb007,0x2cc007,0x2cd007,0x2ce007,0x2cf007
|
||||
.long 0x2d0007,0x2d1007,0x2d2007,0x2d3007,0x2d4007,0x2d5007,0x2d6007,0x2d7007
|
||||
.long 0x2d8007,0x2d9007,0x2da007,0x2db007,0x2dc007,0x2dd007,0x2de007,0x2df007
|
||||
.long 0x2e0007,0x2e1007,0x2e2007,0x2e3007,0x2e4007,0x2e5007,0x2e6007,0x2e7007
|
||||
.long 0x2e8007,0x2e9007,0x2ea007,0x2eb007,0x2ec007,0x2ed007,0x2ee007,0x2ef007
|
||||
.long 0x2f0007,0x2f1007,0x2f2007,0x2f3007,0x2f4007,0x2f5007,0x2f6007,0x2f7007
|
||||
.long 0x2f8007,0x2f9007,0x2fa007,0x2fb007,0x2fc007,0x2fd007,0x2fe007,0x2ff007
|
||||
.long 0x300007,0x301007,0x302007,0x303007,0x304007,0x305007,0x306007,0x307007
|
||||
.long 0x308007,0x309007,0x30a007,0x30b007,0x30c007,0x30d007,0x30e007,0x30f007
|
||||
.long 0x310007,0x311007,0x312007,0x313007,0x314007,0x315007,0x316007,0x317007
|
||||
.long 0x318007,0x319007,0x31a007,0x31b007,0x31c007,0x31d007,0x31e007,0x31f007
|
||||
.long 0x320007,0x321007,0x322007,0x323007,0x324007,0x325007,0x326007,0x327007
|
||||
.long 0x328007,0x329007,0x32a007,0x32b007,0x32c007,0x32d007,0x32e007,0x32f007
|
||||
.long 0x330007,0x331007,0x332007,0x333007,0x334007,0x335007,0x336007,0x337007
|
||||
.long 0x338007,0x339007,0x33a007,0x33b007,0x33c007,0x33d007,0x33e007,0x33f007
|
||||
.long 0x340007,0x341007,0x342007,0x343007,0x344007,0x345007,0x346007,0x347007
|
||||
.long 0x348007,0x349007,0x34a007,0x34b007,0x34c007,0x34d007,0x34e007,0x34f007
|
||||
.long 0x350007,0x351007,0x352007,0x353007,0x354007,0x355007,0x356007,0x357007
|
||||
.long 0x358007,0x359007,0x35a007,0x35b007,0x35c007,0x35d007,0x35e007,0x35f007
|
||||
.long 0x360007,0x361007,0x362007,0x363007,0x364007,0x365007,0x366007,0x367007
|
||||
.long 0x368007,0x369007,0x36a007,0x36b007,0x36c007,0x36d007,0x36e007,0x36f007
|
||||
.long 0x370007,0x371007,0x372007,0x373007,0x374007,0x375007,0x376007,0x377007
|
||||
.long 0x378007,0x379007,0x37a007,0x37b007,0x37c007,0x37d007,0x37e007,0x37f007
|
||||
.long 0x380007,0x381007,0x382007,0x383007,0x384007,0x385007,0x386007,0x387007
|
||||
.long 0x388007,0x389007,0x38a007,0x38b007,0x38c007,0x38d007,0x38e007,0x38f007
|
||||
.long 0x390007,0x391007,0x392007,0x393007,0x394007,0x395007,0x396007,0x397007
|
||||
.long 0x398007,0x399007,0x39a007,0x39b007,0x39c007,0x39d007,0x39e007,0x39f007
|
||||
.long 0x3a0007,0x3a1007,0x3a2007,0x3a3007,0x3a4007,0x3a5007,0x3a6007,0x3a7007
|
||||
.long 0x3a8007,0x3a9007,0x3aa007,0x3ab007,0x3ac007,0x3ad007,0x3ae007,0x3af007
|
||||
.long 0x3b0007,0x3b1007,0x3b2007,0x3b3007,0x3b4007,0x3b5007,0x3b6007,0x3b7007
|
||||
.long 0x3b8007,0x3b9007,0x3ba007,0x3bb007,0x3bc007,0x3bd007,0x3be007,0x3bf007
|
||||
.long 0x3c0007,0x3c1007,0x3c2007,0x3c3007,0x3c4007,0x3c5007,0x3c6007,0x3c7007
|
||||
.long 0x3c8007,0x3c9007,0x3ca007,0x3cb007,0x3cc007,0x3cd007,0x3ce007,0x3cf007
|
||||
.long 0x3d0007,0x3d1007,0x3d2007,0x3d3007,0x3d4007,0x3d5007,0x3d6007,0x3d7007
|
||||
.long 0x3d8007,0x3d9007,0x3da007,0x3db007,0x3dc007,0x3dd007,0x3de007,0x3df007
|
||||
.long 0x3e0007,0x3e1007,0x3e2007,0x3e3007,0x3e4007,0x3e5007,0x3e6007,0x3e7007
|
||||
.long 0x3e8007,0x3e9007,0x3ea007,0x3eb007,0x3ec007,0x3ed007,0x3ee007,0x3ef007
|
||||
.long 0x3f0007,0x3f1007,0x3f2007,0x3f3007,0x3f4007,0x3f5007,0x3f6007,0x3f7007
|
||||
.long 0x3f8007,0x3f9007,0x3fa007,0x3fb007,0x3fc007,0x3fd007,0x3fe007,0x3ff007
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
.long 0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000
|
||||
|
||||
lowmem_pagetable:
|
||||
.long 0x000007,0x001007,0x002007,0x003007,0x004007,0x005007,0x006007,0x007007
|
||||
.long 0x008007,0x009007,0x00a007,0x00b007,0x00c007,0x00d007,0x00e007,0x00f007
|
||||
.long 0x010007,0x011007,0x012007,0x013007,0x014007,0x015007,0x016007,0x017007
|
||||
.long 0x018007,0x019007,0x01a007,0x01b007,0x01c007,0x01d007,0x01e007,0x01f007
|
||||
.long 0x020007,0x021007,0x022007,0x023007,0x024007,0x025007,0x026007,0x027007
|
||||
.long 0x028007,0x029007,0x02a007,0x02b007,0x02c007,0x02d007,0x02e007,0x02f007
|
||||
.long 0x030007,0x031007,0x032007,0x033007,0x034007,0x035007,0x036007,0x037007
|
||||
.long 0x038007,0x039007,0x03a007,0x03b007,0x03c007,0x03d007,0x03e007,0x03f007
|
||||
.long 0x040007,0x041007,0x042007,0x043007,0x044007,0x045007,0x046007,0x047007
|
||||
.long 0x048007,0x049007,0x04a007,0x04b007,0x04c007,0x04d007,0x04e007,0x04f007
|
||||
.long 0x050007,0x051007,0x052007,0x053007,0x054007,0x055007,0x056007,0x057007
|
||||
.long 0x058007,0x059007,0x05a007,0x05b007,0x05c007,0x05d007,0x05e007,0x05f007
|
||||
.long 0x060007,0x061007,0x062007,0x063007,0x064007,0x065007,0x066007,0x067007
|
||||
.long 0x068007,0x069007,0x06a007,0x06b007,0x06c007,0x06d007,0x06e007,0x06f007
|
||||
.long 0x070007,0x071007,0x072007,0x073007,0x074007,0x075007,0x076007,0x077007
|
||||
.long 0x078007,0x079007,0x07a007,0x07b007,0x07c007,0x07d007,0x07e007,0x07f007
|
||||
.long 0x080007,0x081007,0x082007,0x083007,0x084007,0x085007,0x086007,0x087007
|
||||
.long 0x088007,0x089007,0x08a007,0x08b007,0x08c007,0x08d007,0x08e007,0x08f007
|
||||
.long 0x090007,0x091007,0x092007,0x093007,0x094007,0x095007,0x096007,0x097007
|
||||
.long 0x098007,0x099007,0x09a007,0x09b007,0x09c007,0x09d007,0x09e007,0x09f007
|
||||
.long 0x0a0007,0x0a1007,0x0a2007,0x0a3007,0x0a4007,0x0a5007,0x0a6007,0x0a7007
|
||||
.long 0x0a8007,0x0a9007,0x0aa007,0x0ab007,0x0ac007,0x0ad007,0x0ae007,0x0af007
|
||||
.long 0x0b0007,0x0b1007,0x0b2007,0x0b3007,0x0b4007,0x0b5007,0x0b6007,0x0b7007
|
||||
.long 0x0b8007,0x0b9007,0x0ba007,0x0bb007,0x0bc007,0x0bd007,0x0be007,0x0bf007
|
||||
.long 0x0c0007,0x0c1007,0x0c2007,0x0c3007,0x0c4007,0x0c5007,0x0c6007,0x0c7007
|
||||
.long 0x0c8007,0x0c9007,0x0ca007,0x0cb007,0x0cc007,0x0cd007,0x0ce007,0x0cf007
|
||||
.long 0x0d0007,0x0d1007,0x0d2007,0x0d3007,0x0d4007,0x0d5007,0x0d6007,0x0d7007
|
||||
.long 0x0d8007,0x0d9007,0x0da007,0x0db007,0x0dc007,0x0dd007,0x0de007,0x0df007
|
||||
.long 0x0e0007,0x0e1007,0x0e2007,0x0e3007,0x0e4007,0x0e5007,0x0e6007,0x0e7007
|
||||
.long 0x0e8007,0x0e9007,0x0ea007,0x0eb007,0x0ec007,0x0ed007,0x0ee007,0x0ef007
|
||||
.long 0x0f0007,0x0f1007,0x0f2007,0x0f3007,0x0f4007,0x0f5007,0x0f6007,0x0f7007
|
||||
.long 0x0f8007,0x0f9007,0x0fa007,0x0fb007,0x0fc007,0x0fd007,0x0fe007,0x0ff007
|
||||
.long 0x100007,0x101007,0x102007,0x103007,0x104007,0x105007,0x106007,0x107007
|
||||
.long 0x108007,0x109007,0x10a007,0x10b007,0x10c007,0x10d007,0x10e007,0x10f007
|
||||
.long 0x110007,0x111007,0x112007,0x113007,0x114007,0x115007,0x116007,0x117007
|
||||
.long 0x118007,0x119007,0x11a007,0x11b007,0x11c007,0x11d007,0x11e007,0x11f007
|
||||
.long 0x120007,0x121007,0x122007,0x123007,0x124007,0x125007,0x126007,0x127007
|
||||
.long 0x128007,0x129007,0x12a007,0x12b007,0x12c007,0x12d007,0x12e007,0x12f007
|
||||
.long 0x130007,0x131007,0x132007,0x133007,0x134007,0x135007,0x136007,0x137007
|
||||
.long 0x138007,0x139007,0x13a007,0x13b007,0x13c007,0x13d007,0x13e007,0x13f007
|
||||
.long 0x140007,0x141007,0x142007,0x143007,0x144007,0x145007,0x146007,0x147007
|
||||
.long 0x148007,0x149007,0x14a007,0x14b007,0x14c007,0x14d007,0x14e007,0x14f007
|
||||
.long 0x150007,0x151007,0x152007,0x153007,0x154007,0x155007,0x156007,0x157007
|
||||
.long 0x158007,0x159007,0x15a007,0x15b007,0x15c007,0x15d007,0x15e007,0x15f007
|
||||
.long 0x160007,0x161007,0x162007,0x163007,0x164007,0x165007,0x166007,0x167007
|
||||
.long 0x168007,0x169007,0x16a007,0x16b007,0x16c007,0x16d007,0x16e007,0x16f007
|
||||
.long 0x170007,0x171007,0x172007,0x173007,0x174007,0x175007,0x176007,0x177007
|
||||
.long 0x178007,0x179007,0x17a007,0x17b007,0x17c007,0x17d007,0x17e007,0x17f007
|
||||
.long 0x180007,0x181007,0x182007,0x183007,0x184007,0x185007,0x186007,0x187007
|
||||
.long 0x188007,0x189007,0x18a007,0x18b007,0x18c007,0x18d007,0x18e007,0x18f007
|
||||
.long 0x190007,0x191007,0x192007,0x193007,0x194007,0x195007,0x196007,0x197007
|
||||
.long 0x198007,0x199007,0x19a007,0x19b007,0x19c007,0x19d007,0x19e007,0x19f007
|
||||
.long 0x1a0007,0x1a1007,0x1a2007,0x1a3007,0x1a4007,0x1a5007,0x1a6007,0x1a7007
|
||||
.long 0x1a8007,0x1a9007,0x1aa007,0x1ab007,0x1ac007,0x1ad007,0x1ae007,0x1af007
|
||||
.long 0x1b0007,0x1b1007,0x1b2007,0x1b3007,0x1b4007,0x1b5007,0x1b6007,0x1b7007
|
||||
.long 0x1b8007,0x1b9007,0x1ba007,0x1bb007,0x1bc007,0x1bd007,0x1be007,0x1bf007
|
||||
.long 0x1c0007,0x1c1007,0x1c2007,0x1c3007,0x1c4007,0x1c5007,0x1c6007,0x1c7007
|
||||
.long 0x1c8007,0x1c9007,0x1ca007,0x1cb007,0x1cc007,0x1cd007,0x1ce007,0x1cf007
|
||||
.long 0x1d0007,0x1d1007,0x1d2007,0x1d3007,0x1d4007,0x1d5007,0x1d6007,0x1d7007
|
||||
.long 0x1d8007,0x1d9007,0x1da007,0x1db007,0x1dc007,0x1dd007,0x1de007,0x1df007
|
||||
.long 0x1e0007,0x1e1007,0x1e2007,0x1e3007,0x1e4007,0x1e5007,0x1e6007,0x1e7007
|
||||
.long 0x1e8007,0x1e9007,0x1ea007,0x1eb007,0x1ec007,0x1ed007,0x1ee007,0x1ef007
|
||||
.long 0x1f0007,0x1f1007,0x1f2007,0x1f3007,0x1f4007,0x1f5007,0x1f6007,0x1f7007
|
||||
.long 0x1f8007,0x1f9007,0x1fa007,0x1fb007,0x1fc007,0x1fd007,0x1fe007,0x1ff007
|
||||
.long 0x200007,0x201007,0x202007,0x203007,0x204007,0x205007,0x206007,0x207007
|
||||
.long 0x208007,0x209007,0x20a007,0x20b007,0x20c007,0x20d007,0x20e007,0x20f007
|
||||
.long 0x210007,0x211007,0x212007,0x213007,0x214007,0x215007,0x216007,0x217007
|
||||
.long 0x218007,0x219007,0x21a007,0x21b007,0x21c007,0x21d007,0x21e007,0x21f007
|
||||
.long 0x220007,0x221007,0x222007,0x223007,0x224007,0x225007,0x226007,0x227007
|
||||
.long 0x228007,0x229007,0x22a007,0x22b007,0x22c007,0x22d007,0x22e007,0x22f007
|
||||
.long 0x230007,0x231007,0x232007,0x233007,0x234007,0x235007,0x236007,0x237007
|
||||
.long 0x238007,0x239007,0x23a007,0x23b007,0x23c007,0x23d007,0x23e007,0x23f007
|
||||
.long 0x240007,0x241007,0x242007,0x243007,0x244007,0x245007,0x246007,0x247007
|
||||
.long 0x248007,0x249007,0x24a007,0x24b007,0x24c007,0x24d007,0x24e007,0x24f007
|
||||
.long 0x250007,0x251007,0x252007,0x253007,0x254007,0x255007,0x256007,0x257007
|
||||
.long 0x258007,0x259007,0x25a007,0x25b007,0x25c007,0x25d007,0x25e007,0x25f007
|
||||
.long 0x260007,0x261007,0x262007,0x263007,0x264007,0x265007,0x266007,0x267007
|
||||
.long 0x268007,0x269007,0x26a007,0x26b007,0x26c007,0x26d007,0x26e007,0x26f007
|
||||
.long 0x270007,0x271007,0x272007,0x273007,0x274007,0x275007,0x276007,0x277007
|
||||
.long 0x278007,0x279007,0x27a007,0x27b007,0x27c007,0x27d007,0x27e007,0x27f007
|
||||
.long 0x280007,0x281007,0x282007,0x283007,0x284007,0x285007,0x286007,0x287007
|
||||
.long 0x288007,0x289007,0x28a007,0x28b007,0x28c007,0x28d007,0x28e007,0x28f007
|
||||
.long 0x290007,0x291007,0x292007,0x293007,0x294007,0x295007,0x296007,0x297007
|
||||
.long 0x298007,0x299007,0x29a007,0x29b007,0x29c007,0x29d007,0x29e007,0x29f007
|
||||
.long 0x2a0007,0x2a1007,0x2a2007,0x2a3007,0x2a4007,0x2a5007,0x2a6007,0x2a7007
|
||||
.long 0x2a8007,0x2a9007,0x2aa007,0x2ab007,0x2ac007,0x2ad007,0x2ae007,0x2af007
|
||||
.long 0x2b0007,0x2b1007,0x2b2007,0x2b3007,0x2b4007,0x2b5007,0x2b6007,0x2b7007
|
||||
.long 0x2b8007,0x2b9007,0x2ba007,0x2bb007,0x2bc007,0x2bd007,0x2be007,0x2bf007
|
||||
.long 0x2c0007,0x2c1007,0x2c2007,0x2c3007,0x2c4007,0x2c5007,0x2c6007,0x2c7007
|
||||
.long 0x2c8007,0x2c9007,0x2ca007,0x2cb007,0x2cc007,0x2cd007,0x2ce007,0x2cf007
|
||||
.long 0x2d0007,0x2d1007,0x2d2007,0x2d3007,0x2d4007,0x2d5007,0x2d6007,0x2d7007
|
||||
.long 0x2d8007,0x2d9007,0x2da007,0x2db007,0x2dc007,0x2dd007,0x2de007,0x2df007
|
||||
.long 0x2e0007,0x2e1007,0x2e2007,0x2e3007,0x2e4007,0x2e5007,0x2e6007,0x2e7007
|
||||
.long 0x2e8007,0x2e9007,0x2ea007,0x2eb007,0x2ec007,0x2ed007,0x2ee007,0x2ef007
|
||||
.long 0x2f0007,0x2f1007,0x2f2007,0x2f3007,0x2f4007,0x2f5007,0x2f6007,0x2f7007
|
||||
.long 0x2f8007,0x2f9007,0x2fa007,0x2fb007,0x2fc007,0x2fd007,0x2fe007,0x2ff007
|
||||
.long 0x300007,0x301007,0x302007,0x303007,0x304007,0x305007,0x306007,0x307007
|
||||
.long 0x308007,0x309007,0x30a007,0x30b007,0x30c007,0x30d007,0x30e007,0x30f007
|
||||
.long 0x310007,0x311007,0x312007,0x313007,0x314007,0x315007,0x316007,0x317007
|
||||
.long 0x318007,0x319007,0x31a007,0x31b007,0x31c007,0x31d007,0x31e007,0x31f007
|
||||
.long 0x320007,0x321007,0x322007,0x323007,0x324007,0x325007,0x326007,0x327007
|
||||
.long 0x328007,0x329007,0x32a007,0x32b007,0x32c007,0x32d007,0x32e007,0x32f007
|
||||
.long 0x330007,0x331007,0x332007,0x333007,0x334007,0x335007,0x336007,0x337007
|
||||
.long 0x338007,0x339007,0x33a007,0x33b007,0x33c007,0x33d007,0x33e007,0x33f007
|
||||
.long 0x340007,0x341007,0x342007,0x343007,0x344007,0x345007,0x346007,0x347007
|
||||
.long 0x348007,0x349007,0x34a007,0x34b007,0x34c007,0x34d007,0x34e007,0x34f007
|
||||
.long 0x350007,0x351007,0x352007,0x353007,0x354007,0x355007,0x356007,0x357007
|
||||
.long 0x358007,0x359007,0x35a007,0x35b007,0x35c007,0x35d007,0x35e007,0x35f007
|
||||
.long 0x360007,0x361007,0x362007,0x363007,0x364007,0x365007,0x366007,0x367007
|
||||
.long 0x368007,0x369007,0x36a007,0x36b007,0x36c007,0x36d007,0x36e007,0x36f007
|
||||
.long 0x370007,0x371007,0x372007,0x373007,0x374007,0x375007,0x376007,0x377007
|
||||
.long 0x378007,0x379007,0x37a007,0x37b007,0x37c007,0x37d007,0x37e007,0x37f007
|
||||
.long 0x380007,0x381007,0x382007,0x383007,0x384007,0x385007,0x386007,0x387007
|
||||
.long 0x388007,0x389007,0x38a007,0x38b007,0x38c007,0x38d007,0x38e007,0x38f007
|
||||
.long 0x390007,0x391007,0x392007,0x393007,0x394007,0x395007,0x396007,0x397007
|
||||
.long 0x398007,0x399007,0x39a007,0x39b007,0x39c007,0x39d007,0x39e007,0x39f007
|
||||
.long 0x3a0007,0x3a1007,0x3a2007,0x3a3007,0x3a4007,0x3a5007,0x3a6007,0x3a7007
|
||||
.long 0x3a8007,0x3a9007,0x3aa007,0x3ab007,0x3ac007,0x3ad007,0x3ae007,0x3af007
|
||||
.long 0x3b0007,0x3b1007,0x3b2007,0x3b3007,0x3b4007,0x3b5007,0x3b6007,0x3b7007
|
||||
.long 0x3b8007,0x3b9007,0x3ba007,0x3bb007,0x3bc007,0x3bd007,0x3be007,0x3bf007
|
||||
.long 0x3c0007,0x3c1007,0x3c2007,0x3c3007,0x3c4007,0x3c5007,0x3c6007,0x3c7007
|
||||
.long 0x3c8007,0x3c9007,0x3ca007,0x3cb007,0x3cc007,0x3cd007,0x3ce007,0x3cf007
|
||||
.long 0x3d0007,0x3d1007,0x3d2007,0x3d3007,0x3d4007,0x3d5007,0x3d6007,0x3d7007
|
||||
.long 0x3d8007,0x3d9007,0x3da007,0x3db007,0x3dc007,0x3dd007,0x3de007,0x3df007
|
||||
.long 0x3e0007,0x3e1007,0x3e2007,0x3e3007,0x3e4007,0x3e5007,0x3e6007,0x3e7007
|
||||
.long 0x3e8007,0x3e9007,0x3ea007,0x3eb007,0x3ec007,0x3ed007,0x3ee007,0x3ef007
|
||||
.long 0x3f0007,0x3f1007,0x3f2007,0x3f3007,0x3f4007,0x3f5007,0x3f6007,0x3f7007
|
||||
.long 0x3f8007,0x3f9007,0x3fa007,0x3fb007,0x3fc007,0x3fd007,0x3fe007,0x3ff007
|
||||
.long 0x200007,0x201007,0x202007,0x203007,0x204007,0x205007,0x206007,0x207007
|
||||
.long 0x208007,0x209007,0x20a007,0x20b007,0x20c007,0x20d007,0x20e007,0x20f007
|
||||
.long 0x210007,0x211007,0x212007,0x213007,0x214007,0x215007,0x216007,0x217007
|
||||
.long 0x218007,0x219007,0x21a007,0x21b007,0x21c007,0x21d007,0x21e007,0x21f007
|
||||
.long 0x220007,0x221007,0x222007,0x223007,0x224007,0x225007,0x226007,0x227007
|
||||
.long 0x228007,0x229007,0x22a007,0x22b007,0x22c007,0x22d007,0x22e007,0x22f007
|
||||
.long 0x230007,0x231007,0x232007,0x233007,0x234007,0x235007,0x236007,0x237007
|
||||
.long 0x238007,0x239007,0x23a007,0x23b007,0x23c007,0x23d007,0x23e007,0x23f007
|
||||
.long 0x240007,0x241007,0x242007,0x243007,0x244007,0x245007,0x246007,0x247007
|
||||
.long 0x248007,0x249007,0x24a007,0x24b007,0x24c007,0x24d007,0x24e007,0x24f007
|
||||
.long 0x250007,0x251007,0x252007,0x253007,0x254007,0x255007,0x256007,0x257007
|
||||
.long 0x258007,0x259007,0x25a007,0x25b007,0x25c007,0x25d007,0x25e007,0x25f007
|
||||
.long 0x260007,0x261007,0x262007,0x263007,0x264007,0x265007,0x266007,0x267007
|
||||
.long 0x268007,0x269007,0x26a007,0x26b007,0x26c007,0x26d007,0x26e007,0x26f007
|
||||
.long 0x270007,0x271007,0x272007,0x273007,0x274007,0x275007,0x276007,0x277007
|
||||
.long 0x278007,0x279007,0x27a007,0x27b007,0x27c007,0x27d007,0x27e007,0x27f007
|
||||
.long 0x280007,0x281007,0x282007,0x283007,0x284007,0x285007,0x286007,0x287007
|
||||
.long 0x288007,0x289007,0x28a007,0x28b007,0x28c007,0x28d007,0x28e007,0x28f007
|
||||
.long 0x290007,0x291007,0x292007,0x293007,0x294007,0x295007,0x296007,0x297007
|
||||
.long 0x298007,0x299007,0x29a007,0x29b007,0x29c007,0x29d007,0x29e007,0x29f007
|
||||
.long 0x2a0007,0x2a1007,0x2a2007,0x2a3007,0x2a4007,0x2a5007,0x2a6007,0x2a7007
|
||||
.long 0x2a8007,0x2a9007,0x2aa007,0x2ab007,0x2ac007,0x2ad007,0x2ae007,0x2af007
|
||||
.long 0x2b0007,0x2b1007,0x2b2007,0x2b3007,0x2b4007,0x2b5007,0x2b6007,0x2b7007
|
||||
.long 0x2b8007,0x2b9007,0x2ba007,0x2bb007,0x2bc007,0x2bd007,0x2be007,0x2bf007
|
||||
.long 0x2c0007,0x2c1007,0x2c2007,0x2c3007,0x2c4007,0x2c5007,0x2c6007,0x2c7007
|
||||
.long 0x2c8007,0x2c9007,0x2ca007,0x2cb007,0x2cc007,0x2cd007,0x2ce007,0x2cf007
|
||||
.long 0x2d0007,0x2d1007,0x2d2007,0x2d3007,0x2d4007,0x2d5007,0x2d6007,0x2d7007
|
||||
.long 0x2d8007,0x2d9007,0x2da007,0x2db007,0x2dc007,0x2dd007,0x2de007,0x2df007
|
||||
.long 0x2e0007,0x2e1007,0x2e2007,0x2e3007,0x2e4007,0x2e5007,0x2e6007,0x2e7007
|
||||
.long 0x2e8007,0x2e9007,0x2ea007,0x2eb007,0x2ec007,0x2ed007,0x2ee007,0x2ef007
|
||||
.long 0x2f0007,0x2f1007,0x2f2007,0x2f3007,0x2f4007,0x2f5007,0x2f6007,0x2f7007
|
||||
.long 0x2f8007,0x2f9007,0x2fa007,0x2fb007,0x2fc007,0x2fd007,0x2fe007,0x2ff007
|
||||
.long 0x300007,0x301007,0x302007,0x303007,0x304007,0x305007,0x306007,0x307007
|
||||
.long 0x308007,0x309007,0x30a007,0x30b007,0x30c007,0x30d007,0x30e007,0x30f007
|
||||
.long 0x310007,0x311007,0x312007,0x313007,0x314007,0x315007,0x316007,0x317007
|
||||
.long 0x318007,0x319007,0x31a007,0x31b007,0x31c007,0x31d007,0x31e007,0x31f007
|
||||
.long 0x320007,0x321007,0x322007,0x323007,0x324007,0x325007,0x326007,0x327007
|
||||
.long 0x328007,0x329007,0x32a007,0x32b007,0x32c007,0x32d007,0x32e007,0x32f007
|
||||
.long 0x330007,0x331007,0x332007,0x333007,0x334007,0x335007,0x336007,0x337007
|
||||
.long 0x338007,0x339007,0x33a007,0x33b007,0x33c007,0x33d007,0x33e007,0x33f007
|
||||
.long 0x340007,0x341007,0x342007,0x343007,0x344007,0x345007,0x346007,0x347007
|
||||
.long 0x348007,0x349007,0x34a007,0x34b007,0x34c007,0x34d007,0x34e007,0x34f007
|
||||
.long 0x350007,0x351007,0x352007,0x353007,0x354007,0x355007,0x356007,0x357007
|
||||
.long 0x358007,0x359007,0x35a007,0x35b007,0x35c007,0x35d007,0x35e007,0x35f007
|
||||
.long 0x360007,0x361007,0x362007,0x363007,0x364007,0x365007,0x366007,0x367007
|
||||
.long 0x368007,0x369007,0x36a007,0x36b007,0x36c007,0x36d007,0x36e007,0x36f007
|
||||
.long 0x370007,0x371007,0x372007,0x373007,0x374007,0x375007,0x376007,0x377007
|
||||
.long 0x378007,0x379007,0x37a007,0x37b007,0x37c007,0x37d007,0x37e007,0x37f007
|
||||
.long 0x380007,0x381007,0x382007,0x383007,0x384007,0x385007,0x386007,0x387007
|
||||
.long 0x388007,0x389007,0x38a007,0x38b007,0x38c007,0x38d007,0x38e007,0x38f007
|
||||
.long 0x390007,0x391007,0x392007,0x393007,0x394007,0x395007,0x396007,0x397007
|
||||
.long 0x398007,0x399007,0x39a007,0x39b007,0x39c007,0x39d007,0x39e007,0x39f007
|
||||
.long 0x3a0007,0x3a1007,0x3a2007,0x3a3007,0x3a4007,0x3a5007,0x3a6007,0x3a7007
|
||||
.long 0x3a8007,0x3a9007,0x3aa007,0x3ab007,0x3ac007,0x3ad007,0x3ae007,0x3af007
|
||||
.long 0x3b0007,0x3b1007,0x3b2007,0x3b3007,0x3b4007,0x3b5007,0x3b6007,0x3b7007
|
||||
.long 0x3b8007,0x3b9007,0x3ba007,0x3bb007,0x3bc007,0x3bd007,0x3be007,0x3bf007
|
||||
.long 0x3c0007,0x3c1007,0x3c2007,0x3c3007,0x3c4007,0x3c5007,0x3c6007,0x3c7007
|
||||
.long 0x3c8007,0x3c9007,0x3ca007,0x3cb007,0x3cc007,0x3cd007,0x3ce007,0x3cf007
|
||||
.long 0x3d0007,0x3d1007,0x3d2007,0x3d3007,0x3d4007,0x3d5007,0x3d6007,0x3d7007
|
||||
.long 0x3d8007,0x3d9007,0x3da007,0x3db007,0x3dc007,0x3dd007,0x3de007,0x3df007
|
||||
.long 0x3e0007,0x3e1007,0x3e2007,0x3e3007,0x3e4007,0x3e5007,0x3e6007,0x3e7007
|
||||
.long 0x3e8007,0x3e9007,0x3ea007,0x3eb007,0x3ec007,0x3ed007,0x3ee007,0x3ef007
|
||||
.long 0x3f0007,0x3f1007,0x3f2007,0x3f3007,0x3f4007,0x3f5007,0x3f6007,0x3f7007
|
||||
.long 0x3f8007,0x3f9007,0x3fa007,0x3fb007,0x3fc007,0x3fd007,0x3fe007,0x3ff007
|
||||
|
||||
_gdt_descr:
|
||||
.word ((8+NR_TASKS)*8)-1
|
||||
.long _KiGdt
|
||||
|
||||
_idt_descr:
|
||||
.word (256*8)-1
|
||||
.long _KiIdt
|
||||
|
||||
_init_stack:
|
||||
.fill 4096,1,0
|
||||
_init_stack_top:
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: spinlock.c,v 1.4 2000/06/09 20:07:20 ekohl Exp $
|
||||
/* $Id: spinlock.c,v 1.5 2000/10/07 13:41:52 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -22,13 +22,10 @@
|
|||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
STDCALL
|
||||
KeSynchronizeExecution (
|
||||
PKINTERRUPT Interrupt,
|
||||
PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
|
||||
PVOID SynchronizeContext
|
||||
)
|
||||
BOOLEAN STDCALL
|
||||
KeSynchronizeExecution (PKINTERRUPT Interrupt,
|
||||
PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
|
||||
PVOID SynchronizeContext)
|
||||
/*
|
||||
* FUNCTION: Synchronizes the execution of a given routine with the ISR
|
||||
* of a given interrupt object
|
||||
|
@ -54,11 +51,8 @@ KeSynchronizeExecution (
|
|||
return(ret);
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KeInitializeSpinLock (
|
||||
PKSPIN_LOCK SpinLock
|
||||
)
|
||||
VOID STDCALL
|
||||
KeInitializeSpinLock (PKSPIN_LOCK SpinLock)
|
||||
/*
|
||||
* FUNCTION: Initalizes a spinlock
|
||||
* ARGUMENTS:
|
||||
|
@ -68,11 +62,8 @@ KeInitializeSpinLock (
|
|||
SpinLock->Lock = 0;
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KeAcquireSpinLockAtDpcLevel (
|
||||
PKSPIN_LOCK SpinLock
|
||||
)
|
||||
VOID STDCALL
|
||||
KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock)
|
||||
/*
|
||||
* FUNCTION: Acquires a spinlock when the caller is already running at
|
||||
* dispatch level
|
||||
|
@ -89,11 +80,8 @@ KeAcquireSpinLockAtDpcLevel (
|
|||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KeReleaseSpinLockFromDpcLevel (
|
||||
PKSPIN_LOCK SpinLock
|
||||
)
|
||||
VOID STDCALL
|
||||
KeReleaseSpinLockFromDpcLevel (PKSPIN_LOCK SpinLock)
|
||||
/*
|
||||
* FUNCTION: Releases a spinlock when the caller was running at dispatch
|
||||
* level before acquiring it
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: timer.c,v 1.34 2000/08/30 19:33:28 dwelch Exp $
|
||||
/* $Id: timer.c,v 1.35 2000/10/07 13:41:52 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -41,12 +41,12 @@
|
|||
* Return a linear address which can be used to access the physical memory
|
||||
* starting at x
|
||||
*/
|
||||
extern inline unsigned int physical_to_linear(unsigned int x)
|
||||
unsigned int physical_to_linear(unsigned int x)
|
||||
{
|
||||
return(x+IDMAP_BASE);
|
||||
}
|
||||
|
||||
extern inline unsigned int linear_to_physical(unsigned int x)
|
||||
unsigned int linear_to_physical(unsigned int x)
|
||||
{
|
||||
return(x-IDMAP_BASE);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: loader.c,v 1.62 2000/08/26 16:20:34 ekohl Exp $
|
||||
/* $Id: loader.c,v 1.63 2000/10/07 13:41:52 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -612,8 +612,9 @@ LdrPEProcessModule(PVOID ModuleLoadBase, PUNICODE_STRING pModuleName)
|
|||
DPRINT("DrvrBase:%08lx ImgBase:%08lx RelocDelta:%08lx\n",
|
||||
DriverBase,
|
||||
PEOptionalHeader->ImageBase,
|
||||
RelocDelta);
|
||||
RelocDelta);
|
||||
DPRINT("RelocDir %x\n",RelocDir);
|
||||
#if 1
|
||||
for (Idx = 0; Idx < PEFileHeader->NumberOfSections; Idx++)
|
||||
{
|
||||
if (PESectionHeaders[Idx].VirtualAddress == (DWORD)RelocDir)
|
||||
|
@ -627,6 +628,11 @@ LdrPEProcessModule(PVOID ModuleLoadBase, PUNICODE_STRING pModuleName)
|
|||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
RelocDir = RelocDir + (ULONG)DriverBase;
|
||||
CurrentSize = PEOptionalHeader->DataDirectory
|
||||
[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
|
||||
#endif
|
||||
DPRINT("RelocDir %08lx CurrentSize %08lx\n", RelocDir, CurrentSize);
|
||||
TotalRelocs = 0;
|
||||
while (TotalRelocs < CurrentSize && RelocDir->SizeOfBlock != 0)
|
||||
|
@ -661,7 +667,7 @@ LdrPEProcessModule(PVOID ModuleLoadBase, PUNICODE_STRING pModuleName)
|
|||
}
|
||||
else if (Type != 0)
|
||||
{
|
||||
DbgPrint("Unknown relocation type %x\n",Type);
|
||||
DbgPrint("Unknown relocation type %x at %x\n",Type, &Type);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@ _MmSafeCopyFromUserRestart:
|
|||
popl %edi
|
||||
popl %esi
|
||||
|
||||
ret
|
||||
popl %ebp
|
||||
ret
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@ -76,6 +77,7 @@ _MmSafeCopyToUserRestart:
|
|||
popl %ecx
|
||||
popl %edi
|
||||
popl %esi
|
||||
|
||||
|
||||
popl %ebp
|
||||
ret
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: page.c,v 1.14 2000/08/20 17:02:09 dwelch Exp $
|
||||
/* $Id: page.c,v 1.15 2000/10/07 13:41:53 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -36,6 +36,14 @@
|
|||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
PULONG MmGetPageDirectory(void)
|
||||
{
|
||||
unsigned int page_dir=0;
|
||||
__asm__("movl %%cr3,%0\n\t"
|
||||
: "=r" (page_dir));
|
||||
return((PULONG)page_dir);
|
||||
}
|
||||
|
||||
static ULONG ProtectToPTE(ULONG flProtect)
|
||||
{
|
||||
ULONG Attributes = 0;
|
||||
|
@ -97,6 +105,10 @@ NTSTATUS MmCopyMmInfo(PEPROCESS Src, PEPROCESS Dest)
|
|||
{
|
||||
PageDirectory[i] = CurrentPageDirectory[i];
|
||||
}
|
||||
for (i=961; i<1024; i++)
|
||||
{
|
||||
PageDirectory[i] = CurrentPageDirectory[i];
|
||||
}
|
||||
DPRINT("Addr %x\n",PAGETABLE_MAP / (4*1024*1024));
|
||||
PageDirectory[PAGETABLE_MAP / (4*1024*1024)] =
|
||||
(ULONG)PhysPageDirectory | 0x7;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mminit.c,v 1.7 2000/08/30 19:33:28 dwelch Exp $
|
||||
/* $Id: mminit.c,v 1.8 2000/10/07 13:41:53 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -39,14 +39,12 @@
|
|||
/*
|
||||
* Compiler defined symbol s
|
||||
*/
|
||||
extern unsigned int stext;
|
||||
extern unsigned int etext;
|
||||
extern unsigned int end;
|
||||
extern unsigned int _text_start__;
|
||||
extern unsigned int _text_end__;
|
||||
|
||||
static BOOLEAN IsThisAnNtAsSystem = FALSE;
|
||||
static MM_SYSTEM_SIZE MmSystemSize = MmSmallSystem;
|
||||
|
||||
extern unsigned int etext;
|
||||
extern unsigned int _bss_end__;
|
||||
|
||||
static MEMORY_AREA* kernel_text_desc = NULL;
|
||||
|
@ -73,7 +71,8 @@ VOID MiShutdownMemoryManager(VOID)
|
|||
{
|
||||
}
|
||||
|
||||
VOID MmInitVirtualMemory(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
||||
VOID MmInitVirtualMemory(ULONG LastKernelAddress,
|
||||
ULONG KernelLength)
|
||||
/*
|
||||
* FUNCTION: Intialize the memory areas list
|
||||
* ARGUMENTS:
|
||||
|
@ -81,10 +80,9 @@ VOID MmInitVirtualMemory(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
* kernel_len = Length of the kernel
|
||||
*/
|
||||
{
|
||||
unsigned int kernel_len = bp->end_mem - bp->start_mem;
|
||||
PVOID BaseAddress;
|
||||
ULONG Length;
|
||||
ULONG ParamLength = kernel_len;
|
||||
ULONG ParamLength = KernelLength;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("MmInitVirtualMemory(%x)\n",bp);
|
||||
|
@ -100,7 +98,7 @@ VOID MmInitVirtualMemory(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
* Setup the system area descriptor list
|
||||
*/
|
||||
BaseAddress = (PVOID)KERNEL_BASE;
|
||||
Length = PAGE_ROUND_UP(((ULONG)&etext)) - KERNEL_BASE;
|
||||
Length = PAGE_ROUND_UP(((ULONG)&_text_end__)) - KERNEL_BASE;
|
||||
ParamLength = ParamLength - Length;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
|
@ -111,10 +109,10 @@ VOID MmInitVirtualMemory(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
&kernel_text_desc);
|
||||
|
||||
Length = PAGE_ROUND_UP(((ULONG)&_bss_end__)) -
|
||||
PAGE_ROUND_UP(((ULONG)&etext));
|
||||
PAGE_ROUND_UP(((ULONG)&_text_end__));
|
||||
ParamLength = ParamLength - Length;
|
||||
DPRINT("Length %x\n",Length);
|
||||
BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG)&etext));
|
||||
BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG)&_text_end__));
|
||||
DPRINT("BaseAddress %x\n",BaseAddress);
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
|
@ -124,7 +122,7 @@ VOID MmInitVirtualMemory(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
0,
|
||||
&kernel_data_desc);
|
||||
|
||||
BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG)&end));
|
||||
BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG)&_bss_end__));
|
||||
// Length = ParamLength;
|
||||
Length = LastKernelAddress - (ULONG)BaseAddress;
|
||||
MmCreateMemoryArea(NULL,
|
||||
|
@ -170,13 +168,13 @@ VOID MmInitVirtualMemory(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
DPRINT("MmInitVirtualMemory() done\n");
|
||||
}
|
||||
|
||||
VOID MmInit1(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
||||
VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
||||
ULONG LastKrnlPhysAddr,
|
||||
ULONG LastKernelAddress)
|
||||
/*
|
||||
* FUNCTION: Initalize memory managment
|
||||
*/
|
||||
{
|
||||
ULONG first_krnl_phys_addr;
|
||||
ULONG last_krnl_phys_addr;
|
||||
ULONG i;
|
||||
ULONG kernel_len;
|
||||
|
||||
|
@ -218,20 +216,18 @@ VOID MmInit1(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
* (we assume the kernel occupies a continuous range of physical
|
||||
* memory)
|
||||
*/
|
||||
first_krnl_phys_addr = bp->start_mem;
|
||||
last_krnl_phys_addr = bp->end_mem;
|
||||
DPRINT("first krnl %x\nlast krnl %x\n",first_krnl_phys_addr,
|
||||
last_krnl_phys_addr);
|
||||
DPRINT("first krnl %x\nlast krnl %x\n",FirstKrnlPhysAddr,
|
||||
LastKrnlPhysAddr);
|
||||
|
||||
/*
|
||||
* Free physical memory not used by the kernel
|
||||
*/
|
||||
LastKernelAddress = (ULONG)MmInitializePageList(
|
||||
(PVOID)first_krnl_phys_addr,
|
||||
(PVOID)last_krnl_phys_addr,
|
||||
(PVOID)FirstKrnlPhysAddr,
|
||||
(PVOID)LastKrnlPhysAddr,
|
||||
1024,
|
||||
PAGE_ROUND_UP(LastKernelAddress));
|
||||
kernel_len = last_krnl_phys_addr - first_krnl_phys_addr;
|
||||
kernel_len = LastKrnlPhysAddr - FirstKrnlPhysAddr;
|
||||
|
||||
/*
|
||||
* Create a trap for null pointer references and protect text
|
||||
|
@ -239,8 +235,8 @@ VOID MmInit1(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
*/
|
||||
CHECKPOINT;
|
||||
DPRINT("stext %x etext %x\n",(int)&stext,(int)&etext);
|
||||
for (i=PAGE_ROUND_UP(((int)&stext));
|
||||
i<PAGE_ROUND_DOWN(((int)&etext));i=i+PAGESIZE)
|
||||
for (i=PAGE_ROUND_UP(((int)&_text_start__));
|
||||
i<PAGE_ROUND_DOWN(((int)&_text_end__));i=i+PAGESIZE)
|
||||
{
|
||||
MmSetPageProtect(NULL,
|
||||
(PVOID)i,
|
||||
|
@ -261,7 +257,7 @@ VOID MmInit1(PLOADER_PARAMETER_BLOCK bp, ULONG LastKernelAddress)
|
|||
/*
|
||||
* Intialize memory areas
|
||||
*/
|
||||
MmInitVirtualMemory(bp, LastKernelAddress);
|
||||
MmInitVirtualMemory(LastKernelAddress, kernel_len);
|
||||
}
|
||||
|
||||
VOID MmInit2(VOID)
|
||||
|
|
96
reactos/ntoskrnl/ntoskrnl.lnk
Normal file
96
reactos/ntoskrnl/ntoskrnl.lnk
Normal file
|
@ -0,0 +1,96 @@
|
|||
OUTPUT_FORMAT(pei-i386)
|
||||
ENTRY(_mainCRTStartup)
|
||||
SECTIONS
|
||||
{
|
||||
.text __image_base__ + __section_alignment__ :
|
||||
{
|
||||
__text_start__ = .;
|
||||
*(.init)
|
||||
*(.text)
|
||||
*(SORT(.text$*))
|
||||
*(.glue_7t)
|
||||
*(.glue_7)
|
||||
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
|
||||
LONG (-1); *(.ctors); *(.ctor); LONG (0);
|
||||
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
|
||||
LONG (-1); *(.dtors); *(.dtor); LONG (0);
|
||||
*(.fini)
|
||||
/* ??? Why is .gcc_exc here? */
|
||||
*(.gcc_exc)
|
||||
__text_end__ = .;
|
||||
*(.gcc_except_table)
|
||||
}
|
||||
/* The Cygwin32 library uses a section to avoid copying certain data
|
||||
on fork. This used to be named ".data". The linker used
|
||||
to include this between __data_start__ and __data_end__, but that
|
||||
breaks building the cygwin32 dll. Instead, we name the section
|
||||
".data_cygwin_nocopy" and explictly include it after __data_end__. */
|
||||
.data BLOCK(__section_alignment__) :
|
||||
{
|
||||
__data_start__ = . ;
|
||||
*(.data)
|
||||
*(.data2)
|
||||
*(SORT(.data$*))
|
||||
__data_end__ = . ;
|
||||
*(.data_cygwin_nocopy)
|
||||
}
|
||||
.rdata BLOCK(__section_alignment__) :
|
||||
{
|
||||
*(.rdata)
|
||||
*(SORT(.rdata$*))
|
||||
*(.eh_frame)
|
||||
}
|
||||
.edata BLOCK(__section_alignment__) :
|
||||
{
|
||||
*(.edata)
|
||||
}
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(.debug$S)
|
||||
*(.debug$T)
|
||||
*(.debug$F)
|
||||
*(.drectve)
|
||||
}
|
||||
.idata BLOCK(__section_alignment__) :
|
||||
{
|
||||
/* This cannot currently be handled with grouped sections.
|
||||
See pe.em:sort_sections. */
|
||||
SORT(*)(.idata$2)
|
||||
SORT(*)(.idata$3)
|
||||
/* These zeroes mark the end of the import list. */
|
||||
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
|
||||
SORT(*)(.idata$4)
|
||||
SORT(*)(.idata$5)
|
||||
SORT(*)(.idata$6)
|
||||
SORT(*)(.idata$7)
|
||||
}
|
||||
.CRT BLOCK(__section_alignment__) :
|
||||
{
|
||||
*(SORT(.CRT$*))
|
||||
}
|
||||
.rsrc BLOCK(__section_alignment__) :
|
||||
{
|
||||
*(.rsrc)
|
||||
*(SORT(.rsrc$*))
|
||||
}
|
||||
.bss BLOCK(__section_alignment__) :
|
||||
{
|
||||
__bss_start__ = . ;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
__bss_end__ = . ;
|
||||
}
|
||||
.reloc BLOCK(__section_alignment__) :
|
||||
{
|
||||
*(.reloc)
|
||||
}
|
||||
.stab BLOCK(__section_alignment__) (NOLOAD) :
|
||||
{
|
||||
[ .stab ]
|
||||
}
|
||||
.stabstr BLOCK(__section_alignment__) (NOLOAD) :
|
||||
{
|
||||
[ .stabstr ]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: object.c,v 1.27 2000/09/29 15:03:21 jean Exp $
|
||||
/* $Id: object.c,v 1.28 2000/10/07 13:41:53 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -24,6 +24,18 @@
|
|||
|
||||
/* FUNCTIONS ************************************************************/
|
||||
|
||||
PVOID HEADER_TO_BODY(POBJECT_HEADER obj)
|
||||
{
|
||||
return(((void *)obj)+sizeof(OBJECT_HEADER)-sizeof(COMMON_BODY_HEADER));
|
||||
}
|
||||
|
||||
POBJECT_HEADER BODY_TO_HEADER(PVOID body)
|
||||
{
|
||||
PCOMMON_BODY_HEADER chdr = (PCOMMON_BODY_HEADER)body;
|
||||
return(CONTAINING_RECORD((&(chdr->Type)),OBJECT_HEADER,Type));
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* NAME PRIVATE
|
||||
* ObInitializeObject
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: create.c,v 1.22 2000/09/06 03:08:08 phreak Exp $
|
||||
/* $Id: create.c,v 1.23 2000/10/07 13:41:54 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -253,10 +253,10 @@ PACCESS_TOKEN STDCALL PsReferenceImpersonationToken(PETHREAD Thread,
|
|||
return(Thread->ImpersonationInfo->Token);
|
||||
}
|
||||
|
||||
static VOID PiTimeoutThread(struct _KDPC *dpc,
|
||||
PVOID Context,
|
||||
PVOID arg1,
|
||||
PVOID arg2 )
|
||||
VOID PiTimeoutThread(struct _KDPC *dpc,
|
||||
PVOID Context,
|
||||
PVOID arg1,
|
||||
PVOID arg2)
|
||||
{
|
||||
// wake up the thread, and tell it it timed out
|
||||
NTSTATUS Status = STATUS_TIMEOUT;
|
||||
|
@ -360,23 +360,14 @@ NTSTATUS PsInitializeThread(HANDLE ProcessHandle,
|
|||
|
||||
PiNrThreads++;
|
||||
|
||||
Thread->Tcb.State = THREAD_STATE_SUSPENDED;
|
||||
Thread->Tcb.SuspendCount = 0;
|
||||
Thread->Tcb.FreezeCount = 1;
|
||||
InitializeListHead(&Thread->Tcb.ApcState.ApcListHead[0]);
|
||||
InitializeListHead(&Thread->Tcb.ApcState.ApcListHead[1]);
|
||||
Thread->Tcb.KernelApcDisable = 1;
|
||||
Thread->Tcb.WaitIrql = PASSIVE_LEVEL;
|
||||
KeInitializeThread(&Process->Pcb, &Thread->Tcb);
|
||||
Thread->ThreadsProcess = Process;
|
||||
KeInitializeDpc(&Thread->Tcb.TimerDpc, PiTimeoutThread, Thread);
|
||||
Thread->Tcb.WaitBlockList = NULL;
|
||||
/*
|
||||
* FIXME: What lock protects this?
|
||||
*/
|
||||
InsertTailList(&Thread->ThreadsProcess->ThreadListHead,
|
||||
&Thread->Tcb.ProcessThreadListEntry);
|
||||
InitializeListHead(&Thread->TerminationPortList);
|
||||
KeInitializeDispatcherHeader(&Thread->Tcb.DispatcherHeader,
|
||||
InternalThreadType,
|
||||
sizeof(ETHREAD),
|
||||
FALSE);
|
||||
KeInitializeSpinLock(&Thread->ActiveTimerListLock);
|
||||
InitializeListHead(&Thread->IrpList);
|
||||
Thread->Cid.UniqueThread = (HANDLE)InterlockedIncrement(
|
||||
|
|
|
@ -56,7 +56,7 @@ VOID PsInitIdleThread(VOID)
|
|||
PsIdleThreadMain,
|
||||
NULL);
|
||||
|
||||
Priority = THREAD_PRIORITY_IDLE;
|
||||
Priority = LOW_PRIORITY;
|
||||
ZwSetInformationThread(PsIdleThreadHandle,
|
||||
ThreadPriority,
|
||||
&Priority,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: process.c,v 1.52 2000/08/12 19:33:22 dwelch Exp $
|
||||
/* $Id: process.c,v 1.53 2000/10/07 13:41:54 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -210,7 +210,7 @@ VOID PsInitProcessManagment(VOID)
|
|||
MmInitializeAddressSpace(PsInitialSystemProcess,
|
||||
&PsInitialSystemProcess->AddressSpace);
|
||||
ObCreateHandleTable(NULL,FALSE,PsInitialSystemProcess);
|
||||
KProcess->PageTableDirectory = get_page_directory();
|
||||
KProcess->PageTableDirectory = MmGetPageDirectory();
|
||||
PsInitialSystemProcess->UniqueProcessId =
|
||||
InterlockedIncrement(&PiNextProcessUniqueId);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: thread.c,v 1.55 2000/09/24 23:55:21 phreak Exp $
|
||||
/* $Id: thread.c,v 1.56 2000/10/07 13:41:54 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -38,16 +38,13 @@
|
|||
|
||||
POBJECT_TYPE EXPORTED PsThreadType = NULL;
|
||||
|
||||
#define NR_THREAD_PRIORITY_LEVELS (32)
|
||||
#define THREAD_PRIORITY_MAX (15)
|
||||
|
||||
KSPIN_LOCK PiThreadListLock;
|
||||
|
||||
/*
|
||||
* PURPOSE: List of threads associated with each priority level
|
||||
*/
|
||||
LIST_ENTRY PiThreadListHead;
|
||||
static LIST_ENTRY PriorityListHead[NR_THREAD_PRIORITY_LEVELS];
|
||||
static LIST_ENTRY PriorityListHead[MAXIMUM_PRIORITY];
|
||||
static BOOLEAN DoneInitYet = FALSE;
|
||||
ULONG PiNrThreads = 0;
|
||||
ULONG PiNrRunnableThreads = 0;
|
||||
|
@ -116,7 +113,6 @@ PETHREAD STDCALL PsGetCurrentThread(VOID)
|
|||
return(CurrentThread);
|
||||
}
|
||||
|
||||
|
||||
HANDLE STDCALL PsGetCurrentThreadId(VOID)
|
||||
{
|
||||
return(PsGetCurrentThread()->Cid.UniqueThread);
|
||||
|
@ -124,11 +120,20 @@ HANDLE STDCALL PsGetCurrentThreadId(VOID)
|
|||
|
||||
static VOID PsInsertIntoThreadList(KPRIORITY Priority, PETHREAD Thread)
|
||||
{
|
||||
DPRINT("PsInsertIntoThreadList(Priority %x, Thread %x)\n",Priority,
|
||||
Thread);
|
||||
DPRINT("Offset %x\n", THREAD_PRIORITY_MAX + Priority);
|
||||
InsertTailList(&PriorityListHead[THREAD_PRIORITY_MAX+Priority],
|
||||
&Thread->Tcb.QueueListEntry);
|
||||
// DPRINT("PsInsertIntoThreadList(Priority %x, Thread %x)\n",Priority,
|
||||
// Thread);
|
||||
// DPRINT("Offset %x\n", THREAD_PRIORITY_MAX + Priority);
|
||||
|
||||
if (PiThreadListLock.Lock == 0)
|
||||
{
|
||||
KeBugCheck(0);
|
||||
}
|
||||
if (Priority >= MAXIMUM_PRIORITY || Priority < 0)
|
||||
{
|
||||
DPRINT1("Invalid thread priority\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
InsertTailList(&PriorityListHead[Priority], &Thread->Tcb.QueueListEntry);
|
||||
PiNrRunnableThreads++;
|
||||
}
|
||||
|
||||
|
@ -171,10 +176,12 @@ static PETHREAD PsScanThreadList (KPRIORITY Priority)
|
|||
PETHREAD current;
|
||||
|
||||
// DPRINT("PsScanThreadList(Priority %d)\n",Priority);
|
||||
|
||||
current_entry = RemoveHeadList(
|
||||
&PriorityListHead[THREAD_PRIORITY_MAX + Priority]);
|
||||
if (current_entry != &PriorityListHead[THREAD_PRIORITY_MAX + Priority])
|
||||
if (PiThreadListLock.Lock == 0)
|
||||
{
|
||||
KeBugCheck(0);
|
||||
}
|
||||
current_entry = RemoveHeadList(&PriorityListHead[Priority]);
|
||||
if (current_entry != &PriorityListHead[Priority])
|
||||
{
|
||||
current = CONTAINING_RECORD(current_entry, ETHREAD,
|
||||
Tcb.QueueListEntry);
|
||||
|
@ -194,15 +201,15 @@ VOID PsDispatchThreadNoLock (ULONG NewThreadStatus)
|
|||
PETHREAD Candidate;
|
||||
|
||||
CurrentThread->Tcb.State = NewThreadStatus;
|
||||
PiNrRunnableThreads--;
|
||||
if (CurrentThread->Tcb.State == THREAD_STATE_RUNNABLE)
|
||||
{
|
||||
PiNrRunnableThreads--;
|
||||
PsInsertIntoThreadList(CurrentThread->Tcb.Priority,
|
||||
CurrentThread);
|
||||
}
|
||||
|
||||
for (CurrentPriority = (THREAD_PRIORITY_TIME_CRITICAL + 1);
|
||||
(CurrentPriority >= THREAD_PRIORITY_IDLE);
|
||||
for (CurrentPriority = HIGH_PRIORITY;
|
||||
CurrentPriority >= LOW_PRIORITY;
|
||||
CurrentPriority--)
|
||||
{
|
||||
Candidate = PsScanThreadList(CurrentPriority);
|
||||
|
@ -219,7 +226,7 @@ VOID PsDispatchThreadNoLock (ULONG NewThreadStatus)
|
|||
|
||||
CurrentThread = Candidate;
|
||||
|
||||
KeReleaseSpinLockFromDpcLevel( &PiThreadListLock );
|
||||
KeReleaseSpinLockFromDpcLevel(&PiThreadListLock);
|
||||
HalTaskSwitch(&CurrentThread->Tcb);
|
||||
PsReapThreads();
|
||||
return;
|
||||
|
@ -239,10 +246,12 @@ VOID PsDispatchThread(ULONG NewThreadStatus)
|
|||
}
|
||||
|
||||
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
|
||||
CurrentThread->Tcb.WaitIrql = oldIrql; // save wait Irql
|
||||
/*
|
||||
* Save wait IrqL
|
||||
*/
|
||||
CurrentThread->Tcb.WaitIrql = oldIrql;
|
||||
PsDispatchThreadNoLock(NewThreadStatus);
|
||||
KeLowerIrql(oldIrql);
|
||||
// DPRINT("oldIrql %d\n",oldIrql);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -366,11 +375,10 @@ VOID PsInitThreadManagment(VOID)
|
|||
{
|
||||
PETHREAD FirstThread;
|
||||
ULONG i;
|
||||
ANSI_STRING AnsiString;
|
||||
HANDLE FirstThreadHandle;
|
||||
|
||||
KeInitializeSpinLock(&PiThreadListLock);
|
||||
for (i=0; i<NR_THREAD_PRIORITY_LEVELS; i++)
|
||||
for (i=0; i < MAXIMUM_PRIORITY; i++)
|
||||
{
|
||||
InitializeListHead(&PriorityListHead[i]);
|
||||
}
|
||||
|
@ -378,8 +386,7 @@ VOID PsInitThreadManagment(VOID)
|
|||
|
||||
PsThreadType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
|
||||
|
||||
RtlInitAnsiString(&AnsiString,"Thread");
|
||||
RtlAnsiStringToUnicodeString(&PsThreadType->TypeName,&AnsiString,TRUE);
|
||||
RtlInitUnicodeString(&PsThreadType->TypeName, L"Thread");
|
||||
|
||||
PsThreadType->TotalObjects = 0;
|
||||
PsThreadType->TotalHandles = 0;
|
||||
|
@ -402,12 +409,12 @@ VOID PsInitThreadManagment(VOID)
|
|||
HalInitFirstTask(FirstThread);
|
||||
FirstThread->Tcb.State = THREAD_STATE_RUNNING;
|
||||
FirstThread->Tcb.FreezeCount = 0;
|
||||
CurrentThread = FirstThread;
|
||||
CURRENT_KPCR->CurrentThread = (PVOID)FirstThread;
|
||||
ZwClose(FirstThreadHandle);
|
||||
|
||||
DPRINT("FirstThread %x\n",FirstThread);
|
||||
|
||||
CurrentThread = FirstThread;
|
||||
|
||||
|
||||
DoneInitYet = TRUE;
|
||||
}
|
||||
|
||||
|
@ -416,45 +423,41 @@ VOID PsInitThreadManagment(VOID)
|
|||
* Sets thread's base priority relative to the process' base priority
|
||||
* Should only be passed in THREAD_PRIORITY_ constants in pstypes.h
|
||||
*/
|
||||
LONG
|
||||
STDCALL
|
||||
KeSetBasePriorityThread (
|
||||
PKTHREAD Thread,
|
||||
LONG Increment
|
||||
)
|
||||
LONG STDCALL
|
||||
KeSetBasePriorityThread (PKTHREAD Thread,
|
||||
LONG Increment)
|
||||
{
|
||||
Thread->BasePriority = ((PETHREAD)Thread)->ThreadsProcess->Pcb.BasePriority + Increment;
|
||||
if( Thread->BasePriority < 0 )
|
||||
Thread->BasePriority = 0;
|
||||
else if( Thread->BasePriority >= NR_THREAD_PRIORITY_LEVELS )
|
||||
Thread->BasePriority = NR_THREAD_PRIORITY_LEVELS - 1;
|
||||
Thread->BasePriority =
|
||||
((PETHREAD)Thread)->ThreadsProcess->Pcb.BasePriority + Increment;
|
||||
if (Thread->BasePriority < LOW_PRIORITY)
|
||||
Thread->BasePriority = LOW_PRIORITY;
|
||||
else if (Thread->BasePriority >= MAXIMUM_PRIORITY)
|
||||
Thread->BasePriority = HIGH_PRIORITY;
|
||||
Thread->Priority = Thread->BasePriority;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
KPRIORITY
|
||||
STDCALL
|
||||
KeSetPriorityThread (
|
||||
PKTHREAD Thread,
|
||||
KPRIORITY Priority
|
||||
)
|
||||
KPRIORITY STDCALL
|
||||
KeSetPriorityThread (PKTHREAD Thread, KPRIORITY Priority)
|
||||
{
|
||||
KPRIORITY OldPriority;
|
||||
KIRQL oldIrql;
|
||||
|
||||
if (Priority < 0 || Priority >= MAXIMUM_PRIORITY)
|
||||
{
|
||||
KeBugCheck(0);
|
||||
}
|
||||
|
||||
OldPriority = Thread->Priority;
|
||||
Thread->Priority = (CHAR)Priority;
|
||||
|
||||
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
|
||||
// Truncate priority to the max value
|
||||
Priority = Priority > THREAD_PRIORITY_MAX ? THREAD_PRIORITY_MAX : Priority;
|
||||
OldPriority = Thread->Priority;
|
||||
Thread->Priority = Priority;
|
||||
// Remove thread from run queue, and plcae it back on using the new priority
|
||||
// but only if it is already on the runqueue!
|
||||
if( Thread->State == THREAD_STATE_RUNNABLE )
|
||||
{
|
||||
RemoveEntryList(&Thread->QueueListEntry);
|
||||
PsInsertIntoThreadList(Thread->Priority,
|
||||
CONTAINING_RECORD(Thread,ETHREAD,Tcb));
|
||||
if (Thread->State == THREAD_STATE_RUNNABLE)
|
||||
{
|
||||
RemoveEntryList(&Thread->QueueListEntry);
|
||||
PsInsertIntoThreadList(Thread->BasePriority,
|
||||
CONTAINING_RECORD(Thread,ETHREAD,Tcb));
|
||||
}
|
||||
KeReleaseSpinLock(&PiThreadListLock, oldIrql);
|
||||
return(OldPriority);
|
||||
|
|
|
@ -59,9 +59,19 @@ NTSTATUS STDCALL NtSetInformationThread(HANDLE ThreadHandle,
|
|||
break;
|
||||
|
||||
case ThreadPriority:
|
||||
KeSetPriorityThread(&Thread->Tcb, *(KPRIORITY *)ThreadInformation);
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
{
|
||||
KPRIORITY Priority;
|
||||
|
||||
Priority = *(KPRIORITY*)ThreadInformation;
|
||||
if (Priority < LOW_PRIORITY || Priority >= MAXIMUM_PRIORITY)
|
||||
{
|
||||
Status = STATUS_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
KeSetPriorityThread(&Thread->Tcb, Priority);
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
||||
case ThreadBasePriority:
|
||||
break;
|
||||
|
@ -105,8 +115,7 @@ NTSTATUS STDCALL NtSetInformationThread(HANDLE ThreadHandle,
|
|||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
NTSTATUS STDCALL
|
||||
NtQueryInformationThread (
|
||||
IN HANDLE ThreadHandle,
|
||||
IN THREADINFOCLASS ThreadInformationClass,
|
||||
|
@ -191,22 +200,16 @@ VOID KeSetPreviousMode(ULONG Mode)
|
|||
PsGetCurrentThread()->Tcb.PreviousMode = Mode;
|
||||
}
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
KeGetPreviousMode (
|
||||
VOID
|
||||
)
|
||||
ULONG STDCALL
|
||||
KeGetPreviousMode (VOID)
|
||||
{
|
||||
/* CurrentThread is in ntoskrnl/ps/thread.c */
|
||||
return (ULONG)PsGetCurrentThread()->Tcb.PreviousMode;
|
||||
}
|
||||
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
ExGetPreviousMode (
|
||||
VOID
|
||||
)
|
||||
ULONG STDCALL
|
||||
ExGetPreviousMode (VOID)
|
||||
{
|
||||
/* CurrentThread is in ntoskrnl/ps/thread.c */
|
||||
return (ULONG)PsGetCurrentThread()->Tcb.PreviousMode;
|
||||
|
|
203
reactos/ntoskrnl/rtl/bitops.c
Normal file
203
reactos/ntoskrnl/rtl/bitops.c
Normal file
|
@ -0,0 +1,203 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* Copyright 1992, Linus Torvalds.
|
||||
*/
|
||||
/*
|
||||
* These have to be done with inline assembly: that way the bit-setting
|
||||
* is guaranteed to be atomic. All bit operations return 0 if the bit
|
||||
* was cleared before the operation and != 0 if it was not.
|
||||
*
|
||||
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
|
||||
*/
|
||||
|
||||
#ifdef __SMP__
|
||||
#define LOCK_PREFIX "lock ; "
|
||||
#else
|
||||
#define LOCK_PREFIX ""
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function prototypes to keep gcc -Wall happy
|
||||
*/
|
||||
extern void set_bit(int nr, volatile void * addr);
|
||||
extern void clear_bit(int nr, volatile void * addr);
|
||||
extern void change_bit(int nr, volatile void * addr);
|
||||
extern int test_and_set_bit(int nr, volatile void * addr);
|
||||
extern int test_and_clear_bit(int nr, volatile void * addr);
|
||||
extern int test_and_change_bit(int nr, volatile void * addr);
|
||||
extern int __constant_test_bit(int nr, const volatile void * addr);
|
||||
extern int __test_bit(int nr, volatile void * addr);
|
||||
extern int find_first_zero_bit(void * addr, unsigned size);
|
||||
extern int find_next_zero_bit (void * addr, int size, int offset);
|
||||
extern unsigned long ffz(unsigned long word);
|
||||
|
||||
/*
|
||||
* Some hacks to defeat gcc over-optimizations..
|
||||
*/
|
||||
struct __dummy { unsigned long a[100]; };
|
||||
#define ADDR (*(volatile struct __dummy *) addr)
|
||||
#define CONST_ADDR (*(volatile const struct __dummy *) addr)
|
||||
|
||||
void set_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btsl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
void clear_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btrl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
void change_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btcl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
int test_and_set_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btsl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
int test_and_clear_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btrl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
int test_and_change_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btcl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine doesn't need to be atomic.
|
||||
*/
|
||||
int __constant_test_bit(int nr, const volatile void * addr)
|
||||
{
|
||||
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
|
||||
}
|
||||
|
||||
int test_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"btl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit)
|
||||
:"m" (ADDR),"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#define test_bit(nr,addr) \
|
||||
(__builtin_constant_p(nr) ? \
|
||||
__constant_test_bit((nr),(addr)) : \
|
||||
__test_bit((nr),(addr)))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find-bit routines..
|
||||
*/
|
||||
int find_first_zero_bit(void * addr, unsigned size)
|
||||
{
|
||||
int d0, d1, d2;
|
||||
int res;
|
||||
|
||||
if (!size)
|
||||
return 0;
|
||||
__asm__("cld\n\t"
|
||||
"movl $-1,%%eax\n\t"
|
||||
"xorl %%edx,%%edx\n\t"
|
||||
"repe; scasl\n\t"
|
||||
"je 1f\n\t"
|
||||
"xorl -4(%%edi),%%eax\n\t"
|
||||
"subl $4,%%edi\n\t"
|
||||
"bsfl %%eax,%%edx\n"
|
||||
"1:\tsubl %%ebx,%%edi\n\t"
|
||||
"shll $3,%%edi\n\t"
|
||||
"addl %%edi,%%edx"
|
||||
:"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
|
||||
:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
|
||||
return res;
|
||||
}
|
||||
|
||||
int find_next_zero_bit (void * addr, int size, int offset)
|
||||
{
|
||||
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
|
||||
int set = 0, bit = offset & 31, res;
|
||||
|
||||
if (bit) {
|
||||
/*
|
||||
* Look for zero in first byte
|
||||
*/
|
||||
__asm__("bsfl %1,%0\n\t"
|
||||
"jne 1f\n\t"
|
||||
"movl $32, %0\n"
|
||||
"1:"
|
||||
: "=r" (set)
|
||||
: "r" (~(*p >> bit)));
|
||||
if (set < (32 - bit))
|
||||
return set + offset;
|
||||
set = 32 - bit;
|
||||
p++;
|
||||
}
|
||||
/*
|
||||
* No zero yet, search remaining full bytes for a zero
|
||||
*/
|
||||
res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
|
||||
return (offset + set + res);
|
||||
}
|
||||
|
||||
/*
|
||||
* ffz = Find First Zero in word. Undefined if no zero exists,
|
||||
* so code should check against ~0UL first..
|
||||
*/
|
||||
unsigned long ffz(unsigned long word)
|
||||
{
|
||||
__asm__("bsfl %1,%0"
|
||||
:"=r" (word)
|
||||
:"r" (~word));
|
||||
return word;
|
||||
}
|
|
@ -1,17 +1,42 @@
|
|||
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/rtl/memchr.c
|
||||
* PURPOSE: Implements memchr function
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 22/05/98
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
void *memchr(const void *s, int c, size_t n)
|
||||
{
|
||||
if (n)
|
||||
{
|
||||
const char *p = s;
|
||||
do {
|
||||
if (*p++ == c)
|
||||
return (void *)(p-1);
|
||||
} while (--n != 0);
|
||||
}
|
||||
return 0;
|
||||
while (n > 0)
|
||||
{
|
||||
if ((*((const unsigned char *)s)) == (unsigned char)c)
|
||||
{
|
||||
return((void *)s);
|
||||
}
|
||||
s++;
|
||||
n--;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
|
47
reactos/ntoskrnl/rtl/memcmp.c
Normal file
47
reactos/ntoskrnl/rtl/memcmp.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/rtl/memcmp.c
|
||||
* PURPOSE: Implements memcmp function
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 01/10/00
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
int memcmp(const void* _s1, const void* _s2, size_t n)
|
||||
{
|
||||
unsigned int i;
|
||||
const char* s1;
|
||||
const char* s2;
|
||||
|
||||
s1 = (const char *)_s1;
|
||||
s2 = (const char *)_s2;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if ((*s1) != (*s2))
|
||||
{
|
||||
return((*s1) - (*s2));
|
||||
}
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
return(0);
|
||||
}
|
|
@ -24,7 +24,7 @@ EXE_PREFIX = ./
|
|||
CP = $(PATH_TO_TOP)/rcopy
|
||||
DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
|
||||
NASM_CMD = nasm
|
||||
KM_SPECS = $(TOPDIR)/specs
|
||||
#KM_SPECS = $(TOPDIR)/specs
|
||||
FLOPPY_DIR = /a
|
||||
# DIST_DIR should be relative from the top of the tree
|
||||
DIST_DIR = dist
|
||||
|
@ -40,72 +40,39 @@ DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
|
|||
NASM_CMD = nasm
|
||||
RM = del
|
||||
RMDIR = rmdir
|
||||
KM_SPECS = specs
|
||||
#KM_SPECS = specs
|
||||
DOSCLI = yes
|
||||
FLOPPY_DIR = A:
|
||||
# DIST_DIR should be relative from the top of the tree
|
||||
DIST_DIR = dist
|
||||
endif
|
||||
|
||||
#
|
||||
# Create variables for all the compiler tools
|
||||
#
|
||||
ifeq ($(WITH_DEBUGGING),yes)
|
||||
DEBUGGING_CFLAGS = -g
|
||||
OPTIMIZATIONS = -O2
|
||||
else
|
||||
DEBUGGING_CFLAGS =
|
||||
OPTIMIZATIONS = -O2
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(WARNINGS_ARE_ERRORS),yes)
|
||||
EXTRA_CFLAGS = -Werror
|
||||
endif
|
||||
|
||||
ifeq ($(BOCHS_30ROWS),yes)
|
||||
DEFINES = -DDBG -DBOCHS_30ROWS
|
||||
else
|
||||
DEFINES = -DDBG
|
||||
endif
|
||||
|
||||
ifeq ($(WIN32_LEAN_AND_MEAN),yes)
|
||||
LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
|
||||
else
|
||||
LEAN_AND_MEAN_DEFINE =
|
||||
endif
|
||||
|
||||
CC = $(PREFIX)gcc
|
||||
NATIVE_CC = gcc
|
||||
NATIVE_NM = nm
|
||||
CFLAGS = $(BASE_CFLAGS) \
|
||||
-pipe \
|
||||
$(OPTIMIZATIONS) \
|
||||
$(LEAN_AND_MEAN_DEFINE) \
|
||||
$(DEFINES) -Wall \
|
||||
-Wstrict-prototypes $(DEBUGGING_CFLAGS) \
|
||||
$(EXTRA_CFLAGS)
|
||||
HOST_CC = gcc
|
||||
HOST_NM = nm
|
||||
CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
NFLAGS = -i../../include/ -i../include/ -pinternal/asm.inc -f$(NASM_FORMAT) -d$(NASM_FORMAT)
|
||||
NFLAGS = -i$(PATH_TO_TOP)/include/ -f$(NASM_FORMAT) -d$(NASM_FORMAT)
|
||||
LD = $(PREFIX)ld
|
||||
NM = $(PREFIX)nm
|
||||
OBJCOPY = $(PREFIX)objcopy
|
||||
STRIP = $(PREFIX)strip
|
||||
AS_INCLUDES = -I../include
|
||||
AS = $(PREFIX)gcc -c -x assembler-with-cpp -D__ASM__ $(AS_BASEFLAGS) $(AS_INCLUDES)
|
||||
ASFLAGS := $(ASFLAGS) -I$(PATH_TO_TOP)/include -D__ASM__
|
||||
AS = $(PREFIX)gcc -c -x assembler-with-cpp
|
||||
CPP = $(PREFIX)cpp
|
||||
AR = $(PREFIX)ar
|
||||
RC = $(PREFIX)windres
|
||||
RCINC = \
|
||||
--include-dir ../include \
|
||||
--include-dir ../../include \
|
||||
--include-dir ../../../include \
|
||||
--include-dir ../../../../include
|
||||
RCINC = --include-dir $(PATH_TO_TOP)/include
|
||||
OBJCOPY = $(PREFIX)objcopy
|
||||
|
||||
%.o: %.cc
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
%.o: %.S
|
||||
$(AS) $(ASFLAGS) -c $< -o $@
|
||||
%.o: %.s
|
||||
$(AS) $(ASFLAGS) -c $< -o $@
|
||||
%.o: %.asm
|
||||
$(NASM_CMD) $(NFLAGS) $< -o $@
|
||||
%.coff: %.rc
|
||||
|
@ -113,7 +80,7 @@ RCINC = \
|
|||
|
||||
%.sys: %.o
|
||||
$(CC) \
|
||||
-specs=$(PATH_TO_TOP)/services/svc_specs \
|
||||
-nostartfiles -nostdlib -e _DriverEntry@8\
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--defsym,_end=end \
|
||||
|
@ -132,14 +99,14 @@ RCINC = \
|
|||
-Wl,--image-base,0x10000 \
|
||||
-Wl,-e,_DriverEntry@8 \
|
||||
-Wl,temp.exp \
|
||||
-specs=$(PATH_TO_TOP)/services/svc_specs \
|
||||
-nostartfiles -nostdlib -e _DriverEntry@8 \
|
||||
-mdll \
|
||||
-o $@.unstripped \
|
||||
$^
|
||||
- $(RM) temp.exp
|
||||
$(STRIP) --strip-debug $<
|
||||
$(CC) \
|
||||
-specs=$(PATH_TO_TOP)/services/svc_specs \
|
||||
-nostartfiles -nostdlib -e _DriverEntry@8 \
|
||||
-mdll \
|
||||
-o junk.tmp \
|
||||
-Wl,--defsym,_end=end \
|
||||
|
@ -158,10 +125,18 @@ RCINC = \
|
|||
-Wl,--image-base,0x10000 \
|
||||
-Wl,-e,_DriverEntry@8 \
|
||||
-Wl,temp.exp \
|
||||
-specs=$(PATH_TO_TOP)/services/svc_specs \
|
||||
-nostartfiles -nostdlib -e _DriverEntry@8 \
|
||||
-mdll \
|
||||
-o $@ \
|
||||
$^
|
||||
- $(RM) temp.exp
|
||||
|
||||
RULES_MAK_INCLUDED = 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
# $Id: makefile,v 1.8 2000/08/11 12:46:24 ekohl Exp $
|
||||
# $Id: makefile,v 1.9 2000/10/07 13:41:57 dwelch Exp $
|
||||
#
|
||||
# CSRSS: Client/server runtime subsystem
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
TARGET=csrss
|
||||
|
||||
BASE_CFLAGS = -I../../include -I.
|
||||
CFLAGS = -I.
|
||||
|
||||
OBJECTS_API = api/process.o api/wapi.o api/conio.o api/handle.o
|
||||
|
||||
|
@ -47,21 +49,12 @@ $(TARGET).exe: $(OBJECTS) $(LIBS)
|
|||
install: $(FLOPPY_DIR)/subsys/$(TARGET).exe
|
||||
|
||||
$(FLOPPY_DIR)/subsys/$(TARGET).exe: $(TARGET).exe
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGET).exe $(FLOPPY_DIR)\subsys\$(TARGET).exe
|
||||
else
|
||||
$(CP) $(TARGET).exe $(FLOPPY_DIR)/subsys/$(TARGET).exe
|
||||
endif
|
||||
|
||||
|
||||
dist: $(DIST_DIR)/subsys/$(TARGET).exe
|
||||
|
||||
$(DIST_DIR)/subsys/$(TARGET).exe: $(TARGET).exe
|
||||
ifeq ($(DOSCLI),yes)
|
||||
$(CP) $(TARGET).exe ..\..\$(DIST_DIR)\subsys\$(TARGET).exe
|
||||
else
|
||||
$(CP) $(TARGET).exe ../../$(DIST_DIR)/subsys/$(TARGET).exe
|
||||
endif
|
||||
|
||||
WITH_DEBUGGING = yes
|
||||
include ../../rules.mak
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# $Id: makefile,v 1.4 2000/08/11 12:46:37 ekohl Exp $
|
||||
# $Id: makefile,v 1.5 2000/10/07 13:41:57 dwelch Exp $
|
||||
#
|
||||
# Session Manager
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
TARGET=smss
|
||||
|
||||
BASE_CFLAGS = -I../../include
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
# $Id: makefile,v 1.25 2000/08/11 12:46:47 ekohl Exp $
|
||||
# $Id: makefile,v 1.26 2000/10/07 13:41:58 dwelch Exp $
|
||||
#
|
||||
# WIN32K.SYS build spec
|
||||
#
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
TARGET=win32k
|
||||
|
||||
BASE_CFLAGS = -I. -I../../include
|
||||
CFLAGS = -I.
|
||||
|
||||
ENG_OBJECTS= eng/debug.o eng/mem.o eng/brush.o eng/bitblt.o eng/clip.o eng/copybits.o \
|
||||
eng/device.o eng/handle.o eng/lineto.o eng/paint.o eng/palette.o \
|
||||
|
@ -52,6 +53,7 @@ $(TARGET).sys: $(OBJECTS) $(TARGET).def
|
|||
--output-lib $(TARGET).a \
|
||||
--kill-at
|
||||
$(CC) \
|
||||
-nostartfiles -nostdlib \
|
||||
--subsystem=native \
|
||||
-mdll \
|
||||
--dll \
|
||||
|
@ -64,7 +66,6 @@ $(TARGET).sys: $(OBJECTS) $(TARGET).def
|
|||
-Wl,--defsym,_edata=__data_end__ \
|
||||
-Wl,--defsym,_etext=etext \
|
||||
-Wl,--base-file,base.tmp $(TARGET).o \
|
||||
-specs=../../specs \
|
||||
../../ntoskrnl/ntoskrnl.a
|
||||
- $(RM) junk.tmp
|
||||
$(DLLTOOL) \
|
||||
|
@ -75,6 +76,7 @@ $(TARGET).sys: $(OBJECTS) $(TARGET).def
|
|||
--kill-at
|
||||
- $(RM) base.tmp
|
||||
$(CC) \
|
||||
-nostartfiles -nostdlib \
|
||||
--subsystem=native \
|
||||
-mdll \
|
||||
--dll \
|
||||
|
@ -88,8 +90,7 @@ $(TARGET).sys: $(OBJECTS) $(TARGET).def
|
|||
-Wl,--defsym,_end=end \
|
||||
-Wl,--defsym,_edata=__data_end__ \
|
||||
-Wl,--defsym,_etext=etext \
|
||||
-Wl,temp.exp \
|
||||
-specs=../../specs
|
||||
-Wl,temp.exp
|
||||
|
||||
- $(RM) temp.exp
|
||||
$(NM) --numeric-sort $(TARGET).sys > $(TARGET).sym
|
||||
|
|
Loading…
Reference in a new issue