/*
- * FreeLoader
- *
- * Copyright (C) 2004 Eric Kohl
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * PROJECT: FreeLoader
+ * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: APM BIOS detection routines
+ * COPYRIGHT: Copyright 2004 Eric Kohl (eric.kohl@reactos.org)
*/
#include <freeldr.h>
static BOOLEAN
FindApmBios(VOID)
{
- REGS RegsIn;
- REGS RegsOut;
+ REGS RegsIn, RegsOut;
+ /* APM BIOS - Installation check */
#if defined(SARCH_PC98)
RegsIn.w.ax = 0x9A00;
RegsIn.w.bx = 0x0000;
RegsIn.w.bx = 0x0000;
Int386(0x15, &RegsIn, &RegsOut);
#endif
- if (INT386_SUCCESS(RegsOut))
+ if (INT386_SUCCESS(RegsOut) && RegsOut.w.bx == 'PM')
{
TRACE("Found APM BIOS\n");
TRACE("AH: %x\n", RegsOut.b.ah);
return FALSE;
}
-
VOID
DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
{
PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
ULONG Size;
+ if (!FindApmBios())
+ return;
+
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
- if (FindApmBios())
+ /* Set 'Configuration Data' value */
+ PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
+ if (PartialResourceList == NULL)
{
- /* Create 'Configuration Data' value */
- PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
- memset(PartialResourceList, 0, Size);
- PartialResourceList->Version = 0;
- PartialResourceList->Revision = 0;
- PartialResourceList->Count = 0;
-
- /* Create new bus key */
- FldrCreateComponentKey(SystemKey,
- AdapterClass,
- MultiFunctionAdapter,
- 0x0,
- 0x0,
- 0xFFFFFFFF,
- "APM",
- PartialResourceList,
- Size,
- &BiosKey);
-
- /* Increment bus number */
- (*BusNumber)++;
+ ERR("Failed to allocate resource descriptor\n");
+ return;
}
+ RtlZeroMemory(PartialResourceList, Size);
+ PartialResourceList->Version = 0;
+ PartialResourceList->Revision = 0;
+ PartialResourceList->Count = 0;
/* FIXME: Add configuration data */
+
+ /* Create new bus key */
+ FldrCreateComponentKey(SystemKey,
+ AdapterClass,
+ MultiFunctionAdapter,
+ 0x0,
+ 0,
+ 0xFFFFFFFF,
+ "APM",
+ PartialResourceList,
+ Size,
+ &BiosKey);
+
+ /* Increment bus number */
+ (*BusNumber)++;
}
/* EOF */
/* INCLUDES ******************************************************************/
-#include <ntoskrnl.h>
#include <freeldr.h>
+#include <ntoskrnl.h>
/* FUNCTIONS *****************************************************************/
/* Create the 'System' key */
FldrCreateSystemKey(&SystemKey);
- // TODO: Discover and set the machine type as the Component->Identifier
+ // TODO: Discover and set the other machine types
+ FldrSetIdentifier(SystemKey, "AT/AT COMPATIBLE");
GetHarddiskConfigurationData = PcGetHarddiskConfigurationData;
FindPciBios = PcFindPciBios;
PeripheralClass,
DiskPeripheral,
Output | Input,
- 0x0,
+ i,
0xFFFFFFFF,
Identifier,
PartialResourceList,
#include <freeldr.h>
#include <drivers/pc98/video.h>
-extern UCHAR XboxFont8x16[];
+extern UCHAR BitmapFont8x16[];
extern BOOLEAN HiResoMachine;
/* GLOBALS ********************************************************************/
UCHAR R = (Attr & 0x40) ? 0xFF : 0;
UCHAR I = (Attr & 0x80) ? 0xFF : 0;
ULONG VramOffset = X + (Y * CHAR_HEIGHT) * BYTES_PER_SCANLINE;
- PUCHAR FontPtr = XboxFont8x16 + Ch * 16;
+ PUCHAR FontPtr = BitmapFont8x16 + Ch * 16;
for (Line = 0; Line < CHAR_HEIGHT; Line++)
{
ULONG ComBase = 0;
// Enter Configuration
- WRITE_PORT_UCHAR(LPC_IO_BASE, LPC_ENTER_CONFIG_KEY);
+ WRITE_PORT_UCHAR((PUCHAR)LPC_IO_BASE, LPC_ENTER_CONFIG_KEY);
// Select serial device
- WRITE_PORT_UCHAR(LPC_IO_BASE, LPC_CONFIG_DEVICE_NUMBER);
- WRITE_PORT_UCHAR(LPC_IO_BASE + 1, Device[Index]);
+ WRITE_PORT_UCHAR((PUCHAR)LPC_IO_BASE, LPC_CONFIG_DEVICE_NUMBER);
+ WRITE_PORT_UCHAR((PUCHAR)(LPC_IO_BASE + 1), Device[Index]);
// Check if selected device is active
- WRITE_PORT_UCHAR(LPC_IO_BASE, LPC_CONFIG_DEVICE_ACTIVATE);
- if (READ_PORT_UCHAR(LPC_IO_BASE + 1) == 1)
+ WRITE_PORT_UCHAR((PUCHAR)LPC_IO_BASE, LPC_CONFIG_DEVICE_ACTIVATE);
+ if (READ_PORT_UCHAR((PUCHAR)(LPC_IO_BASE + 1)) == 1)
{
// Read LSB
- WRITE_PORT_UCHAR(LPC_IO_BASE, LPC_CONFIG_DEVICE_BASE_ADDRESS_LOW);
- ComBase = READ_PORT_UCHAR(LPC_IO_BASE + 1);
+ WRITE_PORT_UCHAR((PUCHAR)LPC_IO_BASE, LPC_CONFIG_DEVICE_BASE_ADDRESS_LOW);
+ ComBase = READ_PORT_UCHAR((PUCHAR)(LPC_IO_BASE + 1));
// Read MSB
- WRITE_PORT_UCHAR(LPC_IO_BASE, LPC_CONFIG_DEVICE_BASE_ADDRESS_HIGH);
- ComBase |= (READ_PORT_UCHAR(LPC_IO_BASE + 1) << 8);
+ WRITE_PORT_UCHAR((PUCHAR)LPC_IO_BASE, LPC_CONFIG_DEVICE_BASE_ADDRESS_HIGH);
+ ComBase |= (READ_PORT_UCHAR((PUCHAR)(LPC_IO_BASE + 1)) << 8);
// Read IRQ
- WRITE_PORT_UCHAR(LPC_IO_BASE, LPC_CONFIG_DEVICE_INTERRUPT);
- *Irq = READ_PORT_UCHAR(LPC_IO_BASE + 1);
+ WRITE_PORT_UCHAR((PUCHAR)LPC_IO_BASE, LPC_CONFIG_DEVICE_INTERRUPT);
+ *Irq = READ_PORT_UCHAR((PUCHAR)(LPC_IO_BASE + 1));
}
// Exit Configuration
- WRITE_PORT_UCHAR(LPC_IO_BASE, LPC_EXIT_CONFIG_KEY);
+ WRITE_PORT_UCHAR((PUCHAR)LPC_IO_BASE, LPC_EXIT_CONFIG_KEY);
return ComBase;
}
/*
- * FreeLoader
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Note: Converted from the XFree vga.bdf font
+ * PROJECT: FreeLoader
+ * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: VGA font 8x16
+ * COPYRIGHT: Copyright 2004 Gé van Geldorp (gvg@reactos.org)
*/
+/* Note: Converted from the XFree vga.bdf font */
+
#include <freeldr.h>
-UCHAR XboxFont8x16[256 * 16] =
+UCHAR BitmapFont8x16[256 * 16] =
{
- 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x00,0x00, /* 0x00 */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0x00 */
0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xa5,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, /* 0x01 */
0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xdb,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, /* 0x02 */
0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00, /* 0x03 */
};
/* EOF */
-
unsigned Line;
unsigned Col;
- FontPtr = XboxFont8x16 + Char * 16;
+ FontPtr = BitmapFont8x16 + Char * 16;
Pixel = (PULONG) ((char *) FrameBuffer + (Y * CHAR_HEIGHT + TOP_BOTTOM_LINES) * Delta
+ X * CHAR_WIDTH * BytesPerPixel);
for (Line = 0; Line < CHAR_HEIGHT; Line++)
/* Not supported */
}
-VOID
-XboxBeep(VOID)
-{
- /* Call PC version */
- PcBeep();
-}
-
VOID
XboxVideoPrepareForReactOS(VOID)
{
#define NV2A_RAMDAC_FP_HVALID_END (0x838 + NV2A_RAMDAC_OFFSET)
#define NV2A_RAMDAC_FP_VVALID_END (0x818 + NV2A_RAMDAC_OFFSET)
-extern UCHAR XboxFont8x16[256 * 16];
+extern UCHAR BitmapFont8x16[256 * 16];
VOID XboxConsPutChar(int Ch);
BOOLEAN XboxConsKbHit(VOID);
#pragma once
-#define TUI_SCREEN_MEM 0xB8000
#define TITLE_BOX_CHAR_HEIGHT 5
///////////////////////////////////////////////////////////////////////////////////////
#pragma once
-#define TUI_SCREEN_MEM 0xB8000
#define TUI_TITLE_BOX_CHAR_HEIGHT 5
///////////////////////////////////////////////////////////////////////////////////////