-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.c
45 lines (36 loc) · 1 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
#include "efi/efi.h"
#include "loader.h"
#include "log.h"
efi_status_t efi_main(
efi_handle_t handle,
struct efi_system_table *system)
{
uint16_t config_path[] = u"efi\\boot\\config.txt";
struct loader loader;
efi_status_t status;
info(system, "Setting up the loader...\r\n");
status = setup_loader(handle, system, &loader);
if (status != EFI_SUCCESS)
return status;
info(system, "Loading the config...\r\n");
status = load_config(&loader, config_path);
if (status != EFI_SUCCESS)
return status;
info(system, "Parsing the config...\r\n");
status = parse_config(&loader);
if (status != EFI_SUCCESS)
return status;
info(system, "Loading the kernel...\r\n");
status = load_kernel(&loader);
if (status != EFI_SUCCESS)
return status;
info(system, "Loading the data...\r\n");
status = load_modules(&loader);
if (status != EFI_SUCCESS)
return status;
info(system, "Starting the kernel...\r\n");
status = start_kernel(&loader);
if (status != EFI_SUCCESS)
return status;
return EFI_SUCCESS;
}