Make finishing touches before UEFI addition

As legacy BIOS isn't as straightforward to develop using a modern
system, modern emulators/VMs and virtual machine firmware, it was
decided to start work on an UEFI version of the Nightloader.

This commit leaves the not-yet boot-capable, but as far as it's
there already assembling and working legacy BIOS code behind for
later work on this edition.
This commit is contained in:
Eric-Paul Ickhorn 2024-08-07 10:06:18 +02:00
parent 65db388f00
commit 7abe0539f9
Signed by: epickh
GPG Key ID: 1358818BAA38B104
5 changed files with 13 additions and 19 deletions

View File

@ -73,4 +73,3 @@ setup_drivers:
ret
%include "drivers/pci/driver.asm"
%include "drivers/acpi/driver.asm"

View File

@ -18,7 +18,7 @@ stage_2_setup_entry:
cli
mov ah, 0x00
mov al, 0x03 ;0x13
mov al, 0x03 ; 0x13 for graphics, 0x03 for text.
int 0x10
.check_a20:
@ -51,19 +51,15 @@ stage_2_setup_entry:
%include "memory/a20.asm"
%include "memory/gdt.asm"
bits 32
stage2_true_entry:
push ebp
mov ebp, esp
call setup_drivers
mov esp, ebp
pop ebp
stage2_protected_entry:
cli
hlt
.buffer:
dd 0
%include "utility/math.asm"
%include "utility/memory.asm"
%include "utility/display.asm"

View File

@ -286,7 +286,7 @@ bits 32
mov ebx, [esi + (64 - 8)]
mov eax, [esi + (64 - 4)]
jmp dword stage2_true_entry
jmp dword stage2_protected_entry
align 16
.gdtr:

View File

@ -65,32 +65,31 @@ mem_equal:
mov [esi + (32 - 16)], edi
.body:
mov edx, [ebp - 4] ; Block 1
mov edi, [ebp - 8] ; Block 2
xor eax, eax ; Current Byte Offset
.body.compare_loop:
.comparison_loop:
mov edx, [ebp - 4] ; Block 1
mov ebx, edx
add ebx, eax
mov dl, [ebx]
mov edi, [ebp - 8] ; Block 2
mov ebx, edi
add ebx, eax
mov dh, [ebx]
inc eax
cmp dl, dh
je .body.compare_loop.condition
je .length_condition
; On NOT equal
xor eax, eax
jmp .epilog
.body.compare_loop.condition:
.length_condition:
inc eax
cmp eax, [ebp - 12]
jb .body.compare_loop
jb .comparison_loop
mov eax, 1
.epilog:

View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash
qemu-system-i386 nightloader.bin -qmp unix:qmp.socket,server,nowait
qemu-system-x86_64 -m 512M -enable-kvm -d guest_errors nightloader.bin -qmp unix:qmp.socket,server,nowait