Add support for 360K disk images as well

This commit is contained in:
Juhani Krekelä 2021-06-30 22:56:15 +03:00
parent 485a75d6c3
commit 96dcfa48bb
3 changed files with 35 additions and 3 deletions

View File

@ -1,3 +1,5 @@
FLOPPY = 1440
.SUFFIXES:
.SUFFIXES: .bin .asm
@ -5,15 +7,15 @@ all: nor86.img
nor86.img: bootsect.bin kernel.bin CC0 README.md
rm -f $@
mkdosfs -C $@ 1440
mkdosfs -C $@ $(FLOPPY)
rw -i bootsect.bin -o $@
mcopy -i $@ CC0 ::
mcopy -i $@ README.md ::
mcopy -i $@ kernel.bin ::
.asm.bin:
nasm -fbin -o $@ $<
nasm -MD $@.d -fbin -o $@ $<
nasm -fbin -d F$(FLOPPY) -o $@ $<
nasm -MD $@.d -d F$(FLOPPY) -fbin -o $@ $<
clean:
rm -f *.bin *.img *.bin.d

View File

@ -3,3 +3,11 @@ Nor86 operating system
Nor86 is a real-mode operating system targeting IBM PC compatibles with 64K
or more RAM. It is inspired by [EttinOS](https://ahti.space/git/crazyettin/EttinOS).
Floppy sizes
------------
You can build either a 1440K or a 360K floppy image from Nor86 sources, the
default being 1440K. To build a 360K floppy instead, run:
make FLOPPY=360

View File

@ -4,6 +4,7 @@ org 0x7c00
jmp short _code
nop
%ifdef F1440
; 1440K floppy
; BPB
oemidentifier db "nor86 "
@ -20,6 +21,27 @@ heads dw 2
hiddensectors dd 0
totalsectorslarge dd 0
%elifdef F360
; 360K floppy
; BPB
oemidentifier db "nor86 "
byterpersector dw 512
sectorspercluster db 2
reservedsectors dw 1
fats db 2
rootdirentries dw 112
totalsectors dw 720
mediadescription db 0xfd
sectorsperfat dw 2
sectorspertrack dw 9
heads dw 2
hiddensectors dd 0
totalsectorslarge dd 0
%else
%error "No valid floppy format specified, specify -d F1440 or -d F360"
%endif
; EBPB
drivenumber db 0 ; useless on-disk, used as a variable
reserved db 0 ; winnt flags