ReactOS 0.4.15-dev-8138-g1e75ea8
machpc98.h File Reference
#include "mm.h"
Include dependency graph for machpc98.h:

Go to the source code of this file.

Classes

struct  _PC98_DISK_DRIVE
 

Macros

#define MEM_EXPMMSZ   0x401
 
#define MEM_BIOS_FLAG5   0x458
 
#define NESA_BUS_FLAG   0x80
 
#define MEM_SCSI_TABLE   0x460
 
#define MEM_KEYB_TYPE   0x481
 
#define MEM_DISK_EQUIPS   0x482
 
#define MEM_RDISK_EQUIP   0x488
 
#define MEM_BIOS_FLAG1   0x501
 
#define CONVENTIONAL_MEMORY_SIZE   0x07 /* In 128 kB */
 
#define HIGH_RESOLUTION_FLAG   0x08
 
#define SYSTEM_CLOCK_8MHZ_FLAG   0x80 /* 0 = PIT runs at 2.4576 MHz, 1 = at 1.9968 MHz */
 
#define MEM_DISK_EQUIP   0x55C
 
#define MEM_DISK_BOOT   0x584
 
#define MEM_EXPMMSZ16M_LOW   0x594
 
#define MEM_EXPMMSZ16M_HIGH   0x595
 
#define MEM_F144_SUPPORT   0x5AE
 
#define MEM_EXTENDED_NORMAL   0xF8E80
 
#define MEM_EXTENDED_HIGH_RESO   0xFFE80
 
#define DRIVE_SASI   0x00
 
#define DRIVE_IDE   0x01
 
#define DRIVE_SCSI   0x02
 
#define DRIVE_CDROM   0x04
 
#define DRIVE_FDD   0x08
 
#define DRIVE_MO   0x10
 
#define DRIVE_RAM   0x20
 

Typedefs

typedef struct _PC98_DISK_DRIVE PC98_DISK_DRIVE
 
typedef struct _PC98_DISK_DRIVEPPC98_DISK_DRIVE
 

Functions

VOID Pc98Beep (VOID)
 
VOID Pc98ConsPutChar (int Ch)
 
BOOLEAN Pc98ConsKbHit (VOID)
 
int Pc98ConsGetCh (VOID)
 
VOID Pc98VideoInit (VOID)
 
VOID Pc98VideoClearScreen (UCHAR Attr)
 
VIDEODISPLAYMODE Pc98VideoSetDisplayMode (char *DisplayMode, BOOLEAN Init)
 
VOID Pc98VideoGetDisplaySize (PULONG Width, PULONG Height, PULONG Depth)
 
ULONG Pc98VideoGetBufferSize (VOID)
 
VOID Pc98VideoGetFontsFromFirmware (PULONG RomFontPointers)
 
VOID Pc98VideoSetTextCursorPosition (UCHAR X, UCHAR Y)
 
VOID Pc98VideoHideShowTextCursor (BOOLEAN Show)
 
VOID Pc98VideoPutChar (int Ch, UCHAR Attr, unsigned X, unsigned Y)
 
VOID Pc98VideoCopyOffScreenBufferToVRAM (PVOID Buffer)
 
BOOLEAN Pc98VideoIsPaletteFixed (VOID)
 
