-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.c
46 lines (42 loc) · 1.52 KB
/
main.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
#include <stdint.h>
typedef struct EfiTableHeader {
uint64_t signature;
uint32_t revision;
uint32_t headerSize;
uint32_t crc32;
uint32_t reserved;
} EfiTableHeader;
struct EfiSimpleTextOutputProtocol;
typedef uint64_t (*EfiTextString)(struct EfiSimpleTextOutputProtocol* this, int16_t* string);
typedef struct EfiSimpleTextOutputProtocol {
uint64_t reset;
EfiTextString output_string;
uint64_t test_string;
uint64_t query_mode;
uint64_t set_mode;
uint64_t set_attribute;
uint64_t clear_screen;
uint64_t set_cursor_position;
uint64_t enable_cursor;
uint64_t mode;
} EfiSimpleTextOutputProtocol;
typedef struct EfiSystemTable {
EfiTableHeader hdr;
int16_t* firmwareVendor;
uint32_t firmwareRevision;
void* consoleInHandle;
uint64_t conIn;
void* consoleOutHandle;
EfiSimpleTextOutputProtocol* conOut;
void* standardErrorHandle;
uint64_t stdErr;
uint64_t runtimeServices;
uint64_t bootServices;
uint64_t numberOfTableEntries;
uint64_t configurationTable;
} EfiSystemTable;
int efi_main(void *imageHandle, EfiSystemTable* systemTable) {
systemTable->conOut->output_string(systemTable->conOut, (int16_t *)L"Hello, World!");
for(;;);
return 0;
}