-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
uefisetup.c
59 lines (51 loc) · 2.24 KB
/
uefisetup.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* PROJECT: FreeLoader UEFI Support
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Machine Setup
* COPYRIGHT: Copyright 2022 Justin Miller <justinmiller100@gmail.com>
*/
#include <uefildr.h>
#include <debug.h>
DBG_DEFAULT_CHANNEL(WARNING);
/* GLOBALS ********************************************************************/
extern EFI_SYSTEM_TABLE* GlobalSystemTable;
extern EFI_HANDLE GlobalImageHandle;
/* FUNCTIONS ******************************************************************/
VOID
MachInit(const char *CmdLine)
{
RtlZeroMemory(&MachVtbl, sizeof(MachVtbl));
MachVtbl.ConsPutChar = UefiConsPutChar;
MachVtbl.ConsKbHit = UefiConsKbHit;
MachVtbl.ConsGetCh = UefiConsGetCh;
MachVtbl.VideoClearScreen = UefiVideoClearScreen;
MachVtbl.VideoSetDisplayMode = UefiVideoSetDisplayMode;
MachVtbl.VideoGetDisplaySize = UefiVideoGetDisplaySize;
MachVtbl.VideoGetBufferSize = UefiVideoGetBufferSize;
MachVtbl.VideoGetFontsFromFirmware = UefiVideoGetFontsFromFirmware;
MachVtbl.VideoSetTextCursorPosition = UefiVideoSetTextCursorPosition;
MachVtbl.VideoHideShowTextCursor = UefiVideoHideShowTextCursor;
MachVtbl.VideoPutChar = UefiVideoPutChar;
MachVtbl.VideoCopyOffScreenBufferToVRAM = UefiVideoCopyOffScreenBufferToVRAM;
MachVtbl.VideoIsPaletteFixed = UefiVideoIsPaletteFixed;
MachVtbl.VideoSetPaletteColor = UefiVideoSetPaletteColor;
MachVtbl.VideoGetPaletteColor = UefiVideoGetPaletteColor;
MachVtbl.VideoSync = UefiVideoSync;
MachVtbl.Beep = UefiPcBeep;
MachVtbl.PrepareForReactOS = UefiPrepareForReactOS;
MachVtbl.GetMemoryMap = UefiMemGetMemoryMap;
MachVtbl.GetExtendedBIOSData = UefiGetExtendedBIOSData;
MachVtbl.GetFloppyCount = UefiGetFloppyCount;
MachVtbl.DiskReadLogicalSectors = UefiDiskReadLogicalSectors;
MachVtbl.DiskGetDriveGeometry = UefiDiskGetDriveGeometry;
MachVtbl.DiskGetCacheableBlockCount = UefiDiskGetCacheableBlockCount;
MachVtbl.GetTime = UefiGetTime;
MachVtbl.InitializeBootDevices = UefiInitializeBootDevices;
MachVtbl.HwDetect = UefiHwDetect;
MachVtbl.HwIdle = UefiHwIdle;
/* Setup GOP */
if (UefiInitalizeVideo() != EFI_SUCCESS)
{
ERR("Failed to setup GOP\n");
}
}