5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 typedef enum tagVIDEODISPLAYMODE
39 } VIDEODISPLAYMODE
, *PVIDEODISPLAYMODE
;
41 typedef struct tagMACHVTBL
43 VOID (*ConsPutChar
)(int Ch
);
44 BOOLEAN (*ConsKbHit
)(VOID
);
45 int (*ConsGetCh
)(VOID
);
47 VOID (*VideoClearScreen
)(UCHAR Attr
);
48 VIDEODISPLAYMODE (*VideoSetDisplayMode
)(char *DisplayMode
, BOOLEAN Init
);
49 VOID (*VideoGetDisplaySize
)(PULONG Width
, PULONG Height
, PULONG Depth
);
50 ULONG (*VideoGetBufferSize
)(VOID
);
51 VOID (*VideoSetTextCursorPosition
)(ULONG X
, ULONG Y
);
52 VOID (*VideoHideShowTextCursor
)(BOOLEAN Show
);
53 VOID (*VideoPutChar
)(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
54 VOID (*VideoCopyOffScreenBufferToVRAM
)(PVOID Buffer
);
55 BOOLEAN (*VideoIsPaletteFixed
)(VOID
);
56 VOID (*VideoSetPaletteColor
)(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
57 VOID (*VideoGetPaletteColor
)(UCHAR Color
, UCHAR
* Red
, UCHAR
* Green
, UCHAR
* Blue
);
58 VOID (*VideoSync
)(VOID
);
60 VOID (*PrepareForReactOS
)(IN BOOLEAN Setup
);
62 MEMORY_DESCRIPTOR
* (*GetMemoryDescriptor
)(MEMORY_DESCRIPTOR
* Current
);
63 ULONG (*GetMemoryMap
)(PBIOS_MEMORY_MAP BiosMemoryMap
, ULONG MaxMemoryMapSize
);
65 BOOLEAN (*DiskGetBootPath
)(char *BootPath
, unsigned Size
);
66 BOOLEAN (*DiskNormalizeSystemPath
)(char *SystemPath
, unsigned Size
);
67 BOOLEAN (*DiskReadLogicalSectors
)(ULONG DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
68 BOOLEAN (*DiskGetPartitionEntry
)(ULONG DriveNumber
, ULONG PartitionNumber
, PPARTITION_TABLE_ENTRY PartitionTableEntry
);
69 BOOLEAN (*DiskGetDriveGeometry
)(ULONG DriveNumber
, PGEOMETRY DriveGeometry
);
70 ULONG (*DiskGetCacheableBlockCount
)(ULONG DriveNumber
);
72 TIMEINFO
* (*GetTime
)(VOID
);
73 ULONG (*GetRelativeTime
)(VOID
);
75 PCONFIGURATION_COMPONENT_DATA (*HwDetect
)(VOID
);
76 } MACHVTBL
, *PMACHVTBL
;
78 VOID
MachInit(const char *CmdLine
);
80 extern MACHVTBL MachVtbl
;
82 VOID
MachConsPutChar(int Ch
);
83 BOOLEAN
MachConsKbHit();
85 VOID
MachVideoClearScreen(UCHAR Attr
);
86 VIDEODISPLAYMODE
MachVideoSetDisplayMode(char *DisplayMode
, BOOLEAN Init
);
87 VOID
MachVideoGetDisplaySize(PULONG Width
, PULONG Height
, PULONG Depth
);
88 ULONG
MachVideoGetBufferSize(VOID
);
89 VOID
MachVideoSetTextCursorPosition(ULONG X
, ULONG Y
);
90 VOID
MachVideoHideShowTextCursor(BOOLEAN Show
);
91 VOID
MachVideoPutChar(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
92 VOID
MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer
);
93 BOOLEAN
MachVideoIsPaletteFixed(VOID
);
94 VOID
MachVideoSetPaletteColor(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
95 VOID
MachVideoGetPaletteColor(UCHAR Color
, UCHAR
*Red
, UCHAR
*Green
, UCHAR
*Blue
);
96 VOID
MachVideoSync(VOID
);
98 MEMORY_DESCRIPTOR
* ArcGetMemoryDescriptor(MEMORY_DESCRIPTOR
* Current
);
99 BOOLEAN
MachDiskGetBootPath(char *BootPath
, unsigned Size
);
100 BOOLEAN
MachDiskNormalizeSystemPath(char *SystemPath
, unsigned Size
);
101 BOOLEAN
MachDiskReadLogicalSectors(ULONG DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
102 BOOLEAN
MachDiskGetPartitionEntry(ULONG DriveNumber
, ULONG PartitionNumber
, PPARTITION_TABLE_ENTRY PartitionTableEntry
);
103 BOOLEAN
MachDiskGetDriveGeometry(ULONG DriveNumber
, PGEOMETRY DriveGeometry
);
104 ULONG
MachDiskGetCacheableBlockCount(ULONG DriveNumber
);
105 TIMEINFO
* ArcGetTime(VOID
);
106 ULONG
ArcGetRelativeTime(VOID
);
107 VOID
MachHwDetect(VOID
);
108 VOID
MachPrepareForReactOS(IN BOOLEAN Setup
);
110 #define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
111 #define MachConsKbHit() MachVtbl.ConsKbHit()
112 #define MachConsGetCh() MachVtbl.ConsGetCh()
113 #define MachVideoClearScreen(Attr) MachVtbl.VideoClearScreen(Attr)
114 #define MachVideoSetDisplayMode(Mode, Init) MachVtbl.VideoSetDisplayMode((Mode), (Init))
115 #define MachVideoGetDisplaySize(W, H, D) MachVtbl.VideoGetDisplaySize((W), (H), (D))
116 #define MachVideoGetBufferSize() MachVtbl.VideoGetBufferSize()
117 #define MachVideoSetTextCursorPosition(X, Y) MachVtbl.VideoSetTextCursorPosition((X), (Y))
118 #define MachVideoHideShowTextCursor(Show) MachVtbl.VideoHideShowTextCursor(Show)
119 #define MachVideoPutChar(Ch, Attr, X, Y) MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
120 #define MachVideoCopyOffScreenBufferToVRAM(Buf) MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
121 #define MachVideoIsPaletteFixed() MachVtbl.VideoIsPaletteFixed()
122 #define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
123 #define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
124 #define MachVideoSync() MachVtbl.VideoSync()
125 #define MachBeep() MachVtbl.Beep()
126 #define MachPrepareForReactOS(a) MachVtbl.PrepareForReactOS(a)
127 #define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size))
128 #define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size))
129 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
130 #define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry))
131 #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
132 #define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
133 #define MachHwDetect() MachVtbl.HwDetect()
135 #endif /* __MACHINE_H_ */