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.
31 typedef enum tagVIDEODISPLAYMODE
35 } VIDEODISPLAYMODE
, *PVIDEODISPLAYMODE
;
37 typedef struct tagMACHVTBL
39 VOID (*ConsPutChar
)(int Ch
);
40 BOOL (*ConsKbHit
)(VOID
);
41 int (*ConsGetCh
)(VOID
);
43 VOID (*VideoClearScreen
)(UCHAR Attr
);
44 VIDEODISPLAYMODE (*VideoSetDisplayMode
)(char *DisplayMode
, BOOL Init
);
45 VOID (*VideoGetDisplaySize
)(PULONG Width
, PULONG Height
, PULONG Depth
);
46 ULONG (*VideoGetBufferSize
)(VOID
);
47 VOID (*VideoSetTextCursorPosition
)(ULONG X
, ULONG Y
);
48 VOID (*VideoHideShowTextCursor
)(BOOL Show
);
49 VOID (*VideoPutChar
)(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
50 VOID (*VideoCopyOffScreenBufferToVRAM
)(PVOID Buffer
);
51 BOOL (*VideoIsPaletteFixed
)(VOID
);
52 VOID (*VideoSetPaletteColor
)(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
53 VOID (*VideoGetPaletteColor
)(UCHAR Color
, UCHAR
* Red
, UCHAR
* Green
, UCHAR
* Blue
);
54 VOID (*VideoSync
)(VOID
);
55 VOID (*VideoPrepareForReactOS
)(VOID
);
57 ULONG (*GetMemoryMap
)(PBIOS_MEMORY_MAP BiosMemoryMap
, ULONG MaxMemoryMapSize
);
59 BOOL (*DiskGetBootVolume
)(PULONG DriveNumber
, PULONGLONG StartSector
, PULONGLONG SectorCount
, int *FsType
);
60 BOOL (*DiskGetSystemVolume
)(char *SystemPath
, char *RemainingPath
, PULONG Device
, PULONG DriveNumber
, PULONGLONG StartSector
, PULONGLONG SectorCount
, int *FsType
);
61 BOOL (*DiskGetBootPath
)(char *BootPath
, unsigned Size
);
62 VOID (*DiskGetBootDevice
)(PULONG BootDevice
);
63 BOOL (*DiskBootingFromFloppy
)(VOID
);
64 BOOL (*DiskNormalizeSystemPath
)(char *SystemPath
, unsigned Size
);
65 BOOL (*DiskReadLogicalSectors
)(ULONG DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
66 BOOL (*DiskGetPartitionEntry
)(ULONG DriveNumber
, ULONG PartitionNumber
, PPARTITION_TABLE_ENTRY PartitionTableEntry
);
67 BOOL (*DiskGetDriveGeometry
)(ULONG DriveNumber
, PGEOMETRY DriveGeometry
);
68 ULONG (*DiskGetCacheableBlockCount
)(ULONG DriveNumber
);
70 VOID (*RTCGetCurrentDateTime
)(PULONG Year
, PULONG Month
, PULONG Day
, PULONG Hour
, PULONG Minute
, PULONG Second
);
72 VOID (*HwDetect
)(VOID
);
73 } MACHVTBL
, *PMACHVTBL
;
75 VOID
MachInit(const char *CmdLine
);
77 extern MACHVTBL MachVtbl
;
79 VOID
MachConsPutChar(int Ch
);
82 VOID
MachVideoClearScreen(UCHAR Attr
);
83 VIDEODISPLAYMODE
MachVideoSetDisplayMode(char *DisplayMode
, BOOL Init
);
84 VOID
MachVideoGetDisplaySize(PULONG Width
, PULONG Height
, PULONG Depth
);
85 ULONG
MachVideoGetBufferSize(VOID
);
86 VOID
MachVideoSetTextCursorPosition(ULONG X
, ULONG Y
);
87 VOID
MachVideoHideShowTextCursor(BOOL Show
);
88 VOID
MachVideoPutChar(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
89 VOID
MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer
);
90 BOOL
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
);
94 VOID
MachVideoPrepareForReactOS(VOID
);
95 ULONG
MachGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap
, ULONG MaxMemoryMapSize
);
96 BOOL
MachDiskGetBootVolume(PULONG DriveNumber
, PULONGLONG StartSector
, PULONGLONG SectorCount
, int *FsType
);
98 MachDiskGetSystemVolume(char *SystemPath
,
102 PULONGLONG StartSector
,
103 PULONGLONG SectorCount
,
105 BOOL
MachDiskGetBootPath(char *BootPath
, unsigned Size
);
106 VOID
MachDiskGetBootDevice(PULONG BootDevice
);
107 BOOL
MachDiskBootingFromFloppy();
108 BOOL
MachDiskNormalizeSystemPath(char *SystemPath
, unsigned Size
);
109 BOOL
MachDiskReadLogicalSectors(ULONG DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
110 BOOL
MachDiskGetPartitionEntry(ULONG DriveNumber
, ULONG PartitionNumber
, PPARTITION_TABLE_ENTRY PartitionTableEntry
);
111 BOOL
MachDiskGetDriveGeometry(ULONG DriveNumber
, PGEOMETRY DriveGeometry
);
112 ULONG
MachDiskGetCacheableBlockCount(ULONG DriveNumber
);
113 VOID
MachRTCGetCurrentDateTime(PULONG Year
, PULONG Month
, PULONG Day
, PULONG Hour
, PULONG Minute
, PULONG Second
);
114 VOID
MachHwDetect(VOID
);
116 #define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
117 #define MachConsKbHit() MachVtbl.ConsKbHit()
118 #define MachConsGetCh() MachVtbl.ConsGetCh()
119 #define MachVideoClearScreen(Attr) MachVtbl.VideoClearScreen(Attr)
120 #define MachVideoSetDisplayMode(Mode, Init) MachVtbl.VideoSetDisplayMode((Mode), (Init))
121 #define MachVideoGetDisplaySize(W, H, D) MachVtbl.VideoGetDisplaySize((W), (H), (D))
122 #define MachVideoGetBufferSize() MachVtbl.VideoGetBufferSize()
123 #define MachVideoSetTextCursorPosition(X, Y) MachVtbl.VideoSetTextCursorPosition((X), (Y))
124 #define MachVideoHideShowTextCursor(Show) MachVtbl.VideoHideShowTextCursor(Show)
125 #define MachVideoPutChar(Ch, Attr, X, Y) MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
126 #define MachVideoCopyOffScreenBufferToVRAM(Buf) MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
127 #define MachVideoIsPaletteFixed() MachVtbl.VideoIsPaletteFixed()
128 #define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
129 #define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
130 #define MachVideoSync() MachVtbl.VideoSync()
131 #define MachVideoPrepareForReactOS() MachVtbl.VideoPrepareForReactOS()
132 #define MachGetMemoryMap(MMap, Size) MachVtbl.GetMemoryMap((MMap), (Size))
133 #define MachDiskGetBootVolume(Drv, Start, Cnt, FsType) MachVtbl.DiskGetBootVolume((Drv), (Start), (Cnt), (FsType))
134 #define MachDiskGetSystemVolume(SysPath, RemPath, Dev, Drv, Start, Cnt, FsType) MachVtbl.DiskGetSystemVolume((SysPath), (RemPath), (Dev), (Drv), (Start), (Cnt), (FsType))
135 #define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size))
136 #define MachDiskGetBootDevice(BootDevice) MachVtbl.DiskGetBootDevice(BootDevice)
137 #define MachDiskBootingFromFloppy() MachVtbl.DiskBootingFromFloppy()
138 #define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size))
139 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
140 #define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry))
141 #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
142 #define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
143 #define MachRTCGetCurrentDateTime(Y, Mo, D, H, Mi, S) MachVtbl.RTCGetCurrentDateTime((Y), (Mo), (D), (H), (Mi), (S));
144 #define MachHwDetect() MachVtbl.HwDetect()
146 #endif /* __MACHINE_H_ */