Add support for 360K disk images as well
This commit is contained in:
parent
485a75d6c3
commit
96dcfa48bb
8
Makefile
8
Makefile
|
@ -1,3 +1,5 @@
|
||||||
|
FLOPPY = 1440
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .bin .asm
|
.SUFFIXES: .bin .asm
|
||||||
|
|
||||||
|
@ -5,15 +7,15 @@ all: nor86.img
|
||||||
|
|
||||||
nor86.img: bootsect.bin kernel.bin CC0 README.md
|
nor86.img: bootsect.bin kernel.bin CC0 README.md
|
||||||
rm -f $@
|
rm -f $@
|
||||||
mkdosfs -C $@ 1440
|
mkdosfs -C $@ $(FLOPPY)
|
||||||
rw -i bootsect.bin -o $@
|
rw -i bootsect.bin -o $@
|
||||||
mcopy -i $@ CC0 ::
|
mcopy -i $@ CC0 ::
|
||||||
mcopy -i $@ README.md ::
|
mcopy -i $@ README.md ::
|
||||||
mcopy -i $@ kernel.bin ::
|
mcopy -i $@ kernel.bin ::
|
||||||
|
|
||||||
.asm.bin:
|
.asm.bin:
|
||||||
nasm -fbin -o $@ $<
|
nasm -fbin -d F$(FLOPPY) -o $@ $<
|
||||||
nasm -MD $@.d -fbin -o $@ $<
|
nasm -MD $@.d -d F$(FLOPPY) -fbin -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.bin *.img *.bin.d
|
rm -f *.bin *.img *.bin.d
|
||||||
|
|
|
@ -3,3 +3,11 @@ Nor86 operating system
|
||||||
|
|
||||||
Nor86 is a real-mode operating system targeting IBM PC compatibles with 64K
|
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).
|
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
|
||||||
|
|
22
bootsect.asm
22
bootsect.asm
|
@ -4,6 +4,7 @@ org 0x7c00
|
||||||
jmp short _code
|
jmp short _code
|
||||||
nop
|
nop
|
||||||
|
|
||||||
|
%ifdef F1440
|
||||||
; 1440K floppy
|
; 1440K floppy
|
||||||
; BPB
|
; BPB
|
||||||
oemidentifier db "nor86 "
|
oemidentifier db "nor86 "
|
||||||
|
@ -20,6 +21,27 @@ heads dw 2
|
||||||
hiddensectors dd 0
|
hiddensectors dd 0
|
||||||
totalsectorslarge 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
|
; EBPB
|
||||||
drivenumber db 0 ; useless on-disk, used as a variable
|
drivenumber db 0 ; useless on-disk, used as a variable
|
||||||
reserved db 0 ; winnt flags
|
reserved db 0 ; winnt flags
|
||||||
|
|
Loading…
Reference in New Issue