mirror of
https://github.com/reactos/reactos.git
synced 2025-07-29 09:12:20 +00:00
Fixed hal display and initialization code.
svn path=/trunk/; revision=697
This commit is contained in:
parent
4551dfba1e
commit
29812be566
12 changed files with 386 additions and 384 deletions
|
@ -12,6 +12,8 @@
|
||||||
#ifndef __INCLUDE_INTERNAL_HAL_DDK_H
|
#ifndef __INCLUDE_INTERNAL_HAL_DDK_H
|
||||||
#define __INCLUDE_INTERNAL_HAL_DDK_H
|
#define __INCLUDE_INTERNAL_HAL_DDK_H
|
||||||
|
|
||||||
|
#include <internal/ntoskrnl.h>
|
||||||
|
|
||||||
/* HalReturnToFirmware */
|
/* HalReturnToFirmware */
|
||||||
#define FIRMWARE_HALT 1
|
#define FIRMWARE_HALT 1
|
||||||
#define FIRMWARE_REBOOT 3
|
#define FIRMWARE_REBOOT 3
|
||||||
|
@ -59,13 +61,17 @@ typedef struct _DEVICE_DESCRIPTION
|
||||||
ULONG DmaPort;
|
ULONG DmaPort;
|
||||||
} DEVICE_DESCRIPTION, *PDEVICE_DESCRIPTION;
|
} DEVICE_DESCRIPTION, *PDEVICE_DESCRIPTION;
|
||||||
|
|
||||||
typedef BOOLEAN STDCALL (*RESET_DISPLAY_ROUTINE)(ULONG SizeX, ULONG SizeY);
|
typedef BOOLEAN (*PHAL_RESET_DISPLAY_PARAMETERS)(ULONG Columns, ULONG Rows);
|
||||||
|
|
||||||
|
|
||||||
|
VOID HalAcquireDisplayOwnership (
|
||||||
|
PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
|
||||||
|
|
||||||
VOID HalAcquireDisplayOwnership(RESET_DISPLAY_ROUTINE ResetRoutine);
|
|
||||||
PVOID HalAllocateCommonBuffer(PADAPTER_OBJECT AdapterObject,
|
PVOID HalAllocateCommonBuffer(PADAPTER_OBJECT AdapterObject,
|
||||||
ULONG Length,
|
ULONG Length,
|
||||||
PPHYSICAL_ADDRESS LogicalAddress,
|
PPHYSICAL_ADDRESS LogicalAddress,
|
||||||
BOOLEAN CacheEnabled);
|
BOOLEAN CacheEnabled);
|
||||||
|
|
||||||
NTSTATUS HalAssignSlotResources(PUNICODE_STRING RegistryPath,
|
NTSTATUS HalAssignSlotResources(PUNICODE_STRING RegistryPath,
|
||||||
PUNICODE_STRING DriverClassName,
|
PUNICODE_STRING DriverClassName,
|
||||||
PDRIVER_OBJECT DriverObject,
|
PDRIVER_OBJECT DriverObject,
|
||||||
|
@ -74,57 +80,79 @@ NTSTATUS HalAssignSlotResources(PUNICODE_STRING RegistryPath,
|
||||||
ULONG BusNumber,
|
ULONG BusNumber,
|
||||||
ULONG SlotNumber,
|
ULONG SlotNumber,
|
||||||
PCM_RESOURCE_LIST* AllocatedResources);
|
PCM_RESOURCE_LIST* AllocatedResources);
|
||||||
|
|
||||||
|
VOID HalDisplayString (PCH String);
|
||||||
|
|
||||||
VOID HalExamineMBR(PDEVICE_OBJECT DeviceObject,
|
VOID HalExamineMBR(PDEVICE_OBJECT DeviceObject,
|
||||||
ULONG SectorSize,
|
ULONG SectorSize,
|
||||||
ULONG MBRTypeIdentifier,
|
ULONG MBRTypeIdentifier,
|
||||||
PVOID Buffer);
|
PVOID Buffer);
|
||||||
|
|
||||||
VOID HalFreeCommonBuffer(PADAPTER_OBJECT AdapterObject,
|
VOID HalFreeCommonBuffer(PADAPTER_OBJECT AdapterObject,
|
||||||
ULONG Length,
|
ULONG Length,
|
||||||
PHYSICAL_ADDRESS LogicalAddress,
|
PHYSICAL_ADDRESS LogicalAddress,
|
||||||
PVOID VirtualAddress,
|
PVOID VirtualAddress,
|
||||||
BOOLEAN CacheEnabled);
|
BOOLEAN CacheEnabled);
|
||||||
|
|
||||||
PADAPTER_OBJECT HalGetAdapter(PDEVICE_DESCRIPTION DeviceDescription,
|
PADAPTER_OBJECT HalGetAdapter(PDEVICE_DESCRIPTION DeviceDescription,
|
||||||
PULONG NumberOfMapRegisters);
|
PULONG NumberOfMapRegisters);
|
||||||
|
|
||||||
ULONG HalGetBusData(BUS_DATA_TYPE BusDataType,
|
ULONG HalGetBusData(BUS_DATA_TYPE BusDataType,
|
||||||
ULONG BusNumber,
|
ULONG BusNumber,
|
||||||
ULONG SlotNumber,
|
ULONG SlotNumber,
|
||||||
PVOID Buffer,
|
PVOID Buffer,
|
||||||
ULONG Length);
|
ULONG Length);
|
||||||
|
|
||||||
ULONG HalGetBusDataByOffset(BUS_DATA_TYPE BusDataType,
|
ULONG HalGetBusDataByOffset(BUS_DATA_TYPE BusDataType,
|
||||||
ULONG BusNumber,
|
ULONG BusNumber,
|
||||||
ULONG SlotNumber,
|
ULONG SlotNumber,
|
||||||
PVOID Buffer,
|
PVOID Buffer,
|
||||||
ULONG Offset,
|
ULONG Offset,
|
||||||
ULONG Length);
|
ULONG Length);
|
||||||
|
|
||||||
ULONG HalGetDmaAlignmentRequirement(VOID);
|
ULONG HalGetDmaAlignmentRequirement(VOID);
|
||||||
|
|
||||||
ULONG HalGetInterruptVector(INTERFACE_TYPE InterfaceType,
|
ULONG HalGetInterruptVector(INTERFACE_TYPE InterfaceType,
|
||||||
ULONG BusNumber,
|
ULONG BusNumber,
|
||||||
ULONG BusInterruptLevel,
|
ULONG BusInterruptLevel,
|
||||||
ULONG BusInterruptVector,
|
ULONG BusInterruptVector,
|
||||||
PKIRQL Irql,
|
PKIRQL Irql,
|
||||||
PKAFFINITY Affinity);
|
PKAFFINITY Affinity);
|
||||||
BOOLEAN HalMakeBeep(ULONG Frequency);
|
|
||||||
|
BOOLEAN HalInitSystem (ULONG Phase,
|
||||||
|
boot_param *bp);
|
||||||
|
|
||||||
|
BOOLEAN HalMakeBeep (ULONG Frequency);
|
||||||
|
|
||||||
VOID HalQueryDisplayParameters(PULONG DispSizeX,
|
VOID HalQueryDisplayParameters(PULONG DispSizeX,
|
||||||
PULONG DispSizeY,
|
PULONG DispSizeY,
|
||||||
PULONG CursorPosX,
|
PULONG CursorPosX,
|
||||||
PULONG CursorPosY);
|
PULONG CursorPosY);
|
||||||
|
|
||||||
VOID HalQueryRealTimeClock(PTIME_FIELDS pTime);
|
VOID HalQueryRealTimeClock(PTIME_FIELDS pTime);
|
||||||
|
|
||||||
VOID HalQuerySystemInformation(VOID);
|
VOID HalQuerySystemInformation(VOID);
|
||||||
|
|
||||||
ULONG HalReadDmaCounter(PADAPTER_OBJECT AdapterObject);
|
ULONG HalReadDmaCounter(PADAPTER_OBJECT AdapterObject);
|
||||||
|
|
||||||
VOID HalReturnToFirmware(ULONG Action);
|
VOID HalReturnToFirmware(ULONG Action);
|
||||||
|
|
||||||
ULONG HalSetBusData(BUS_DATA_TYPE BusDataType,
|
ULONG HalSetBusData(BUS_DATA_TYPE BusDataType,
|
||||||
ULONG BusNumber,
|
ULONG BusNumber,
|
||||||
ULONG SlotNumber,
|
ULONG SlotNumber,
|
||||||
PVOID Buffer,
|
PVOID Buffer,
|
||||||
ULONG Length);
|
ULONG Length);
|
||||||
|
|
||||||
ULONG HalSetBusDataByOffset(BUS_DATA_TYPE BusDataType,
|
ULONG HalSetBusDataByOffset(BUS_DATA_TYPE BusDataType,
|
||||||
ULONG BusNumber,
|
ULONG BusNumber,
|
||||||
ULONG SlotNumber,
|
ULONG SlotNumber,
|
||||||
PVOID Buffer,
|
PVOID Buffer,
|
||||||
ULONG Offset,
|
ULONG Offset,
|
||||||
ULONG Length);
|
ULONG Length);
|
||||||
|
|
||||||
VOID HalSetDisplayParameters(ULONG CursorPosX,
|
VOID HalSetDisplayParameters(ULONG CursorPosX,
|
||||||
ULONG CursorPosY);
|
ULONG CursorPosY);
|
||||||
|
|
||||||
BOOLEAN HalTranslateBusAddress(INTERFACE_TYPE InterfaceType,
|
BOOLEAN HalTranslateBusAddress(INTERFACE_TYPE InterfaceType,
|
||||||
ULONG BusNumber,
|
ULONG BusNumber,
|
||||||
PHYSICAL_ADDRESS BusAddress,
|
PHYSICAL_ADDRESS BusAddress,
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#ifndef __INTERNAL_HAL_HAL_H
|
#ifndef __INTERNAL_HAL_HAL_H
|
||||||
#define __INTERNAL_HAL_HAL_H
|
#define __INTERNAL_HAL_HAL_H
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
unsigned short previous_task;
|
unsigned short previous_task;
|
||||||
|
@ -71,7 +72,7 @@ BOOLEAN Hal_bios32_is_service_present(ULONG service);
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Initializes the text mode display (blue screen)
|
* FUNCTION: Initializes the text mode display (blue screen)
|
||||||
*/
|
*/
|
||||||
VOID HalInitializeDisplay (VOID);
|
VOID HalInitializeDisplay (boot_param *bp);
|
||||||
|
VOID HalResetDisplay (VOID)
|
||||||
|
|
||||||
#endif /* __INTERNAL_HAL_HAL_H */
|
#endif /* __INTERNAL_HAL_HAL_H */
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#define __INTERNAL_HAL_HAL_H
|
#define __INTERNAL_HAL_HAL_H
|
||||||
|
|
||||||
#include <internal/service.h>
|
#include <internal/service.h>
|
||||||
|
#include <internal/ntoskrnl.h>
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -78,4 +79,7 @@ NTSTATUS HalRegisterServiceTable(DWORD Mask,
|
||||||
PSERVICE_TABLE Table,
|
PSERVICE_TABLE Table,
|
||||||
DWORD Count);
|
DWORD Count);
|
||||||
|
|
||||||
|
VOID HalInitializeDisplay (boot_param *bp);
|
||||||
|
VOID HalResetDisplay (VOID);
|
||||||
|
|
||||||
#endif /* __INTERNAL_HAL_HAL_H */
|
#endif /* __INTERNAL_HAL_HAL_H */
|
||||||
|
|
|
@ -79,13 +79,11 @@ VOID NtInit(VOID);
|
||||||
* Initalization functions (called once by main())
|
* Initalization functions (called once by main())
|
||||||
*/
|
*/
|
||||||
VOID MmInitialize(boot_param* bp, ULONG LastKernelAddress);
|
VOID MmInitialize(boot_param* bp, ULONG LastKernelAddress);
|
||||||
VOID HalInit(boot_param* bp);
|
|
||||||
VOID IoInit(VOID);
|
VOID IoInit(VOID);
|
||||||
VOID ObInit(VOID);
|
VOID ObInit(VOID);
|
||||||
VOID PsInit(VOID);
|
VOID PsInit(VOID);
|
||||||
VOID TstBegin(VOID);
|
VOID TstBegin(VOID);
|
||||||
VOID KeInit(VOID);
|
VOID KeInit(VOID);
|
||||||
VOID HalInitConsole(boot_param* bp);
|
|
||||||
VOID CmInitializeRegistry(VOID);
|
VOID CmInitializeRegistry(VOID);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
57
reactos/ntoskrnl/dbg/print.c
Normal file
57
reactos/ntoskrnl/dbg/print.c
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
/* $Id: print.c,v 1.1 1999/10/15 15:20:31 ekohl Exp $
|
||||||
|
*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS kernel
|
||||||
|
* FILE: ntoskrnl/dbg/print.c
|
||||||
|
* PURPOSE: Debug output
|
||||||
|
* PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
|
||||||
|
* UPDATE HISTORY:
|
||||||
|
* 14/10/99: Created
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
|
#include <ddk/ntddk.h>
|
||||||
|
#include <internal/hal/ddk.h>
|
||||||
|
#include <internal/ntoskrnl.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
ULONG DbgPrint(PCH Format, ...)
|
||||||
|
{
|
||||||
|
char buffer[256];
|
||||||
|
va_list ap;
|
||||||
|
unsigned int eflags;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Because this is used by alomost every subsystem including irqs it
|
||||||
|
* must be atomic. The following code sequence disables interrupts after
|
||||||
|
* saving the previous state of the interrupt flag
|
||||||
|
*/
|
||||||
|
__asm__("pushf\n\tpop %0\n\tcli\n\t"
|
||||||
|
: "=m" (eflags)
|
||||||
|
: /* */);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process the format string into a fixed length buffer using the
|
||||||
|
* standard C RTL function
|
||||||
|
*/
|
||||||
|
va_start(ap,Format);
|
||||||
|
vsprintf(buffer,Format,ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
HalDisplayString (buffer);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Restore the interrupt flag
|
||||||
|
*/
|
||||||
|
__asm__("push %0\n\tpopf\n\t"
|
||||||
|
:
|
||||||
|
: "m" (eflags));
|
||||||
|
return(strlen(buffer));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
|
@ -1,9 +1,9 @@
|
||||||
/* $Id: display.c,v 1.1 1999/10/11 20:50:32 ekohl Exp $
|
/* $Id: display.c,v 1.2 1999/10/15 15:18:39 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/hal/x86/display.c
|
* FILE: ntoskrnl/hal/x86/display.c
|
||||||
* PURPOSE: Text mode display functions (blue screen)
|
* PURPOSE: Blue screen display
|
||||||
* PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
|
* PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
|
||||||
* UPDATE HISTORY:
|
* UPDATE HISTORY:
|
||||||
* Created 08/10/99
|
* Created 08/10/99
|
||||||
|
@ -11,6 +11,66 @@
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <internal/hal.h>
|
#include <internal/hal.h>
|
||||||
|
#include <internal/halio.h>
|
||||||
|
|
||||||
|
|
||||||
|
//#define BOCHS_DEBUGGING
|
||||||
|
//#define SERIAL_DEBUGGING
|
||||||
|
#define SCREEN_DEBUGGING
|
||||||
|
|
||||||
|
|
||||||
|
#define SERIAL_PORT 0x03f8
|
||||||
|
#define SERIAL_BAUD_RATE 19200
|
||||||
|
#define SERIAL_LINE_CONTROL (SR_LCR_CS8 | SR_LCR_ST1 | SR_LCR_PNO)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef BOCHS_DEBUGGING
|
||||||
|
#define BOCHS_LOGGER_PORT (0x3ed)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SERIAL_DEBUGGING
|
||||||
|
#define SER_RBR SERIAL_PORT + 0
|
||||||
|
#define SER_THR SERIAL_PORT + 0
|
||||||
|
#define SER_DLL SERIAL_PORT + 0
|
||||||
|
#define SER_IER SERIAL_PORT + 1
|
||||||
|
#define SER_DLM SERIAL_PORT + 1
|
||||||
|
#define SER_IIR SERIAL_PORT + 2
|
||||||
|
#define SER_LCR SERIAL_PORT + 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 SERIAL_PORT + 4
|
||||||
|
#define SR_MCR_DTR 0x01
|
||||||
|
#define SR_MCR_RTS 0x02
|
||||||
|
#define SER_LSR SERIAL_PORT + 5
|
||||||
|
#define SR_LSR_TBE 0x20
|
||||||
|
#define SER_MSR SERIAL_PORT + 6
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SCREEN_DEBUGGING
|
||||||
|
#define CRTC_COMMAND 0x3d4
|
||||||
|
#define CRTC_DATA 0x3d5
|
||||||
|
#define CRTC_CURLO 0x0f
|
||||||
|
#define CRTC_CURHI 0x0e
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define CHAR_ATTRIBUTE 0x17 /* grey on blue */
|
||||||
|
|
||||||
|
|
||||||
/* VARIABLES ****************************************************************/
|
/* VARIABLES ****************************************************************/
|
||||||
|
@ -23,9 +83,9 @@ static ULONG SizeY = 50;
|
||||||
static BOOLEAN DisplayInitialized = FALSE;
|
static BOOLEAN DisplayInitialized = FALSE;
|
||||||
static BOOLEAN HalOwnsDisplay = TRUE;
|
static BOOLEAN HalOwnsDisplay = TRUE;
|
||||||
|
|
||||||
static BYTE *VideoBuffer = NULL;
|
static WORD *VideoBuffer = NULL;
|
||||||
|
|
||||||
static RESET_DISPLAY_ROUTINE ResetRoutine = NULL;
|
static PHAL_RESET_DISPLAY_PARAMETERS HalResetDisplayParameters = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* STATIC FUNCTIONS *********************************************************/
|
/* STATIC FUNCTIONS *********************************************************/
|
||||||
|
@ -36,24 +96,98 @@ HalClearDisplay (VOID)
|
||||||
WORD *ptr = (WORD*)VideoBuffer;
|
WORD *ptr = (WORD*)VideoBuffer;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
for (i=0; i < SizeX*SizeY; i++, ptr++)
|
for (i = 0; i < SizeX * SizeY; i++, ptr++)
|
||||||
*ptr = 0x1720;
|
*ptr = ((CHAR_ATTRIBUTE << 8) + ' ');
|
||||||
|
|
||||||
|
CursorX = 0;
|
||||||
|
CursorY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
HalScrollDisplay (VOID)
|
||||||
|
{
|
||||||
|
WORD *ptr;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
ptr = VideoBuffer + SizeX;
|
||||||
|
RtlMoveMemory (VideoBuffer,
|
||||||
|
ptr,
|
||||||
|
SizeX * (SizeY - 1) * 2);
|
||||||
|
|
||||||
|
ptr = VideoBuffer + (SizeX * (SizeY - 1));
|
||||||
|
for (i = 0; i < SizeX; i++, ptr++)
|
||||||
|
{
|
||||||
|
*ptr = (CHAR_ATTRIBUTE << 8) + ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
HalPutCharacter (CHAR Character)
|
||||||
|
{
|
||||||
|
WORD *ptr;
|
||||||
|
|
||||||
|
ptr = VideoBuffer + ((CursorY * SizeX) + CursorX);
|
||||||
|
*ptr = (CHAR_ATTRIBUTE << 8) + Character;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS ********************************************************/
|
/* PRIVATE FUNCTIONS ********************************************************/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
HalInitializeDisplay (VOID)
|
HalInitializeDisplay (boot_param *bp)
|
||||||
|
/*
|
||||||
|
* FUNCTION: Initalize the display
|
||||||
|
* ARGUMENTS:
|
||||||
|
* InitParameters = Parameters setup by the boot loader
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
if (DisplayInitialized == FALSE)
|
if (DisplayInitialized == FALSE)
|
||||||
{
|
{
|
||||||
DisplayInitialized = TRUE;
|
#ifdef SERIAL_DEBUGGING
|
||||||
|
/* turn on DTR and RTS */
|
||||||
|
outb_p(SER_MCR, SR_MCR_DTR | SR_MCR_RTS);
|
||||||
|
/* set baud rate, line control */
|
||||||
|
outb_p(SER_LCR, SERIAL_LINE_CONTROL | SR_LCR_DLAB);
|
||||||
|
outb_p(SER_DLL, (115200 / SERIAL_BAUD_RATE) & 0xff);
|
||||||
|
outb_p(SER_DLM, ((115200 / SERIAL_BAUD_RATE) >> 8) & 0xff);
|
||||||
|
outb_p(SER_LCR, SERIAL_LINE_CONTROL);
|
||||||
|
#endif
|
||||||
|
|
||||||
VideoBuffer = (BYTE *)(0xd0000000 + 0xb8000);
|
VideoBuffer = (WORD *)(0xd0000000 + 0xb8000);
|
||||||
// VideoBuffer = HalMapPhysicalMemory (0xb8000, 2);
|
// VideoBuffer = HalMapPhysicalMemory (0xb8000, 2);
|
||||||
|
|
||||||
|
/* Set cursor position */
|
||||||
|
CursorX = bp->cursorx;
|
||||||
|
CursorY = bp->cursory;
|
||||||
|
SizeX = 80;
|
||||||
|
SizeY = 50;
|
||||||
|
|
||||||
|
HalClearDisplay ();
|
||||||
|
|
||||||
|
DisplayInitialized = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
HalResetDisplay (VOID)
|
||||||
|
/*
|
||||||
|
* FUNCTION: Reset the display
|
||||||
|
* ARGUMENTS:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
if (HalResetDisplayParameters == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (HalOwnsDisplay == TRUE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (HalResetDisplayParameters(SizeX, SizeY) == TRUE)
|
||||||
|
{
|
||||||
|
HalOwnsDisplay = TRUE;
|
||||||
HalClearDisplay ();
|
HalClearDisplay ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,25 +197,107 @@ HalInitializeDisplay (VOID)
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
HalAcquireDisplayOwnership (
|
||||||
HalAcquireDisplayOwnership (RESET_DISPLAY_ROUTINE ResetDisplay)
|
IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters
|
||||||
|
)
|
||||||
|
/*
|
||||||
|
* FUNCTION:
|
||||||
|
* ARGUMENTS:
|
||||||
|
* ResetDisplayParameters = Pointer to a driver specific
|
||||||
|
* reset routine.
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
HalOwnsDisplay = FALSE;
|
HalOwnsDisplay = FALSE;
|
||||||
ResetRoutine = ResetDisplay;
|
HalResetDisplayParameters = ResetDisplayParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
HalDisplayString(PCH String)
|
||||||
HalDisplayString (VOID)
|
/*
|
||||||
|
* FUNCTION: Switches the screen to HAL console mode (BSOD) if not there
|
||||||
|
* already and displays a string
|
||||||
|
* ARGUMENT:
|
||||||
|
* string = ASCII string to display
|
||||||
|
* NOTE: Use with care because there is no support for returning from BSOD
|
||||||
|
* mode
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
|
PCH pch;
|
||||||
|
#ifdef SCREEN_DEBUGGING
|
||||||
|
int offset;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pch = String;
|
||||||
|
|
||||||
|
if (HalOwnsDisplay == FALSE)
|
||||||
|
{
|
||||||
|
HalResetDisplay ();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef BOCHS_DEBUGGING
|
||||||
|
outb_p(BOCHS_LOGGER_PORT,c);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SERIAL_DEBUGGING
|
||||||
|
while ((inb_p(SER_LSR) & SR_LSR_TBE) == 0)
|
||||||
|
;
|
||||||
|
|
||||||
|
outb_p(SER_THR, c);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SCREEN_DEBUGGING
|
||||||
|
outb_p(CRTC_COMMAND, CRTC_CURHI);
|
||||||
|
offset = inb_p(CRTC_DATA)<<8;
|
||||||
|
outb_p(CRTC_COMMAND, CRTC_CURLO);
|
||||||
|
offset += inb_p(CRTC_DATA);
|
||||||
|
|
||||||
|
CursorY = offset / SizeX;
|
||||||
|
CursorX = offset % SizeX;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
while (*pch != 0)
|
||||||
|
{
|
||||||
|
if (*pch == '\n')
|
||||||
|
{
|
||||||
|
CursorY++;
|
||||||
|
CursorX = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HalPutCharacter (*pch);
|
||||||
|
CursorX++;
|
||||||
|
|
||||||
|
if (CursorX >= SizeX)
|
||||||
|
{
|
||||||
|
CursorY++;
|
||||||
|
CursorX = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CursorY >= SizeY)
|
||||||
|
{
|
||||||
|
HalScrollDisplay ();
|
||||||
|
CursorY = SizeY - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pch++;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef SCREEN_DEBUGGING
|
||||||
|
offset = (CursorY * SizeX) + CursorX;
|
||||||
|
|
||||||
|
outb_p(CRTC_COMMAND, CRTC_CURLO);
|
||||||
|
outb_p(CRTC_DATA, offset);
|
||||||
|
outb_p(CRTC_COMMAND, CRTC_CURHI);
|
||||||
|
offset >>= 8;
|
||||||
|
outb_p(CRTC_DATA, offset);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
|
||||||
HalQueryDisplayParameters (PULONG DispSizeX,
|
HalQueryDisplayParameters (PULONG DispSizeX,
|
||||||
PULONG DispSizeY,
|
PULONG DispSizeY,
|
||||||
PULONG CursorPosX,
|
PULONG CursorPosX,
|
||||||
|
@ -99,7 +315,6 @@ HalQueryDisplayParameters (PULONG DispSizeX,
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
|
||||||
HalSetDisplayParameters (ULONG CursorPosX,
|
HalSetDisplayParameters (ULONG CursorPosX,
|
||||||
ULONG CursorPosY)
|
ULONG CursorPosY)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/*
|
/* $Id: halinit.c,v 1.6 1999/10/15 15:18:39 ekohl Exp $
|
||||||
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/hal/x86/halinit.c
|
* FILE: ntoskrnl/hal/x86/halinit.c
|
||||||
|
@ -11,38 +12,47 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <internal/ntoskrnl.h>
|
|
||||||
#include <internal/ke.h>
|
|
||||||
#include <internal/hal.h>
|
#include <internal/hal.h>
|
||||||
|
#include <internal/ke.h>
|
||||||
|
#include <internal/ntoskrnl.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
|
||||||
VOID HalInit(boot_param* bp)
|
BOOLEAN
|
||||||
{
|
HalInitSystem (ULONG Phase, boot_param *bp)
|
||||||
KeInitExceptions();
|
{
|
||||||
KeInitIRQ();
|
if (Phase == 0)
|
||||||
KeLowerIrql(DISPATCH_LEVEL);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Probe for a BIOS32 extension
|
|
||||||
*/
|
|
||||||
Hal_bios32_probe();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Probe for buses attached to the computer
|
|
||||||
* NOTE: Order is important here because ISA is the default
|
|
||||||
*/
|
|
||||||
#if 0
|
|
||||||
if (HalPciProbe())
|
|
||||||
{
|
{
|
||||||
return;
|
HalInitializeDisplay (bp);
|
||||||
}
|
}
|
||||||
HalIsaProbe();
|
else
|
||||||
#endif
|
{
|
||||||
|
KeInitExceptions();
|
||||||
|
KeInitIRQ();
|
||||||
|
KeLowerIrql(DISPATCH_LEVEL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Probe for a BIOS32 extension
|
||||||
|
*/
|
||||||
|
Hal_bios32_probe();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Probe for buses attached to the computer
|
||||||
|
* NOTE: Order is important here because ISA is the default
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
|
if (HalPciProbe())
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
HalIsaProbe();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
||||||
|
|
|
@ -1,327 +0,0 @@
|
||||||
/*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS kernel
|
|
||||||
* FILE: ntoskrnl/hal/x86/printk.c
|
|
||||||
* PURPOSE: Writing to the console
|
|
||||||
* PROGRAMMER: David Welch (welch@mcmail.com)
|
|
||||||
* UPDATE HISTORY:
|
|
||||||
* ??/??/??: Created
|
|
||||||
* 05/06/98: Implemented BSOD
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
|
||||||
#include <internal/ntoskrnl.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <internal/string.h>
|
|
||||||
#include <internal/mmhal.h>
|
|
||||||
#include <internal/halio.h>
|
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include <internal/debug.h>
|
|
||||||
|
|
||||||
/* GLOBALS ******************************************************************/
|
|
||||||
|
|
||||||
//#define BOCHS_DEBUGGING 1
|
|
||||||
//#define SERIAL_DEBUGGING
|
|
||||||
#define SERIAL_PORT 0x03f8
|
|
||||||
#define SERIAL_BAUD_RATE 19200
|
|
||||||
#define SERIAL_LINE_CONTROL (SR_LCR_CS8 | SR_LCR_ST1 | SR_LCR_PNO)
|
|
||||||
|
|
||||||
|
|
||||||
#define IDMAP_BASE (0xd0000000)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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)
|
|
||||||
{
|
|
||||||
return(x+IDMAP_BASE);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern inline unsigned int linear_to_physical(unsigned int x)
|
|
||||||
{
|
|
||||||
return(x-IDMAP_BASE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef BOCHS_DEBUGGING
|
|
||||||
#define BOCHS_LOGGER_PORT (0x3ed)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SERIAL_DEBUGGING
|
|
||||||
#define SER_RBR SERIAL_PORT + 0
|
|
||||||
#define SER_THR SERIAL_PORT + 0
|
|
||||||
#define SER_DLL SERIAL_PORT + 0
|
|
||||||
#define SER_IER SERIAL_PORT + 1
|
|
||||||
#define SER_DLM SERIAL_PORT + 1
|
|
||||||
#define SER_IIR SERIAL_PORT + 2
|
|
||||||
#define SER_LCR SERIAL_PORT + 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 SERIAL_PORT + 4
|
|
||||||
#define SR_MCR_DTR 0x01
|
|
||||||
#define SR_MCR_RTS 0x02
|
|
||||||
#define SER_LSR SERIAL_PORT + 5
|
|
||||||
#define SR_LSR_TBE 0x20
|
|
||||||
#define SER_MSR SERIAL_PORT + 6
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PURPOSE: Current cursor position
|
|
||||||
*/
|
|
||||||
static unsigned int cursorx=0, cursory=0;
|
|
||||||
static unsigned int lines_seen = 0;
|
|
||||||
static unsigned char CharAttribute = 0x17;
|
|
||||||
|
|
||||||
//#define NR_ROWS 25
|
|
||||||
#define NR_ROWS 50
|
|
||||||
#define NR_COLUMNS 80
|
|
||||||
#define VIDMEM_BASE 0xb8000
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PURPOSE: Points to the base of text mode video memory
|
|
||||||
*/
|
|
||||||
static char* vidmem = (char *)(VIDMEM_BASE + IDMAP_BASE);
|
|
||||||
|
|
||||||
#define CRTC_COMMAND 0x3d4
|
|
||||||
#define CRTC_DATA 0x3d5
|
|
||||||
#define CRTC_CURLO 0x0f
|
|
||||||
#define CRTC_CURHI 0x0e
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PURPOSE: This flag is set to true if the system is in HAL managed
|
|
||||||
* console mode. This is initially true then once the graphics drivers
|
|
||||||
* initialize, it is turned off, HAL console mode is reentered if a fatal
|
|
||||||
* error occurs or on system shutdown
|
|
||||||
*/
|
|
||||||
static unsigned int in_hal_console = 1;
|
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
void __putchar(char c);
|
|
||||||
|
|
||||||
|
|
||||||
void HalSwitchToBlueScreen(void)
|
|
||||||
/*
|
|
||||||
* FUNCTION: Switches the monitor to text mode and writes a blue background
|
|
||||||
* NOTE: This function is entirely self contained and can be used from any
|
|
||||||
* graphics mode.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Sanity check
|
|
||||||
*/
|
|
||||||
if (in_hal_console)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Reset the cursor position
|
|
||||||
*/
|
|
||||||
cursorx=0;
|
|
||||||
cursory=0;
|
|
||||||
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURLO);
|
|
||||||
outb_p(CRTC_DATA, 0);
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURHI);
|
|
||||||
outb_p(CRTC_DATA, 0);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This code section is taken from the sample routines by
|
|
||||||
* Jeff Morgan (kinfira@hotmail.com)
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL NtDisplayString(IN PUNICODE_STRING DisplayString)
|
|
||||||
{
|
|
||||||
// DbgPrint("NtDisplayString(%w)\n",DisplayString->Buffer);
|
|
||||||
DbgPrint("%w",DisplayString->Buffer);
|
|
||||||
return(STATUS_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HalDisplayString(char* string)
|
|
||||||
/*
|
|
||||||
* FUNCTION: Switches the screen to HAL console mode (BSOD) if not there
|
|
||||||
* already and displays a string
|
|
||||||
* ARGUMENT:
|
|
||||||
* string = ASCII string to display
|
|
||||||
* NOTE: Use with care because there is no support for returning from BSOD
|
|
||||||
* mode
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
char* str=string;
|
|
||||||
|
|
||||||
if (!in_hal_console)
|
|
||||||
{
|
|
||||||
HalSwitchToBlueScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((*str)!=0)
|
|
||||||
{
|
|
||||||
__putchar(*str);
|
|
||||||
str++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void __putchar(char c)
|
|
||||||
/*
|
|
||||||
* FUNCTION: Writes a character to the console and updates the cursor position
|
|
||||||
* ARGUMENTS:
|
|
||||||
* c = the character to write
|
|
||||||
* NOTE: This function handles newlines as well
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
int offset;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
#ifdef BOCHS_DEBUGGING
|
|
||||||
outb_p(BOCHS_LOGGER_PORT,c);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SERIAL_DEBUGGING
|
|
||||||
while ((inb_p(SER_LSR) & SR_LSR_TBE) == 0)
|
|
||||||
;
|
|
||||||
outb_p(SER_THR, c);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURHI);
|
|
||||||
offset = inb_p(CRTC_DATA)<<8;
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURLO);
|
|
||||||
offset += inb_p(CRTC_DATA);
|
|
||||||
|
|
||||||
cursory = offset / NR_COLUMNS;
|
|
||||||
cursorx = offset % NR_COLUMNS;
|
|
||||||
|
|
||||||
switch(c)
|
|
||||||
{
|
|
||||||
case '\n':
|
|
||||||
cursory++;
|
|
||||||
cursorx = 0;
|
|
||||||
lines_seen++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
vidmem[(cursorx * 2) + (cursory * 80 * 2)] = c;
|
|
||||||
vidmem[(cursorx * 2) + (cursory * 80 * 2) + 1] = CharAttribute;
|
|
||||||
cursorx++;
|
|
||||||
if (cursorx >= NR_COLUMNS)
|
|
||||||
{
|
|
||||||
cursory++;
|
|
||||||
lines_seen++;
|
|
||||||
cursorx = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cursory >= NR_ROWS)
|
|
||||||
{
|
|
||||||
unsigned short *LinePtr;
|
|
||||||
|
|
||||||
memcpy(vidmem,
|
|
||||||
&vidmem[NR_COLUMNS * 2],
|
|
||||||
NR_COLUMNS * (NR_ROWS - 1) * 2);
|
|
||||||
LinePtr = (unsigned short *) &vidmem[NR_COLUMNS * (NR_ROWS - 1) * 2];
|
|
||||||
for (i = 0; i < NR_COLUMNS; i++)
|
|
||||||
{
|
|
||||||
LinePtr[i] = CharAttribute << 8;
|
|
||||||
}
|
|
||||||
cursory = NR_ROWS - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set the cursor position
|
|
||||||
*/
|
|
||||||
|
|
||||||
offset = (cursory * NR_COLUMNS) + cursorx;
|
|
||||||
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURLO);
|
|
||||||
outb_p(CRTC_DATA, offset);
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURHI);
|
|
||||||
offset >>= 8;
|
|
||||||
outb_p(CRTC_DATA, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ULONG DbgPrint(PCH Format, ...)
|
|
||||||
{
|
|
||||||
char buffer[256];
|
|
||||||
va_list ap;
|
|
||||||
unsigned int eflags;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Because this is used by alomost every subsystem including irqs it
|
|
||||||
* must be atomic. The following code sequence disables interrupts after
|
|
||||||
* saving the previous state of the interrupt flag
|
|
||||||
*/
|
|
||||||
__asm__("pushf\n\tpop %0\n\tcli\n\t"
|
|
||||||
: "=m" (eflags)
|
|
||||||
: /* */);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Process the format string into a fixed length buffer using the
|
|
||||||
* standard C RTL function
|
|
||||||
*/
|
|
||||||
va_start(ap,Format);
|
|
||||||
vsprintf(buffer,Format,ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
HalDisplayString (buffer);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Restore the interrupt flag
|
|
||||||
*/
|
|
||||||
__asm__("push %0\n\tpopf\n\t"
|
|
||||||
:
|
|
||||||
: "m" (eflags));
|
|
||||||
return(strlen(buffer));
|
|
||||||
}
|
|
||||||
|
|
||||||
void HalInitConsole(boot_param* bp)
|
|
||||||
/*
|
|
||||||
* FUNCTION: Initalize the console
|
|
||||||
* ARGUMENTS:
|
|
||||||
* bp = Parameters setup by the boot loader
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
|
|
||||||
#ifdef SERIAL_DEBUGGING
|
|
||||||
/* turn on DTR and RTS */
|
|
||||||
outb_p(SER_MCR, SR_MCR_DTR | SR_MCR_RTS);
|
|
||||||
/* set baud rate, line control */
|
|
||||||
outb_p(SER_LCR, SERIAL_LINE_CONTROL | SR_LCR_DLAB);
|
|
||||||
outb_p(SER_DLL, (115200 / SERIAL_BAUD_RATE) & 0xff);
|
|
||||||
outb_p(SER_DLM, ((115200 / SERIAL_BAUD_RATE) >> 8) & 0xff);
|
|
||||||
outb_p(SER_LCR, SERIAL_LINE_CONTROL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set cursor position */
|
|
||||||
|
|
||||||
cursorx=bp->cursorx;
|
|
||||||
cursory=bp->cursory;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
offset = (cursory * NR_COLUMNS) + cursorx;
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURLO);
|
|
||||||
outb_p(CRTC_DATA, offset);
|
|
||||||
outb_p(CRTC_COMMAND, CRTC_CURHI);
|
|
||||||
offset >>= 8;
|
|
||||||
outb_p(CRTC_DATA, offset);
|
|
||||||
#endif
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: reboot.c,v 1.1 1999/10/11 20:50:33 ekohl Exp $
|
/* $Id: reboot.c,v 1.2 1999/10/15 15:18:39 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -61,7 +61,7 @@ HalReturnToFirmware (ULONG Action)
|
||||||
}
|
}
|
||||||
else if (Action == FIRMWARE_REBOOT)
|
else if (Action == FIRMWARE_REBOOT)
|
||||||
{
|
{
|
||||||
// HalVideoReboot();
|
HalResetDisplay ();
|
||||||
HalReboot ();
|
HalReboot ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
HAL_OBJECTS = hal/x86/head.o hal/x86/irq.o hal/x86/exp.o hal/x86/isa.o \
|
HAL_OBJECTS = hal/x86/head.o hal/x86/irq.o hal/x86/exp.o hal/x86/isa.o \
|
||||||
hal/x86/pci.o hal/x86/irqhand.o hal/x86/page.o hal/x86/halinit.o \
|
hal/x86/pci.o hal/x86/irqhand.o hal/x86/page.o hal/x86/halinit.o \
|
||||||
hal/x86/irql.o hal/x86/bios32.o hal/x86/thread.o hal/x86/spinlock.o \
|
hal/x86/irql.o hal/x86/bios32.o hal/x86/thread.o hal/x86/spinlock.o \
|
||||||
hal/x86/printk.o hal/x86/mp.o hal/x86/dma.o hal/x86/bus.o hal/x86/mbr.o \
|
hal/x86/mp.o hal/x86/dma.o hal/x86/bus.o hal/x86/mbr.o \
|
||||||
hal/x86/sysinfo.o hal/x86/time.o hal/x86/usercall.o hal/x86/beep.o \
|
hal/x86/sysinfo.o hal/x86/time.o hal/x86/usercall.o hal/x86/beep.o \
|
||||||
hal/x86/display.o hal/x86/reboot.o
|
hal/x86/display.o hal/x86/reboot.o
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: main.c,v 1.24 1999/10/14 16:53:30 ekohl Exp $
|
/* $Id: main.c,v 1.25 1999/10/15 15:21:03 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -144,11 +144,11 @@ asmlinkage void _main(boot_param* _bp)
|
||||||
memcpy(&bp,_bp,sizeof(boot_param));
|
memcpy(&bp,_bp,sizeof(boot_param));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initalize the console (before printing anything)
|
* Initalize the hal (Phase 0)
|
||||||
*/
|
*/
|
||||||
HalInitConsole(&bp);
|
HalInitSystem (0, &bp);
|
||||||
|
|
||||||
DbgPrint("Starting ReactOS "KERNEL_VERSION" (Build "__DATE__", "__TIME__")\n");
|
HalDisplayString("Starting ReactOS "KERNEL_VERSION" (Build "__DATE__", "__TIME__")\n");
|
||||||
|
|
||||||
start = KERNEL_BASE + PAGE_ROUND_UP(bp.module_length[0]);
|
start = KERNEL_BASE + PAGE_ROUND_UP(bp.module_length[0]);
|
||||||
if (start < ((int)&end))
|
if (start < ((int)&end))
|
||||||
|
@ -170,7 +170,7 @@ asmlinkage void _main(boot_param* _bp)
|
||||||
/*
|
/*
|
||||||
* Initalize various critical subsystems
|
* Initalize various critical subsystems
|
||||||
*/
|
*/
|
||||||
HalInit(&bp);
|
HalInitSystem (1, &bp);
|
||||||
MmInitialize(&bp, last_kernel_address);
|
MmInitialize(&bp, last_kernel_address);
|
||||||
KeInit();
|
KeInit();
|
||||||
ExInit();
|
ExInit();
|
||||||
|
|
|
@ -16,6 +16,22 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
NtDisplayString(IN PUNICODE_STRING DisplayString)
|
||||||
|
{
|
||||||
|
ANSI_STRING AnsiString;
|
||||||
|
|
||||||
|
RtlUnicodeStringToAnsiString (&AnsiString, DisplayString, TRUE);
|
||||||
|
|
||||||
|
HalDisplayString (AnsiString.Buffer);
|
||||||
|
|
||||||
|
RtlFreeAnsiString (&AnsiString);
|
||||||
|
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL NtVdmControl(VOID)
|
NTSTATUS STDCALL NtVdmControl(VOID)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue