ReactOS 0.4.17-dev-966-gf06eace
machpc98.h
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Header file for NEC PC-98 series
5 * COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
6 */
7
8#pragma once
9
10#ifndef __MEMORY_H
11#include "mm.h"
12#endif
13
14/*
15 * BIOS work area memory
16 */
17
18/* Extended RAM between 0x100000 and 0xFFFFFF in 128 kB */
19#define MEM_EXPMMSZ 0x401
20
21#define MEM_BIOS_FLAG5 0x458
22 #define NESA_BUS_FLAG 0x80
23
24#define MEM_SCSI_TABLE 0x460
25
26/* Bit 3 and bit 6 - keyboard type */
27#define MEM_KEYB_TYPE 0x481
28
29/* Status about connected SCSI hard drives */
30#define MEM_DISK_EQUIPS 0x482
31
32/* Status about RAM drives */
33#define MEM_RDISK_EQUIP 0x488
34
35#define MEM_BIOS_FLAG1 0x501
36 #define CONVENTIONAL_MEMORY_SIZE 0x07 /* In 128 kB */
37 #define HIGH_RESOLUTION_FLAG 0x08
38 #define SYSTEM_CLOCK_8MHZ_FLAG 0x80 /* 0 = PIT runs at 2.4576 MHz, 1 = at 1.9968 MHz */
39
40/* Status about connected floppies */
41#define MEM_DISK_EQUIP 0x55C
42
43/* Device Address/Unit Address (DA/UA) */
44#define MEM_DISK_BOOT 0x584
45
46/* Extended RAM after 0x1000000, low part, in 1 MB */
47#define MEM_EXPMMSZ16M_LOW 0x594
48
49/* Extended RAM after 0x1000000, high part, in 1 MB */
50#define MEM_EXPMMSZ16M_HIGH 0x595
51
52/* Status about connected 1.44 MB floppies */
53#define MEM_F144_SUPPORT 0x5AE
54
55#define MEM_EXTENDED_NORMAL 0xF8E80
56#define MEM_EXTENDED_HIGH_RESO 0xFFE80
57
59
63
72VOID Pc98VideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y);
79
83
87
89
90/* pcmem.c */
93
95
96/* hwpci.c */
101 _Out_ PPCI_REGISTRY_INFO BusData);
102
103/*
104 * Disk Variables and Functions
105 */
106
107typedef struct _PC98_DISK_DRIVE
108{
109 /* Disk geometry */
111
112 /* PC-98 BIOS drive number */
114
115 /* IDE driver drive number */
117
118 /* Drive type */
120#define DRIVE_TYPE_HDD 0
121#define DRIVE_TYPE_CDROM 1
122#define DRIVE_TYPE_FDD 2
123
124 /* Drive flags */
126#define DRIVE_FLAGS_IDE 0x01 // IDE drive, accessed by the IDE driver
127#define DRIVE_FLAGS_LBA 0x02 // LBA access supported
128#define DRIVE_FLAGS_REMOVABLE 0x04 // The drive is removable (e.g. floppy, CD-ROM...)
129#define DRIVE_FLAGS_INITIALIZED 0x80 // The drive has been initialized
131
132/* Platform-specific boot drive and partition numbers */
133extern UCHAR FrldrBootDrive;
135
138 _In_ UCHAR DriveNumber);
139
140LONG
142 _In_ BOOLEAN bShowError);
143
146 _In_ UCHAR DriveNumber,
147 _In_ ULONGLONG SectorNumber,
150
153 _In_ UCHAR DriveNumber,
154 _Out_ PGEOMETRY DriveGeometry);
155
156ULONG
158 _In_ UCHAR DriveNumber);
159
160UCHAR
162
165 _In_ UCHAR DriveNumber);
166
167ULONG
169 _In_ UCHAR DriveNumber);
170
171/* hwdisk.c */
unsigned char BOOLEAN
Definition: actypes.h:127
#define RomFontPointers
Definition: winldr.c:348
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
Definition: bufpool.h:45
UINT Depth
Definition: d3d12.idl:4644
_Check_return_ _In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS _Out_ UINT _Out_ UINT * Height
Definition: dispmprt.h:1445
_Check_return_ _In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS _Out_ UINT * Width
Definition: dispmprt.h:1444
#define Y(I)
VOID Pc98VideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: pc98video.c:192
ULONG Pc98GetBootSectorLoadAddress(_In_ UCHAR DriveNumber)
Definition: machpc98.c:43
ULONG Pc98DiskGetCacheableBlockCount(_In_ UCHAR DriveNumber)
Definition: pc98disk.c:774
BOOLEAN Pc98ConsKbHit(VOID)
Definition: pc98cons.c:64
BIOS_MEMORY_MAP PcBiosMemoryMap[]
Definition: pcmem.c:37
VOID Pc98HwIdle(VOID)
Definition: machpc98.c:29
BOOLEAN Pc98VideoIsPaletteFixed(VOID)
Definition: pc98video.c:397
VOID Pc98VideoClearScreen(UCHAR Attr)
Definition: pc98video.c:164
ULONG Pc98VideoGetBufferSize(VOID)
Definition: pc98video.c:200
struct _PC98_DISK_DRIVE * PPC98_DISK_DRIVE
VOID Pc98VideoInit(VOID)
Definition: pc98video.c:66
PCONFIGURATION_COMPONENT_DATA Pc98HwDetect(_In_opt_ PCSTR Options)
Definition: pc98hw.c:1231
VOID Pc98VideoGetFontsFromFirmware(PULONG RomFontPointers)
Definition: pc98video.c:206
PFREELDR_MEMORY_DESCRIPTOR Pc98MemGetMemoryMap(ULONG *MemoryMapSize)
Definition: pc98mem.c:48
VOID Pc98VideoSetTextCursorPosition(UCHAR X, UCHAR Y)
Definition: pc98video.c:212
ULONG PcBiosMapCount
Definition: pcmem.c:38
VOID Pc98Beep(VOID)
Definition: pc98beep.c:10
BOOLEAN Pc98InitializeBootDevices(VOID)
Definition: pc98disk.c:624
BOOLEAN Pc98DiskReadLogicalSectors(_In_ UCHAR DriveNumber, _In_ ULONGLONG SectorNumber, _In_ ULONG SectorCount, _Out_ PVOID Buffer)
Definition: pc98disk.c:716
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:438
VOID Pc98VideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pc98video.c:313
LONG DiskReportError(_In_ BOOLEAN bShowError)
Definition: disk.c:38
CONFIGURATION_TYPE DiskGetConfigType(_In_ UCHAR DriveNumber)
Definition: pcdisk.c:381
VOID Pc98VideoHideShowTextCursor(BOOLEAN Show)
Definition: pc98video.c:225
VOID Pc98ConsPutChar(int Ch)
Definition: pc98cons.c:25
BOOLEAN Pc98DiskGetDriveGeometry(_In_ UCHAR DriveNumber, _Out_ PGEOMETRY DriveGeometry)
Definition: pc98disk.c:756
VIDEODISPLAYMODE Pc98VideoSetDisplayMode(PCSTR DisplayMode, BOOLEAN Init)
Definition: pc98video.c:185
VOID Pc98VideoPrepareForReactOS(VOID)
Definition: pc98video.c:443
VOID Pc98VideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: pc98video.c:415
UCHAR Pc98GetFloppyCount(VOID)
Definition: pc98hw.c:1261
int Pc98ConsGetCh(VOID)
Definition: pc98cons.c:85
VOID Pc98VideoSync(VOID)
Definition: pc98video.c:433
struct _PC98_DISK_DRIVE PC98_DISK_DRIVE
UCHAR FrldrBootDrive
Definition: uefidisk.c:57
TIMEINFO * Pc98GetTime(VOID)
Definition: pc98rtc.c:19
VOID Pc98VideoCopyOffScreenBufferToVRAM(PVOID Buffer)
Definition: pc98video.c:381
VOID Pc98VideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: pc98video.c:403
PPC98_DISK_DRIVE Pc98DiskDriveNumberToDrive(_In_ UCHAR DriveNumber)
Definition: pc98disk.c:113
ULONG FrldrBootPartition
Definition: uefidisk.c:58
BOOLEAN PcDetectPciBus(_In_ PCONFIGURATION_COMPONENT_DATA SystemKey, _Inout_ PULONG BusNumber, _Out_ PPCI_REGISTRY_INFO BusData)
Definition: hwpci.c:175
VOID Pc98PrepareForReactOS(VOID)
Definition: machpc98.c:35
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
ULONG SectorCount
Definition: part_brfr.c:22
_In_ ULONG BusNumber
Definition: pciidex.h:65
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:121
long LONG
Definition: pedump.c:60
enum _CONFIGURATION_TYPE CONFIGURATION_TYPE
#define Ch(x, y, z)
Definition: sha2.c:141
Definition: disk.h:24
UCHAR AtaUnitNumber
Definition: machpc98.h:116
GEOMETRY Geometry
Definition: machpc98.h:110
Definition: fw.h:10
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: typedefs.h:53
uint64_t ULONGLONG
Definition: typedefs.h:67
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG
Definition: typedefs.h:59
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3540