From e8e139ddf3b2c7a76704cf9ed3aa14b8a2de125f Mon Sep 17 00:00:00 2001 From: Thomas Oltmann Date: Mon, 7 Jul 2025 02:55:26 +0200 Subject: [PATCH] Retrieving the first block via PXE --- fernlader.ld | 11 ++++++++--- lboot.S | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/fernlader.ld b/fernlader.ld index 17c6f00..f40031d 100644 --- a/fernlader.ld +++ b/fernlader.ld @@ -1,7 +1,12 @@ +PHDRS { + all PT_LOAD; +} SECTIONS { .text 0x7C00: { - lboot.o(.text*, .data*) - loader.o(.text*, .data*, .bss*) - } + lboot.o(.text) + *(.text) + *(.data) + *(.bss, COMMON) + } :all memmap = ALIGN(8); } diff --git a/lboot.S b/lboot.S index 1ac006a..af17760 100644 --- a/lboot.S +++ b/lboot.S @@ -286,6 +286,29 @@ read_file: pxe_call PXE_TFTP_OPEN add $14+128, %sp + + + .set PXE_TFTP_READ, 0x0022 + push %cs + push $tx_buf + push $0 + push $0 + push $0 + pxe_call PXE_TFTP_READ + add $10, %sp + + + + .set PXE_TFTP_CLOSE, 0x0021 + push $0 + pxe_call PXE_TFTP_CLOSE + add $2, %sp + + + + mov $tx_buf, %si + call print + ret // print: print NUL-terminated string pointed to by SI