diff --git a/Makefile b/Makefile index 597102e..e1d874a 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,13 @@ PROGRAMS = hello.com DISTFILES = $(PROGRAMS) ROMS = -QEMU_ARCH = $(shell uname -m) -QEMU = qemu-system-$(QEMU_ARCH) +QEMU = qemu-system-i386 QEMU_ARGS = $(addprefix --option-rom ,$(ROMS)) +VERSION = $(shell git log -1 --format=%cd --date=format:%Y%m%d) + NASM = nasm -NASM_ARGS = -s -Ilib +NASM_ARGS = -s -Ilib -DVERSION=$(VERSION) KVM = $(shell test -w /dev/kvm && echo 1) diff --git a/README.md b/README.md index 005286f..18b19a1 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,20 @@ - Boot linux - Editor (nano or ed-like) - Self-hosting assembler + +## Building + +You can generate a 3.5" floppy image with `make fd1440.img`, a 5.25" floppy with `make fd160.img`. + +Build requirements: + +- make +- nasm +- mtools >=4.0.20 (Debian buster or up) + +Useful for testing: + +- C compiler +- qemu-system-i386 + +The Makefile has other potentially interesting targets. diff --git a/boot/kernel.asm b/boot/kernel.asm index b742457..3150256 100644 --- a/boot/kernel.asm +++ b/boot/kernel.asm @@ -9,7 +9,10 @@ jmp near init - db "LOVELAIN" +%defstr STRVER VERSION +%define INTVER 0x %+ VERSION + + db STRVER ; mformat writes stuff until 0x3E params: times ( 0x3E - ($-$$) ) nop @@ -44,6 +47,8 @@ hlt: hlt db "rdos kernel" + dd INTVER + end: align 512 section .bss