VOID Pc98VideoSetPaletteColor (UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
 
VOID Pc98VideoGetPaletteColor (UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
 
VOID Pc98VideoSync (VOID)
 
VOID Pc98VideoPrepareForReactOS (VOID)
 
VOID Pc98PrepareForReactOS (VOID)
 
TIMEINFOPc98GetTime (VOID)
 
BOOLEAN Pc98InitializeBootDevices (VOID)
 
PCONFIGURATION_COMPONENT_DATA Pc98HwDetect (_In_opt_ PCSTR Options)
 
VOID Pc98HwIdle (VOID)
 
PFREELDR_MEMORY_DESCRIPTOR Pc98MemGetMemoryMap (ULONG *MemoryMapSize)
 
BOOLEAN PcFindPciBios (PPCI_REGISTRY_INFO BusData)
 
LONG DiskReportError (BOOLEAN bShowError)
 
BOOLEAN DiskResetController (IN PPC98_DISK_DRIVE DiskDrive)
 
BOOLEAN Pc98DiskReadLogicalSectors (UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
 
BOOLEAN Pc98DiskGetDriveGeometry (UCHAR DriveNumber, PGEOMETRY DriveGeometry)
 
ULONG Pc98DiskGetCacheableBlockCount (UCHAR DriveNumber)
 
UCHAR Pc98GetFloppyCount (VOID)
 
PPC98_DISK_DRIVE Pc98DiskDriveNumberToDrive (IN UCHAR DriveNumber)
 
ULONG Pc98GetBootSectorLoadAddress (IN UCHAR DriveNumber)
 
VOID Pc98DiskPrepareForReactOS (VOID)
 
BOOLEAN PcInitializeBootDevices (VOID)
 

Variables

BIOS_MEMORY_MAP PcBiosMemoryMap []
 
ULONG PcBiosMapCount
 
UCHAR FrldrBootDrive
 
ULONG FrldrBootPartition
 

Macro Definition Documentation

◆ CONVENTIONAL_MEMORY_SIZE

#define CONVENTIONAL_MEMORY_SIZE   0x07 /* In 128 kB */

Definition at line 36 of file machpc98.h.

◆ DRIVE_CDROM

#define DRIVE_CDROM   0x04

Definition at line 119 of file machpc98.h.

◆ DRIVE_FDD

#define DRIVE_FDD   0x08

Definition at line 120 of file machpc98.h.

◆ DRIVE_IDE

#define DRIVE_IDE   0x01

Definition at line 117 of file machpc98.h.

◆ DRIVE_MO

#define DRIVE_MO   0x10

Definition at line 121 of file machpc98.h.

◆ DRIVE_RAM

#define DRIVE_RAM   0x20

Definition at line 122 of file machpc98.h.

◆ DRIVE_SASI

#define DRIVE_SASI   0x00

Definition at line 116 of file machpc98.h.

◆ DRIVE_SCSI

#define DRIVE_SCSI   0x02

Definition at line 118 of file machpc98.h.

◆ HIGH_RESOLUTION_FLAG

#define HIGH_RESOLUTION_FLAG   0x08

Definition at line 37 of file machpc98.h.

◆ MEM_BIOS_FLAG1

#define MEM_BIOS_FLAG1   0x501

Definition at line 35 of file machpc98.h.

◆ MEM_BIOS_FLAG5

#define MEM_BIOS_FLAG5   0x458

Definition at line 21 of file machpc98.h.

◆ MEM_DISK_BOOT

#define MEM_DISK_BOOT   0x584

Definition at line 44 of file machpc98.h.

◆ MEM_DISK_EQUIP

#define MEM_DISK_EQUIP   0x55C

Definition at line 41 of file machpc98.h.

◆ MEM_DISK_EQUIPS

#define MEM_DISK_EQUIPS   0x482

Definition at line 30 of file machpc98.h.

◆ MEM_EXPMMSZ

#define MEM_EXPMMSZ   0x401

Definition at line 19 of file machpc98.h.

◆ MEM_EXPMMSZ16M_HIGH

#define MEM_EXPMMSZ16M_HIGH   0x595

Definition at line 50 of file machpc98.h.

◆ MEM_EXPMMSZ16M_LOW

#define MEM_EXPMMSZ16M_LOW   0x594

Definition at line 47 of file machpc98.h.

◆ MEM_EXTENDED_HIGH_RESO

#define MEM_EXTENDED_HIGH_RESO   0xFFE80

Definition at line 56 of file machpc98.h.

◆ MEM_EXTENDED_NORMAL

#define MEM_EXTENDED_NORMAL   0xF8E80

Definition at line 55 of file machpc98.h.

◆ MEM_F144_SUPPORT

#define MEM_F144_SUPPORT   0x5AE

Definition at line 53 of file machpc98.h.

◆ MEM_KEYB_TYPE

#define MEM_KEYB_TYPE   0x481

Definition at line 27 of file machpc98.h.

◆ MEM_RDISK_EQUIP

#define MEM_RDISK_EQUIP   0x488

Definition at line 33 of file machpc98.h.

◆ MEM_SCSI_TABLE

#define MEM_SCSI_TABLE   0x460

Definition at line 24 of file machpc98.h.

◆ NESA_BUS_FLAG

#define NESA_BUS_FLAG   0x80

Definition at line 22 of file machpc98.h.

◆ SYSTEM_CLOCK_8MHZ_FLAG

#define SYSTEM_CLOCK_8MHZ_FLAG   0x80 /* 0 = PIT runs at 2.4576 MHz, 1 = at 1.9968 MHz */

Definition at line 38 of file machpc98.h.

Typedef Documentation

◆ PC98_DISK_DRIVE

◆ PPC98_DISK_DRIVE

Function Documentation

◆ DiskReportError()

LONG DiskReportError ( BOOLEAN  bShowError)

Definition at line 120 of file pcdisk.c.

121{
122 /* Set the reference count */
123 if (bShowError) ++lReportError;
124 else --lReportError;
125 return lReportError;
126}
static LONG lReportError
Definition: pcdisk.c:118

◆ DiskResetController()

BOOLEAN DiskResetController ( IN PPC98_DISK_DRIVE  DiskDrive)

Definition at line 91 of file pc98disk.c.

92{
93 REGS Regs;
94
95 if (DiskDrive->Type & DRIVE_FDD)
96 {
97 /* Int 1Bh AH=07h
98 * DISK BIOS - Recalibrate
99 *
100 * Call with:
101 * AL - drive number
102 *
103 * Return:
104 * CF - set on error, clear if successful
105 * AH - status
106 */
107 Regs.b.ah = 0x07;
108 }
109 else if (DiskDrive->Type != (DRIVE_IDE | DRIVE_CDROM))
110 {
111 /* Int 1Bh AH=03h
112 * DISK BIOS - Initialize
113 *
114 * Call with:
115 * AL - drive number
116 *
117 * Return:
118 * CF - set on error, clear if successful
119 * AH - status
120 */
121 Regs.b.ah = 0x03;
122 }
123 else
124 {
125 return FALSE;
126 }
127
128 WARN("DiskResetController(0x%x) DISK OPERATION FAILED -- RESETTING CONTROLLER\n", DiskDrive->DaUa);
129
130 Regs.b.al = DiskDrive->DaUa;
131 Int386(0x1B, &Regs, &Regs);
132 return INT386_SUCCESS(Regs);
133}
#define WARN(fmt,...)
Definition: debug.h:115
#define FALSE
Definition: types.h:117
#define DRIVE_IDE
Definition: machpc98.h:117
#define DRIVE_CDROM
Definition: machpc98.h:119
#define DRIVE_FDD
Definition: machpc98.h:120
#define INT386_SUCCESS(regs)
Definition: pcbios.h:179
int __cdecl Int386(int ivec, REGS *in, REGS *out)
unsigned char al
Definition: pcbios.h:131
unsigned char ah
Definition: pcbios.h:132
Definition: pcbios.h:159
BYTEREGS b
Definition: pcbios.h:163

Referenced by Pc98DiskReadLogicalSectorsCHS(), and Pc98DiskReadLogicalSectorsLBA().

◆ Pc98Beep()

VOID Pc98Beep ( VOID  )

Definition at line 10 of file pc98beep.c.

11{
12 REGS Regs;
13
14 /* Int 18h AH=17h
15 * CRT BIOS - Beep on
16 */
17 Regs.b.ah = 0x17;
18 Int386(0x18, &Regs, &Regs);
19
21
22 /* Int 18h AH=18h
23 * CRT BIOS - Beep off
24 */
25 Regs.b.ah = 0x18;
26 Int386(0x18, &Regs, &Regs);
27}
VOID StallExecutionProcessor(ULONG Microseconds)
Definition: pchw.c:60

Referenced by MachInit().

◆ Pc98ConsGetCh()

int Pc98ConsGetCh ( VOID  )

Definition at line 85 of file pc98cons.c.

86{
87 static BOOLEAN ExtendedKey = FALSE;
88 static UCHAR ExtendedScanCode = 0;
89 REGS Regs;
90
91 /*
92 * If the last time we were called an
93 * extended key was pressed then return
94 * that keys scan code.
95 */
96 if (ExtendedKey)
97 {
99
100 return ExtendedScanCode;
101 }
102
103 /* Int 18h AH=00h
104 * KEYBOARD - GET KEYSTROKE
105 *
106 * Return:
107 * AH - BIOS scan code
108 * AL - ASCII character
109 */
110 Regs.b.ah = 0x00;
111 Int386(0x18, &Regs, &Regs);
112
113 /* Check for an extended keystroke */
114 if (Regs.b.al == 0)
115 {
117 ExtendedScanCode = Regs.b.ah;
118 }
119
120 /* Return keystroke */
121 return Regs.b.al;
122}
unsigned char BOOLEAN
#define TRUE
Definition: types.h:120
static BOOLEAN ExtendedKey
Definition: ueficon.c:20
static char ExtendedScanCode
Definition: ueficon.c:21
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by MachInit().

◆ Pc98ConsKbHit()

BOOLEAN Pc98ConsKbHit ( VOID  )

Definition at line 64 of file pc98cons.c.

65{
66 REGS Regs;
67
68 /* Int 18h AH=01h
69 * KEYBOARD - CHECK FOR KEYSTROKE
70 *
71 * Return:
72 * BH - status
73 * 00h - if no keystroke available
74 * 01h - if keystroke available
75 * AH - BIOS scan code
76 * AL - ASCII character
77 */
78 Regs.b.ah = 0x01;
79 Int386(0x18, &Regs, &Regs);
80
81 return Regs.b.bh == 1;
82}
unsigned char bh
Definition: pcbios.h:135

Referenced by MachInit().

◆ Pc98ConsPutChar()

VOID Pc98ConsPutChar ( int  Ch)

Definition at line 25 of file pc98cons.c.

26{
27 /* If scrolling is needed */
29 {
33
35 }
36
37 if (Ch == '\n')
38 {
39 if (CursorPosition % TextCols != 0)
41
42 return;
43 }
44
45 if (Ch == '\t')
46 {
47 Pc98ConsPutChar(' ');
48 Pc98ConsPutChar(' ');
49 Pc98ConsPutChar(' ');
50 Pc98ConsPutChar(' ');
51 Pc98ConsPutChar(' ');
52 Pc98ConsPutChar(' ');
53 Pc98ConsPutChar(' ');
54 Pc98ConsPutChar(' ');
55
56 return;
57 }
58
61}
UCHAR TextLines
Definition: pc98video.c:22
ULONG VramText
Definition: pc98video.c:40
UCHAR TextCols
Definition: pc98video.c:21
VOID Pc98ConsPutChar(int Ch)
Definition: pc98cons.c:25
#define TEXT_CHAR_SIZE
Definition: pc98cons.c:18
static USHORT CursorPosition
Definition: pc98cons.c:20
#define Ch(x, y, z)
Definition: sha2.c:141
uint16_t * PUSHORT
Definition: typedefs.h:56
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by MachInit(), and Pc98ConsPutChar().

◆ Pc98DiskDriveNumberToDrive()

PPC98_DISK_DRIVE Pc98DiskDriveNumberToDrive ( IN UCHAR  DriveNumber)

Definition at line 141 of file pc98disk.c.

142{
143 PPC98_DISK_DRIVE DiskDrive;
144
145 ASSERT((0 <= DriveNumber) && (DriveNumber < RTL_NUMBER_OF(Pc98DiskDrive)));
146
147 /* Retrieve a slot */
148 DiskDrive = &Pc98DiskDrive[DriveNumber];
149
150 /* The pre-initialization of the BIOS disks was already done in Pc98InitializeBootDevices() */
151 if (DiskDrive->Initialized)
152 return DiskDrive;
153 else
154 return NULL;
155}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define NULL
Definition: types.h:112
#define ASSERT(a)
Definition: mode.c:44
PC98_DISK_DRIVE Pc98DiskDrive[MAX_DRIVES]
Definition: pc98disk.c:22
BOOLEAN Initialized
Definition: machpc98.h:137

Referenced by ChainLoadBiosBootSectorCode(), Pc98DiskGetCacheableBlockCount(), Pc98DiskGetDriveGeometry(), Pc98DiskReadLogicalSectors(), and Pc98GetBootSectorLoadAddress().

◆ Pc98DiskGetCacheableBlockCount()

ULONG Pc98DiskGetCacheableBlockCount ( UCHAR  DriveNumber)

Definition at line 886 of file pc98disk.c.

887{
888 PPC98_DISK_DRIVE DiskDrive;
889
890 DiskDrive = Pc98DiskDriveNumberToDrive(DriveNumber);
891 if (!DiskDrive)
892 return 1; // Unknown count.
893
894 /*
895 * If LBA is supported then the block size will be 64 sectors (32k).
896 * If not then the block size is the size of one track.
897 */
898 if (DiskDrive->LBASupported)
899 return 64;
900 else
901 return DiskDrive->Geometry.Sectors;
902}
PPC98_DISK_DRIVE Pc98DiskDriveNumberToDrive(IN UCHAR DriveNumber)
Definition: pc98disk.c:141
ULONG Sectors
Definition: disk.h:28
BOOLEAN LBASupported
Definition: machpc98.h:125
GEOMETRY Geometry
Definition: machpc98.h:106

Referenced by MachInit().

◆ Pc98DiskGetDriveGeometry()

BOOLEAN Pc98DiskGetDriveGeometry ( UCHAR  DriveNumber,
PGEOMETRY  DriveGeometry 
)

Definition at line 870 of file pc98disk.c.

871{
872 PPC98_DISK_DRIVE DiskDrive;
873
874 TRACE("Pc98DiskGetDriveGeometry(0x%x)\n", DriveNumber);
875
876 DiskDrive = Pc98DiskDriveNumberToDrive(DriveNumber);
877 if (!DiskDrive)
878 return FALSE;
879
880 *Geometry = DiskDrive->Geometry;
881
882 return TRUE;
883}
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by DetectBiosDisks(), MachInit(), and Pc98GetHarddiskConfigurationData().

◆ Pc98DiskPrepareForReactOS()

VOID Pc98DiskPrepareForReactOS ( VOID  )

Definition at line 135 of file pc98disk.c.

136{
137 AtaFree();
138}
VOID AtaFree()

Referenced by Pc98PrepareForReactOS().

◆ Pc98DiskReadLogicalSectors()

BOOLEAN Pc98DiskReadLogicalSectors ( UCHAR  DriveNumber,
ULONGLONG  SectorNumber,
ULONG  SectorCount,
PVOID  Buffer 
)

◆ Pc98GetBootSectorLoadAddress()

ULONG Pc98GetBootSectorLoadAddress ( IN UCHAR  DriveNumber)

Definition at line 44 of file machpc98.c.

45{
46 PPC98_DISK_DRIVE DiskDrive;
47
48 DiskDrive = Pc98DiskDriveNumberToDrive(DriveNumber);
49 if (!DiskDrive)
50 {
51 ERR("Failed to get drive 0x%x\n", DriveNumber);
52 return 0x1FC00;
53 }
54
55 if (((DiskDrive->DaUa & 0xF0) == 0x30) ||
56 ((DiskDrive->DaUa & 0xF0) == 0xB0))
57 {
58 /* 1.44 MB floppy */
59 return 0x1FE00;
60 }
61 else if (DiskDrive->Type & DRIVE_FDD)
62 {
63 return 0x1FC00;
64 }
65
66 return 0x1F800;
67}
#define ERR(fmt,...)
Definition: debug.h:113

Referenced by ChainLoadBiosBootSectorCode().

◆ Pc98GetFloppyCount()

UCHAR Pc98GetFloppyCount ( VOID  )

Definition at line 1214 of file pc98hw.c.

1215{
1216 USHORT DiskEquipment = *(PUSHORT)MEM_DISK_EQUIP & ~(*(PUCHAR)MEM_RDISK_EQUIP);
1217 UCHAR DiskMask;
1218 UCHAR FloppyCount = 0;
1219
1220 for (DiskMask = 0x01; DiskMask != 0; DiskMask <<= 1)
1221 {
1222 if (FIRSTBYTE(DiskEquipment) & DiskMask)
1223 ++FloppyCount;
1224 }
1225
1226 for (DiskMask = 0x10; DiskMask != 0; DiskMask <<= 1)
1227 {
1228 if (SECONDBYTE(DiskEquipment) & DiskMask)
1229 ++FloppyCount;
1230 }
1231
1232 return FloppyCount;
1233}
#define MEM_RDISK_EQUIP
Definition: machpc98.h:33
#define MEM_DISK_EQUIP
Definition: machpc98.h:41
unsigned short USHORT
Definition: pedump.c:61
unsigned char * PUCHAR
Definition: typedefs.h:53
#define SECONDBYTE(VALUE)
Definition: rtlfuncs.h:796
#define FIRSTBYTE(VALUE)
Definition: rtlfuncs.h:795

Referenced by DetectBiosFloppyController(), DetectBiosFloppyPeripheral(), and MachInit().

◆ Pc98GetTime()

TIMEINFO * Pc98GetTime ( VOID  )

Definition at line 13 of file pc98rtc.c.

14{
15 static TIMEINFO TimeInfo;
16 REGS Regs;
17 UCHAR SysTime[6];
18
19 /* Int 1Ch AH=00h
20 * TIMER BIOS - Read system time
21 *
22 * Call with:
23 * ES:BX -> data buffer
24 */
25 Regs.b.ah = 0x00;
26 Regs.w.es = ((ULONG_PTR)SysTime) >> 4;
27 Regs.w.bx = ((ULONG_PTR)SysTime) & 0x0F;
28 Int386(0x1C, &Regs, &Regs);
29
30 TimeInfo.Year = BCD_INT(SysTime[0]);
31 TimeInfo.Month = BCD_INT(SysTime[1] >> 4);
32 TimeInfo.Day = BCD_INT(SysTime[2]);
33 TimeInfo.Hour = BCD_INT(SysTime[3]);
34 TimeInfo.Minute = BCD_INT(SysTime[4]);
35 TimeInfo.Second = BCD_INT(SysTime[5]);
36 if (TimeInfo.Year >= 80)
37 TimeInfo.Year += 1900;
38 else
39 TimeInfo.Year += 2000;
40
41 return &TimeInfo;
42}
#define ULONG_PTR
Definition: config.h:101
#define BCD_INT(bcd)
Definition: pc98rtc.c:10
unsigned short es
Definition: pcbios.h:121
unsigned short bx
Definition: pcbios.h:112
Definition: fw.h:10
USHORT Month
Definition: fw.h:12
USHORT Day
Definition: fw.h:13
USHORT Minute
Definition: fw.h:15
USHORT Hour
Definition: fw.h:14
USHORT Second
Definition: fw.h:16
USHORT Year
Definition: fw.h:11
WORDREGS w
Definition: pcbios.h:162

Referenced by MachInit().

◆ Pc98HwDetect()

PCONFIGURATION_COMPONENT_DATA Pc98HwDetect ( _In_opt_ PCSTR  Options)

Definition at line 1183 of file pc98hw.c.

1185{
1187 ULONG BusNumber = 0;
1188
1189 TRACE("DetectHardware()\n");
1190
1191 /* Create the 'System' key */
1192 FldrCreateSystemKey(&SystemKey, "NEC PC-98");
1193
1196
1197 /* Detect buses */
1198 DetectPciBios(SystemKey, &BusNumber);
1199 DetectApmBios(SystemKey, &BusNumber);
1200 DetectPnpBios(SystemKey, &BusNumber);
1201 DetectNesaBios(SystemKey, &BusNumber);
1202 DetectCBusBios(SystemKey, &BusNumber);
1203 DetectAcpiBios(SystemKey, &BusNumber);
1204 // TODO: Detect more buses
1205
1206 // TODO: Collect the ROM blocks and append their
1207 // CM_ROM_BLOCK data into the 'System' key's configuration data.
1208
1209 TRACE("DetectHardware() Done\n");
1210 return SystemKey;
1211}
VOID FldrCreateSystemKey(_Out_ PCONFIGURATION_COMPONENT_DATA *SystemNode, _In_ PCSTR IdentifierString)
Definition: archwsup.c:135
VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwacpi.c:54
VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwpci.c:176
BOOLEAN PcFindPciBios(PPCI_REGISTRY_INFO BusData)
Definition: hwpci.c:80
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
VOID DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwapm.c:46
static VOID DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: pc98hw.c:1050
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: pc98hw.c:23
static VOID DetectNesaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: pc98hw.c:1009
static PCM_PARTIAL_RESOURCE_LIST Pc98GetHarddiskConfigurationData(UCHAR DriveNumber, ULONG *pSize)
Definition: pc98hw.c:316
static VOID DetectCBusBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: pc98hw.c:963
uint32_t ULONG
Definition: typedefs.h:59
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160

Referenced by MachInit().

◆ Pc98HwIdle()

VOID Pc98HwIdle ( VOID  )

Definition at line 29 of file machpc98.c.

30{
31 /* Unimplemented */
32}

Referenced by MachInit().

◆ Pc98InitializeBootDevices()

BOOLEAN Pc98InitializeBootDevices ( VOID  )

Definition at line 720 of file pc98disk.c.

721{
722 PPC98_DISK_DRIVE DiskDrive;
723 UCHAR FakeFloppyDriveNumber = 0x30;
724 UCHAR FakeHardDriveDriveNumber = 0x80;
725 UCHAR FakeCdRomDriveNumber = 0xE0;
726 USHORT DiskEquipment = *(PUSHORT)MEM_DISK_EQUIP & ~(*(PUCHAR)MEM_RDISK_EQUIP);
727 UCHAR IdeDetectedCount;
728 UCHAR i;
729
730 TRACE("Pc98InitializeBootDevices()\n");
731
733
734 /*
735 * Map DA/UA to drive number, i.e.
736 * 0x90 -> 0x30
737 * 0x80 -> 0x80
738 * 0xA0 -> 0x81, etc.
739 */
740
741 /* Map floppies */
742
743 for (i = 0; i < 4; i++)
744 {
745 DiskDrive = &Pc98DiskDrive[FakeFloppyDriveNumber];
746 if (FIRSTBYTE(DiskEquipment) & (1 << i))
747 {
748 if (InitFloppyDrive(0x30 + i, DiskDrive) || InitFloppyDrive(0xB0 + i, DiskDrive) ||
749 InitFloppyDrive(0x90 + i, DiskDrive) || InitFloppyDrive(0x10 + i, DiskDrive))
750 ++FakeFloppyDriveNumber;
751 }
752 }
753
754 for (i = 0; i < 4; i++)
755 {
756 DiskDrive = &Pc98DiskDrive[FakeFloppyDriveNumber];
757 if (FIRSTBYTE(DiskEquipment) & (16 << i))
758 {
759 if (InitFloppyDrive(0x50 + i, DiskDrive))
760 ++FakeFloppyDriveNumber;
761 }
762 }
763
764 for (i = 0; i < 4; i++)
765 {
766 DiskDrive = &Pc98DiskDrive[FakeFloppyDriveNumber];
767 if (SECONDBYTE(DiskEquipment) & (16 << i))
768 {
769 if (InitFloppyDrive(0x70 + i, DiskDrive) || InitFloppyDrive(0xF0 + i, DiskDrive))
770 ++FakeFloppyDriveNumber;
771 }
772 }
773
774 /* Map IDE/SASI drives */
775
776 for (i = 0; i < 4; i++)
777 {
778 DiskDrive = &Pc98DiskDrive[FakeHardDriveDriveNumber];
779 if (InitHardDrive(0x80 + i, DiskDrive) || InitHardDrive(0x00 + i, DiskDrive))
780 ++FakeHardDriveDriveNumber;
781 }
782
783 AtaInit(&IdeDetectedCount);
784 for (i = 0; i <= IdeDetectedCount; i++)
785 {
786 DiskDrive = &Pc98DiskDrive[FakeCdRomDriveNumber];
787 if (InitIdeDrive(i, DiskDrive))
788 ++FakeCdRomDriveNumber;
789 }
790
791 /* Map SCSI drives */
792
793 for (i = 0; i < 7; i++)
794 {
795 DiskDrive = &Pc98DiskDrive[FakeHardDriveDriveNumber];
796 if (InitScsiDrive(0xA0 + i, DiskDrive) || InitScsiDrive(0x20 + i, DiskDrive))
797 {
798 if (DiskDrive->Type & DRIVE_CDROM || DiskDrive->Type & DRIVE_MO)
799 {
800 /* Move to CD-ROM area */
801 Pc98DiskDrive[FakeCdRomDriveNumber] = *DiskDrive;
802 RtlZeroMemory(DiskDrive, sizeof(PC98_DISK_DRIVE));
803 ++FakeCdRomDriveNumber;
804 }
805 else
806 {
807 ++FakeHardDriveDriveNumber;
808 }
809 }
810 }
811
812#if 1
813 // Ugly HACK: Force ISO boot
814 // FIXME: Fill ARC disk blocks completely
815 // to allow usage of CD-ROM root path (See floppy_pc98.ini).
816 FrldrBootDrive = 0xE0;
817 FrldrBootPartition = 0xFF;
818#else
819 /* Reassign boot drive */
820 for (i = 0; i < MAX_DRIVES - 1; i++)
821 {
822 DiskDrive = &Pc98DiskDrive[i];
823 if (DiskDrive->Initialized && DiskDrive->DaUa == FrldrBootDrive)
824 {
825 TRACE("Boot drive: old 0x%x, new 0x%x\n", FrldrBootDrive, i);
827 break;
828 }
829 }
830#endif
831
832 /* Call PC version */
834}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:473
BOOLEAN AtaInit(OUT PUCHAR DetectedCount)
Definition: hwide.c:139
#define DRIVE_MO
Definition: machpc98.h:121
static BOOLEAN InitHardDrive(IN UCHAR DaUa, IN OUT PPC98_DISK_DRIVE DiskDrive)
Definition: pc98disk.c:544
static BOOLEAN InitFloppyDrive(IN UCHAR DaUa, IN OUT PPC98_DISK_DRIVE DiskDrive)
Definition: pc98disk.c:608
#define MAX_DRIVES
Definition: pc98disk.c:19
static BOOLEAN InitIdeDrive(IN UCHAR UnitNumber, IN OUT PPC98_DISK_DRIVE DiskDrive)
Definition: pc98disk.c:505
static BOOLEAN InitScsiDrive(IN UCHAR DaUa, IN OUT PPC98_DISK_DRIVE DiskDrive)
Definition: pc98disk.c:404
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
UCHAR FrldrBootDrive
Definition: uefidisk.c:47
ULONG FrldrBootPartition
Definition: uefidisk.c:48

Referenced by MachInit().

◆ Pc98MemGetMemoryMap()

PFREELDR_MEMORY_DESCRIPTOR Pc98MemGetMemoryMap ( ULONG MemoryMapSize)

Definition at line 48 of file pc98mem.c.

49{
50 USHORT ConventionalMemory, ExtendedMemory;
51 ULONG ExtendedMemory16;
52
53 TRACE("Pc98MemGetMemoryMap()\n");
54
57
58 ConventionalMemory = ((*(PUCHAR)MEM_BIOS_FLAG1 & CONVENTIONAL_MEMORY_SIZE) + 1) * 128;
59 ExtendedMemory = *(PUCHAR)MEM_EXPMMSZ * 128;
60 ExtendedMemory16 = (*(PUCHAR)MEM_EXPMMSZ16M_LOW + (*(PUCHAR)MEM_EXPMMSZ16M_HIGH << 8)) * 1024;
61
62 if (ConventionalMemory > 640 && !HiResoMachine)
63 ConventionalMemory = 640;
64
65 TRACE("Total conventional memory %d kB available.\n", ConventionalMemory);
66 TRACE("Total extended memory %d kB available.\n", ExtendedMemory);
67 TRACE("Total extended high memory %d kB available.\n", ExtendedMemory16);
68 TRACE("Installed physical memory %d kB.\n", ConventionalMemory + ExtendedMemory + ExtendedMemory16);
69
70 /* First, setup allowed ranges */
71 SetMemory(Pc98MemoryMap, 0x0000600, ConventionalMemory * KB, LoaderFree);
72 SetMemory(Pc98MemoryMap, 0x0100000, ExtendedMemory * KB, LoaderFree);
73 SetMemory(Pc98MemoryMap, 0x1000000, ExtendedMemory16 * KB, LoaderFree);
74
75 /* Next, setup some protected ranges */
76 if (HiResoMachine)
77 {
78 SetMemory(Pc98MemoryMap, 0x000000, 1 * KB, LoaderFirmwarePermanent); /* Real mode IVT */
79 SetMemory(Pc98MemoryMap, 0x000400, 512, LoaderFirmwarePermanent); /* Real mode BDA */
80 SetMemory(Pc98MemoryMap, 0x080000, 256 * KB, LoaderFirmwarePermanent);/* Memory Window */
81 SetMemory(Pc98MemoryMap, 0x0C0000, 128 * KB, LoaderFirmwarePermanent);/* VRAM */
82 SetMemory(Pc98MemoryMap, 0x0E0000, 16 * KB, LoaderFirmwarePermanent); /* Text VRAM */
83 SetMemory(Pc98MemoryMap, 0x0E4000, 4 * KB, LoaderFirmwarePermanent); /* CG Window */
84 SetMemory(Pc98MemoryMap, 0x0E5000, 103 * KB, LoaderSpecialMemory); /* BIOS ROM */
85 SetMemory(Pc98MemoryMap, 0xF00000, 640 * KB, LoaderSpecialMemory); /* Reserved */
86 }
87 else
88 {
89 SetMemory(Pc98MemoryMap, 0x000000, 1 * KB, LoaderFirmwarePermanent); /* Real mode IVT */
90 SetMemory(Pc98MemoryMap, 0x000400, 512, LoaderFirmwarePermanent); /* Real mode BDA */
91 SetMemory(Pc98MemoryMap, 0x000600 + ConventionalMemory * KB,
92 (640 - ConventionalMemory) * KB, LoaderSpecialMemory); /* External bus */
93 SetMemory(Pc98MemoryMap, 0x0A0000, 16 * KB, LoaderFirmwarePermanent); /* Text VRAM */
94 SetMemory(Pc98MemoryMap, 0x0A4000, 4 * KB, LoaderFirmwarePermanent); /* CG Window */
95 SetMemory(Pc98MemoryMap, 0x0A5000, 12 * KB, LoaderFirmwarePermanent); /* Reserved */
96 SetMemory(Pc98MemoryMap, 0x0A8000, 96 * KB, LoaderFirmwarePermanent); /* VRAM (Plane B, R, G) */
97 SetMemory(Pc98MemoryMap, 0x0C0000, 128 * KB, LoaderSpecialMemory); /* BIOS ROM (Peripherals) */
98 SetMemory(Pc98MemoryMap, 0x0E0000, 32 * KB, LoaderFirmwarePermanent); /* VRAM (Plane I) */
99 SetMemory(Pc98MemoryMap, 0x0E8000, 96 * KB, LoaderSpecialMemory); /* BIOS ROM */
100 SetMemory(Pc98MemoryMap, 0xF00000, 640 * KB, LoaderSpecialMemory); /* Reserved */
101 }
102
103 *MemoryMapSize = PcMemFinalizeMemoryMap(Pc98MemoryMap);
104 return Pc98MemoryMap;
105}
#define MEM_EXPMMSZ16M_HIGH
Definition: machpc98.h:50
#define MEM_EXPMMSZ16M_LOW
Definition: machpc98.h:47
#define MEM_BIOS_FLAG1
Definition: machpc98.h:35
#define MEM_EXPMMSZ
Definition: machpc98.h:19
#define CONVENTIONAL_MEMORY_SIZE
Definition: machpc98.h:36
#define KB
Definition: pc98mem.c:40
ULONG PcMemFinalizeMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap)
Definition: pcmem.c:547
static FREELDR_MEMORY_DESCRIPTOR Pc98MemoryMap[MAX_BIOS_DESCRIPTORS+1]
Definition: pc98mem.c:43
VOID SetMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType)
Definition: pcmem.c:527
BOOLEAN HiResoMachine
Definition: machpc98.c:17
#define MAX_BIOS_DESCRIPTORS
Definition: pcbios.h:12
ULONG PcBiosMapCount
Definition: pcmem.c:38
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS]
Definition: pcmem.c:37
@ LoaderFree
Definition: arc.h:176
@ LoaderFirmwarePermanent
Definition: arc.h:180
@ LoaderSpecialMemory
Definition: arc.h:196

Referenced by MachInit().

◆ Pc98PrepareForReactOS()

VOID Pc98PrepareForReactOS ( VOID  )

Definition at line 35 of file machpc98.c.

36{
41}
#define DebugDisableScreenPort()
Definition: debug.h:123
VOID Pc98DiskPrepareForReactOS(VOID)
Definition: pc98disk.c:135
VOID __cdecl DiskStopFloppyMotor(VOID)
Definition: pc98hw.c:1235
VOID Pc98VideoPrepareForReactOS(VOID)
Definition: pc98video.c:445

Referenced by MachInit().

◆ Pc98VideoClearScreen()

VOID Pc98VideoClearScreen ( UCHAR  Attr)

Definition at line 167 of file pc98video.c.

168{
169 USHORT i;
170 USHORT B = (Attr & 0x10) ? 0xFFFF : 0;
171 USHORT G = (Attr & 0x20) ? 0xFFFF : 0;
172 USHORT R = (Attr & 0x40) ? 0xFFFF : 0;
173 USHORT I = (Attr & 0x80) ? 0xFFFF : 0;
174
175 for (i = 0; i < VRAM_TEXT_SIZE; i += TEXT_CHAR_SIZE)
176 *(PUSHORT)(VramText + i) = ' ';
177
178 for (i = 0; i < BYTES_PER_SCANLINE * SCREEN_HEIGHT; i += sizeof(USHORT))
179 {
180 *(PUSHORT)(VramPlaneB + i) = B;
181 *(PUSHORT)(VramPlaneG + i) = G;
182 *(PUSHORT)(VramPlaneR + i) = R;
183 *(PUSHORT)(VramPlaneI + i) = I;
184 }
185}
#define G(r, i, a, b, c, d)
Definition: blake2b-ref.c:117
Definition: ehthrow.cxx:54
#define B(row, col)
#define I(s)
static ULONG VramPlaneB
Definition: pc98video.c:41
ULONG VramText
Definition: pc98video.c:40
static ULONG VramPlaneG
Definition: pc98video.c:42
static ULONG VramPlaneR
Definition: pc98video.c:43
#define SCREEN_HEIGHT
Definition: pc98video.c:28
static ULONG VramPlaneI
Definition: pc98video.c:44
#define BYTES_PER_SCANLINE
Definition: pc98video.c:29
#define TEXT_CHAR_SIZE
Definition: pc98video.c:20
#define VRAM_TEXT_SIZE
Definition: video.h:19
#define R(b, x)
Definition: sha2.c:134

