add initial source and build system
This commit is contained in:
commit
768871596d
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/.rscons*
|
||||
/build/
|
11
Rsconscript
Normal file
11
Rsconscript
Normal file
@ -0,0 +1,11 @@
|
||||
build do
|
||||
Environment.new do |env|
|
||||
env["CC"] = "x86_64-w64-mingw32-gcc"
|
||||
env["CPPPATH"] += %w[/usr/include/efi /usr/include/efi/x86_64]
|
||||
env["CFLAGS"] += %w[-ffreestanding]
|
||||
env["LDFLAGS"] += %w[-nostdlib -Wl,-dll -shared -Wl,--subsystem,10 -e efi_main]
|
||||
env["LIBS"] += %w[gcc]
|
||||
env["sources"] = glob("*.c")
|
||||
env.Program("^/BOOTX64.EFI", "${sources}")
|
||||
end
|
||||
end
|
23
main.c
Normal file
23
main.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <efi.h>
|
||||
#include <efilib.h>
|
||||
|
||||
EFI_STATUS
|
||||
efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * system_table)
|
||||
{
|
||||
EFI_STATUS status;
|
||||
EFI_INPUT_KEY key;
|
||||
|
||||
status = system_table->ConOut->OutputString(system_table->ConOut, L"My first EFI loader\n\r");
|
||||
if (EFI_ERROR(status))
|
||||
return status;
|
||||
|
||||
status = system_table->ConIn->Reset(system_table->ConIn, FALSE);
|
||||
if (EFI_ERROR(status))
|
||||
return status;
|
||||
|
||||
while ((status = system_table->ConIn->ReadKeyStroke(system_table->ConIn, &key)) == EFI_NOT_READY)
|
||||
{
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user