Improve build transparency (documentation and inline version number)

This commit is contained in:
Nero 2020-09-17 08:59:22 +00:00
parent e1bfaa5d88
commit 1d64c2364d
3 changed files with 27 additions and 4 deletions

View File

@ -2,12 +2,13 @@ PROGRAMS = hello.com
DISTFILES = $(PROGRAMS) DISTFILES = $(PROGRAMS)
ROMS = ROMS =
QEMU_ARCH = $(shell uname -m) QEMU = qemu-system-i386
QEMU = qemu-system-$(QEMU_ARCH)
QEMU_ARGS = $(addprefix --option-rom ,$(ROMS)) QEMU_ARGS = $(addprefix --option-rom ,$(ROMS))
VERSION = $(shell git log -1 --format=%cd --date=format:%Y%m%d)
NASM = nasm NASM = nasm
NASM_ARGS = -s -Ilib NASM_ARGS = -s -Ilib -DVERSION=$(VERSION)
KVM = $(shell test -w /dev/kvm && echo 1) KVM = $(shell test -w /dev/kvm && echo 1)

View File

@ -11,3 +11,20 @@
- Boot linux - Boot linux
- Editor (nano or ed-like) - Editor (nano or ed-like)
- Self-hosting assembler - 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.

View File

@ -9,7 +9,10 @@
jmp near init jmp near init
db "LOVELAIN" %defstr STRVER VERSION
%define INTVER 0x %+ VERSION
db STRVER
; mformat writes stuff until 0x3E ; mformat writes stuff until 0x3E
params: times ( 0x3E - ($-$$) ) nop params: times ( 0x3E - ($-$$) ) nop
@ -44,6 +47,8 @@ hlt: hlt
db "rdos kernel" db "rdos kernel"
dd INTVER
end: align 512 end: align 512
section .bss section .bss