Rev 2726 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2726 | vana | 1 | #define EFI_SUCCESS 0 |
2 | |||
3 | typedef short CHAR16; |
||
4 | typedef unsigned long UINTN; |
||
5 | typedef unsigned long long UINT64; |
||
6 | typedef unsigned int UINT32; |
||
7 | typedef void * EFI_HANDLE; |
||
8 | typedef UINTN EFI_STATUS; |
||
9 | |||
10 | typedef struct _EFI_TABLE_HEARDER { |
||
11 | UINT64 Signature; |
||
12 | UINT32 Revision; |
||
13 | UINT32 HeaderSize; |
||
14 | UINT32 CRC32; |
||
15 | UINT32 Reserved; |
||
16 | } EFI_TABLE_HEADER; |
||
17 | |||
18 | typedef EFI_STATUS (*EFI_TEXT_STRING) (void *This, CHAR16 *String); |
||
19 | |||
20 | typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE { |
||
21 | void * Reset; |
||
22 | |||
23 | EFI_TEXT_STRING OutputString; |
||
24 | } SIMPLE_TEXT_OUTPUT_INTERFACE; |
||
25 | |||
26 | typedef struct _EFI_SYSTEM_TABLE { |
||
27 | EFI_TABLE_HEADER Hdr; |
||
28 | |||
29 | CHAR16 *FirmwareVendor; |
||
30 | UINT32 FirmwareRevision; |
||
31 | |||
32 | EFI_HANDLE ConsoleInHandle; |
||
33 | /*SIMPLE_INPUT_INTERFACE*/ void *ConIn; |
||
34 | |||
35 | EFI_HANDLE ConsoleOutHandle; |
||
36 | SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut; |
||
37 | |||
38 | EFI_HANDLE StandardErrorHandle; |
||
39 | SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr; |
||
40 | |||
41 | /*EFI_RUNTIME_SERVICES*/ void *RuntimeServices; |
||
42 | /*EFI_BOOT_SERVICES*/ void *BootServices; |
||
43 | |||
44 | UINTN NumberOfTableEntries; |
||
45 | /*EFI_CONFIGURATION_TABLE*/void *ConfigurationTable; |
||
46 | |||
47 | } EFI_SYSTEM_TABLE; |
||
48 | |||
49 | static CHAR16 * |
||
50 | a2u (char *str) |
||
51 | { |
||
52 | static CHAR16 mem[2048]; |
||
53 | int i; |
||
54 | |||
55 | for (i = 0; str[i]; ++i) |
||
56 | mem[i] = (CHAR16) str[i]; |
||
57 | mem[i] = 0; |
||
58 | return mem; |
||
59 | } |
||
60 | |||
61 | EFI_STATUS |
||
62 | efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab) |
||
63 | { |
||
64 | SIMPLE_TEXT_OUTPUT_INTERFACE *conout; |
||
65 | |||
66 | conout = systab->ConOut; |
||
67 | conout->OutputString(conout, (CHAR16 *)L"Hello World!\n\r"); |
||
68 | conout->OutputString(conout, a2u("Hello World!\n\r")); |
||
69 | |||
70 | return EFI_SUCCESS; |
||
71 | } |