First program to return to polmon

This commit is contained in:
2025-10-01 23:34:25 +02:00
parent 188256b0ac
commit bf9a88805f
3 changed files with 20 additions and 3 deletions

View File

@@ -53,15 +53,19 @@ wozmon.bin: wozmon.elf
paracli.elf: LDFLAGS += -T doscom.ld paracli.elf: LDFLAGS += -T doscom.ld
paracli.elf: paracli.s paracomm.o paracli.elf: paracli.s paracomm.o
mushroom.elf: LDFLAGS += -T doscom.ld dos-programs = mushroom.elf hello.elf
mushroom.elf: mushroom.s paracomm.o $(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 dd if=/dev/zero of=$@ bs=512 count=720
mformat -i $@ -t 40 -h 2 -s 9 mformat -i $@ -t 40 -h 2 -s 9
mcopy -i $@ polio.com ::/ mcopy -i $@ polio.com ::/
mcopy -i $@ polmon.com ::/ mcopy -i $@ polmon.com ::/
mcopy -i $@ mushroom.com ::/ mcopy -i $@ mushroom.com ::/
mcopy -i $@ hello.com ::/
dd if=fat12boot.bin of=$@ conv=notrunc dd if=fat12boot.bin of=$@ conv=notrunc
.PHONY: clean .PHONY: clean

8
crt0.s Normal file
View File

@@ -0,0 +1,8 @@
.arch i8086,jumps
.code16
.intel_syntax noprefix
.section .init
.global _start
_start:
jmp main

5
hello.c Normal file
View File

@@ -0,0 +1,5 @@
#include <stdio.h>
int main() {
puts("Hello, world!\r\n");
}