c2d7fa / jonasforth

Forth interpreter written in bare-metal assembly running on UEFI. (Unfinished)
41 stars 8 forks source link

"os/uefi.asm" file not found #2

Closed dfischer closed 3 years ago

dfischer commented 3 years ago
 make
mkdir -p out
fasm src/main.asm out/main
flat assembler  version 1.73.22  (16384 kilobytes memory)
src/main.asm [17]:
include 'os/uefi.asm'
error: file not found.
make: *** [Makefile:19: out/main] Error 2

Sorry if this is a newbie problem, learning assembly/qemu. I updated the Makefile to work with Ubuntu

.PHONY: qemu
qemu: out/main out/startup.nsh OVMF_CODE.fd OVMF_VARS.fd
        # Based on https://wiki.osdev.org/UEFI#Emulation_with_QEMU_and_OVMF
        qemu-system-x86_64 -cpu qemu64 \
                -drive if=pflash,format=raw,unit=0,file=OVMF_CODE.fd,readonly=on \
                -drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
                -net none \
                -drive format=raw,file=fat:rw:out \
                -display type=gtk,zoom-to-fit=on

# Assuming 'ovmf' package on Arch Linux is installed.
OVMF_CODE.fd: /usr/share/OVMF/OVMF_CODE.fd
        cp $< $@
OVMF_VARS.fd: /usr/share/OVMF/OVMF_VARS.fd
        cp $< $@

out/main: src/main.asm src/impl.asm src/bootstrap.asm src/uefi.asm init/sys.f init/uefi.f
        mkdir -p out
        fasm $< $@

out/startup.nsh:
        mkdir -p out
        echo 'fs0:main' >out/startup.nsh

.PHONY: clean
clean:
        rm -rf out OVMF_CODE.fd OVMF_VARS.fd                                  

At least I think I updated it propery, I updated the path for OVMF. However the os/uefi include I'm not sure where that is supposed to be coming from?

 ls /usr/share/OVMF/
OVMF_CODE.fd  OVMF_CODE.ms.fd@  OVMF_CODE.secboot.fd  OVMF_VARS.fd  OVMF_VARS.ms.fd  OVMF_VARS.snakeoil.fd
c2d7fa commented 3 years ago

Oops, looks like I broke something after shuffling some files around. This should be fixed in the last commit. Try again, and let me know if it still doesn't work! :)

In case you're curious, the issue was just that main.asm included a file called os/uefi.asm (which contains some subroutines for calling into UEFI), but that file was since moved to src/uefi.asm. (In earlier versions, I also had a Linux backend in os/linux.asm, but I removed that in c6c2c19 so I could write some UEFI subroutines in Forth instead of needing to write everything directly in assembly.)

Thanks for letting me know about this!