test: dropping to 32bit protected mode
[efitest3] / NOTES
1 UEFI notes
2 ==========
3
4 /efi/boot/bootx64.efi
5
6 rcx: efi handle
7 rdx: efi system table pointer
8 rsp: return address?
9
10 after loading call EFI_BOOT_SERVICES.ExitBootServices()
11
12 struct EFI_TABLE_HEADER {
13         uint64_t signature;
14         uint32_t revision;
15         uint32_t header_size;
16         uint32_t crc32;
17         uint32_t rsvd;
18 };
19
20 EFI_SYSTEM_TABLE signature: 0x5453595320494249
21 0       EFI_TABLE_HEADER
22 24      wchar_t *firmware_vendor
23 32      uint32_t firmware_revision
24 36      padding
25 40      void *console_in_handle
26 48      EFI_SIMPLE_TEXT_INPUT_PROTOCOL*
27 56      void *console_out_handle
28 64      EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*
29 72      EFI_RUNTIME_SERVICES *runtime_services;
30 80      EFI_BOOT_SERVICES *boot_services;
31         uint64_t num_of_table_entries;
32         EFI_CONFIGURATION_TABLE *cfg_table;
33
34 EFI_BOOT_SERVICES signature: 0x56524553544f4f42
35 0       EFI_TABLE_HEADER
36 24      EFI_RAISE_TPL
37 32      EFI_RESTORE_TPL
38 40      EFI_ALLOCATE_PAGES
39 48      EFI_FREE_PAGES
40 56      EFI_GET_MEMORY_MAP
41 64      EFI_ALLOCATE_POOL
42 72      EFI_FREE_POOL
43 80      EFI_CREATE_EVENT
44 88      EFI_SET_TIMER
45 96      EFI_WAIT_FOR_EVENT
46 104     EFI_SIGNAL_EVENT
47 112     EFI_CLOSE_EVENT
48 120     EFI_CHECK_EVENT
49 128     EFI_INSTALL_PROTOCOL_INTERFACE
50 136     EFI_REINSTALL_PROTOCOL_INTERFACE
51 144     EFI_UNINSTALL_PROTOCOL_INTERFACE
52 152     EFI_HANDLE_PROTOCOL
53 160     void *rsvd
54 168     EFI_REGISTER_PROTOCOL_NOTIFY
55 176     EFI_LOCATE_HANDLE
56 184     EFI_LOCATE_DEVICE_PATH
57 192     EFI_INSTALL_CONFIGURATION_TABLE
58 200     EFI_IMAGE_LOAD
59 208     EFI_IMAGE_START
60 216     EFI_EXIT
61 224     EFI_IMAGE_UNLOAD
62 232     EFI_EXIT_BOOT_SERVICES
63         ... more ...
64
65 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
66 0       EFI_TEXT_RESET
67 8       EFI_TEXT_STRING
68 16      EFI_TEXT_TEST_STRING
69 24      EFI_TEXT_QUERY_MODE
70 32      EFI_TEXT_SET_MODE
71 40      EFI_TEXT_SET_ATTRIBUTE
72 48      EFI_TEXT_CLEAR_SCREEN
73 56      EFI_TEXT_SET_CURSOR_POSITION
74 64      EFI_TEXT_ENABLE_CURSOR
75 72      SIMPLE_TEXT_OUPUT_MODE *mode;
76 };