make space in bss directly for boot_drive and partition offsets

This commit is contained in:
2024-10-17 20:33:44 -04:00
parent 508bf1aa55
commit 520f877b05

View File

@@ -121,21 +121,13 @@ struc EarlyBootStruct_t
.fat32_ebpb resb FAT32_ebpb_t_size
endstruc
; bp - 2 : byte boot_drive
; bp - 4 : word part_offset
; bp - 6 : ptr PartTable_t partition_table
; bp - 4 : ptr PartTable_t partition_table
; bp - 8 : ptr FAT32_bpb_t fat32_bpb
ALIGN 4, db 0x90
main:
lea ax, [bp - 2]
mov [boot_drive_ptr], ax
lea ax, [bp - 4]
mov [partition_offset_ptr], ax ; setup pointers to boot_drive and partition offset on stack
mov byte [bp - 2], dl ; boot_drive (probably 0x80)
mov word [bp - 4], si ; partition_offset
mov word [bp - 6], bx ; partition_table_vbr
mov byte [boot_drive], dl ; boot_drive (probably 0x80)
mov word [partition_offset], si ; partition_offset
mov word [bp - 4], bx ; partition_table_vbr
mov word [bp - 8], dx ; fat32_bpb_vbr
.check_sig:
mov eax, dword [STAGE2_SIG]
@@ -145,7 +137,7 @@ main:
.stage2_main:
mov ax, PartTable_t_size
push ax
mov ax, [bp - 6] ; ptr partition_table
mov ax, [bp - 4] ; ptr partition_table
push ax
mov ax, partition_table
push ax
@@ -524,9 +516,12 @@ SteviaInfo:
;
; locals
;
boot_drive_ptr:
resw 1
partition_offset_ptr:
ALIGN 4,resb 1
boot_drive:
resb 1
ALIGN 4,resb 1
partition_offset:
resw 1
;