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 : {
*(.data) *(.data)
. = ALIGN(4K); . = ALIGN(4K);
lboot.o(.data.bootboot)
} :all } :all
_bss_start = .; _bss_start = .;
.bss (NOLOAD) : { .bss (NOLOAD) : {
*(.bss, COMMON) *(.bss, COMMON)
*(.bootboot)
} :all } :all
_bss_end = .; _bss_end = .;
} }

40
lboot.S
View file

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