f91b4cba75082287d69079707c1d26dfa09dda8a
[reactos.git] / reactos / boot / freeldr / freeldr / machine.c
1 /* $Id$
2 *
3 * FreeLoader
4 *
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.
9 *
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.
14 *
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.
18 */
19
20 #include <freeldr.h>
21
22 #undef MachConsPutChar
23 #undef MachConsKbHit
24 #undef MachConsGetCh
25 #undef MachVideoClearScreen
26 #undef MachVideoSetDisplayMode
27 #undef MachVideoGetDisplaySize
28 #undef MachVideoGetBufferSize
29 #undef MachVideoSetTextCursorPosition
30 #undef MachVideoHideShowTextCursor
31 #undef MachVideoPutChar
32 #undef MachVideoCopyOffScreenBufferToVRAM
33 #undef MachVideoIsPaletteFixed
34 #undef MachVideoSetPaletteColor
35 #undef MachVideoGetPaletteColor
36 #undef MachVideoSync
37 #undef MachVideoPrepareForReactOS
38 #undef MachGetMemoryMap
39 #undef MachDiskGetBootVolume
40 #undef MachDiskGetSystemVolume
41 #undef MachDiskGetBootPath
42 #undef MachDiskGetBootDevice
43 #undef MachDiskBootingFromFloppy
44 #undef MachDiskNormalizeSystemPath
45 #undef MachDiskReadLogicalSectors
46 #undef MachDiskGetPartitionEntry
47 #undef MachDiskGetDriveGeometry
48 #undef MachDiskGetCacheableBlockCount
49 #undef MachRTCGetCurrentDateTime
50 #undef MachHwDetect
51
52 MACHVTBL MachVtbl;
53
54 VOID
55 MachConsPutChar(int Ch)
56 {
57 MachVtbl.ConsPutChar(Ch);
58 }
59
60 BOOLEAN
61 MachConsKbHit()
62 {
63 return MachVtbl.ConsKbHit();
64 }
65
66 int
67 MachConsGetCh()
68 {
69 return MachVtbl.ConsGetCh();
70 }
71
72 VOID
73 MachVideoClearScreen(UCHAR Attr)
74 {
75 MachVtbl.VideoClearScreen(Attr);
76 }
77
78 VIDEODISPLAYMODE
79 MachVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init)
80 {
81 return MachVtbl.VideoSetDisplayMode(DisplayMode, Init);
82 }
83
84 VOID
85 MachVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
86 {
87 return MachVtbl.VideoGetDisplaySize(Width, Height, Depth);
88 }
89
90 ULONG
91 MachVideoGetBufferSize(VOID)
92 {
93 return MachVtbl.VideoGetBufferSize();
94 }
95
96 VOID
97 MachVideoSetTextCursorPosition(ULONG X, ULONG Y)
98 {
99 return MachVtbl.VideoSetTextCursorPosition(X, Y);
100 }
101
102 VOID
103 MachVideoHideShowTextCursor(BOOLEAN Show)
104 {
105 MachVtbl.VideoHideShowTextCursor(Show);
106 }
107
108 VOID
109 MachVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
110 {
111 MachVtbl.VideoPutChar(Ch, Attr, X, Y);
112 }
113
114 VOID
115 MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
116 {
117 MachVtbl.VideoCopyOffScreenBufferToVRAM(Buffer);
118 }
119
120 BOOLEAN
121 MachVideoIsPaletteFixed(VOID)
122 {
123 return MachVtbl.VideoIsPaletteFixed();
124 }
125
126 VOID
127 MachVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
128 {
129 return MachVtbl.VideoSetPaletteColor(Color, Red, Green, Blue);
130 }
131
132 VOID
133 MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
134 {
135 return MachVtbl.VideoGetPaletteColor(Color, Red, Green, Blue);
136 }
137
138 VOID
139 MachVideoSync(VOID)
140 {
141 MachVtbl.VideoSync();
142 }
143
144 VOID
145 MachVideoPrepareForReactOS(IN BOOLEAN Setup)
146 {
147 MachVtbl.VideoPrepareForReactOS(Setup);
148 }
149
150 ULONG
151 MachGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize)
152 {
153 return MachVtbl.GetMemoryMap(BiosMemoryMap, MaxMemoryMapSize);
154 }
155
156 BOOLEAN
157 MachDiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType)
158 {
159 return MachVtbl.DiskGetBootVolume(DriveNumber, StartSector, SectorCount, FsType);
160 }
161
162 BOOLEAN
163 MachDiskGetSystemVolume(char *SystemPath,
164 char *RemainingPath,
165 PULONG Device,
166 PULONG DriveNumber,
167 PULONGLONG StartSector,
168 PULONGLONG SectorCount,
169 int *FsType)
170 {
171 return MachVtbl.DiskGetSystemVolume(SystemPath, RemainingPath, Device,
172 DriveNumber, StartSector, SectorCount,
173 FsType);
174 }
175
176 BOOLEAN
177 MachDiskGetBootPath(char *BootPath, unsigned Size)
178 {
179 return MachVtbl.DiskGetBootPath(BootPath, Size);
180 }
181
182 VOID
183 MachDiskGetBootDevice(PULONG BootDevice)
184 {
185 MachVtbl.DiskGetBootDevice(BootDevice);
186 }
187
188 BOOLEAN
189 MachDiskBootingFromFloppy()
190 {
191 return MachVtbl.DiskBootingFromFloppy();
192 }
193
194 BOOLEAN
195 MachDiskNormalizeSystemPath(char *SystemPath, unsigned Size)
196 {
197 return MachVtbl.DiskNormalizeSystemPath(SystemPath, Size);
198 }
199
200 BOOLEAN
201 MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
202 {
203 return MachVtbl.DiskReadLogicalSectors(DriveNumber, SectorNumber, SectorCount, Buffer);
204 }
205
206 BOOLEAN
207 MachDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry)
208 {
209 return MachVtbl.DiskGetPartitionEntry(DriveNumber, PartitionNumber, PartitionTableEntry);
210 }
211
212 BOOLEAN
213 MachDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry)
214 {
215 return MachVtbl.DiskGetDriveGeometry(DriveNumber, DriveGeometry);
216 }
217
218 ULONG
219 MachDiskGetCacheableBlockCount(ULONG DriveNumber)
220 {
221 return MachVtbl.DiskGetCacheableBlockCount(DriveNumber);
222 }
223
224 VOID
225 MachRTCGetCurrentDateTime(PULONG Year, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second)
226 {
227 MachVtbl.RTCGetCurrentDateTime(Year, Month, Day, Hour, Minute, Second);
228 }
229
230 VOID
231 MachHwDetect(VOID)
232 {
233 MachVtbl.HwDetect();
234 }
235
236 /* EOF */