First sign of life

This commit is contained in:
Thomas Oltmann 2025-07-04 03:10:55 +02:00
commit 793fbcd03c
7 changed files with 55 additions and 0 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
config.mk
*.o
boot.bin
boot.elf

21
Makefile Normal file
View file

@ -0,0 +1,21 @@
-include config.mk
.PHONY: all clean
all: boot.bin
clean:
rm -f *.o
rm -f boot.elf boot.bin
config.mk: | config.default.mk
cp config.default.mk $@
boot.bin: boot.elf
objcopy -O binary --only-section=.text boot.elf $@
boot.elf: boot16.o fernlader.ld
$(LD) $(LDFLAGS) -o $@ boot16.o
.S.o:
$(CC) $(CFLAGS) -c -o $@ $(@:.o=.S)

2
Readme.md Normal file
View file

@ -0,0 +1,2 @@
# fernlader -- bootboot-compliant PXE bootloader

14
boot16.S Normal file
View file

@ -0,0 +1,14 @@
// vim: et:sw=12:ts=12:sts=12
.code16
.global _start
.text
_start:
xor %bx, %bx
mov $0x0E, %ah
mov $'A', %al
int $0x10
1: hlt
jmp 1b

5
config.default.mk Normal file
View file

@ -0,0 +1,5 @@
CC = cc
LD = ld
CFLAGS = -no-pie -fno-pic
LDFLAGS = -Tfernlader.ld

6
fernlader.ld Normal file
View file

@ -0,0 +1,6 @@
SECTIONS {
. = 0x7C00;
.text : {
*(*)
}
}

2
run-qemu.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
qemu-system-x86_64 -netdev user,id=n1,net=10.0.0.5/24,tftp=netboot,bootfile=/boot.bin -device virtio-net-pci,netdev=n1