Add a skeleton file for eventual assembly port of hex0.
This commit is contained in:
parent
571ea5e8f0
commit
081a890e05
|
@ -1,4 +1,8 @@
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
*~
|
*~
|
||||||
Development/build/
|
*/build/
|
||||||
|
*.d
|
||||||
|
*.lib
|
||||||
|
*.efi
|
||||||
|
*.o
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# kaem
|
||||||
|
|
||||||
|
# Rebuild hex0
|
||||||
|
EFI\BOOT\hex0.efi hex0_AMD64_POSIX.hex0 hex0 # hex0
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
cc = clang
|
||||||
|
cflags = -ffreestanding -MMD -mno-red-zone -std=c11 -target x86_64-unknown-windows
|
||||||
|
ld = lld-link
|
||||||
|
lflags = -subsystem:efi_application -nodefaultlib -dll
|
||||||
|
|
||||||
|
build = build
|
||||||
|
|
||||||
|
all: $(build)/hex0.efi
|
||||||
|
|
||||||
|
$(build)/%.o : %.S
|
||||||
|
mkdir -p $(build)
|
||||||
|
$(cc) $(cflags) -c $< -o $@
|
||||||
|
|
||||||
|
$(build)/%.efi : $(build)/%.o
|
||||||
|
$(ld) $(lflags) -entry:efi_main $< -out:$@
|
||||||
|
|
||||||
|
. PHONY : clean all
|
||||||
|
clean:
|
||||||
|
rm -f $(build)
|
|
@ -0,0 +1,14 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
.text
|
||||||
|
.globl efi_main
|
||||||
|
|
||||||
|
efi_main:
|
||||||
|
sub $16, %rsp
|
||||||
|
mov %rdx, 8(%rsp)
|
||||||
|
mov %rcx, (%rsp)
|
||||||
|
mov $42, %eax
|
||||||
|
add $16, %rsp
|
||||||
|
ret
|
Loading…
Reference in New Issue