[ros-diffs] [ablackmann] 43959: Refactoring and cleanup. Start fleshing out the output phase. Start handling exit correctly. Fix a bug in DoLAYOUT. Nothing new to see here...
ablackmann at svn.reactos.org
ablackmann at svn.reactos.org
Wed Nov 4 23:07:30 CET 2009
- Previous message: [ros-diffs] [sginsberg] 43958: - Finish the work around for the Pentium cmpxchg8b lock errata: We detected the errata and allocated the 7 first IDT entries on a write protected page, but the final piece of the work around, detecting the write fault ti the Invalid Opcode handler, was missing. Implemented this in the page fault handler to detect and dispatch the write fault to the Invalid Opcode handler. - Fix the "fix" of un-protecting the 7 IDT entries on P5 in HAL's BIOS call code when setting the custom Invalid Opcode handler. The IDT was unprotected but the write protection wasn't reapplied after the BIOS call, breaking the work around. Other: - KdDebuggerEnabled is a BOOLEAN, so don't do a dword compare in KeUpdateSystemTime. - Use better comment for the hack where we always allow page faults to be handled, even if they the fault occured with interrupts disabled.
- Next message: [ros-diffs] [sginsberg] 43960: - Implement support for reading and writing physical memory for KD. The implementation uses a reserved mapping page to map the target physical address to. On x86 this page is located at virtual address 0xFFBFF000, and the PTE for this page is the last PTE of the nonpaged pool's PDE. Other architectures may need to reserve the PTE elsewhere. - The physical memory support relies on several Mm variables and structures to be properly set up. Add a new flag, MiDbgReadyForPhysical, and set it when the debugger support can handle physical memory requests. - Protect this page with a Memory Area to make the old Mm keep its dirty hands off it. - Does not support I/O space or cache flags yet. - Add generic KeInvalidateTlbEntry to invalidate a single TLB entry for a given address instead of flushing the whole TLB. Used by the debugger physical memory support as invalidating the whole TLB for every map and unmap of its debug PTE would incur significant overhead for large copies. Replace direct usage of __invlpg() with this in x86 code too. - Fix incorrect cache flag check and set in KdpRead/WritePhysicalmemory for write combined requests. The debugger's Uncached flag was checked instead of the Write Combined flag, and the debuggers Write Combine number (0x3) was set instead of Mm's flag (0x20). - Fix implementation of MmIsAddressValid (at least for x86; other architectures will need more checks). Just check the Address' PDE and PTE valid bits instead of using Memory Areas. - Add missing ASSERTs to ensure the Memory Areas for paged pool, the PCR page, and the Shared User Data page are created. - Add missing Memory Area for the 2 pages HAL currently uses for its own mappings on x86 -- previously, those pages could have been allocated by other parts of the OS, which would have resulted in serious corruptions.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: ablackmann
Date: Wed Nov 4 23:07:29 2009
New Revision: 43959
URL: http://svn.reactos.org/svn/reactos?rev=43959&view=rev
Log:
Refactoring and cleanup. Start fleshing out the output phase. Start handling exit correctly. Fix a bug in DoLAYOUT. Nothing new to see here...
Added:
trunk/reactos/tools/kbdtool/data.c (with props)
trunk/reactos/tools/kbdtool/kbdtool.h (with props)
Modified:
trunk/reactos/tools/kbdtool/kbdtool.rbuild
trunk/reactos/tools/kbdtool/main.c
trunk/reactos/tools/kbdtool/output.c
trunk/reactos/tools/kbdtool/parser.c
Added: trunk/reactos/tools/kbdtool/data.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/data.c?rev=43959&view=auto
==============================================================================
--- trunk/reactos/tools/kbdtool/data.c (added)
+++ trunk/reactos/tools/kbdtool/data.c [iso-8859-1] Wed Nov 4 23:07:29 2009
@@ -1,0 +1,174 @@
+/*
+ * PROJECT: ReactOS Build Tools [Keyboard Layout Compiler]
+ * LICENSE: BSD - See COPYING.BSD in the top level directory
+ * FILE: tools/kbdtool/data.c
+ * PURPOSE: Internal Keyboard (Scancode/Virtual Key) Tables
+ * PROGRAMMERS: ReactOS Foundation
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "kbdtool.h"
+
+/* GLOBALS ********************************************************************/
+
+/* Table of Virtual Key Names */
+VKNAME VKName[] =
+{
+ {0x08, "BACK"},
+ {0x03, "CANCEL"},
+ {0x1b, "ESCAPE"},
+ {0x0d, "RETURN"},
+ {0x20, "SPACE"},
+ {0x6e, "DECIMAL"},
+ {0xba, "OEM_1"},
+ {0xbb, "OEM_PLUS"},
+ {0xbc, "OEM_COMMA"},
+ {0xbd, "OEM_MINUS"},
+ {0xbe, "OEM_PERIOD"},
+ {0xbf, "OEM_2"},
+ {0xc0, "OEM_3"},
+ {0xdb, "OEM_4"},
+ {0xdc, "OEM_5"},
+ {0xdd, "OEM_6"},
+ {0xde, "OEM_7"},
+ {0xdf, "OEM_8"},
+ {0xe2, "OEM_102"},
+ {0xc1, "ABNT_C1"},
+ {0xc2, "ABNT_C2"},
+ {0x10, "SHIFT"},
+ {0xa0, "LSHIFT"},
+ {0xa1, "RSHIFT"},
+ {0x12, "MENU"},
+ {0xa4, "LMENU"},
+ {0xa5, "RMENU"},
+ {0x11, "CONTROL"},
+ {0xa2, "LCONTROL"},
+ {0xa3, "RCONTROL"},
+ {0x6c, "SEPARATOR"},
+ {0xe4, "ICO_00"},
+ {0x2e, "DELETE"},
+ {0x2d, "INSERT"},
+ {0xe5, "GROUPSHIFT"},
+ {0xe6, "RGROUPSHIFT"}
+};
+
+/* ISO 110-key Keyboard Scancode to Virtual Key Conversion Table */
+SCVK ScVk[] =
+{
+ {0x02, '1', NULL, FALSE},
+ {0x03, '2', NULL, FALSE},
+ {0x04, '3', NULL, FALSE},
+ {0x05, '4', NULL, FALSE},
+ {0x06, '5', NULL, FALSE},
+ {0x07, '6', NULL, FALSE},
+ {0x08, '7', NULL, FALSE},
+ {0x09, '8', NULL, FALSE},
+ {0x0a, '9', NULL, FALSE},
+ {0x0b, '0', NULL, FALSE},
+ {0x0c, 0xbd, NULL, FALSE},
+ {0x0d, 0xbb, NULL, FALSE},
+ {0x10, 'Q', NULL, FALSE},
+ {0x11, 'W', NULL, FALSE},
+ {0x12, 'E', NULL, FALSE},
+ {0x13, 'R', NULL, FALSE},
+ {0x14, 'T', NULL, FALSE},
+ {0x15, 'Y', NULL, FALSE},
+ {0x16, 'U', NULL, FALSE},
+ {0x17, 'I', NULL, FALSE},
+ {0x18, 'O', NULL, FALSE},
+ {0x19, 'P', NULL, FALSE},
+ {0x1a, 0xdb, NULL, FALSE},
+ {0x1b, 0xdd, NULL, FALSE},
+ {0x1e, 'A', NULL, FALSE},
+ {0x1f, 'S', NULL, FALSE},
+ {0x20, 'D', NULL, FALSE},
+ {0x21, 'F', NULL, FALSE},
+ {0x22, 'G', NULL, FALSE},
+ {0x23, 'H', NULL, FALSE},
+ {0x24, 'J', NULL, FALSE},
+ {0x25, 'K', NULL, FALSE},
+ {0x26, 'L', NULL, FALSE},
+ {0x27, 0xba, NULL, FALSE},
+ {0x28, 0xde, NULL, FALSE},
+ {0x29, 0xc0, NULL, FALSE},
+ {0x2b, 0xdc, NULL, FALSE},
+ {0x2c, 'Z', NULL, FALSE},
+ {0x2d, 'X', NULL, FALSE},
+ {0x2e, 'C', NULL, FALSE},
+ {0x2f, 'V', NULL, FALSE},
+ {0x30, 'B', NULL, FALSE},
+ {0x31, 'N', NULL, FALSE},
+ {0x32, 'M', NULL, FALSE},
+ {0x33, 0xbc, NULL, FALSE},
+ {0x34, 0xbe, NULL, FALSE},
+ {0x35, 0xbf, NULL, FALSE},
+ {0x53, 0x6e, NULL, FALSE},
+ {0x56, 0xe2, NULL, FALSE},
+ {0x73, 0xc1, NULL, FALSE},
+ {0x7e, 0xc2, NULL, FALSE},
+ {0xe010, 0xb1, "Speedracer: Previous Track", FALSE},
+ {0xe019, 0xb0, "Speedracer: Next Track", FALSE},
+ {0xe01d, 0xa3, "RControl", FALSE},
+ {0xe020, 0xad, "Speedracer: Volume Mute", FALSE},
+ {0xe021, 0xb7, "Speedracer: Launch App 2", FALSE},
+ {0xe022, 0xb3, "Speedracer: Media Play/Pause", FALSE},
+ {0xe024, 0xb2, "Speedracer: Media Stop", FALSE},
+ {0xe02e, 0xae, "Speedracer: Volume Up", FALSE},
+ {0xe030, 0xaf, "Speedracer: Volume Down", FALSE},
+ {0xe032, 0xac, "Speedracer: Browser Home", FALSE},
+ {0xe035, 0x6f, "Numpad Divide", FALSE},
+ {0xe037, 0x2c, "Snapshot", FALSE},
+ {0xe038, 0xa5, "RMenu", FALSE},
+ {0xe047, 0x24, "Home", FALSE},
+ {0xe048, 0x26, "Up", FALSE},
+ {0xe049, 0x21, "Prior", FALSE},
+ {0xe04b, 0x25, "Left", FALSE},
+ {0xe04d, 0x27, "Right", FALSE},
+ {0xe04f, 0x23, "End", FALSE},
+ {0xe050, 0x28, "Down", FALSE},
+ {0xe051, 0x22, "Next", FALSE},
+ {0xe052, 0x2d, "Insert", FALSE},
+ {0xe053, 0x2e, "Delete", FALSE},
+ {0xe05b, 0x5b, "Left Win", FALSE},
+ {0xe05c, 0x5c, "Right Win", FALSE},
+ {0xe05d, 0x5d, "Application", FALSE},
+ {0xe05e, 0xff, "Power", FALSE},
+ {0xe05f, 0x5f, "Speedracer: Sleep", FALSE},
+ {0xe060, 0xff, "BAD SCANCODE", FALSE},
+ {0xe061, 0xff, "BAD SCANCODE", FALSE},
+ {0xe065, 0xaa, "Speedracer: Browser Search", FALSE},
+ {0xe066, 0xab, "Speedracer: Browser Favorites", FALSE},
+ {0xe067, 0xa8, "Speedracer: Browser Refresh", FALSE},
+ {0xe068, 0xa9, "Speedracer: Browser Stop", FALSE},
+ {0xe069, 0xa7, "Speedracer: Browser Foward", FALSE},
+ {0xe06a, 0xa6, "Speedracer: Browser Back", FALSE},
+ {0xe06b, 0xb6, "Speedracer: Launch App 1", FALSE},
+ {0xe06c, 0xb4, "Speedracer: Launch Mail", FALSE},
+ {0xe06d, 0xb5, "Speedracer: Launch Media Selector", FALSE},
+ {0x53, 0x6e, NULL, FALSE},
+ {0x0e, 0x08, NULL, FALSE},
+ {0x01, 0x1b, NULL, FALSE},
+ {0xe01c, 0x0d, "Numpad Enter", FALSE},
+ {0x1c, 0x0d, NULL, FALSE},
+ {0x39, 0x20, NULL, FALSE},
+ {0xe046, 0x03, "Break (Ctrl + Pause)", FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE},
+ {0xFFFF, 0x00, NULL, FALSE}
+};
+
+/* FUNCTIONS ******************************************************************/
+
+/* EOF */
Propchange: trunk/reactos/tools/kbdtool/data.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/tools/kbdtool/kbdtool.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/kbdtool.h?rev=43959&view=auto
==============================================================================
--- trunk/reactos/tools/kbdtool/kbdtool.h (added)
+++ trunk/reactos/tools/kbdtool/kbdtool.h [iso-8859-1] Wed Nov 4 23:07:29 2009
@@ -1,0 +1,75 @@
+/*
+ * PROJECT: ReactOS Build Tools [Keyboard Layout Compiler]
+ * LICENSE: BSD - See COPYING.BSD in the top level directory
+ * FILE: tools/kbdtool/kbdtool.h
+ * PURPOSE: Main Header File
+ * PROGRAMMERS: ReactOS Foundation
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <host/typedefs.h>
+
+#define KEYWORD_COUNT 17
+
+#define CHAR_NORMAL_KEY 0
+#define CHAR_DEAD_KEY 1
+#define CHAR_OTHER_KEY 2
+#define CHAR_INVALID_KEY 3
+#define CHAR_LIGATURE_KEY 4
+
+typedef struct tagKEYNAME
+{
+ ULONG Code;
+ PCHAR Name;
+ struct tagKEYNAME* Next;
+} KEYNAME, *PKEYNAME;
+
+typedef struct tagSCVK
+{
+ USHORT ScanCode;
+ USHORT VirtualKey;
+ PCHAR Name;
+ BOOLEAN Processed;
+} SCVK, *PSCVK;
+
+typedef struct tagVKNAME
+{
+ ULONG VirtualKey;
+ PCHAR Name;
+} VKNAME, *PVKNAME;
+
+typedef struct tagLAYOUTENTRY
+{
+ USHORT ScanCode;
+ UCHAR VirtualKey;
+ UCHAR OriginalVirtualKey;
+ ULONG Cap;
+ ULONG StateCount;
+ ULONG CharData[8];
+ ULONG DeadCharData[8];
+ ULONG OtherCharData[8];
+ struct LAYOUTENTRY* CapData;
+ PCHAR Name;
+ ULONG Processed;
+ ULONG LineCount;
+} LAYOUTENTRY, *PLAYOUTENTRY;
+
+typedef struct tagLAYOUT
+{
+ LAYOUTENTRY Entry[110];
+} LAYOUT, *PLAYOUT;
+
+extern BOOLEAN Verbose, UnicodeFile, SanityCheck, FallbackDriver;
+extern PCHAR gpszFileName;
+extern FILE* gfpInput;
+extern VKNAME VKName[];
+extern SCVK ScVk[];
+extern LAYOUT g_Layout;
+
+/* EOF */
Propchange: trunk/reactos/tools/kbdtool/kbdtool.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/tools/kbdtool/kbdtool.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/kbdtool.rbuild?rev=43959&r1=43958&r2=43959&view=diff
==============================================================================
--- trunk/reactos/tools/kbdtool/kbdtool.rbuild [iso-8859-1] (original)
+++ trunk/reactos/tools/kbdtool/kbdtool.rbuild [iso-8859-1] Wed Nov 4 23:07:29 2009
@@ -1,7 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<module name="kbdtool" type="buildtool">
- <file>main.c</file>
+ <file>data.c</file>
+ <file>main.c</file>
<file>output.c</file>
<file>parser.c</file>
</module>
Modified: trunk/reactos/tools/kbdtool/main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/main.c?rev=43959&r1=43958&r2=43959&view=diff
==============================================================================
--- trunk/reactos/tools/kbdtool/main.c [iso-8859-1] (original)
+++ trunk/reactos/tools/kbdtool/main.c [iso-8859-1] Wed Nov 4 23:07:29 2009
@@ -8,21 +8,21 @@
/* INCLUDES *******************************************************************/
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "getopt.h"
-#include <host/typedefs.h>
+#include "kbdtool.h"
/* GLOBALS ********************************************************************/
+/* Internal tool data */
ULONG gVersion = 3;
ULONG gSubVersion = 40;
+
+/* Input file */
+PCHAR gpszFileName;
+FILE* gfpInput;
+
+/* Command-line parameters */
BOOLEAN UnicodeFile, Verbose, NoLogo, FallbackDriver, SanityCheck, SourceOnly;
ULONG BuildType;
-PCHAR gpszFileName;
-FILE* gfpInput;
/* FUNCTIONS ******************************************************************/
@@ -53,7 +53,7 @@
printf("\t-i/-x/-m/-o-s will exhibit the same behavior when than one of them is specified.\n\n");
/* Quit */
- _exit(1);
+ exit(1);
printf("should not be here");
}
@@ -61,6 +61,7 @@
main(INT argc,
PCHAR* argv)
{
+ ULONG ErrorCode, FailureCode;
CHAR Option;
PCHAR OpenFlags;
CHAR BuildOptions[16] = {0};
@@ -213,16 +214,27 @@
/* Now inform the user */
printf("Compiling layout information from '%s' for %s.\n", gpszFileName, BuildOptions);
}
-
+
/* Now parse the keywords */
- DoParsing();
-
- /* We are done */
- fclose(gfpInput);
-
- /* Now do something... */
- printf("Like a rock...\n");
- exit(0);
+ FailureCode = DoParsing();
+
+ /* Should we build? */
+ if (!(SourceOnly) && !(FallbackDriver)) ErrorCode = 0;//DoBuild();
+
+ /* Did everything work? */
+ if (FailureCode == 0)
+ {
+ /* Tell the user, if he cares */
+ if (!NoLogo) printf("All tasks completed successfully.\n");
+ }
+ else
+ {
+ /* Print the failure code */
+ printf("\n %13d\n", FailureCode);
+ }
+
+ /* Return the error code */
+ return ErrorCode;
}
/* EOF */
Modified: trunk/reactos/tools/kbdtool/output.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/output.c?rev=43959&r1=43958&r2=43959&view=diff
==============================================================================
--- trunk/reactos/tools/kbdtool/output.c [iso-8859-1] (original)
+++ trunk/reactos/tools/kbdtool/output.c [iso-8859-1] Wed Nov 4 23:07:29 2009
@@ -8,14 +8,98 @@
/* INCLUDES *******************************************************************/
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <host/typedefs.h>
+#include "kbdtool.h"
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
+BOOLEAN
+kbd_h(IN PLAYOUT Layout)
+{
+ /* FIXME: Stub */
+ return FALSE;
+}
+
+BOOLEAN
+kbd_rc(IN PKEYNAME DescriptionData,
+ IN PKEYNAME LanguageData)
+{
+ /* FIXME: Stub */
+ return FALSE;
+}
+
+BOOLEAN
+kbd_def(VOID)
+{
+ /* FIXME: Stub */
+ return FALSE;
+}
+
+BOOLEAN
+kbd_c(IN ULONG StateCount,
+ IN PULONG ShiftStates,
+ IN PVOID AttributeData,
+ IN PLAYOUT Layout,
+ IN PVOID DeadKeyData,
+ IN PVOID LigatureData,
+ IN PKEYNAME KeyNameData,
+ IN PKEYNAME KeyNameExtData,
+ IN PKEYNAME KeyNameDeadData)
+{
+ /* FIXME: Stub */
+ return FALSE;
+}
+
+ULONG
+DoOutput(IN ULONG StateCount,
+ IN PULONG ShiftStates,
+ IN PKEYNAME DescriptionData,
+ IN PKEYNAME LanguageData,
+ IN PVOID AttributeData,
+ IN PVOID DeadKeyData,
+ IN PVOID LigatureData,
+ IN PKEYNAME KeyNameData,
+ IN PKEYNAME KeyNameExtData,
+ IN PKEYNAME KeyNameDeadData)
+{
+ ULONG FailureCode = 0;
+
+ /* Check if this just a fallback driver*/
+ if (!FallbackDriver)
+ {
+ /* It's not, create header file */
+ if (!kbd_h(&g_Layout)) FailureCode = 1;
+
+ /* Create the resource file */
+ if (!kbd_rc(DescriptionData, LanguageData)) FailureCode = 2;
+ }
+
+ /* Create the C file */
+ if (!kbd_c(StateCount,
+ ShiftStates,
+ AttributeData,
+ &g_Layout,
+ DeadKeyData,
+ LigatureData,
+ KeyNameData,
+ KeyNameExtData,
+ KeyNameDeadData))
+ {
+ /* Failed in C file generation */
+ FailureCode = 3;
+ }
+
+ /* Check if this just a fallback driver*/
+ if (!FallbackDriver)
+ {
+ /* Generate the definition file */
+ if (!kbd_def()) FailureCode = 4;
+ }
+
+ /* Done */
+ return FailureCode;
+}
+
+
/* EOF */
Modified: trunk/reactos/tools/kbdtool/parser.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/parser.c?rev=43959&r1=43958&r2=43959&view=diff
==============================================================================
--- trunk/reactos/tools/kbdtool/parser.c [iso-8859-1] (original)
+++ trunk/reactos/tools/kbdtool/parser.c [iso-8859-1] Wed Nov 4 23:07:29 2009
@@ -8,61 +8,11 @@
/* INCLUDES *******************************************************************/
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <host/typedefs.h>
-
-typedef struct tagKEYNAME
-{
- ULONG Code;
- PCHAR Name;
- struct tagKEYNAME* Next;
-} KEYNAME, *PKEYNAME;
-
-typedef struct tagSCVK
-{
- USHORT ScanCode;
- USHORT VirtualKey;
- PCHAR Name;
- BOOLEAN Processed;
-} SCVK, *PSCVK;
-
-typedef struct tagVKNAME
-{
- ULONG VirtualKey;
- PCHAR Name;
-} VKNAME, *PVKNAME;
-
-typedef struct tagLAYOUTENTRY
-{
- USHORT ScanCode;
- UCHAR VirtualKey;
- UCHAR OriginalVirtualKey;
- ULONG Cap;
- ULONG StateCount;
- ULONG CharData[8];
- ULONG DeadCharData[8];
- ULONG OtherCharData[8];
- struct LAYOUTENTRY* CapData;
- PCHAR Name;
- ULONG Processed;
- ULONG LineCount;
-} LAYOUTENTRY, *PLAYOUTENTRY;
-
-typedef struct tagLAYOUT
-{
- LAYOUTENTRY Entry[110];
-} LAYOUT, *PLAYOUT;
+#include "kbdtool.h"
/* GLOBALS ********************************************************************/
-#define KEYWORD_COUNT 17
-
-extern BOOLEAN Verbose, UnicodeFile, SanityCheck;
-extern PCHAR gpszFileName;
-extern FILE* gfpInput;
+/* Internal parser data about everything that was parsed */
CHAR gBuf[256];
CHAR gKBDName[10];
CHAR gCopyright[256];
@@ -73,6 +23,8 @@
ULONG gKbdLayoutVersion;
LAYOUT g_Layout;
ULONG gLineCount;
+
+/* Table of keywords the parser recognizes */
PCHAR KeyWordList[KEYWORD_COUNT] =
{
"KBD",
@@ -93,168 +45,6 @@
"LANGUAGENAMES",
"ENDKBD",
};
-
-/* ISO 110-key Keyboard Scancode to Virtual Key Conversion Table */
-SCVK ScVk[] =
-{
- {0x02, '1', NULL, FALSE},
- {0x03, '2', NULL, FALSE},
- {0x04, '3', NULL, FALSE},
- {0x05, '4', NULL, FALSE},
- {0x06, '5', NULL, FALSE},
- {0x07, '6', NULL, FALSE},
- {0x08, '7', NULL, FALSE},
- {0x09, '8', NULL, FALSE},
- {0x0a, '9', NULL, FALSE},
- {0x0b, '0', NULL, FALSE},
- {0x0c, 0xbd, NULL, FALSE},
- {0x0d, 0xbb, NULL, FALSE},
- {0x10, 'Q', NULL, FALSE},
- {0x11, 'W', NULL, FALSE},
- {0x12, 'E', NULL, FALSE},
- {0x13, 'R', NULL, FALSE},
- {0x14, 'T', NULL, FALSE},
- {0x15, 'Y', NULL, FALSE},
- {0x16, 'U', NULL, FALSE},
- {0x17, 'I', NULL, FALSE},
- {0x18, 'O', NULL, FALSE},
- {0x19, 'P', NULL, FALSE},
- {0x1a, 0xdb, NULL, FALSE},
- {0x1b, 0xdd, NULL, FALSE},
- {0x1e, 'A', NULL, FALSE},
- {0x1f, 'S', NULL, FALSE},
- {0x20, 'D', NULL, FALSE},
- {0x21, 'F', NULL, FALSE},
- {0x22, 'G', NULL, FALSE},
- {0x23, 'H', NULL, FALSE},
- {0x24, 'J', NULL, FALSE},
- {0x25, 'K', NULL, FALSE},
- {0x26, 'L', NULL, FALSE},
- {0x27, 0xba, NULL, FALSE},
- {0x28, 0xde, NULL, FALSE},
- {0x29, 0xc0, NULL, FALSE},
- {0x2b, 0xdc, NULL, FALSE},
- {0x2c, 'Z', NULL, FALSE},
- {0x2d, 'X', NULL, FALSE},
- {0x2e, 'C', NULL, FALSE},
- {0x2f, 'V', NULL, FALSE},
- {0x30, 'B', NULL, FALSE},
- {0x31, 'N', NULL, FALSE},
- {0x32, 'M', NULL, FALSE},
- {0x33, 0xbc, NULL, FALSE},
- {0x34, 0xbe, NULL, FALSE},
- {0x35, 0xbf, NULL, FALSE},
- {0x53, 0x6e, NULL, FALSE},
- {0x56, 0xe2, NULL, FALSE},
- {0x73, 0xc1, NULL, FALSE},
- {0x7e, 0xc2, NULL, FALSE},
- {0xe010, 0xb1, "Speedracer: Previous Track", FALSE},
- {0xe019, 0xb0, "Speedracer: Next Track", FALSE},
- {0xe01d, 0xa3, "RControl", FALSE},
- {0xe020, 0xad, "Speedracer: Volume Mute", FALSE},
- {0xe021, 0xb7, "Speedracer: Launch App 2", FALSE},
- {0xe022, 0xb3, "Speedracer: Media Play/Pause", FALSE},
- {0xe024, 0xb2, "Speedracer: Media Stop", FALSE},
- {0xe02e, 0xae, "Speedracer: Volume Up", FALSE},
- {0xe030, 0xaf, "Speedracer: Volume Down", FALSE},
- {0xe032, 0xac, "Speedracer: Browser Home", FALSE},
- {0xe035, 0x6f, "Numpad Divide", FALSE},
- {0xe037, 0x2c, "Snapshot", FALSE},
- {0xe038, 0xa5, "RMenu", FALSE},
- {0xe047, 0x24, "Home", FALSE},
- {0xe048, 0x26, "Up", FALSE},
- {0xe049, 0x21, "Prior", FALSE},
- {0xe04b, 0x25, "Left", FALSE},
- {0xe04d, 0x27, "Right", FALSE},
- {0xe04f, 0x23, "End", FALSE},
- {0xe050, 0x28, "Down", FALSE},
- {0xe051, 0x22, "Next", FALSE},
- {0xe052, 0x2d, "Insert", FALSE},
- {0xe053, 0x2e, "Delete", FALSE},
- {0xe05b, 0x5b, "Left Win", FALSE},
- {0xe05c, 0x5c, "Right Win", FALSE},
- {0xe05d, 0x5d, "Application", FALSE},
- {0xe05e, 0xff, "Power", FALSE},
- {0xe05f, 0x5f, "Speedracer: Sleep", FALSE},
- {0xe060, 0xff, "BAD SCANCODE", FALSE},
- {0xe061, 0xff, "BAD SCANCODE", FALSE},
- {0xe065, 0xaa, "Speedracer: Browser Search", FALSE},
- {0xe066, 0xab, "Speedracer: Browser Favorites", FALSE},
- {0xe067, 0xa8, "Speedracer: Browser Refresh", FALSE},
- {0xe068, 0xa9, "Speedracer: Browser Stop", FALSE},
- {0xe069, 0xa7, "Speedracer: Browser Foward", FALSE},
- {0xe06a, 0xa6, "Speedracer: Browser Back", FALSE},
- {0xe06b, 0xb6, "Speedracer: Launch App 1", FALSE},
- {0xe06c, 0xb4, "Speedracer: Launch Mail", FALSE},
- {0xe06d, 0xb5, "Speedracer: Launch Media Selector", FALSE},
- {0x53, 0x6e, NULL, FALSE},
- {0x0e, 0x08, NULL, FALSE},
- {0x01, 0x1b, NULL, FALSE},
- {0xe01c, 0x0d, "Numpad Enter", FALSE},
- {0x1c, 0x0d, NULL, FALSE},
- {0x39, 0x20, NULL, FALSE},
- {0xe046, 0x03, "Break (Ctrl + Pause)", FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE},
- {0xFFFF, 0x00, NULL, FALSE}
-};
-
-VKNAME VKName[] =
-{
- {0x08, "BACK"},
- {0x03, "CANCEL"},
- {0x1b, "ESCAPE"},
- {0x0d, "RETURN"},
- {0x20, "SPACE"},
- {0x6e, "DECIMAL"},
- {0xba, "OEM_1"},
- {0xbb, "OEM_PLUS"},
- {0xbc, "OEM_COMMA"},
- {0xbd, "OEM_MINUS"},
- {0xbe, "OEM_PERIOD"},
- {0xbf, "OEM_2"},
- {0xc0, "OEM_3"},
- {0xdb, "OEM_4"},
- {0xdc, "OEM_5"},
- {0xdd, "OEM_6"},
- {0xde, "OEM_7"},
- {0xdf, "OEM_8"},
- {0xe2, "OEM_102"},
- {0xc1, "ABNT_C1"},
- {0xc2, "ABNT_C2"},
- {0x10, "SHIFT"},
- {0xa0, "LSHIFT"},
- {0xa1, "RSHIFT"},
- {0x12, "MENU"},
- {0xa4, "LMENU"},
- {0xa5, "RMENU"},
- {0x11, "CONTROL"},
- {0xa2, "LCONTROL"},
- {0xa3, "RCONTROL"},
- {0x6c, "SEPARATOR"},
- {0xe4, "ICO_00"},
- {0x2e, "DELETE"},
- {0x2d, "INSERT"},
- {0xe5, "GROUPSHIFT"},
- {0xe6, "RGROUPSHIFT"}
-};
-
-#define CHAR_NORMAL_KEY 0
-#define CHAR_DEAD_KEY 1
-#define CHAR_OTHER_KEY 2
-#define CHAR_INVALID_KEY 3
-#define CHAR_LIGATURE_KEY 4
/* FUNCTIONS ******************************************************************/
@@ -1081,10 +871,10 @@
}
/* Skip what's left */
- return SkipLines();
-}
-
-VOID
+ return KeyWord;
+}
+
+ULONG
DoParsing(VOID)
{
ULONG KeyWords[KEYWORD_COUNT];
@@ -1119,8 +909,7 @@
printf("The '%s' keyword appeared multiple times.\n",
KeyWordList[KeyWord]);
}
-
-
+
/* Now parse this keyword */
switch (KeyWord)
{
@@ -1257,6 +1046,21 @@
default:
break;
}
- }
+ }
+
+ /* We are done */
+ fclose(gfpInput);
+
+ /* Now enter the output phase */
+ return DoOutput(StateCount,
+ ShiftStates,
+ DescriptionData,
+ LanguageData,
+ AttributeData,
+ DeadKeyData,
+ LigatureData,
+ KeyNameData,
+ KeyNameExtData,
+ KeyNameDeadData);
}
/* EOF */
- Previous message: [ros-diffs] [sginsberg] 43958: - Finish the work around for the Pentium cmpxchg8b lock errata: We detected the errata and allocated the 7 first IDT entries on a write protected page, but the final piece of the work around, detecting the write fault ti the Invalid Opcode handler, was missing. Implemented this in the page fault handler to detect and dispatch the write fault to the Invalid Opcode handler. - Fix the "fix" of un-protecting the 7 IDT entries on P5 in HAL's BIOS call code when setting the custom Invalid Opcode handler. The IDT was unprotected but the write protection wasn't reapplied after the BIOS call, breaking the work around. Other: - KdDebuggerEnabled is a BOOLEAN, so don't do a dword compare in KeUpdateSystemTime. - Use better comment for the hack where we always allow page faults to be handled, even if they the fault occured with interrupts disabled.
- Next message: [ros-diffs] [sginsberg] 43960: - Implement support for reading and writing physical memory for KD. The implementation uses a reserved mapping page to map the target physical address to. On x86 this page is located at virtual address 0xFFBFF000, and the PTE for this page is the last PTE of the nonpaged pool's PDE. Other architectures may need to reserve the PTE elsewhere. - The physical memory support relies on several Mm variables and structures to be properly set up. Add a new flag, MiDbgReadyForPhysical, and set it when the debugger support can handle physical memory requests. - Protect this page with a Memory Area to make the old Mm keep its dirty hands off it. - Does not support I/O space or cache flags yet. - Add generic KeInvalidateTlbEntry to invalidate a single TLB entry for a given address instead of flushing the whole TLB. Used by the debugger physical memory support as invalidating the whole TLB for every map and unmap of its debug PTE would incur significant overhead for large copies. Replace direct usage of __invlpg() with this in x86 code too. - Fix incorrect cache flag check and set in KdpRead/WritePhysicalmemory for write combined requests. The debugger's Uncached flag was checked instead of the Write Combined flag, and the debuggers Write Combine number (0x3) was set instead of Mm's flag (0x20). - Fix implementation of MmIsAddressValid (at least for x86; other architectures will need more checks). Just check the Address' PDE and PTE valid bits instead of using Memory Areas. - Add missing ASSERTs to ensure the Memory Areas for paged pool, the PCR page, and the Shared User Data page are created. - Add missing Memory Area for the 2 pages HAL currently uses for its own mappings on x86 -- previously, those pages could have been allocated by other parts of the OS, which would have resulted in serious corruptions.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Ros-diffs
mailing list