Referenced by ChainLoadBiosBootSectorCode(), and MachInit().

◆ Pc98VideoCopyOffScreenBufferToVRAM()

VOID Pc98VideoCopyOffScreenBufferToVRAM ( PVOID  Buffer)

Definition at line 383 of file pc98video.c.

384{
385 PUCHAR OffScreenBuffer = (PUCHAR)Buffer;
386 USHORT X, Y;
387
388 for (Y = 0; Y < SCREEN_HEIGHT / CHAR_HEIGHT; Y++)
389 {
390 for (X = 0; X < SCREEN_WIDTH / CHAR_WIDTH; X++)
391 {
392 Pc98VideoPutChar(OffScreenBuffer[0], OffScreenBuffer[1], X, Y);
393 OffScreenBuffer += VGA_CHAR_SIZE;
394 }
395 }
396}
Definition: bufpool.h:45
#define Y(I)
#define X(b, s)
#define SCREEN_WIDTH
Definition: pc98video.c:27
#define VGA_CHAR_SIZE
Definition: pc98video.c:18
#define CHAR_WIDTH
Definition: pc98video.c:24
VOID Pc98VideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pc98video.c:316
#define CHAR_HEIGHT
Definition: pc98video.c:25

Referenced by MachInit().

◆ Pc98VideoGetBufferSize()

