mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
Fixes for page list initialization
V86 mode fixes svn path=/trunk/; revision=1736
This commit is contained in:
parent
51a205bc71
commit
8c86bcfe89
10 changed files with 263 additions and 291 deletions
|
@ -1,5 +1,6 @@
|
|||
file ntoskrnl/ntoskrnl.nostrip.exe
|
||||
#add-symbol-file lib/ntdll/ntdll.dll 0x77f61000
|
||||
add-symbol-file lib/kernel32/kernel32.dll 0x77f01000
|
||||
#add-symbol-file apps/exp/exp.exe 0x401000
|
||||
#add-symbol-file subsys/csrss/csrss.exe 0x401000
|
||||
#add-symbol-file subsys/smss/smss.exe 0x401000
|
||||
|
|
|
@ -13,41 +13,43 @@ typedef struct _KTSS
|
|||
{
|
||||
USHORT PreviousTask;
|
||||
USHORT Reserved1;
|
||||
ULONG Esp0;
|
||||
ULONG Esp0;
|
||||
USHORT Ss0;
|
||||
USHORT Reserved2;
|
||||
ULONG Esp1;
|
||||
ULONG Esp1;
|
||||
USHORT Ss1;
|
||||
USHORT Reserved3;
|
||||
ULONG Esp2;
|
||||
ULONG Esp2;
|
||||
USHORT Ss2;
|
||||
USHORT Reserved4;
|
||||
ULONG Cr3;
|
||||
ULONG Eip;
|
||||
ULONG Eflags;
|
||||
ULONG Eax;
|
||||
ULONG Ecx;
|
||||
ULONG Edx;
|
||||
ULONG Ebx;
|
||||
ULONG Esp;
|
||||
ULONG Ebp;
|
||||
ULONG Esi;
|
||||
ULONG Edi;
|
||||
ULONG Cr3;
|
||||
ULONG Eip;
|
||||
ULONG Eflags;
|
||||
ULONG Eax;
|
||||
ULONG Ecx;
|
||||
ULONG Edx;
|
||||
ULONG Ebx;
|
||||
ULONG Esp;
|
||||
ULONG Ebp;
|
||||
ULONG Esi;
|
||||
ULONG Edi;
|
||||
USHORT Es;
|
||||
USHORT Reserved5;
|
||||
USHORT Cs;
|
||||
USHORT Reserved6;
|
||||
USHORT Ss;
|
||||
USHORT Reserved7;
|
||||
USHORT Fs;
|
||||
USHORT Ds;
|
||||
USHORT Reserved8;
|
||||
USHORT Gs;
|
||||
USHORT Fs;
|
||||
USHORT Reserved9;
|
||||
USHORT Ldt;
|
||||
USHORT Gs;
|
||||
USHORT Reserved10;
|
||||
USHORT Ldt;
|
||||
USHORT Reserved11;
|
||||
USHORT Trap;
|
||||
USHORT IoMapBase;
|
||||
UCHAR IoBitmap[1];
|
||||
UCHAR IoBitmap[1];
|
||||
} KTSS;
|
||||
|
||||
#endif /* not __ASM__ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: atom.c,v 1.9 2000/07/01 17:07:00 ea Exp $
|
||||
/* $Id: atom.c,v 1.10 2001/03/26 20:46:52 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -97,25 +97,20 @@ DeleteAtom(
|
|||
|
||||
|
||||
|
||||
ATOM
|
||||
STDCALL
|
||||
GlobalAddAtomA(
|
||||
LPCSTR lpString
|
||||
)
|
||||
ATOM STDCALL
|
||||
GlobalAddAtomA(LPCSTR lpString)
|
||||
{
|
||||
|
||||
UINT BufLen = strlen(lpString);
|
||||
WCHAR * lpBuffer = (WCHAR *) HeapAlloc(
|
||||
GetProcessHeap(),
|
||||
(HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY),
|
||||
(BufLen * sizeof (WCHAR))
|
||||
);
|
||||
ATOM atom;
|
||||
|
||||
ansi2unicode(lpBuffer, lpString,BufLen);
|
||||
atom = AWGLAddAtom(&GlobalAtomTable,lpBuffer );
|
||||
HeapFree(GetProcessHeap(),0,lpBuffer);
|
||||
return atom;
|
||||
UINT BufLen = strlen(lpString);
|
||||
WCHAR* lpBuffer;
|
||||
ATOM atom;
|
||||
|
||||
lpBuffer = (WCHAR *) HeapAlloc(GetProcessHeap(),
|
||||
(HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY),
|
||||
(BufLen * sizeof (WCHAR)));
|
||||
ansi2unicode(lpBuffer, lpString, BufLen);
|
||||
atom = AWGLAddAtom(&GlobalAtomTable, lpBuffer);
|
||||
HeapFree(GetProcessHeap(), 0, lpBuffer);
|
||||
return(atom);
|
||||
}
|
||||
|
||||
|
||||
|
@ -300,91 +295,96 @@ GLDeleteAtom(
|
|||
|
||||
|
||||
ATOM
|
||||
AWGLAddAtom(
|
||||
ATOMTABLE *at, const WCHAR *lpString
|
||||
)
|
||||
AWGLAddAtom(ATOMTABLE *at, const WCHAR *lpString)
|
||||
{
|
||||
ATOM atom;
|
||||
ATOMID q;
|
||||
LPATOMENTRY lp,lpfree;
|
||||
int index,freeindex;
|
||||
int atomlen;
|
||||
int newlen;
|
||||
|
||||
|
||||
|
||||
/* if we already have it, bump refcnt */
|
||||
if((atom = AWGLFindAtom(at, lpString ))) {
|
||||
lp = GetAtomPointer(at,atom - ATOMBASE);
|
||||
if(lp->idsize) lp->refcnt++;
|
||||
return atom;
|
||||
}
|
||||
ATOM atom;
|
||||
ATOMID q;
|
||||
LPATOMENTRY lp,lpfree;
|
||||
int index,freeindex;
|
||||
int atomlen;
|
||||
int newlen;
|
||||
|
||||
/* if we already have it, bump refcnt */
|
||||
if((atom = AWGLFindAtom(at, lpString )))
|
||||
{
|
||||
lp = GetAtomPointer(at,atom - ATOMBASE);
|
||||
if(lp->idsize) lp->refcnt++;
|
||||
return atom;
|
||||
}
|
||||
|
||||
/* add to a free slot */
|
||||
q = AtomHashString(lpString,&atomlen);
|
||||
|
||||
lpfree = 0;
|
||||
freeindex = 0;
|
||||
|
||||
for(index = 0;(lp = GetAtomPointer(at,index));index++) {
|
||||
if(lp->q == 0 && lp->refcnt == 0) {
|
||||
if(lp->idsize > atomlen) {
|
||||
if ((lpfree == 0) ||
|
||||
(lpfree->idsize > lp->idsize)) {
|
||||
lpfree = lp;
|
||||
freeindex = index;
|
||||
}
|
||||
}
|
||||
/* add to a free slot */
|
||||
q = AtomHashString(lpString,&atomlen);
|
||||
|
||||
lpfree = 0;
|
||||
freeindex = 0;
|
||||
|
||||
for(index = 0;(lp = GetAtomPointer(at,index));index++)
|
||||
{
|
||||
if(lp->q == 0 && lp->refcnt == 0)
|
||||
{
|
||||
if(lp->idsize > atomlen)
|
||||
{
|
||||
if ((lpfree == 0) ||
|
||||
(lpfree->idsize > lp->idsize))
|
||||
{
|
||||
lpfree = lp;
|
||||
freeindex = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* intatoms do not take space in data, but do get new entries */
|
||||
/* an INTATOM will have length of 0 */
|
||||
if(lpfree && atomlen) {
|
||||
lpfree->q = q;
|
||||
lpfree->refcnt = 1;
|
||||
lstrcpynW(&at->AtomData[lpfree->idx],lpString,atomlen);
|
||||
return freeindex + ATOMBASE;
|
||||
}
|
||||
}
|
||||
/* intatoms do not take space in data, but do get new entries */
|
||||
/* an INTATOM will have length of 0 */
|
||||
if(lpfree && atomlen)
|
||||
{
|
||||
lpfree->q = q;
|
||||
lpfree->refcnt = 1;
|
||||
lstrcpynW(&at->AtomData[lpfree->idx],lpString,atomlen);
|
||||
return freeindex + ATOMBASE;
|
||||
}
|
||||
|
||||
/* no space was available, or we have an INTATOM */
|
||||
/* so expand or create the table */
|
||||
if(at->AtomTable == 0)
|
||||
{
|
||||
at->AtomTable = (ATOMENTRY *) HeapAlloc(GetProcessHeap(),HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,sizeof(ATOMENTRY));
|
||||
at->TableSize = 1;
|
||||
lp = at->AtomTable;
|
||||
index = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
at->TableSize++;
|
||||
at->AtomTable = (ATOMENTRY *) HeapReAlloc(GetProcessHeap(),0,
|
||||
(LPVOID) at->AtomTable,
|
||||
at->TableSize * sizeof(ATOMENTRY));
|
||||
lp = &at->AtomTable[at->TableSize - 1];
|
||||
}
|
||||
|
||||
/* set in the entry */
|
||||
lp->refcnt = 1;
|
||||
lp->q = q;
|
||||
lp->idsize = atomlen;
|
||||
lp->idx = 0;
|
||||
|
||||
/* no space was available, or we have an INTATOM */
|
||||
/* so expand or create the table */
|
||||
if(at->AtomTable == 0) {
|
||||
at->AtomTable = (ATOMENTRY *) HeapAlloc(GetProcessHeap(),HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,sizeof(ATOMENTRY));
|
||||
at->TableSize = 1;
|
||||
lp = at->AtomTable;
|
||||
index = 0;
|
||||
} else {
|
||||
at->TableSize++;
|
||||
at->AtomTable = (ATOMENTRY *) HeapReAlloc(GetProcessHeap(),0,
|
||||
(LPVOID) at->AtomTable,
|
||||
at->TableSize * sizeof(ATOMENTRY));
|
||||
lp = &at->AtomTable[at->TableSize - 1];
|
||||
}
|
||||
|
||||
/* set in the entry */
|
||||
lp->refcnt = 1;
|
||||
lp->q = q;
|
||||
lp->idsize = atomlen;
|
||||
lp->idx = 0;
|
||||
|
||||
/* add an entry if not intatom... */
|
||||
if(atomlen) {
|
||||
newlen = at->DataSize + atomlen;
|
||||
|
||||
if(at->AtomData == 0) {
|
||||
at->AtomData = (WCHAR *) HeapAlloc(GetProcessHeap(),HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,newlen*2);
|
||||
lp->idx = 0;
|
||||
} else {
|
||||
|
||||
at->AtomData = (WCHAR *) HeapReAlloc(GetProcessHeap(),0,at->AtomData,newlen*2);
|
||||
lp->idx = at->DataSize;
|
||||
}
|
||||
|
||||
lstrcpyW(&at->AtomData[lp->idx],lpString);
|
||||
at->DataSize = newlen;
|
||||
}
|
||||
|
||||
return index + ATOMBASE;
|
||||
/* add an entry if not intatom... */
|
||||
if(atomlen) {
|
||||
newlen = at->DataSize + atomlen;
|
||||
|
||||
if(at->AtomData == 0) {
|
||||
at->AtomData = (WCHAR *) HeapAlloc(GetProcessHeap(),HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,newlen*2);
|
||||
lp->idx = 0;
|
||||
} else {
|
||||
|
||||
at->AtomData = (WCHAR *) HeapReAlloc(GetProcessHeap(),0,at->AtomData,newlen*2);
|
||||
lp->idx = at->DataSize;
|
||||
}
|
||||
|
||||
lstrcpyW(&at->AtomData[lp->idx],lpString);
|
||||
at->DataSize = newlen;
|
||||
}
|
||||
|
||||
return index + ATOMBASE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -397,33 +397,29 @@ AWGLAddAtom(
|
|||
|
||||
|
||||
ATOM
|
||||
AWGLFindAtom(
|
||||
ATOMTABLE *at, const WCHAR *lpString
|
||||
)
|
||||
AWGLFindAtom(ATOMTABLE *at, const WCHAR *lpString)
|
||||
{
|
||||
|
||||
ATOMID q;
|
||||
LPATOMENTRY lp;
|
||||
int index;
|
||||
int atomlen;
|
||||
ATOMID q;
|
||||
LPATOMENTRY lp;
|
||||
int index;
|
||||
int atomlen;
|
||||
|
||||
|
||||
|
||||
|
||||
/* convert string to 'q', and get length */
|
||||
q = AtomHashString(lpString,&atomlen);
|
||||
|
||||
/* find the q value, note: this could be INTATOM */
|
||||
/* if q matches, then do case insensitive compare*/
|
||||
for(index = 0;(lp = GetAtomPointer(at,index));index++) {
|
||||
if(lp->q == q) {
|
||||
if(HIWORD(lpString) == 0)
|
||||
return ATOMBASE + index;
|
||||
if(lstrcmpiW(&at->AtomData[lp->idx],lpString) == 0)
|
||||
return ATOMBASE + index;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
/* convert string to 'q', and get length */
|
||||
q = AtomHashString(lpString,&atomlen);
|
||||
|
||||
/* find the q value, note: this could be INTATOM */
|
||||
/* if q matches, then do case insensitive compare*/
|
||||
for(index = 0;(lp = GetAtomPointer(at,index));index++) {
|
||||
if(lp->q == q) {
|
||||
if(HIWORD(lpString) == 0)
|
||||
return ATOMBASE + index;
|
||||
if(lstrcmpiW(&at->AtomData[lp->idx],lpString) == 0)
|
||||
return ATOMBASE + index;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,88 +13,92 @@
|
|||
#include <user32/dce.h>
|
||||
#include <user32/heapdup.h>
|
||||
|
||||
|
||||
CLASS *rootClass;
|
||||
|
||||
ATOM STDCALL RegisterClassA(const WNDCLASS* wc)
|
||||
ATOM STDCALL
|
||||
RegisterClassA(const WNDCLASS* wc)
|
||||
{
|
||||
WNDCLASSEX wcex;
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
wcex.style = wc->style;
|
||||
wcex.lpfnWndProc = wc->lpfnWndProc;
|
||||
wcex.cbClsExtra = wc->cbClsExtra;
|
||||
wcex.cbWndExtra = wc->cbWndExtra;
|
||||
wcex.hInstance = wc->hInstance;
|
||||
wcex.hIcon = wc->hIcon;
|
||||
wcex.hCursor = wc->hCursor;
|
||||
wcex.hbrBackground = wc->hbrBackground;
|
||||
wcex.lpszMenuName = wc->lpszMenuName;
|
||||
wcex.lpszClassName = wc->lpszClassName;
|
||||
wcex.hIconSm = NULL;
|
||||
return RegisterClassExA(&wcex);
|
||||
WNDCLASSEX wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
wcex.style = wc->style;
|
||||
wcex.lpfnWndProc = wc->lpfnWndProc;
|
||||
wcex.cbClsExtra = wc->cbClsExtra;
|
||||
wcex.cbWndExtra = wc->cbWndExtra;
|
||||
wcex.hInstance = wc->hInstance;
|
||||
wcex.hIcon = wc->hIcon;
|
||||
wcex.hCursor = wc->hCursor;
|
||||
wcex.hbrBackground = wc->hbrBackground;
|
||||
wcex.lpszMenuName = wc->lpszMenuName;
|
||||
wcex.lpszClassName = wc->lpszClassName;
|
||||
wcex.hIconSm = NULL;
|
||||
return RegisterClassExA(&wcex);
|
||||
}
|
||||
|
||||
ATOM STDCALL RegisterClassW(const WNDCLASS* wc)
|
||||
ATOM STDCALL
|
||||
RegisterClassW(const WNDCLASS* wc)
|
||||
{
|
||||
WNDCLASSEX wcex;
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
wcex.style = wc->style;
|
||||
wcex.lpfnWndProc = wc->lpfnWndProc;
|
||||
wcex.cbClsExtra = wc->cbClsExtra;
|
||||
wcex.cbWndExtra = wc->cbWndExtra;
|
||||
wcex.hInstance = wc->hInstance;
|
||||
wcex.hIcon = wc->hIcon;
|
||||
wcex.hCursor = wc->hCursor;
|
||||
wcex.hbrBackground = wc->hbrBackground;
|
||||
wcex.lpszMenuName = wc->lpszMenuName;
|
||||
wcex.lpszClassName = wc->lpszClassName;
|
||||
wcex.hIconSm = NULL;
|
||||
return RegisterClassExW(&wcex);
|
||||
WNDCLASSEX wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
wcex.style = wc->style;
|
||||
wcex.lpfnWndProc = wc->lpfnWndProc;
|
||||
wcex.cbClsExtra = wc->cbClsExtra;
|
||||
wcex.cbWndExtra = wc->cbWndExtra;
|
||||
wcex.hInstance = wc->hInstance;
|
||||
wcex.hIcon = wc->hIcon;
|
||||
wcex.hCursor = wc->hCursor;
|
||||
wcex.hbrBackground = wc->hbrBackground;
|
||||
wcex.lpszMenuName = wc->lpszMenuName;
|
||||
wcex.lpszClassName = wc->lpszClassName;
|
||||
wcex.hIconSm = NULL;
|
||||
return RegisterClassExW(&wcex);
|
||||
}
|
||||
|
||||
ATOM STDCALL RegisterClassExA(const WNDCLASSEX* wc)
|
||||
ATOM STDCALL
|
||||
RegisterClassExA(const WNDCLASSEX* wc)
|
||||
{
|
||||
ATOM atom;
|
||||
CLASS *classPtr;
|
||||
INT classExtra, winExtra;
|
||||
int len;
|
||||
|
||||
|
||||
if ( wc == NULL || wc->cbSize != sizeof(WNDCLASSEX)) {
|
||||
|
||||
if (wc == NULL || wc->cbSize != sizeof(WNDCLASSEX))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_DATA);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
atom = GlobalAddAtomA( wc->lpszClassName );
|
||||
}
|
||||
|
||||
atom = GlobalAddAtomA(wc->lpszClassName);
|
||||
if (!atom)
|
||||
{
|
||||
{
|
||||
SetLastError(ERROR_CLASS_ALREADY_EXISTS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
classExtra = wc->cbClsExtra;
|
||||
if (classExtra < 0)
|
||||
classExtra = 0;
|
||||
classExtra = 0;
|
||||
else if (classExtra > 40)
|
||||
classExtra = 40;
|
||||
|
||||
classExtra = 40;
|
||||
|
||||
winExtra = wc->cbClsExtra;
|
||||
if (winExtra < 0)
|
||||
winExtra = 0;
|
||||
winExtra = 0;
|
||||
else if (winExtra > 40)
|
||||
winExtra = 40;
|
||||
|
||||
winExtra = 40;
|
||||
|
||||
classPtr = (CLASS *)HeapAlloc( GetProcessHeap(), 0, sizeof(CLASS) +
|
||||
classExtra - sizeof(classPtr->wExtra) );
|
||||
|
||||
|
||||
classExtra - sizeof(classPtr->wExtra) );
|
||||
|
||||
|
||||
if (classExtra)
|
||||
HEAP_memset( classPtr->wExtra, 0, classExtra );
|
||||
|
||||
HEAP_memset( classPtr->wExtra, 0, classExtra );
|
||||
|
||||
if (!classPtr) {
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
GlobalDeleteAtom( atom );
|
||||
return FALSE;
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
GlobalDeleteAtom( atom );
|
||||
return FALSE;
|
||||
}
|
||||
classPtr->magic = CLASS_MAGIC;
|
||||
classPtr->cWindows = 0;
|
||||
|
@ -109,23 +113,23 @@ ATOM STDCALL RegisterClassExA(const WNDCLASSEX* wc)
|
|||
classPtr->hCursor = (HCURSOR)wc->hCursor;
|
||||
classPtr->hbrBackground = (HBRUSH)wc->hbrBackground;
|
||||
classPtr->bUnicode = FALSE;
|
||||
|
||||
|
||||
if (wc->style & CS_CLASSDC)
|
||||
classPtr->dce = DCE_AllocDCE( 0, DCE_CLASS_DC ) ;
|
||||
classPtr->dce = DCE_AllocDCE( 0, DCE_CLASS_DC ) ;
|
||||
else
|
||||
classPtr->dce = NULL;
|
||||
|
||||
|
||||
classPtr->dce = NULL;
|
||||
|
||||
|
||||
if ( wc->lpszMenuName != NULL ) {
|
||||
len = lstrlenA(wc->lpszMenuName);
|
||||
classPtr->menuName = HeapAlloc(GetProcessHeap(),0,len+1);
|
||||
lstrcpyA(classPtr->menuName,wc->lpszMenuName);
|
||||
len = lstrlenA(wc->lpszMenuName);
|
||||
classPtr->menuName = HeapAlloc(GetProcessHeap(),0,len+1);
|
||||
lstrcpyA(classPtr->menuName,wc->lpszMenuName);
|
||||
}
|
||||
else
|
||||
classPtr->menuName = NULL;
|
||||
|
||||
classPtr->menuName = NULL;
|
||||
|
||||
|
||||
|
||||
|
||||
len = lstrlenA(wc->lpszClassName);
|
||||
classPtr->className = HeapAlloc(GetProcessHeap(),0,len+1);
|
||||
lstrcpyA(classPtr->className,wc->lpszClassName);
|
||||
|
@ -557,4 +561,4 @@ WINBOOL CLASS_FreeClass(CLASS *classPtr)
|
|||
HeapFree(GetProcessHeap(),0,classPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -196,7 +196,8 @@ HalInitFirstTask(PETHREAD thread)
|
|||
KiTss.Esp0 = (ULONG)&init_stack_top;
|
||||
KiTss.Ss0 = KERNEL_DS;
|
||||
KiTss.IoMapBase = FIELD_OFFSET(KTSS, IoBitmap);
|
||||
KiTss.IoBitmap[0] = 0xFF;
|
||||
//KiTss.IoMapBase = 0xFFFF;
|
||||
KiTss.IoBitmap[0] = 0xFF;
|
||||
KiTss.Ldt = LDT_SELECTOR;
|
||||
|
||||
/*
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: main.c,v 1.83 2001/03/25 02:34:28 dwelch Exp $
|
||||
/* $Id: main.c,v 1.84 2001/03/26 20:46:53 dwelch Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/main.c
|
||||
|
@ -377,65 +377,6 @@ InitSystemSharedUserPage (PCSZ ParameterLine)
|
|||
}
|
||||
}
|
||||
|
||||
extern NTSTATUS STDCALL
|
||||
Ke386CallBios(UCHAR Int, KV86M_REGISTERS* Regs);
|
||||
|
||||
struct __attribute__((packed)) vesa_info
|
||||
{
|
||||
UCHAR Signature[4];
|
||||
USHORT Version;
|
||||
ULONG OEMName;
|
||||
ULONG Capabilities;
|
||||
ULONG SupportedModes;
|
||||
USHORT TotalVideoMemory;
|
||||
USHORT OEMVersion;
|
||||
ULONG VendorName;
|
||||
ULONG ProductName;
|
||||
ULONG ProductRevisionString;
|
||||
UCHAR Reserved[478];
|
||||
};
|
||||
|
||||
VOID
|
||||
TestV86Mode(VOID)
|
||||
{
|
||||
ULONG i;
|
||||
extern UCHAR OrigIVT[1024];
|
||||
KV86M_REGISTERS regs;
|
||||
NTSTATUS Status;
|
||||
struct vesa_info* vi;
|
||||
|
||||
for (i = 0; i < (640 / 4); i++)
|
||||
{
|
||||
MmCreateVirtualMapping(NULL,
|
||||
(PVOID)(i * 4096),
|
||||
PAGE_EXECUTE_READWRITE,
|
||||
(ULONG)MmAllocPage(0));
|
||||
}
|
||||
for (; i < (1024 / 4); i++)
|
||||
{
|
||||
MmCreateVirtualMapping(NULL,
|
||||
(PVOID)(i * 4096),
|
||||
PAGE_EXECUTE_READ,
|
||||
i * 4096);
|
||||
}
|
||||
vi = (struct vesa_info*)0x20000;
|
||||
vi->Signature[0] = 'V';
|
||||
vi->Signature[1] = 'B';
|
||||
vi->Signature[2] = 'E';
|
||||
vi->Signature[3] = '2';
|
||||
memset(®s, 0, sizeof(regs));
|
||||
regs.Eax = 0x4F00;
|
||||
regs.Es = 0x2000;
|
||||
regs.Edi = 0x0;
|
||||
memcpy((PVOID)0x0, OrigIVT, 1024);
|
||||
Status = Ke386CallBios(0x10, ®s);
|
||||
DbgPrint("Finished (Status %x, CS:EIP %x:%x)\n", Status, regs.Cs,
|
||||
regs.Eip);
|
||||
DbgPrint("Eax %x\n", regs.Eax);
|
||||
DbgPrint("Signature %.4s\n", vi->Signature);
|
||||
DbgPrint("TotalVideoMemory %dKB\n", vi->TotalVideoMemory * 64);
|
||||
}
|
||||
|
||||
VOID
|
||||
_main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock)
|
||||
/*
|
||||
|
@ -484,7 +425,7 @@ _main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock)
|
|||
KeLoaderModules[i].ModEnd += 0xc0000000;
|
||||
KeLoaderModules[i].String = (ULONG)KeLoaderModuleStrings[i];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialization phase 0
|
||||
*/
|
||||
|
|
|
@ -45,6 +45,12 @@ static KSPIN_LOCK PageListLock;
|
|||
static LIST_ENTRY FreePageListHead;
|
||||
static LIST_ENTRY BiosPageListHead;
|
||||
|
||||
NTSTATUS
|
||||
MmCreateVirtualMappingUnsafe(struct _EPROCESS* Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
ULONG PhysicalAddress);
|
||||
|
||||
/* FUNCTIONS *************************************************************/
|
||||
|
||||
PVOID
|
||||
|
@ -163,12 +169,13 @@ PVOID MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
if (!MmIsPagePresent(NULL,
|
||||
(PVOID)((ULONG)MmPageArray + (i * PAGESIZE))))
|
||||
{
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
(PVOID)((ULONG)MmPageArray +
|
||||
(i * PAGESIZE)),
|
||||
PAGE_READWRITE,
|
||||
(ULONG)(LastPhysKernelAddress
|
||||
- (i * PAGESIZE)));
|
||||
Status =
|
||||
MmCreateVirtualMappingUnsafe(NULL,
|
||||
(PVOID)((ULONG)MmPageArray +
|
||||
(i * PAGESIZE)),
|
||||
PAGE_READWRITE,
|
||||
(ULONG)(LastPhysKernelAddress
|
||||
- (i * PAGESIZE)));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("Unable to create virtual mapping\n");
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: page.c,v 1.24 2001/03/25 02:34:29 dwelch Exp $
|
||||
/* $Id: page.c,v 1.25 2001/03/26 20:46:53 dwelch Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/i386/page.c
|
||||
|
@ -583,22 +583,17 @@ BOOLEAN MmIsPagePresent(PEPROCESS Process, PVOID Address)
|
|||
return((MmGetPageEntryForProcess1(Process, Address)) & PA_PRESENT);
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS MmCreateVirtualMapping(PEPROCESS Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
ULONG PhysicalAddress)
|
||||
NTSTATUS
|
||||
MmCreateVirtualMappingUnsafe(PEPROCESS Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
ULONG PhysicalAddress)
|
||||
{
|
||||
PEPROCESS CurrentProcess = PsGetCurrentProcess();
|
||||
ULONG Attributes = 0;
|
||||
PULONG Pte;
|
||||
NTSTATUS Status;
|
||||
|
||||
if (!MmIsUsablePage((PVOID)PhysicalAddress))
|
||||
{
|
||||
DPRINT1("Page not usable\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
if (Process == NULL && Address < (PVOID)KERNEL_BASE)
|
||||
{
|
||||
DPRINT1("No process\n");
|
||||
|
@ -651,6 +646,23 @@ NTSTATUS MmCreateVirtualMapping(PEPROCESS Process,
|
|||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
MmCreateVirtualMapping(PEPROCESS Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
ULONG PhysicalAddress)
|
||||
{
|
||||
if (!MmIsUsablePage((PVOID)PhysicalAddress))
|
||||
{
|
||||
DPRINT1("Page not usable\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
return(MmCreateVirtualMappingUnsafe(Process,
|
||||
Address,
|
||||
flProtect,
|
||||
PhysicalAddress));
|
||||
}
|
||||
|
||||
ULONG
|
||||
MmGetPageProtect(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mminit.c,v 1.15 2001/03/25 02:34:28 dwelch Exp $
|
||||
/* $Id: mminit.c,v 1.16 2001/03/26 20:46:53 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -232,7 +232,7 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
/* add 1MB for standard memory (not extended) */
|
||||
MmStats.NrTotalPages += 256;
|
||||
}
|
||||
DbgPrint("Used memory %d\n", MmStats.NrTotalPages * PAGESIZE);
|
||||
DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGESIZE) / 1024);
|
||||
|
||||
LastKernelAddress = (ULONG)MmInitializePageList(
|
||||
(PVOID)FirstKrnlPhysAddr,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: services.c,v 1.2 2001/01/20 18:39:35 ekohl Exp $
|
||||
/* $Id: services.c,v 1.3 2001/03/26 20:46:52 dwelch Exp $
|
||||
*
|
||||
* service control manager
|
||||
*
|
||||
|
@ -93,6 +93,7 @@ WinMain(HINSTANCE hInstance,
|
|||
int nShowCmd)
|
||||
{
|
||||
HANDLE hScmStartEvent;
|
||||
HANDLE hEvent;
|
||||
|
||||
PrintString("Service Control Manager\n");
|
||||
|
||||
|
@ -137,11 +138,18 @@ WinMain(HINSTANCE hInstance,
|
|||
|
||||
|
||||
PrintString("SERVICES: Running.\n");
|
||||
|
||||
|
||||
hEvent = CreateEvent(NULL,
|
||||
TRUE,
|
||||
FALSE,
|
||||
NULL);
|
||||
WaitForSingleObject(hEvent, INFINITE);
|
||||
#if 0
|
||||
for (;;)
|
||||
{
|
||||
NtYieldExecution();
|
||||
}
|
||||
#endif
|
||||
|
||||
PrintString("SERVICES: Finished.\n");
|
||||
|
||||
|
|
Loading…
Reference in a new issue