#add-symbol-file lib/ntdll/ntdll.dll 0x77f61000
#add-symbol-file apps/exp/exp.exe 0x401000
#add-symbol-file subsys/csrss/csrss.exe 0x401000
-add-symbol-file subsys/smss/smss.exe 0x401000
+#add-symbol-file subsys/smss/smss.exe 0x401000
break exp.c:254
OBJECT_ATTRIBUTES Attr;
UNICODE_STRING Name;
NTSTATUS Status;
+ VIDEO_X86_BIOS_ARGUMENTS vxba;
+ VP_STATUS vps;
CHECKPOINT;
Event = 0;
- setMode( Mode3 );
+ // setMode( Mode3 );
+ vxba.Eax = 0x0003;
+ vps = VideoPortInt10(NULL, &vxba);
RtlInitUnicodeString( &Name, L"\\TextConsoleRefreshEvent" );
InitializeObjectAttributes( &Attr, &Name, 0, 0, 0 );
Status = NtOpenEvent( &Event, STANDARD_RIGHTS_ALL, &Attr );
-# $Id: Makefile,v 1.25 2001/03/18 19:35:12 dwelch Exp $
+# $Id: Makefile,v 1.26 2001/03/25 18:56:12 dwelch Exp $
#
# ReactOS Operating System
#
ASFLAGS = -Iinclude
CFLAGS = -Iinclude -D__NTOSKRNL__ -DDBG -g -Wall -Werror
+# -DDBGPRINT_FILE_LOG
# -W -Wpointer-arith -Wconversion -Wstrict-prototypes -Wundef \
# -Wmissing-prototypes -Wshadow\
-#CFLAGS += -DDBGPRINT_FILE_LOG
+#CFLAGS = -DDBGPRINT_FILE_LOG
include $(PATH_TO_TOP)/rules.mak
-/* $Id: dlog.c,v 1.1 2001/02/16 18:32:20 dwelch Exp $
+/* $Id: dlog.c,v 1.2 2001/03/25 18:56:12 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
static CHAR DebugLog[DEBUGLOG_SIZE];
static ULONG DebugLogStart;
static ULONG DebugLogEnd;
+static ULONG DebugLogCount;
static KSPIN_LOCK DebugLogLock;
static ULONG DebugLogOverflow;
static HANDLE DebugLogThreadHandle;
DebugLogInit(VOID)
{
KeInitializeSpinLock(&DebugLogLock);
- DebugLogStart = -1;
+ DebugLogStart = 0;
DebugLogEnd = 0;
DebugLogOverflow = 0;
+ DebugLogCount = 0;
KeInitializeSemaphore(&DebugLogSem, 0, 255);
}
{
KIRQL oldIrql;
IO_STATUS_BLOCK Iosb;
- CHAR Buffer[256];
+ static CHAR Buffer[256];
ULONG WLen;
for (;;)
FALSE,
NULL);
KeAcquireSpinLock(&DebugLogLock, &oldIrql);
- while (DebugLogStart != -1)
+ while (DebugLogCount > 0)
{
if (DebugLogStart > DebugLogEnd)
{
memcpy(Buffer, &DebugLog[DebugLogStart], WLen);
DebugLogStart =
(DebugLogStart + WLen) % DEBUGLOG_SIZE;
- if (DebugLogStart == DebugLogEnd)
- {
- DebugLogStart = -1;
- }
+ DebugLogCount = DebugLogCount - WLen;
KeReleaseSpinLock(&DebugLogLock, oldIrql);
NtWriteFile(DebugLogFile,
NULL,
memcpy(Buffer, &DebugLog[DebugLogStart], WLen);
DebugLogStart =
(DebugLogStart + WLen) % DEBUGLOG_SIZE;
- if (DebugLogStart == DebugLogEnd)
- {
- DebugLogStart = -1;
- }
+ DebugLogCount = DebugLogCount - WLen;
KeReleaseSpinLock(&DebugLogLock, oldIrql);
NtWriteFile(DebugLogFile,
NULL,
KeAcquireSpinLock(&DebugLogLock, &oldIrql);
- if (DebugLogEnd == DebugLogStart)
+ if (DebugLogCount == DEBUGLOG_SIZE)
{
DebugLogOverflow++;
KeReleaseSpinLock(&DebugLogLock, oldIrql);
- KeReleaseSemaphore(&DebugLogSem, IO_NO_INCREMENT, 1, FALSE);
+ if (oldIrql < DISPATCH_LEVEL)
+ {
+ KeReleaseSemaphore(&DebugLogSem, IO_NO_INCREMENT, 1, FALSE);
+ }
return;
}
- if (DebugLogStart == -1)
- {
- DebugLogStart = DebugLogEnd;
- }
while ((*String) != 0)
{
DebugLog[DebugLogEnd] = *String;
String++;
- if (((DebugLogEnd + 1) % DEBUGLOG_SIZE) == DebugLogStart)
+ DebugLogCount++;
+ if (DebugLogCount == DEBUGLOG_SIZE)
{
DebugLogOverflow++;
KeReleaseSpinLock(&DebugLogLock, oldIrql);
- KeReleaseSemaphore(&DebugLogSem, IO_NO_INCREMENT, 1, FALSE);
+ if (oldIrql < DISPATCH_LEVEL)
+ {
+ KeReleaseSemaphore(&DebugLogSem, IO_NO_INCREMENT, 1, FALSE);
+ }
return;
}
DebugLogEnd = (DebugLogEnd + 1) % DEBUGLOG_SIZE;
}
KeReleaseSpinLock(&DebugLogLock, oldIrql);
- KeReleaseSemaphore(&DebugLogSem, IO_NO_INCREMENT, 1, FALSE);
+ if (oldIrql < DISPATCH_LEVEL)
+ {
+ KeReleaseSemaphore(&DebugLogSem, IO_NO_INCREMENT, 1, FALSE);
+ }
}
#else /* not DBGPRINT_FILE_LOG */
#include <internal/i386/segment.h>
#include <string.h>
-#define NDEBUG
+//#define NDEBUG
#include <internal/debug.h>
/* GLOBALS *******************************************************************/
ip = (PUCHAR)((Tf->Cs & 0xFFFF) * 16 + (Tf->Eip & 0xFFFF));
sp = (PUSHORT)((Tf->Ss & 0xFFFF) * 16 + (Tf->Esp & 0xFFFF));
- DPRINT("KeV86GPF handling %x at %x:%x ss:sp %x:%x\n",
- ip[0], Tf->Cs, Tf->Eip, Tf->Ss, Tf->Esp);
+ DPRINT("KeV86GPF handling %x at %x:%x ss:sp %x:%x Flags %x\n",
+ ip[0], Tf->Cs, Tf->Eip, Tf->Ss, Tf->Esp, VTf->regs->Flags);
switch (ip[0])
{
* Since we are going to fiddle with the stack pointer this must be
* a critical section for this processor
*/
-
+
/*
- * The stack used for handling exceptions from v86 mode in this thread
- * will be the current stack adjusted so we don't overwrite the
- * existing stack frames
+ * Save the old initial stack
*/
- movl $_KiTss, %esi
- movl %esp, KTSS_ESP0(%esi)
+ movl _CurrentThread, %esi
+ movl KTHREAD_INITIAL_STACK(%esi), %edi
+ pushl %edi
/*
* We also need to set the stack in the kthread structure
*/
- movl _CurrentThread, %esi
- movl KTHREAD_INITIAL_STACK(%esi), %edi
movl %esp, KTHREAD_INITIAL_STACK(%esi)
-
+
/*
- * Save the old initial stack
+ * The stack used for handling exceptions from v86 mode in this thread
+ * will be the current stack adjusted so we don't overwrite the
+ * existing stack frames
*/
- pushl %edi
+ movl $_KiTss, %esi
+ movl %esp, KTSS_ESP0(%esi)
/*
* Create the stack frame for an iret to v86 mode
{
DC *dc = DC_HandleToPtr(hDC);
SURFOBJ *SurfObj = AccessUserObject(dc->Surface);
- PUNICODE_STRING UString;
- PANSI_STRING AString;
+ UNICODE_STRING UString;
+ ANSI_STRING AString;
- RtlCreateUnicodeString(UString, (PWSTR)String);
- RtlUnicodeStringToAnsiString(AString, UString, TRUE);
+ RtlCreateUnicodeString(&UString, (PWSTR)String);
+ RtlUnicodeStringToAnsiString(&AString, &UString, TRUE);
// For now we're just going to use an internal font
- grWriteCellString(SurfObj, XStart, YStart, AString->Buffer, 0xffffff);
+ grWriteCellString(SurfObj, XStart, YStart, AString.Buffer, 0xffffff);
- RtlFreeAnsiString(AString);
- RtlFreeUnicodeString(UString);
+ RtlFreeAnsiString(&AString);
+ RtlFreeUnicodeString(&UString);
}
UINT