ULONG Pc98VideoGetBufferSize ( VOID  )

Definition at line 203 of file pc98video.c.

204{
206}

Referenced by MachInit().

◆ Pc98VideoGetDisplaySize()

VOID Pc98VideoGetDisplaySize ( PULONG  Width,
PULONG  Height,
PULONG  Depth 
)

Definition at line 195 of file pc98video.c.

196{
199 *Depth = 0;
200}
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819

Referenced by MachInit().

◆ Pc98VideoGetFontsFromFirmware()

VOID Pc98VideoGetFontsFromFirmware ( PULONG  RomFontPointers)

Definition at line 209 of file pc98video.c.

210{
211 *RomFontPointers = VramText + 0x4000;
212}
#define RomFontPointers
Definition: winldr.c:348

Referenced by MachInit().

◆ Pc98VideoGetPaletteColor()

VOID Pc98VideoGetPaletteColor ( UCHAR  Color,
UCHAR Red,
UCHAR Green,
UCHAR Blue 
)

Definition at line 417 of file pc98video.c.

418{
419 if (Color < 16)
420 {
425 }
426 else
427 {
428 *Red = 0;
429 *Green = 0;
430 *Blue = 0;
431 }
432}
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define GDC2_IO_i_BLUE
Definition: video.h:267
#define GDC2_IO_o_PALETTE_INDEX
Definition: video.h:275
#define GDC2_IO_i_RED
Definition: video.h:266
#define GDC2_IO_i_GREEN
Definition: video.h:265

