Compare commits
2 Commits
346b18f8b4
...
7e41612687
Author | SHA1 | Date |
---|---|---|
Juhani Krekelä | 7e41612687 | |
Juhani Krekelä | 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
|
||||||
|
|
48
bootsect.asm
48
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
|
||||||
|
@ -45,6 +67,28 @@ _start:
|
||||||
; Save bootdrive
|
; Save bootdrive
|
||||||
mov [drivenumber], dl
|
mov [drivenumber], dl
|
||||||
|
|
||||||
|
select_os:
|
||||||
|
mov ah, 0xe
|
||||||
|
mov si, prompt
|
||||||
|
.print:
|
||||||
|
lodsb
|
||||||
|
test al, al
|
||||||
|
jz .end
|
||||||
|
int 0x10
|
||||||
|
jmp .print
|
||||||
|
.end:
|
||||||
|
|
||||||
|
xor ax, ax
|
||||||
|
int 0x16
|
||||||
|
|
||||||
|
cmp al, 'e'
|
||||||
|
jne calc_constants
|
||||||
|
|
||||||
|
mov si, ettinos_kernel_name
|
||||||
|
mov di, kernel_name
|
||||||
|
mov cx, 11
|
||||||
|
rep movsb
|
||||||
|
|
||||||
calc_constants:
|
calc_constants:
|
||||||
; Disk organization:
|
; Disk organization:
|
||||||
; Reserved sectors (MBR)
|
; Reserved sectors (MBR)
|
||||||
|
@ -288,9 +332,9 @@ chs:
|
||||||
pop ax
|
pop ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%include "hexprint.inc"
|
prompt: db "Select OS. 'e' for EttinOS, any other key Nor86.", 0
|
||||||
|
|
||||||
kernel_name: db "KERNEL BIN"
|
kernel_name: db "KERNEL BIN"
|
||||||
|
ettinos_kernel_name: db "SYSTEM BIN"
|
||||||
|
|
||||||
times 510-($-$$) db 0
|
times 510-($-$$) db 0
|
||||||
db 0x55, 0xaa
|
db 0x55, 0xaa
|
||||||
|
|
Loading…
Reference in New Issue