diff --git a/Makefile b/Makefile index b4c5854..bb1e6d9 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ PRODUCT = rdos LABEL = $(PRODUCT) $(VERSION) NASM = nasm -NASM_ARGS = -s -Ilib -DPRODUCT=$(PRODUCT) -DVERSION=$(VERSION) +NASM_ARGS = -s -Ilib --before "cpu 8086" -DPRODUCT=$(PRODUCT) -DVERSION=$(VERSION) QEMU_ARGS += $(shell test -w /dev/kvm && echo --enable-kvm) @@ -28,7 +28,7 @@ SYS = host/sys.elf FIXROM = host/fix-rom.elf .PHONY: default clean qemu-floppy5 qemu-floppy3 -.PRECIOUS: $(DISTFILES) +.PRECIOUS: %.com default: fd1440.img @@ -37,7 +37,7 @@ host/%.elf: host/%.c $(CC) -o $@ $< # COM programs -%.com: com/%.asm +%.com: src/%.asm src/*.inc $(NASM) $(NASM_ARGS) -o $@ $< # Bootloaders, first sector on partition @@ -86,5 +86,8 @@ qemu-hdd: hdd.img $(ROMS) qemu-uartctrl: uartctrl.rom chartab.bs $(QEMU) $(QEMU_ARGS) -option-rom uartctrl.rom -serial stdio -hda chartab.bs -dosbox-%: %.com - dosbox -c "mount P $(CURDIR)" -c "P:" -c "$< $(ARGS)" +dosbox-%: %.com fd1440.img + dosbox -c "mount P $(CURDIR)" -c "P:" -c "IMGMOUNT A: FD1440.IMG -t floppy" -c "$< $(ARGS)" -c "pause" -c "exit" + +emu2-%: %.com + emu2 $< $(ARGS) diff --git a/src/@rdos.asm b/src/@rdos.asm new file mode 100644 index 0000000..cd4f9f8 --- /dev/null +++ b/src/@rdos.asm @@ -0,0 +1,4 @@ + mov ax, 0x0e38 + int 0x10 +halt hlt + jmp halt diff --git a/com/hello.asm b/src/hello.asm similarity index 100% rename from com/hello.asm rename to src/hello.asm diff --git a/src/parse.inc b/src/parse.inc new file mode 100644 index 0000000..1330b75 --- /dev/null +++ b/src/parse.inc @@ -0,0 +1,63 @@ + ; make a char uppercase + ; IN al char + ; OUT al char + ; do nothing if >z +ucase cmp al, 0x7B + jnc .ret + ; do nothing if