mirror of
https://github.com/reactos/reactos.git
synced 2024-09-04 09:39:07 +00:00
- Change kdcom.sys to kdcom.dll.
- Remove all kdcom exports and files from HAL and link with kdcom.dll instead. - Add support in freeldr for loading kdcom.dll (and theoretically any other import, such as the Code Integrity DLL for kernel-mode signing, but for now I've only tested this one). - Refactor some of the HAL loading code to make it generic for any image. - Load HAL manually when loading kernel, before processing imports, to make sure that HAL is index 1 in the loader modules and loads before KDCOM. - Fix some build problems. svn path=/trunk/; revision=24780
This commit is contained in:
parent
4c45bdc2ea
commit
62f904960f
|
@ -235,7 +235,7 @@ dll\win32\wsock32\wsock32.dll 1
|
||||||
|
|
||||||
|
|
||||||
; Drivers
|
; Drivers
|
||||||
drivers\base\bootvid\kdcom.sys 2
|
drivers\base\bootvid\kdcom.dll 2
|
||||||
drivers\base\beep\beep.sys 2
|
drivers\base\beep\beep.sys 2
|
||||||
drivers\base\bootvid\bootvid.sys 2
|
drivers\base\bootvid\bootvid.sys 2
|
||||||
drivers\base\null\null.sys 2
|
drivers\base\null\null.sys 2
|
||||||
|
|
|
@ -22,7 +22,7 @@ c_1252.nls = 2
|
||||||
cdfs.sys = 3
|
cdfs.sys = 3
|
||||||
cdrom.sys = 3
|
cdrom.sys = 3
|
||||||
class2.sys = 3
|
class2.sys = 3
|
||||||
kdcom.sys = 3
|
kdcom.dll = 3
|
||||||
disk.sys = 3
|
disk.sys = 3
|
||||||
floppy.sys = 3
|
floppy.sys = 3
|
||||||
;keyboard.sys = 3
|
;keyboard.sys = 3
|
||||||
|
|
|
@ -132,14 +132,10 @@ extern ULONG_PTR pagedirtable_pae;
|
||||||
extern PAGE_DIRECTORY_X64 apic_pagetable_pae;
|
extern PAGE_DIRECTORY_X64 apic_pagetable_pae;
|
||||||
extern PAGE_DIRECTORY_X64 kpcr_pagetable_pae;
|
extern PAGE_DIRECTORY_X64 kpcr_pagetable_pae;
|
||||||
|
|
||||||
extern CHAR szHalName[1024];
|
BOOLEAN
|
||||||
|
|
||||||
PIMAGE_BASE_RELOCATION
|
|
||||||
NTAPI
|
NTAPI
|
||||||
LdrProcessRelocationBlockLongLong(IN ULONG_PTR Address,
|
FrLdrLoadImage(IN PCHAR szFileName,
|
||||||
IN ULONG Count,
|
IN INT nPos);
|
||||||
IN PUSHORT TypeOffset,
|
|
||||||
IN LONGLONG Delta);
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
@ -733,9 +729,9 @@ FrLdrLoadHal(PCHAR szFileName, INT nPos);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
LdrPEGetOrLoadModule(PCHAR ModuleName,
|
LdrPEGetOrLoadModule(IN PCHAR ModuleName,
|
||||||
PCHAR ImportedName,
|
IN PCHAR ImportedName,
|
||||||
PLOADER_MODULE* ImportedModule)
|
IN PLOADER_MODULE* ImportedModule)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -747,10 +743,11 @@ LdrPEGetOrLoadModule(PCHAR ModuleName,
|
||||||
* Later, FrLdrLoadDriver should be made to share the same
|
* Later, FrLdrLoadDriver should be made to share the same
|
||||||
* code, and we'll just call it instead.
|
* code, and we'll just call it instead.
|
||||||
*/
|
*/
|
||||||
if (!_stricmp(ImportedName, "hal.dll"))
|
if (!_stricmp(ImportedName, "hal.dll") ||
|
||||||
|
!_stricmp(ImportedName, "kdcom.dll"))
|
||||||
{
|
{
|
||||||
/* Load the HAL */
|
/* Load the HAL */
|
||||||
FrLdrLoadHal(szHalName, 10);
|
FrLdrLoadImage(ImportedName, 10);
|
||||||
|
|
||||||
/* Return the new module */
|
/* Return the new module */
|
||||||
*ImportedModule = LdrGetModuleObject(ImportedName);
|
*ImportedModule = LdrGetModuleObject(ImportedName);
|
||||||
|
@ -809,7 +806,7 @@ LdrPEFixupImports(IN PVOID DllBase,
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
FrLdrMapImage(IN PIMAGE_NT_HEADERS NtHeader,
|
FrLdrReMapImage(IN PIMAGE_NT_HEADERS NtHeader,
|
||||||
IN PVOID Base)
|
IN PVOID Base)
|
||||||
{
|
{
|
||||||
PIMAGE_SECTION_HEADER Section;
|
PIMAGE_SECTION_HEADER Section;
|
||||||
|
@ -900,7 +897,7 @@ FrLdrMapKernel(FILE *KernelImage)
|
||||||
FsReadFile(KernelImage, ImageSize, NULL, LoadBase);
|
FsReadFile(KernelImage, ImageSize, NULL, LoadBase);
|
||||||
|
|
||||||
/* Map it */
|
/* Map it */
|
||||||
FrLdrMapImage(NtHeader, LoadBase);
|
FrLdrReMapImage(NtHeader, LoadBase);
|
||||||
|
|
||||||
/* Calculate Difference between Real Base and Compiled Base*/
|
/* Calculate Difference between Real Base and Compiled Base*/
|
||||||
LdrRelocateImageWithBias(LoadBase,
|
LdrRelocateImageWithBias(LoadBase,
|
||||||
|
@ -920,6 +917,9 @@ FrLdrMapKernel(FILE *KernelImage)
|
||||||
/* Increase the next Load Base */
|
/* Increase the next Load Base */
|
||||||
NextModuleBase = ROUND_UP(LoadBase + ImageSize, PAGE_SIZE);
|
NextModuleBase = ROUND_UP(LoadBase + ImageSize, PAGE_SIZE);
|
||||||
|
|
||||||
|
/* Load the HAL now (name will be changed internally if needed) */
|
||||||
|
FrLdrLoadImage("hal.dll", 10);
|
||||||
|
|
||||||
/* Perform import fixups */
|
/* Perform import fixups */
|
||||||
LdrPEFixupImports(LoadBase, "ntoskrnl.exe");
|
LdrPEFixupImports(LoadBase, "ntoskrnl.exe");
|
||||||
|
|
||||||
|
@ -929,11 +929,13 @@ FrLdrMapKernel(FILE *KernelImage)
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
FrLdrMapHal(FILE *HalImage)
|
FrLdrMapImage(IN FILE *HalImage,
|
||||||
|
IN PCHAR Name)
|
||||||
{
|
{
|
||||||
PIMAGE_NT_HEADERS NtHeader;
|
PIMAGE_NT_HEADERS NtHeader;
|
||||||
PVOID ImageBase, LoadBase;
|
PVOID ImageBase, LoadBase;
|
||||||
ULONG ImageSize;
|
ULONG ImageSize;
|
||||||
|
ULONG ImageId = LoaderBlock.ModsCount;
|
||||||
|
|
||||||
/* Set the virtual (image) and physical (load) addresses */
|
/* Set the virtual (image) and physical (load) addresses */
|
||||||
LoadBase = (PVOID)NextModuleBase;
|
LoadBase = (PVOID)NextModuleBase;
|
||||||
|
@ -955,7 +957,7 @@ FrLdrMapHal(FILE *HalImage)
|
||||||
FsReadFile(HalImage, ImageSize, NULL, LoadBase);
|
FsReadFile(HalImage, ImageSize, NULL, LoadBase);
|
||||||
|
|
||||||
/* Map it into virtual memory */
|
/* Map it into virtual memory */
|
||||||
FrLdrMapImage(NtHeader, LoadBase);
|
FrLdrReMapImage(NtHeader, LoadBase);
|
||||||
|
|
||||||
/* Calculate Difference between Real Base and Compiled Base*/
|
/* Calculate Difference between Real Base and Compiled Base*/
|
||||||
LdrRelocateImageWithBias(LoadBase,
|
LdrRelocateImageWithBias(LoadBase,
|
||||||
|
@ -966,18 +968,19 @@ FrLdrMapHal(FILE *HalImage)
|
||||||
STATUS_UNSUCCESSFUL);
|
STATUS_UNSUCCESSFUL);
|
||||||
|
|
||||||
/* Fill out Module Data Structure */
|
/* Fill out Module Data Structure */
|
||||||
reactos_modules[1].ModStart = (ULONG_PTR)ImageBase;
|
reactos_modules[ImageId].ModStart = (ULONG_PTR)ImageBase;
|
||||||
reactos_modules[1].ModEnd = (ULONG_PTR)ImageBase + ImageSize;
|
reactos_modules[ImageId].ModEnd = (ULONG_PTR)ImageBase + ImageSize;
|
||||||
strcpy(reactos_module_strings[1], "hal.dll");
|
strcpy(reactos_module_strings[ImageId], Name);
|
||||||
reactos_modules[1].String = (ULONG_PTR)reactos_module_strings[1];
|
reactos_modules[ImageId].String = (ULONG_PTR)reactos_module_strings[ImageId];
|
||||||
LoaderBlock.ModsCount++;
|
LoaderBlock.ModsCount++;
|
||||||
|
|
||||||
/* Perform import fixups */
|
|
||||||
LdrPEFixupImports(LoadBase, "hal.dll");
|
|
||||||
|
|
||||||
/* Increase the next Load Base */
|
/* Increase the next Load Base */
|
||||||
NextModuleBase = ROUND_UP(NextModuleBase + ImageSize, PAGE_SIZE);
|
NextModuleBase = ROUND_UP(NextModuleBase + ImageSize, PAGE_SIZE);
|
||||||
|
|
||||||
|
/* Perform import fixups */
|
||||||
|
//DbgPrint("Fixing up: %s loaded at: %p\n", Name, ImageBase);
|
||||||
|
LdrPEFixupImports(LoadBase, Name);
|
||||||
|
|
||||||
/* Return Success */
|
/* Return Success */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,8 @@ memory_map_t reactos_memory_map[32]; // Memory map
|
||||||
ARC_DISK_SIGNATURE reactos_arc_disk_info[32]; // ARC Disk Information
|
ARC_DISK_SIGNATURE reactos_arc_disk_info[32]; // ARC Disk Information
|
||||||
char reactos_arc_strings[32][256];
|
char reactos_arc_strings[32][256];
|
||||||
unsigned long reactos_disk_count = 0;
|
unsigned long reactos_disk_count = 0;
|
||||||
CHAR szHalName[1024];
|
CHAR szHalName[255];
|
||||||
|
CHAR szBootPath[255];
|
||||||
static CHAR szLoadingMsg[] = "Loading ReactOS...";
|
static CHAR szLoadingMsg[] = "Loading ReactOS...";
|
||||||
|
|
||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
|
@ -86,41 +87,56 @@ FrLdrLoadKernel(PCHAR szFileName,
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
FrLdrMapHal(FILE *KernelImage);
|
FrLdrMapImage(
|
||||||
|
IN FILE *Image,
|
||||||
|
IN PCHAR ShortName
|
||||||
|
);
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
FrLdrLoadHal(PCHAR szFileName,
|
FrLdrLoadImage(IN PCHAR szFileName,
|
||||||
INT nPos)
|
IN INT nPos)
|
||||||
{
|
{
|
||||||
PFILE FilePointer;
|
PFILE FilePointer;
|
||||||
PCHAR szShortName;
|
PCHAR szShortName;
|
||||||
CHAR szBuffer[256];
|
CHAR szBuffer[256], szFullPath[256];
|
||||||
|
|
||||||
/* Extract Kernel filename without path */
|
/* Check if this the HAL being loaded */
|
||||||
|
if (!_stricmp(szFileName, "hal.dll"))
|
||||||
|
{
|
||||||
|
/* Use the boot.ini name instead */
|
||||||
|
szFileName = szHalName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Extract filename without path */
|
||||||
szShortName = strrchr(szFileName, '\\');
|
szShortName = strrchr(szFileName, '\\');
|
||||||
if (szShortName == NULL) {
|
if (!szShortName)
|
||||||
|
{
|
||||||
/* No path, leave it alone */
|
/* No path, leave it alone */
|
||||||
szShortName = szFileName;
|
szShortName = szFileName;
|
||||||
|
|
||||||
} else {
|
/* Which means we need to build a path now */
|
||||||
|
strcpy(szBuffer, szFileName);
|
||||||
|
strcpy(szFullPath, szBootPath);
|
||||||
|
strcat(szFullPath, "SYSTEM32\\DRIVERS\\");
|
||||||
|
strcat(szFullPath, szBuffer);
|
||||||
|
szFileName = szFullPath;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* Skip the path */
|
/* Skip the path */
|
||||||
szShortName = szShortName + 1;
|
szShortName = szShortName + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the Kernel */
|
/* Open the image */
|
||||||
FilePointer = FsOpenFile(szFileName);
|
FilePointer = FsOpenFile(szFileName);
|
||||||
|
if (!FilePointer)
|
||||||
/* Make sure it worked */
|
{
|
||||||
if (FilePointer == NULL) {
|
|
||||||
|
|
||||||
/* Return failure on the short name */
|
/* Return failure on the short name */
|
||||||
strcpy(szBuffer, szShortName);
|
strcpy(szBuffer, szShortName);
|
||||||
strcat(szBuffer, " not found.");
|
strcat(szBuffer, " not found.");
|
||||||
UiMessageBox(szBuffer);
|
UiMessageBox(szBuffer);
|
||||||
return(FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the status bar with the current file */
|
/* Update the status bar with the current file */
|
||||||
|
@ -129,11 +145,11 @@ FrLdrLoadHal(PCHAR szFileName,
|
||||||
UiDrawStatusText(szBuffer);
|
UiDrawStatusText(szBuffer);
|
||||||
|
|
||||||
/* Do the actual loading */
|
/* Do the actual loading */
|
||||||
FrLdrMapHal(FilePointer);
|
FrLdrMapImage(FilePointer, szShortName);
|
||||||
|
|
||||||
/* Update Processbar and return success */
|
/* Update Processbar and return success */
|
||||||
UiDrawProgressBarCenter(nPos, 100, szLoadingMsg);
|
UiDrawProgressBarCenter(nPos, 100, szLoadingMsg);
|
||||||
return(TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
|
@ -618,12 +634,11 @@ VOID
|
||||||
LoadAndBootReactOS(PCSTR OperatingSystemName)
|
LoadAndBootReactOS(PCSTR OperatingSystemName)
|
||||||
{
|
{
|
||||||
PFILE FilePointer;
|
PFILE FilePointer;
|
||||||
CHAR name[1024];
|
CHAR name[255];
|
||||||
CHAR value[1024];
|
CHAR value[255];
|
||||||
CHAR SystemPath[1024];
|
CHAR SystemPath[255];
|
||||||
CHAR szKernelName[1024];
|
CHAR szKernelName[255];
|
||||||
CHAR szFileName[1024];
|
CHAR szFileName[255];
|
||||||
CHAR szBootPath[256];
|
|
||||||
UINT i;
|
UINT i;
|
||||||
CHAR MsgBuffer[256];
|
CHAR MsgBuffer[256];
|
||||||
ULONG SectionId;
|
ULONG SectionId;
|
||||||
|
@ -657,10 +672,10 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
|
||||||
LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
|
LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
|
||||||
LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
|
LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
|
||||||
LoaderBlock.BootDevice = 0xffffffff;
|
LoaderBlock.BootDevice = 0xffffffff;
|
||||||
LoaderBlock.CommandLine = (unsigned long)reactos_kernel_cmdline;
|
LoaderBlock.CommandLine = reactos_kernel_cmdline;
|
||||||
LoaderBlock.ModsCount = 0;
|
LoaderBlock.ModsCount = 0;
|
||||||
LoaderBlock.ModsAddr = (unsigned long)reactos_modules;
|
LoaderBlock.ModsAddr = reactos_modules;
|
||||||
LoaderBlock.DrivesAddr = (unsigned long)reactos_arc_disk_info;
|
LoaderBlock.DrivesAddr = reactos_arc_disk_info;
|
||||||
LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)(PVOID)&reactos_memory_map, 32) * sizeof(memory_map_t);
|
LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)(PVOID)&reactos_memory_map, 32) * sizeof(memory_map_t);
|
||||||
if (LoaderBlock.MmapLength)
|
if (LoaderBlock.MmapLength)
|
||||||
{
|
{
|
||||||
|
|
|
@ -314,9 +314,9 @@ VOID RunLoader(VOID)
|
||||||
LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
|
LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
|
||||||
LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
|
LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
|
||||||
LoaderBlock.BootDevice = 0xffffffff;
|
LoaderBlock.BootDevice = 0xffffffff;
|
||||||
LoaderBlock.CommandLine = (unsigned long)reactos_kernel_cmdline;
|
LoaderBlock.CommandLine = reactos_kernel_cmdline;
|
||||||
LoaderBlock.ModsCount = 0;
|
LoaderBlock.ModsCount = 0;
|
||||||
LoaderBlock.ModsAddr = (unsigned long)reactos_modules;
|
LoaderBlock.ModsAddr = reactos_modules;
|
||||||
LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)(PVOID)&reactos_memory_map, 32) * sizeof(memory_map_t);
|
LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)(PVOID)&reactos_memory_map, 32) * sizeof(memory_map_t);
|
||||||
if (LoaderBlock.MmapLength)
|
if (LoaderBlock.MmapLength)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
LIBRARY kdcom.sys
|
LIBRARY kdcom.dll
|
||||||
EXPORTS
|
EXPORTS
|
||||||
|
|
||||||
KdComPortInUse=_KdComPortInUse
|
KdComPortInUse=_KdComPortInUse
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<module name="kdcom" type="kernelmodedll" entrypoint="DriverEntry@8" installbase="system32/drivers" installname="kdcom.sys">
|
<module name="kdcom" type="kernelmodedll" entrypoint="DriverEntry@8" installbase="system32/drivers" installname="kdcom.dll">
|
||||||
<importlibrary definition="kdcom.def"></importlibrary>
|
<importlibrary definition="kdcom.def"></importlibrary>
|
||||||
<bootstrap base="reactos" nameoncd="kdcom.sys" />
|
<bootstrap base="reactos" nameoncd="kdcom.dll" />
|
||||||
<include base="kdcom">.</include>
|
<include base="kdcom">.</include>
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<library>ntoskrnl</library>
|
<library>ntoskrnl</library>
|
||||||
|
|
|
@ -72,21 +72,6 @@ IoMapTransfer@24
|
||||||
IoReadPartitionTable@16=HalpReadPartitionTable@16
|
IoReadPartitionTable@16=HalpReadPartitionTable@16
|
||||||
IoSetPartitionInformation@16=HalpSetPartitionInformation@16
|
IoSetPartitionInformation@16=HalpSetPartitionInformation@16
|
||||||
IoWritePartitionTable@20=HalpWritePartitionTable@20
|
IoWritePartitionTable@20=HalpWritePartitionTable@20
|
||||||
KdComPortInUse=_KdComPortInUse
|
|
||||||
; FIXME: DEPRECATED
|
|
||||||
KdPortGetByte@4
|
|
||||||
KdPortGetByteEx@8
|
|
||||||
KdPortInitialize@12
|
|
||||||
KdPortInitializeEx@12
|
|
||||||
KdPortPollByte@4
|
|
||||||
KdPortPollByteEx@8
|
|
||||||
KdPortPutByte@4
|
|
||||||
KdPortPutByteEx@8
|
|
||||||
KdPortRestore@0
|
|
||||||
KdPortSave@0
|
|
||||||
KdPortDisableInterrupts@0
|
|
||||||
KdPortEnableInterrupts@0
|
|
||||||
; FIXME: END DEPRECATED BLOCK
|
|
||||||
KeAcquireSpinLock@8
|
KeAcquireSpinLock@8
|
||||||
KeFlushWriteBuffer@0
|
KeFlushWriteBuffer@0
|
||||||
KeGetCurrentIrql@0
|
KeGetCurrentIrql@0
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
<file>drive.c</file>
|
<file>drive.c</file>
|
||||||
<file>halinit.c</file>
|
<file>halinit.c</file>
|
||||||
<file>isa.c</file>
|
<file>isa.c</file>
|
||||||
<file>kdbg.c</file>
|
|
||||||
<file>mca.c</file>
|
<file>mca.c</file>
|
||||||
<file>misc.c</file>
|
<file>misc.c</file>
|
||||||
<file>pci.c</file>
|
<file>pci.c</file>
|
||||||
|
|
|
@ -1,547 +0,0 @@
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS kernel
|
|
||||||
* FILE: ntoskrnl/hal/x86/kdbg.c
|
|
||||||
* PURPOSE: Serial i/o functions for the kernel debugger.
|
|
||||||
* PROGRAMMER: Emanuele Aliberti
|
|
||||||
* Eric Kohl
|
|
||||||
* UPDATE HISTORY:
|
|
||||||
* Created 05/09/99
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
|
||||||
|
|
||||||
#include <hal.h>
|
|
||||||
#define NDEBUG
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULT_BAUD_RATE 19200
|
|
||||||
|
|
||||||
|
|
||||||
/* MACROS *******************************************************************/
|
|
||||||
|
|
||||||
#define SER_RBR(x) ((x)+0)
|
|
||||||
#define SER_THR(x) ((x)+0)
|
|
||||||
#define SER_DLL(x) ((x)+0)
|
|
||||||
#define SER_IER(x) ((x)+1)
|
|
||||||
#define SR_IER_ERDA 0x01
|
|
||||||
#define SR_IER_ETHRE 0x02
|
|
||||||
#define SR_IER_ERLSI 0x04
|
|
||||||
#define SR_IER_EMS 0x08
|
|
||||||
#define SR_IER_ALL 0x0F
|
|
||||||
#define SER_DLM(x) ((x)+1)
|
|
||||||
#define SER_IIR(x) ((x)+2)
|
|
||||||
#define SER_FCR(x) ((x)+2)
|
|
||||||
#define SR_FCR_ENABLE_FIFO 0x01
|
|
||||||
#define SR_FCR_CLEAR_RCVR 0x02
|
|
||||||
#define SR_FCR_CLEAR_XMIT 0x04
|
|
||||||
#define SER_LCR(x) ((x)+3)
|
|
||||||
#define SR_LCR_CS5 0x00
|
|
||||||
#define SR_LCR_CS6 0x01
|
|
||||||
#define SR_LCR_CS7 0x02
|
|
||||||
#define SR_LCR_CS8 0x03
|
|
||||||
#define SR_LCR_ST1 0x00
|
|
||||||
#define SR_LCR_ST2 0x04
|
|
||||||
#define SR_LCR_PNO 0x00
|
|
||||||
#define SR_LCR_POD 0x08
|
|
||||||
#define SR_LCR_PEV 0x18
|
|
||||||
#define SR_LCR_PMK 0x28
|
|
||||||
#define SR_LCR_PSP 0x38
|
|
||||||
#define SR_LCR_BRK 0x40
|
|
||||||
#define SR_LCR_DLAB 0x80
|
|
||||||
#define SER_MCR(x) ((x)+4)
|
|
||||||
#define SR_MCR_DTR 0x01
|
|
||||||
#define SR_MCR_RTS 0x02
|
|
||||||
#define SR_MCR_OUT1 0x04
|
|
||||||
#define SR_MCR_OUT2 0x08
|
|
||||||
#define SR_MCR_LOOP 0x10
|
|
||||||
#define SER_LSR(x) ((x)+5)
|
|
||||||
#define SR_LSR_DR 0x01
|
|
||||||
#define SR_LSR_TBE 0x20
|
|
||||||
#define SER_MSR(x) ((x)+6)
|
|
||||||
#define SR_MSR_CTS 0x10
|
|
||||||
#define SR_MSR_DSR 0x20
|
|
||||||
#define SER_SCR(x) ((x)+7)
|
|
||||||
|
|
||||||
|
|
||||||
/* GLOBAL VARIABLES *********************************************************/
|
|
||||||
|
|
||||||
ULONG KdComPortInUse = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/* STATIC VARIABLES *********************************************************/
|
|
||||||
|
|
||||||
static ULONG ComPort = 0;
|
|
||||||
static ULONG BaudRate = 0;
|
|
||||||
static PUCHAR PortBase = (PUCHAR)0;
|
|
||||||
|
|
||||||
/* The com port must only be initialized once! */
|
|
||||||
static BOOLEAN PortInitialized = FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
/* STATIC FUNCTIONS *********************************************************/
|
|
||||||
|
|
||||||
static BOOLEAN
|
|
||||||
KdpDoesComPortExist (PUCHAR BaseAddress)
|
|
||||||
{
|
|
||||||
BOOLEAN found;
|
|
||||||
UCHAR mcr;
|
|
||||||
UCHAR msr;
|
|
||||||
|
|
||||||
found = FALSE;
|
|
||||||
|
|
||||||
/* save Modem Control Register (MCR) */
|
|
||||||
mcr = READ_PORT_UCHAR (SER_MCR(BaseAddress));
|
|
||||||
|
|
||||||
/* enable loop mode (set Bit 4 of the MCR) */
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR(BaseAddress), 0x10);
|
|
||||||
|
|
||||||
/* clear all modem output bits */
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR(BaseAddress), 0x10);
|
|
||||||
|
|
||||||
/* read the Modem Status Register */
|
|
||||||
msr = READ_PORT_UCHAR (SER_MSR(BaseAddress));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* the upper nibble of the MSR (modem output bits) must be
|
|
||||||
* equal to the lower nibble of the MCR (modem input bits)
|
|
||||||
*/
|
|
||||||
if ((msr & 0xF0) == 0x00)
|
|
||||||
{
|
|
||||||
/* set all modem output bits */
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR(BaseAddress), 0x1F);
|
|
||||||
|
|
||||||
/* read the Modem Status Register */
|
|
||||||
msr = READ_PORT_UCHAR (SER_MSR(BaseAddress));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* the upper nibble of the MSR (modem output bits) must be
|
|
||||||
* equal to the lower nibble of the MCR (modem input bits)
|
|
||||||
*/
|
|
||||||
if ((msr & 0xF0) == 0xF0)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* setup a resonable state for the port:
|
|
||||||
* enable fifo and clear recieve/transmit buffers
|
|
||||||
*/
|
|
||||||
WRITE_PORT_UCHAR (SER_FCR(BaseAddress),
|
|
||||||
(SR_FCR_ENABLE_FIFO | SR_FCR_CLEAR_RCVR | SR_FCR_CLEAR_XMIT));
|
|
||||||
WRITE_PORT_UCHAR (SER_FCR(BaseAddress), 0);
|
|
||||||
READ_PORT_UCHAR (SER_RBR(BaseAddress));
|
|
||||||
WRITE_PORT_UCHAR (SER_IER(BaseAddress), 0);
|
|
||||||
found = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* restore MCR */
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR(BaseAddress), mcr);
|
|
||||||
|
|
||||||
return (found);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
|
||||||
|
|
||||||
/* HAL.KdPortInitialize */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortInitialize (
|
|
||||||
PKD_PORT_INFORMATION PortInformation,
|
|
||||||
ULONG Unknown1,
|
|
||||||
ULONG Unknown2
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8};
|
|
||||||
char buffer[80];
|
|
||||||
ULONG divisor;
|
|
||||||
UCHAR lcr;
|
|
||||||
|
|
||||||
if (PortInitialized == FALSE)
|
|
||||||
{
|
|
||||||
if (PortInformation->BaudRate != 0)
|
|
||||||
{
|
|
||||||
BaudRate = PortInformation->BaudRate;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BaudRate = DEFAULT_BAUD_RATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PortInformation->ComPort == 0)
|
|
||||||
{
|
|
||||||
if (KdpDoesComPortExist ((PUCHAR)BaseArray[2]))
|
|
||||||
{
|
|
||||||
PortBase = (PUCHAR)BaseArray[2];
|
|
||||||
ComPort = 2;
|
|
||||||
PortInformation->BaseAddress = (ULONG)PortBase;
|
|
||||||
PortInformation->ComPort = ComPort;
|
|
||||||
#ifndef NDEBUG
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nSerial port COM%ld found at 0x%lx\n",
|
|
||||||
ComPort,
|
|
||||||
(ULONG)PortBase);
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
#endif /* NDEBUG */
|
|
||||||
}
|
|
||||||
else if (KdpDoesComPortExist ((PUCHAR)BaseArray[1]))
|
|
||||||
{
|
|
||||||
PortBase = (PUCHAR)BaseArray[1];
|
|
||||||
ComPort = 1;
|
|
||||||
PortInformation->BaseAddress = (ULONG)PortBase;
|
|
||||||
PortInformation->ComPort = ComPort;
|
|
||||||
#ifndef NDEBUG
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nSerial port COM%ld found at 0x%lx\n",
|
|
||||||
ComPort,
|
|
||||||
(ULONG)PortBase);
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
#endif /* NDEBUG */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nKernel Debugger: No COM port found!!!\n\n");
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (KdpDoesComPortExist ((PUCHAR)BaseArray[PortInformation->ComPort]))
|
|
||||||
{
|
|
||||||
PortBase = (PUCHAR)BaseArray[PortInformation->ComPort];
|
|
||||||
ComPort = PortInformation->ComPort;
|
|
||||||
PortInformation->BaseAddress = (ULONG)PortBase;
|
|
||||||
#ifndef NDEBUG
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nSerial port COM%ld found at 0x%lx\n",
|
|
||||||
ComPort,
|
|
||||||
(ULONG)PortBase);
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
#endif /* NDEBUG */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nKernel Debugger: No serial port found!!!\n\n");
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PortInitialized = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* set baud rate and data format (8N1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* turn on DTR and RTS */
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR(PortBase), SR_MCR_DTR | SR_MCR_RTS);
|
|
||||||
|
|
||||||
/* set DLAB */
|
|
||||||
lcr = READ_PORT_UCHAR (SER_LCR(PortBase)) | SR_LCR_DLAB;
|
|
||||||
WRITE_PORT_UCHAR (SER_LCR(PortBase), lcr);
|
|
||||||
|
|
||||||
/* set baud rate */
|
|
||||||
divisor = 115200 / BaudRate;
|
|
||||||
WRITE_PORT_UCHAR (SER_DLL(PortBase), (UCHAR)(divisor & 0xff));
|
|
||||||
WRITE_PORT_UCHAR (SER_DLM(PortBase), (UCHAR)((divisor >> 8) & 0xff));
|
|
||||||
|
|
||||||
/* reset DLAB and set 8N1 format */
|
|
||||||
WRITE_PORT_UCHAR (SER_LCR(PortBase),
|
|
||||||
SR_LCR_CS8 | SR_LCR_ST1 | SR_LCR_PNO);
|
|
||||||
|
|
||||||
/* read junk out of the RBR */
|
|
||||||
lcr = READ_PORT_UCHAR (SER_RBR(PortBase));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* set global info
|
|
||||||
*/
|
|
||||||
KdComPortInUse = (ULONG)PortBase;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* print message to blue screen
|
|
||||||
*/
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nKernel Debugger: COM%ld (Port 0x%lx) BaudRate %ld\n\n",
|
|
||||||
ComPort,
|
|
||||||
(ULONG)PortBase,
|
|
||||||
BaudRate);
|
|
||||||
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortInitializeEx */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortInitializeEx (
|
|
||||||
PKD_PORT_INFORMATION PortInformation,
|
|
||||||
ULONG Unknown1,
|
|
||||||
ULONG Unknown2
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8};
|
|
||||||
PUCHAR ComPortBase;
|
|
||||||
char buffer[80];
|
|
||||||
ULONG divisor;
|
|
||||||
UCHAR lcr;
|
|
||||||
|
|
||||||
if (PortInformation->BaudRate == 0)
|
|
||||||
{
|
|
||||||
PortInformation->BaudRate = DEFAULT_BAUD_RATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PortInformation->ComPort == 0)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (KdpDoesComPortExist ((PUCHAR)BaseArray[PortInformation->ComPort]))
|
|
||||||
{
|
|
||||||
ComPortBase = (PUCHAR)BaseArray[PortInformation->ComPort];
|
|
||||||
PortInformation->BaseAddress = (ULONG)ComPortBase;
|
|
||||||
#ifndef NDEBUG
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nSerial port COM%ld found at 0x%lx\n",
|
|
||||||
PortInformation->ComPort,
|
|
||||||
(ULONG)ComPortBase];
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
#endif /* NDEBUG */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nKernel Debugger: Serial port not found!!!\n\n");
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* set baud rate and data format (8N1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* turn on DTR and RTS */
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR(ComPortBase), SR_MCR_DTR | SR_MCR_RTS);
|
|
||||||
|
|
||||||
/* set DLAB */
|
|
||||||
lcr = READ_PORT_UCHAR (SER_LCR(ComPortBase)) | SR_LCR_DLAB;
|
|
||||||
WRITE_PORT_UCHAR (SER_LCR(ComPortBase), lcr);
|
|
||||||
|
|
||||||
/* set baud rate */
|
|
||||||
divisor = 115200 / PortInformation->BaudRate;
|
|
||||||
WRITE_PORT_UCHAR (SER_DLL(ComPortBase), (UCHAR)(divisor & 0xff));
|
|
||||||
WRITE_PORT_UCHAR (SER_DLM(ComPortBase), (UCHAR)((divisor >> 8) & 0xff));
|
|
||||||
|
|
||||||
/* reset DLAB and set 8N1 format */
|
|
||||||
WRITE_PORT_UCHAR (SER_LCR(ComPortBase),
|
|
||||||
SR_LCR_CS8 | SR_LCR_ST1 | SR_LCR_PNO);
|
|
||||||
|
|
||||||
/* read junk out of the RBR */
|
|
||||||
lcr = READ_PORT_UCHAR (SER_RBR(ComPortBase));
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
|
|
||||||
/*
|
|
||||||
* print message to blue screen
|
|
||||||
*/
|
|
||||||
sprintf (buffer,
|
|
||||||
"\nKernel Debugger: COM%ld (Port 0x%lx) BaudRate %ld\n\n",
|
|
||||||
PortInformation->ComPort,
|
|
||||||
(ULONG)ComPortBase,
|
|
||||||
PortInformation->BaudRate);
|
|
||||||
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
|
|
||||||
#endif /* NDEBUG */
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortGetByte */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortGetByte (
|
|
||||||
PUCHAR ByteRecieved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (PortInitialized == FALSE)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if ((READ_PORT_UCHAR (SER_LSR(PortBase)) & SR_LSR_DR))
|
|
||||||
{
|
|
||||||
*ByteRecieved = READ_PORT_UCHAR (SER_RBR(PortBase));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortGetByteEx */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortGetByteEx (
|
|
||||||
PKD_PORT_INFORMATION PortInformation,
|
|
||||||
PUCHAR ByteRecieved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
PUCHAR ComPortBase = (PUCHAR)PortInformation->BaseAddress;
|
|
||||||
|
|
||||||
if ((READ_PORT_UCHAR (SER_LSR(ComPortBase)) & SR_LSR_DR))
|
|
||||||
{
|
|
||||||
*ByteRecieved = READ_PORT_UCHAR (SER_RBR(ComPortBase));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortPollByte */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortPollByte (
|
|
||||||
PUCHAR ByteRecieved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (PortInitialized == FALSE)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
while ((READ_PORT_UCHAR (SER_LSR(PortBase)) & SR_LSR_DR) == 0)
|
|
||||||
;
|
|
||||||
|
|
||||||
*ByteRecieved = READ_PORT_UCHAR (SER_RBR(PortBase));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortPollByteEx */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortPollByteEx (
|
|
||||||
PKD_PORT_INFORMATION PortInformation,
|
|
||||||
PUCHAR ByteRecieved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
PUCHAR ComPortBase = (PUCHAR)PortInformation->BaseAddress;
|
|
||||||
|
|
||||||
while ((READ_PORT_UCHAR (SER_LSR(ComPortBase)) & SR_LSR_DR) == 0)
|
|
||||||
;
|
|
||||||
|
|
||||||
*ByteRecieved = READ_PORT_UCHAR (SER_RBR(ComPortBase));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortPutByte */
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
KdPortPutByte (
|
|
||||||
UCHAR ByteToSend
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (PortInitialized == FALSE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
while ((READ_PORT_UCHAR (SER_LSR(PortBase)) & SR_LSR_TBE) == 0)
|
|
||||||
;
|
|
||||||
|
|
||||||
WRITE_PORT_UCHAR (SER_THR(PortBase), ByteToSend);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* HAL.KdPortPutByteEx */
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
KdPortPutByteEx (
|
|
||||||
PKD_PORT_INFORMATION PortInformation,
|
|
||||||
UCHAR ByteToSend
|
|
||||||
)
|
|
||||||
{
|
|
||||||
PUCHAR ComPortBase = (PUCHAR)PortInformation->BaseAddress;
|
|
||||||
|
|
||||||
while ((READ_PORT_UCHAR (SER_LSR(ComPortBase)) & SR_LSR_TBE) == 0)
|
|
||||||
;
|
|
||||||
|
|
||||||
WRITE_PORT_UCHAR (SER_THR(ComPortBase), ByteToSend);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortRestore */
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
KdPortRestore (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortSave */
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
KdPortSave (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortDisableInterrupts */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortDisableInterrupts()
|
|
||||||
{
|
|
||||||
UCHAR ch;
|
|
||||||
|
|
||||||
if (PortInitialized == FALSE)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
ch = READ_PORT_UCHAR (SER_MCR (PortBase));
|
|
||||||
ch &= (~(SR_MCR_OUT1 | SR_MCR_OUT2));
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR (PortBase), ch);
|
|
||||||
|
|
||||||
ch = READ_PORT_UCHAR (SER_IER (PortBase));
|
|
||||||
ch &= (~SR_IER_ALL);
|
|
||||||
WRITE_PORT_UCHAR (SER_IER (PortBase), ch);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HAL.KdPortEnableInterrupts */
|
|
||||||
BOOLEAN
|
|
||||||
STDCALL
|
|
||||||
KdPortEnableInterrupts()
|
|
||||||
{
|
|
||||||
UCHAR ch;
|
|
||||||
|
|
||||||
if (PortInitialized == FALSE)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
ch = READ_PORT_UCHAR (SER_IER (PortBase));
|
|
||||||
ch &= (~SR_IER_ALL);
|
|
||||||
ch |= SR_IER_ERDA;
|
|
||||||
WRITE_PORT_UCHAR (SER_IER (PortBase), ch);
|
|
||||||
|
|
||||||
ch = READ_PORT_UCHAR (SER_MCR (PortBase));
|
|
||||||
ch &= (~SR_MCR_LOOP);
|
|
||||||
ch |= (SR_MCR_OUT1 | SR_MCR_OUT2);
|
|
||||||
WRITE_PORT_UCHAR (SER_MCR (PortBase), ch);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -22,7 +22,7 @@
|
||||||
<library>rtl</library>
|
<library>rtl</library>
|
||||||
<library>rossym</library>
|
<library>rossym</library>
|
||||||
<library>string</library>
|
<library>string</library>
|
||||||
<!-- <library>kdcom</library> -->
|
<library>kdcom</library>
|
||||||
<library>wdmguid</library>
|
<library>wdmguid</library>
|
||||||
<directory name="include">
|
<directory name="include">
|
||||||
<pch>ntoskrnl.h</pch>
|
<pch>ntoskrnl.h</pch>
|
||||||
|
|
Loading…
Reference in a new issue