diff --git a/Makefile b/Makefile index e8dd3bc..92f5e40 100644 --- a/Makefile +++ b/Makefile @@ -53,15 +53,19 @@ wozmon.bin: wozmon.elf paracli.elf: LDFLAGS += -T doscom.ld paracli.elf: paracli.s paracomm.o -mushroom.elf: LDFLAGS += -T doscom.ld -mushroom.elf: mushroom.s paracomm.o +dos-programs = mushroom.elf hello.elf +$(dos-programs): LDFLAGS += -T doscom.ld -polos.img: fat12boot.bin polmon.com polio.com mushroom.com +mushroom.elf: mushroom.s +hello.elf: hello.o stdlib.o crt0.s + +polos.img: fat12boot.bin polmon.com polio.com mushroom.com hello.com dd if=/dev/zero of=$@ bs=512 count=720 mformat -i $@ -t 40 -h 2 -s 9 mcopy -i $@ polio.com ::/ mcopy -i $@ polmon.com ::/ mcopy -i $@ mushroom.com ::/ + mcopy -i $@ hello.com ::/ dd if=fat12boot.bin of=$@ conv=notrunc .PHONY: clean diff --git a/crt0.s b/crt0.s new file mode 100644 index 0000000..cefc687 --- /dev/null +++ b/crt0.s @@ -0,0 +1,8 @@ + .arch i8086,jumps + .code16 + .intel_syntax noprefix + + .section .init + .global _start +_start: + jmp main diff --git a/hello.c b/hello.c new file mode 100644 index 0000000..c9a246f --- /dev/null +++ b/hello.c @@ -0,0 +1,5 @@ +#include + +int main() { + puts("Hello, world!\r\n"); +}