From c51dca994968dc54ae59ac68347cbc3c287b3659 Mon Sep 17 00:00:00 2001 From: Nero <41307858+nero@users.noreply.github.com> Date: Wed, 25 Mar 2020 20:56:00 +0000 Subject: [PATCH] add kernel stub to distfiles this way i can test if the bootloader works as intended --- Makefile | 14 +++++--------- rdos86.asm | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 rdos86.asm diff --git a/Makefile b/Makefile index d7a2852..43c79e6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ FLOPPY = 360 PROGRAMS = hello.com -DISTFILES = $(PROGRAMS) +DISTFILES = $(PROGRAMS) rdos86.bs ROMS = QEMU_ARCH = $(shell uname -m) @@ -47,12 +47,6 @@ vga11.com: cp437.bin # Bootloaders, first sector on partition %.bs: %.asm $(NASM) $(NASM_ARGS) -DBASE=0x7C00 -DBOOT -o $@ $< - : check boot signature - test "$$(echo $$(xxd -p -l 2 -s 510 $@))" == 55aa - -# Network bootstrap protocol as used for PXE -%.0: %.asm - $(NASM) $(NASM_ARGS) -DBASE=0x7C00 -DNBP -o $@ $< # BIOS option roms %.rom: rom/%.asm utils/fix-rom @@ -65,9 +59,11 @@ fdimage.img: fat.bs $(DISTFILES) hdimage.img: mbr.bs fdimage.img cat mbr.bs fdimage.img >$@ -part.img: fat32.bs +part.img: fat32.bs $(DISTFILES) dd if=/dev/zero bs=1024 count=33k of=$@ - mformat -F -i part.img -B fat32.bs :: + mformat -i $@ -F -B fat32.bs :: + mmd -i $@ ::rdos + mcopy -i $@ $(DISTFILES) ::rdos clean: rm -f *.com *.bs *.0 *.lst *.img *.bin *.rom diff --git a/rdos86.asm b/rdos86.asm new file mode 100644 index 0000000..06488fa --- /dev/null +++ b/rdos86.asm @@ -0,0 +1,14 @@ +org 0x7C00 + +main: mov si, msg + mov ah, 0x0e + xor bx, bx +loop: lodsb + test al, al + jz end + int 0x10 + jmp loop +end: hlt + jmp end + +msg: db "rdos kernel stub", 0x0A, 0x0D, 0