Shrunk binary by making bootboot struct BSS

This commit is contained in:
Thomas Oltmann 2025-07-17 07:25:42 +02:00
parent 65c9bf56f5
commit 001f3b0a5c
2 changed files with 23 additions and 19 deletions

View file

@ -10,11 +10,11 @@ SECTIONS {
.data : {
*(.data)
. = ALIGN(4K);
lboot.o(.data.bootboot)
} :all
_bss_start = .;
.bss (NOLOAD) : {
*(.bss, COMMON)
*(.bootboot)
} :all
_bss_end = .;
}

40
lboot.S
View file

@ -63,6 +63,10 @@ _start: cli
xor %al, %al
rep stosb
movl $0x544F4F42, bootboot // "BOOT"
movl $128, bb_size
movb $1, bb_protocol
call init_com1
mov $msg_start, %si
@ -624,7 +628,7 @@ vbe_setmode:
vbe_info:
.ascii "VBE2"
.skip 512 - 4
.space 512 - 4
// long: Enter long mode
long:
@ -813,21 +817,21 @@ type_table: .byte 0
hex_digits: .ascii "0123456789ABCDEF"
.section .data.bootboot
bootboot: .ascii "BOOT"
bb_size: .long 128
.byte 1
.byte 0
.short 1
.short 0
.space 10, 0
bb_ird_ptr: .quad 0
bb_ird_size:.quad 0
bb_fb_ptr: .quad 0
bb_fb_size: .long 0
bb_fb_width:.long 0
bb_fb_height:.long 0
bb_fb_scanl:.long 0
.section .bootboot
bootboot: .space 4
bb_size: .space 4
bb_protocol:.space 1
bb_fb_type: .space 1
bb_numcores:.space 2
bb_bspid: .space 2
bb_time: .space 10, 0
bb_ird_ptr: .space 8
bb_ird_size:.space 8
bb_fb_ptr: .space 8
bb_fb_size: .space 4
bb_fb_width:.space 4
bb_fb_height:.space 4
bb_fb_scanl:.space 4
.space 64, 0
bb_memmap:
.space 4096-128, 0
bb_memmap: .space 4096-128, 0