ReactOS  0.4.15-dev-341-g17c5fb8
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 
62 int Pc98ConsGetCh(VOID);
63 
72 VOID Pc98VideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y);
79 
85 
86 /* pcmem.c */
88 extern ULONG PcBiosMapCount;
89 
91 
92 /* hwpci.c */
94 
95 /*
96  * Disk Variables and Functions
97  */
98 
99 typedef struct _PC98_DISK_DRIVE
100 {
101  /* Disk geometry */
103 
104  /* BIOS drive number */
106 
107  /* IDE driver drive number */
109 
110  /* Drive type flags */
112 #define DRIVE_SASI 0x00
113 #define DRIVE_IDE 0x01
114 #define DRIVE_SCSI 0x02
115 #define DRIVE_CDROM 0x04
116 #define DRIVE_FDD 0x08
117 #define DRIVE_MO 0x10
118 #define DRIVE_RAM 0x20
119 
120  /* TRUE when LBA access are supported */
122 
123  /*
124  * 'IsRemovable' flag: TRUE when the drive is removable (e.g. floppy, CD-ROM...).
125  * In that case some of the cached information might need to be refreshed regularly.
126  */
128 
129  /*
130  * 'Initialized' flag: if TRUE then the drive has been initialized;
131  * if FALSE then the disk isn't detected by BIOS/FreeLoader.
132  */
135 
136 /* Platform-specific boot drive and partition numbers */
137 extern UCHAR FrldrBootDrive;
139 
140 LONG DiskReportError(BOOLEAN bShowError);
142 
144 BOOLEAN Pc98DiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY DriveGeometry);
148 
151 
152 /* hwdisk.c */
PCONFIGURATION_COMPONENT_DATA Pc98HwDetect(VOID)
Definition: pc98hw.c:1192
Definition: bl.h:202
ULONG Pc98DiskGetCacheableBlockCount(UCHAR DriveNumber)
Definition: pc98disk.c:886
#define IN
Definition: typedefs.h:39
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:656
#define Y(I)
BOOLEAN Pc98VideoIsPaletteFixed(VOID)
Definition: pc98video.c:282
BOOLEAN LBASupported
Definition: machpc98.h:121
BOOLEAN Pc98ConsKbHit(VOID)
Definition: pc98cons.c:64
BOOLEAN DiskResetController(IN PPC98_DISK_DRIVE DiskDrive)
Definition: pc98disk.c:91
VOID Pc98VideoHideShowTextCursor(BOOLEAN Show)
Definition: pc98video.c:219
VOID Pc98Beep(VOID)
Definition: pc98beep.c:10
BOOLEAN PcFindPciBios(PPCI_REGISTRY_INFO BusData)
Definition: hwpci.c:80
BIOS_MEMORY_MAP PcBiosMemoryMap[]
Definition: pcmem.c:37
VOID Pc98HwIdle(VOID)
Definition: machpc98.c:29
Definition: bl.h:199
#define Ch(x, y, z)
Definition: sha2.c:141
VOID Pc98VideoClearScreen(UCHAR Attr)
Definition: pc98video.c:158
UCHAR IdeUnitNumber
Definition: machpc98.h:108
BOOLEAN Initialized
Definition: machpc98.h:133
ULONG FrldrBootPartition
ULONG Pc98VideoGetBufferSize(VOID)
Definition: pc98video.c:194
long LONG
Definition: pedump.c:60
VOID Pc98DiskPrepareForReactOS(VOID)
Definition: pc98disk.c:135
Definition: fw.h:9
VOID Pc98VideoSync(VOID)
Definition: pc98video.c:318
BOOLEAN Pc98InitializeBootDevices(VOID)
Definition: pc98disk.c:720
PFREELDR_MEMORY_DESCRIPTOR Pc98MemGetMemoryMap(ULONG *MemoryMapSize)
Definition: pc98mem.c:48
unsigned char BOOLEAN
Definition: bufpool.h:45
int Pc98ConsGetCh(VOID)
Definition: pc98cons.c:85
BOOLEAN Pc98DiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
uint64_t ULONGLONG
Definition: typedefs.h:66
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:470
VOID Pc98VideoGetFontsFromFirmware(PULONG RomFontPointers)
Definition: pc98video.c:200
LONG DiskReportError(BOOLEAN bShowError)
Definition: pcdisk.c:120
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:115
Definition: bl.h:200
VOID Pc98VideoPrepareForReactOS(VOID)
Definition: pc98video.c:328
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID Pc98VideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: pc98video.c:288
ULONG PcBiosMapCount
Definition: pcmem.c:38
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
UCHAR FrldrBootDrive
ULONG SectorCount
Definition: part_xbox.c:31
#define RomFontPointers
Definition: winldr.c:422
VOID Pc98PrepareForReactOS(VOID)
Definition: machpc98.c:35
VOID Pc98VideoSetTextCursorPosition(UCHAR X, UCHAR Y)
Definition: pc98video.c:206
ULONG Pc98GetBootSectorLoadAddress(IN UCHAR DriveNumber)
Definition: machpc98.c:44
struct _PC98_DISK_DRIVE * PPC98_DISK_DRIVE
Definition: disk.h:24
unsigned int * PULONG
Definition: retypes.h:1
BOOLEAN IsRemovable
Definition: machpc98.h:127
VOID Pc98VideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pc98video.c:236
VOID Pc98VideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: pc98video.c:300
VOID Pc98VideoInit(VOID)
Definition: pc98video.c:60
BOOLEAN Pc98DiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: pc98disk.c:870
unsigned int ULONG
Definition: retypes.h:1
VOID Pc98VideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: pc98video.c:186
VIDEODISPLAYMODE Pc98VideoSetDisplayMode(char *DisplayMode, BOOLEAN Init)
Definition: pc98video.c:179
GEOMETRY Geometry
Definition: machpc98.h:102
struct _PC98_DISK_DRIVE PC98_DISK_DRIVE
VOID Pc98VideoCopyOffScreenBufferToVRAM(PVOID Buffer)
Definition: pc98video.c:266
UCHAR Pc98GetFloppyCount(VOID)
Definition: pc98hw.c:1223
TIMEINFO * Pc98GetTime(VOID)
Definition: pc98rtc.c:13
PPC98_DISK_DRIVE Pc98DiskDriveNumberToDrive(IN UCHAR DriveNumber)
Definition: pc98disk.c:141
VOID Pc98ConsPutChar(int Ch)
Definition: pc98cons.c:25