From d0a849ffeb541a8c285a92558cedcd6611072540 Mon Sep 17 00:00:00 2001 From: Jonas Hvid Date: Sun, 4 Oct 2020 01:25:48 +0200 Subject: [PATCH] Supply UEFI module path as environment variable We'd like to have multiple backends -- e.g. Linux instead of UEFI. That would make testing less cumbersome. Also remove an outdated comment. --- Makefile | 4 ++-- main.asm | 16 +--------------- uefi.asm => os/uefi.asm | 0 3 files changed, 3 insertions(+), 17 deletions(-) rename uefi.asm => os/uefi.asm (100%) diff --git a/Makefile b/Makefile index ff474b0..362c429 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,9 @@ OVMF_CODE.fd: /usr/share/ovmf/x64/OVMF_CODE.fd OVMF_VARS.fd: /usr/share/ovmf/x64/OVMF_VARS.fd cp $< $@ -out/main: main.asm impl.asm bootstrap.asm sys.f uefi.asm +out/main: main.asm impl.asm bootstrap.asm sys.f os/uefi.asm mkdir -p out - fasm $< out/main + OS_INCLUDE=os/uefi.asm fasm $< $@ .PHONY: clean clean: diff --git a/main.asm b/main.asm index 43eef7a..0190d18 100644 --- a/main.asm +++ b/main.asm @@ -1,18 +1,6 @@ ;; vim: syntax=fasm -include "uefi.asm" - -;; "Syscalls" {{{ - -;; [NOTE] Volatile registers Linux (syscalls) vs UEFI -;; -;; Linux syscalls: RAX, RCX, R11 -;; UEFI: RAX, RCX, R11, RDX, R8, R9, R10 - -;; We are in the process of replacing our dependency on Linux with a dependency -;; on UEFI. The following macros attempt to isolate what would be syscalls in -;; Linux; thus, we will be able to replace these with UEFI-based implementations, -;; and in theory we should expect the program to work. +include '%OS_INCLUDE%' ;; Print a string of a given length. ;; @@ -64,8 +52,6 @@ macro sys_terminate code { call uefi_terminate } -;; }}} - ;; The code in this macro is placed at the end of each Forth word. When we are ;; executing a definition, this code is what causes execution to resume at the ;; next word in that definition. diff --git a/uefi.asm b/os/uefi.asm similarity index 100% rename from uefi.asm rename to os/uefi.asm -- 2.39.2