StupidOS/boot/efi/bootia32.asm

78 lines
1.2 KiB
NASM
Raw Normal View History

;; File: bootia32.asm
2024-03-21 10:42:18 +00:00
format PE DLL EFI at 10000000h
entry efimain
section '.text' code executable readable
include '../common/const.inc'
include '../common/macro.inc'
2024-03-21 10:42:18 +00:00
include 'uefi.inc'
;; Function: efimain
;;
;; Parameters:
;;
;; [esp+4] - handle
;; [esp+8] - <EFI_SYSTEM_TABLE>
;;
;; Returns:
;;
;; eax - efi status
;;
2024-03-21 10:42:18 +00:00
efimain:
mov eax, [esp+4]
mov [handle], eax
mov eax, [esp+8]
mov [system_table], eax
mov ebx, [eax + EFI_SYSTEM_TABLE.ConOut]
mov eax, 1
push eax
push ebx
call [ebx + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset]
add esp, 8
push hello_msg
push ebx
call [ebx + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString]
add esp, 8
2024-05-28 04:54:10 +00:00
; load config
; #=======================#
2024-05-03 10:00:17 +00:00
; search and load kernel
2024-05-28 04:54:10 +00:00
; openVolume()
; for path in search_path
; if (open(path + file) == ok)
; break
; if not found
; error
2024-05-03 10:00:17 +00:00
; get memory map
; paging
; jump to kernel
2024-03-21 10:42:18 +00:00
jmp $
xor eax, eax
2024-03-21 10:42:18 +00:00
ret
section '.reloc' fixups data discardable
section '.data' data readable writeable
2024-05-03 10:00:17 +00:00
hello_msg du 'StupidOS EFI Bootloader', CR, LF, 0
2024-04-02 10:03:47 +00:00
; Search path: / /boot /boot/efi
2024-05-03 10:00:17 +00:00
search_paths du '\\', 0, \
'\\boot', 0, \
'\\boot\\efi', 0, 0
kernel_file du 'vmstupid.sys', 0
2024-03-21 10:42:18 +00:00
handle dd ?
system_table dd ?