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 along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 typedef enum tagVIDEODISPLAYMODE
38 } VIDEODISPLAYMODE
, *PVIDEODISPLAYMODE
;
40 typedef struct tagMACHVTBL
42 VOID (*ConsPutChar
)(int Ch
);
43 BOOLEAN (*ConsKbHit
)(VOID
);
44 int (*ConsGetCh
)(VOID
);
46 VOID (*VideoClearScreen
)(UCHAR Attr
);
47 VIDEODISPLAYMODE (*VideoSetDisplayMode
)(char *DisplayMode
, BOOLEAN Init
);
48 VOID (*VideoGetDisplaySize
)(PULONG Width
, PULONG Height
, PULONG Depth
);
49 ULONG (*VideoGetBufferSize
)(VOID
);
50 VOID (*VideoSetTextCursorPosition
)(UCHAR X
, UCHAR Y
);
51 VOID (*VideoHideShowTextCursor
)(BOOLEAN Show
);
52 VOID (*VideoPutChar
)(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
53 VOID (*VideoCopyOffScreenBufferToVRAM
)(PVOID Buffer
);
54 BOOLEAN (*VideoIsPaletteFixed
)(VOID
);
55 VOID (*VideoSetPaletteColor
)(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
56 VOID (*VideoGetPaletteColor
)(UCHAR Color
, UCHAR
* Red
, UCHAR
* Green
, UCHAR
* Blue
);
57 VOID (*VideoSync
)(VOID
);
59 VOID (*PrepareForReactOS
)(IN BOOLEAN Setup
);
61 MEMORY_DESCRIPTOR
* (*GetMemoryDescriptor
)(MEMORY_DESCRIPTOR
* Current
);
62 PBIOS_MEMORY_MAP (*GetMemoryMap
)(PULONG MemoryMapSize
);
64 BOOLEAN (*DiskGetBootPath
)(char *BootPath
, unsigned Size
);
65 BOOLEAN (*DiskReadLogicalSectors
)(UCHAR DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
66 BOOLEAN (*DiskGetDriveGeometry
)(UCHAR DriveNumber
, PGEOMETRY DriveGeometry
);
67 ULONG (*DiskGetCacheableBlockCount
)(UCHAR DriveNumber
);
69 TIMEINFO
* (*GetTime
)(VOID
);
70 ULONG (*GetRelativeTime
)(VOID
);
72 PCONFIGURATION_COMPONENT_DATA (*HwDetect
)(VOID
);
73 } MACHVTBL
, *PMACHVTBL
;
75 VOID
MachInit(const char *CmdLine
);
77 extern MACHVTBL MachVtbl
;
79 VOID
MachConsPutChar(int Ch
);
80 BOOLEAN
MachConsKbHit(VOID
);
81 int MachConsGetCh(VOID
);
82 VOID
MachVideoClearScreen(UCHAR Attr
);
83 VIDEODISPLAYMODE
MachVideoSetDisplayMode(char *DisplayMode
, BOOLEAN Init
);
84 VOID
MachVideoGetDisplaySize(PULONG Width
, PULONG Height
, PULONG Depth
);
85 ULONG
MachVideoGetBufferSize(VOID
);
86 VOID
MachVideoSetTextCursorPosition(UCHAR X
, UCHAR Y
);
87 VOID
MachVideoHideShowTextCursor(BOOLEAN Show
);
88 VOID
MachVideoPutChar(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
89 VOID
MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer
);
90 BOOLEAN
MachVideoIsPaletteFixed(VOID
);
91 VOID
MachVideoSetPaletteColor(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
92 VOID
MachVideoGetPaletteColor(UCHAR Color
, UCHAR
*Red
, UCHAR
*Green
, UCHAR
*Blue
);
93 VOID
MachVideoSync(VOID
);
95 BOOLEAN
MachDiskGetBootPath(char *BootPath
, unsigned Size
);
96 BOOLEAN
MachDiskNormalizeSystemPath(char *SystemPath
, unsigned Size
);
97 BOOLEAN
MachDiskReadLogicalSectors(UCHAR DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
98 BOOLEAN
MachDiskGetDriveGeometry(UCHAR DriveNumber
, PGEOMETRY DriveGeometry
);
99 ULONG
MachDiskGetCacheableBlockCount(UCHAR DriveNumber
);
100 VOID
MachPrepareForReactOS(IN BOOLEAN Setup
);
102 #define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
103 #define MachConsKbHit() MachVtbl.ConsKbHit()
104 #define MachConsGetCh() MachVtbl.ConsGetCh()
105 #define MachVideoClearScreen(Attr) MachVtbl.VideoClearScreen(Attr)
106 #define MachVideoSetDisplayMode(Mode, Init) MachVtbl.VideoSetDisplayMode((Mode), (Init))
107 #define MachVideoGetDisplaySize(W, H, D) MachVtbl.VideoGetDisplaySize((W), (H), (D))
108 #define MachVideoGetBufferSize() MachVtbl.VideoGetBufferSize()
109 #define MachVideoSetTextCursorPosition(X, Y) MachVtbl.VideoSetTextCursorPosition((X), (Y))
110 #define MachVideoHideShowTextCursor(Show) MachVtbl.VideoHideShowTextCursor(Show)
111 #define MachVideoPutChar(Ch, Attr, X, Y) MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
112 #define MachVideoCopyOffScreenBufferToVRAM(Buf) MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
113 #define MachVideoIsPaletteFixed() MachVtbl.VideoIsPaletteFixed()
114 #define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
115 #define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
116 #define MachVideoSync() MachVtbl.VideoSync()
117 #define MachBeep() MachVtbl.Beep()
118 #define MachPrepareForReactOS(a) MachVtbl.PrepareForReactOS(a)
119 #define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size))
120 #define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size))
121 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
122 #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
123 #define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
124 #define MachHwDetect() MachVtbl.HwDetect()