Referenced by MachInit().

◆ Pc98VideoHideShowTextCursor()

VOID Pc98VideoHideShowTextCursor ( BOOLEAN  Show)

Definition at line 228 of file pc98video.c.

229{
230 CSRFORMPARAM CursorParameters;
231
232 RtlZeroMemory(&CursorParameters, sizeof(CSRFORMPARAM));
233 CursorParameters.Show = Show;
234 CursorParameters.Blink = TRUE;
235 CursorParameters.BlinkRate = 12;
236 CursorParameters.LinesPerRow = 16;
237 CursorParameters.StartScanLine = 12;
238 CursorParameters.EndScanLine = 15;
239
241 WRITE_GDC_CSRFORM((PUCHAR)GDC1_IO_o_PARAM, &CursorParameters);
242}
FORCEINLINE VOID WRITE_GDC_CSRFORM(PUCHAR Port, PCSRFORMPARAM CursorParameters)
Definition: video.h:186
#define GDC1_IO_o_COMMAND
Definition: video.h:235
#define GDC1_IO_o_PARAM
Definition: video.h:234
#define GDC_COMMAND_CSRFORM
Definition: video.h:173
UCHAR StartScanLine
Definition: video.h:180
UCHAR LinesPerRow
Definition: video.h:179
BOOLEAN Show
Definition: video.h:176
UCHAR EndScanLine
Definition: video.h:181
BOOLEAN Blink
Definition: video.h:177
UCHAR BlinkRate
Definition: video.h:178

Referenced by MachInit(), and Pc98VideoPrepareForReactOS().

◆ Pc98VideoInit()

VOID Pc98VideoInit ( VOID  )

Definition at line 69 of file pc98video.c.

70{
71 REGS Regs;
72 USHORT i;
73
74 if (HiResoMachine)
75 {
81 TextCols = 80;
82 TextLines = 31;
83 }
84 else
85 {
91 TextCols = 80;
92 TextLines = 25;
93 }
94
95 for (i = 0; i < VRAM_ATTR_SIZE; i += TEXT_CHAR_SIZE)
97
98 /* Int 18h AH=41h
99 * CRT BIOS - Stop displaying graphics
100 */
101 Regs.b.ah = 0x41;
102 Int386(0x18, &Regs, &Regs);
103
104 /* Int 18h AH=42h
105 * CRT BIOS - Set display area
106 *
107 * CH0-CH3 - always zero
108 * CH4 - video page
109 * CH5 - CRT display mode
110 * 0 - color
111 * 1 - monochrome
112 * CH6-CH7 - VRAM area
113 * 01 - Upper-half (16-32 kB), 640x200
114 * 10 - Lower-half (0-16 kB), 640x200
115 * 11 - All (0-32 kB), 640x400
116 */
117 Regs.b.ah = 0x42;
118 Regs.b.ch = 0xC0;
119 Int386(0x18, &Regs, &Regs); /* 640x400 */
120
124
126 for (i = 0; i < RTL_NUMBER_OF(CgaPalette); i++)
128
129 /* Int 18h AH=0Ah
130 * CRT BIOS - Set text screen mode
131 *
132 * AL0 - text rows
133 * 0 - 25
134 * 1 - 20
135 * AL1 - text cols
136 * 0 - 80
137 * 1 - 40
138 * AL2 - text attribute
139 * 0 - with vertical line
140 * 1 - normal
141 * AL3 - KCG access mode
142 * 0 - code
143 * 1 - bitmap
144 * AL4-AL7 - always zero
145 *
146 * High-resolution machine:
147 * AL4 - text rows, AL3 - KCG access mode
148 */
149 Regs.b.ah = 0x0A;
150 Regs.b.al = HiResoMachine ? 0x10 : 0x00;
151 Int386(0x18, &Regs, &Regs); /* 80x25(31) */
152
153 /* Int 18h AH=0Ch
154 * CRT BIOS - Start displaying text
155 */
156 Regs.b.ah = 0x0C;
157 Int386(0x18, &Regs, &Regs);
158
159 /* Int 18h AH=40h
160 * CRT BIOS - Start displaying graphics
161 */
162 Regs.b.ah = 0x40;
163 Int386(0x18, &Regs, &Regs);
164}
UCHAR TextLines
Definition: pc98video.c:22
UCHAR TextCols
Definition: pc98video.c:21
VOID Pc98VideoSync(VOID)
Definition: pc98video.c:435
VOID Pc98VideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: pc98video.c:405
BOOLEAN HiResoMachine
Definition: machpc98.c:17
static const PALETTE_ENTRY CgaPalette[]
Definition: pc98video.c:46
#define VRAM_TEXT_ATTR_OFFSET
Definition: video.h:18
#define GDC2_IO_o_MODE_FLIPFLOP2
Definition: video.h:280
#define VRAM_ATTR_SIZE
Definition: video.h:20
#define GDC_ATTR_VISIBLE
Definition: video.h:45
#define VRAM_HI_RESO_PLANE_B
Definition: video.h:28
#define GDC2_IO_o_VIDEO_PAGE_ACCESS
Definition: video.h:274
#define VRAM_HI_RESO_PLANE_R
Definition: video.h:30
#define VRAM_NORMAL_PLANE_B
Definition: video.h:12
#define VRAM_HI_RESO_PLANE_I
Definition: video.h:31
#define VRAM_HI_RESO_PLANE_G
Definition: video.h:29
#define GDC_ATTR_WHITE
Definition: video.h:58
#define VRAM_NORMAL_TEXT
Definition: video.h:17
#define GDC2_IO_o_VIDEO_PAGE
Definition: video.h:273
#define GDC2_MODE_COLORS_16
Definition: video.h:282
#define VRAM_NORMAL_PLANE_I
Definition: video.h:15
#define VRAM_NORMAL_PLANE_G
Definition: video.h:13
#define VRAM_HI_RESO_TEXT
Definition: video.h:32
#define VRAM_NORMAL_PLANE_R
Definition: video.h:14
unsigned char ch
Definition: pcbios.h:138

Referenced by MachInit().

◆ Pc98VideoIsPaletteFixed()

BOOLEAN Pc98VideoIsPaletteFixed ( VOID  )

Definition at line 399 of file pc98video.c.

400{
401 return FALSE;
402}

Referenced by MachInit().

◆ Pc98VideoPrepareForReactOS()

VOID Pc98VideoPrepareForReactOS ( VOID  )

Definition at line 445 of file pc98video.c.

446{
447 REGS Regs;
448
449 /* Int 18h AH=41h
450 * CRT BIOS - Stop displaying graphics
451 */
452 Regs.b.ah = 0x41;
453 Int386(0x18, &Regs, &Regs);
454
456
457 if (UseCGFont && CGAccelDraw)
458 {
459 /* Clear the text screen, resetting to default attributes */
460 for (USHORT i = 0; i < VRAM_TEXT_SIZE; i += TEXT_CHAR_SIZE)
461 {
462 *(PUSHORT)(VramText + i) = ' ';
464 }
465 }
466}
static BOOLEAN CGAccelDraw
Definition: pc98video.c:36
VOID Pc98VideoHideShowTextCursor(BOOLEAN Show)
Definition: pc98video.c:228
static BOOLEAN UseCGFont
Definition: pc98video.c:32

Referenced by Pc98PrepareForReactOS().

◆ Pc98VideoPutChar()

VOID Pc98VideoPutChar ( int  Ch,
UCHAR  Attr,
unsigned  X,
unsigned  Y 
)

Definition at line 316 of file pc98video.c.

317{
318 UCHAR Line;
319 UCHAR B = (Attr & 0x10) ? 0xFF : 0;
320 UCHAR G = (Attr & 0x20) ? 0xFF : 0;
321 UCHAR R = (Attr & 0x40) ? 0xFF : 0;
322 UCHAR I = (Attr & 0x80) ? 0xFF : 0;
323 ULONG VramOffset = X + (Y * CHAR_HEIGHT) * BYTES_PER_SCANLINE;
324 PUCHAR FontPtr = BitmapFont8x16 + Ch * 16;
325 BOOLEAN CGFont = UseCGFont && (Ch != LIGHT_FILL && Ch != MEDIUM_FILL && Ch != DARK_FILL);
326
327 if (CGFont)
328 {
330
331 if (CGAccelDraw)
332 {
333 Pc98VideoTextRamPutChar(Ch, Attr, X, Y);
334 }
335 else
336 {
337 /* Set needed character code to obtain glyph from CG Window */
340 }
341 }
342 else if (UseCGFont && CGAccelDraw)
343 {
344 /* Clear character at this place in Text RAM */
345 Pc98VideoTextRamPutChar(' ', Attr, X, Y);
346 }
347
348 for (Line = 0; Line < CHAR_HEIGHT; Line++)
349 {
350 if (CGFont)
351 {
352 if (CGAccelDraw)
353 {
354 /* Character is already displayed by GDC (Text RAM),
355 * so display only background for it. */
356 FontPtr[Line] = 0;
357 }
358 else
359 {
360 /* Obtain glyph data from CG Window */
363 }
364 }
365 if (Attr & 0x0F)
366 {
367 *(PUCHAR)(VramPlaneB + VramOffset + Line * BYTES_PER_SCANLINE) = B | ((Attr & 0x01) ? FontPtr[Line] : 0);
368 *(PUCHAR)(VramPlaneG + VramOffset + Line * BYTES_PER_SCANLINE) = G | ((Attr & 0x02) ? FontPtr[Line] : 0);
369 *(PUCHAR)(VramPlaneR + VramOffset + Line * BYTES_PER_SCANLINE) = R | ((Attr & 0x04) ? FontPtr[Line] : 0);
370 *(PUCHAR)(VramPlaneI + VramOffset + Line * BYTES_PER_SCANLINE) = I | ((Attr & 0x08) ? FontPtr[Line] : 0);
371 }
372 else
373 {
374 *(PUCHAR)(VramPlaneB + VramOffset + Line * BYTES_PER_SCANLINE) = B & ~FontPtr[Line];
375 *(PUCHAR)(VramPlaneG + VramOffset + Line * BYTES_PER_SCANLINE) = G & ~FontPtr[Line];
376 *(PUCHAR)(VramPlaneR + VramOffset + Line * BYTES_PER_SCANLINE) = R & ~FontPtr[Line];
377 *(PUCHAR)(VramPlaneI + VramOffset + Line * BYTES_PER_SCANLINE) = I & ~FontPtr[Line];
378 }
379 }
380}
#define LIGHT_FILL
Definition: ui.h:310
#define MEDIUM_FILL
Definition: ui.h:311
#define DARK_FILL
Definition: ui.h:312
static VOID Pc98VideoTextRamPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pc98video.c:309
static USHORT Pc98AsciiToJisX(int Ch)
Definition: pc98video.c:281
UCHAR BitmapFont8x16[]
Definition: vgafont.c:12
#define KCG_IO_o_CHARCODE_HIGH
Definition: video.h:399
#define KCG_IO_o_LINE
Definition: video.h:401
#define KCG_IO_i_PATTERN
Definition: video.h:404
#define KCG_IO_o_CHARCODE_LOW
Definition: video.h:400
Definition: ncftp.h:79

Referenced by MachInit(), and Pc98VideoCopyOffScreenBufferToVRAM().

◆ Pc98VideoSetDisplayMode()

VIDEODISPLAYMODE Pc98VideoSetDisplayMode ( char DisplayMode,
BOOLEAN  Init 
)

Definition at line 188 of file pc98video.c.

189{
190 /* Not supported by hardware */
191 return VideoTextMode;
192}
@ VideoTextMode
Definition: machine.h:35

Referenced by MachInit().

◆ Pc98VideoSetPaletteColor()

VOID Pc98VideoSetPaletteColor ( UCHAR  Color,
UCHAR  Red,
UCHAR  Green,
UCHAR  Blue 
)

Definition at line 405 of file pc98video.c.

406{
407 if (Color < 16)
408 {
413 }
414}
#define GDC2_IO_o_RED
Definition: video.h:277
#define GDC2_IO_o_GREEN
Definition: video.h:276
#define GDC2_IO_o_BLUE
Definition: video.h:278

Referenced by MachInit(), and Pc98VideoInit().

◆ Pc98VideoSetTextCursorPosition()

VOID Pc98VideoSetTextCursorPosition ( UCHAR  X,
UCHAR  Y 
)

Definition at line 215 of file pc98video.c.

216{
217 CSRWPARAM CursorParameters;
218
219 RtlZeroMemory(&CursorParameters, sizeof(CSRWPARAM));
220 CursorParameters.CursorAddress = X + Y * TextCols;
221 CursorParameters.DotAddress = 0;
222
224 WRITE_GDC_CSRW((PUCHAR)GDC1_IO_o_PARAM, &CursorParameters);
225}
FORCEINLINE VOID WRITE_GDC_CSRW(PUCHAR Port, PCSRWPARAM CursorParameters)
Definition: video.h:160
#define GDC_COMMAND_CSRW
Definition: video.h:151
UCHAR DotAddress
Definition: video.h:155
ULONG CursorAddress
Definition: video.h:154

Referenced by MachInit().

◆ Pc98VideoSync()

VOID Pc98VideoSync ( VOID  )

Definition at line 435 of file pc98video.c.

436{
438 NOTHING;
439
441 NOTHING;
442}
#define NOTHING
Definition: input_list.c:10
#define GDC2_IO_i_STATUS
Definition: video.h:260
#define GDC_STATUS_VSYNC
Definition: video.h:41

Referenced by MachInit(), and Pc98VideoInit().

◆ PcFindPciBios()

BOOLEAN PcFindPciBios ( PPCI_REGISTRY_INFO  BusData)

Definition at line 80 of file hwpci.c.

81{
82 REGS RegsIn;
83 REGS RegsOut;
84
85 RegsIn.b.ah = 0xB1; /* Subfunction B1h */
86 RegsIn.b.al = 0x01; /* PCI BIOS present */
87
88 Int386(0x1A, &RegsIn, &RegsOut);
89
90 if (INT386_SUCCESS(RegsOut) &&
91 (RegsOut.d.edx == ' ICP') &&
92 (RegsOut.b.ah == 0))
93 {
94 TRACE("Found PCI bios\n");
95
96 TRACE("AL: %x\n", RegsOut.b.al);
97 TRACE("BH: %x\n", RegsOut.b.bh);
98 TRACE("BL: %x\n", RegsOut.b.bl);
99 TRACE("CL: %x\n", RegsOut.b.cl);
100
101 BusData->NoBuses = RegsOut.b.cl + 1;
102 BusData->MajorRevision = RegsOut.b.bh;
103 BusData->MinorRevision = RegsOut.b.bl;
104 BusData->HardwareMechanism = RegsOut.b.al;
105
106 return TRUE;
107 }
108
109 TRACE("No PCI bios found\n");
110
111 return FALSE;
112}
unsigned char bl
Definition: pcbios.h:134
unsigned char cl
Definition: pcbios.h:137
unsigned long edx
Definition: pcbios.h:94
UCHAR MajorRevision
Definition: pci.h:107
UCHAR NoBuses
Definition: pci.h:109
UCHAR HardwareMechanism
Definition: pci.h:110
UCHAR MinorRevision
Definition: pci.h:108
DWORDREGS d
Definition: pcbios.h:161

◆ PcInitializeBootDevices()

BOOLEAN PcInitializeBootDevices ( VOID  )

Definition at line 473 of file hwdisk.c.

474{
475 UCHAR DiskCount;
476 BOOLEAN BootDriveReported = FALSE;
477 ULONG i;
478
479 DiskCount = EnumerateHarddisks(&BootDriveReported);
480
481 /* Initialize FrLdrBootPath, the boot path we're booting from (the "SystemPartition") */
483
484 /* Add it, if it's a floppy or cdrom */
485 if ((FrldrBootDrive >= FIRST_BIOS_DISK && !BootDriveReported) ||
487 {
488 /* TODO: Check if it's really a CDROM drive */
489
492 ULONG Checksum = 0;
494
495 /* Read the MBR */
497 {
498 ERR("Reading MBR failed\n");
499 return FALSE;
500 }
501
504
505 Signature = Mbr->Signature;
506 TRACE("Signature: %x\n", Signature);
507
508 /* Calculate the MBR checksum */
509 for (i = 0; i < 2048 / sizeof(ULONG); i++)
510 {
511 Checksum += Buffer[i];
512 }
513 Checksum = ~Checksum + 1;
514 TRACE("Checksum: %x\n", Checksum);
515
516 /* Fill out the ARC disk block */
518
520 DiskCount++; // This is not accounted for in the number of pre-enumerated BIOS drives!
521 TRACE("Additional boot drive detected: 0x%02X\n", (int)FrldrBootDrive);
522 }
523
524 return (DiskCount != 0);
525}
VOID AddReactOSArcDiskInfo(IN PSTR ArcName, IN ULONG Signature, IN ULONG Checksum, IN BOOLEAN ValidPartitionTable)
Definition: archwsup.c:77
struct _MASTER_BOOT_RECORD * PMASTER_BOOT_RECORD
VOID FsRegisterDevice(CHAR *Prefix, const DEVVTBL *FuncTable)
Definition: fs.c:385
#define MachDiskReadLogicalSectors(Drive, Start, Count, Buf)
Definition: machine.h:126
static const WCHAR Signature[]
Definition: parser.c:141
CCHAR FrLdrBootPath[MAX_PATH]
Definition: freeldr.c:39
BOOLEAN PxeInit(VOID)
Definition: pxe.c:346
static const DEVVTBL DiskVtbl
Definition: hwdisk.c:241
static BOOLEAN DiskGetBootPath(BOOLEAN IsPxe)
Definition: hwdisk.c:420
static BOOLEAN DiskIsDriveRemovable(UCHAR DriveNumber)
Definition: hwdisk.c:405
PVOID DiskReadBuffer
Definition: hwdisk.c:49
#define FIRST_BIOS_DISK
Definition: hwdisk.c:31
static UCHAR EnumerateHarddisks(OUT PBOOLEAN BootDriveReported)
Definition: hwdisk.c:345
ULONG Signature
Definition: disk.h:75
uint32_t * PULONG
Definition: typedefs.h:59

Variable Documentation

◆ FrldrBootDrive

UCHAR FrldrBootDrive
extern

Definition at line 47 of file uefidisk.c.

◆ FrldrBootPartition

ULONG FrldrBootPartition
extern

Definition at line 48 of file uefidisk.c.

◆ PcBiosMapCount

ULONG PcBiosMapCount
extern

Definition at line 38 of file pcmem.c.

◆ PcBiosMemoryMap

BIOS_MEMORY_MAP PcBiosMemoryMap[]
extern

Definition at line 37 of file pcmem.c.