Revert to more sensible kernel.bs boot scheme
I think i should consider it a necessity that the kernel is accessible as a regular file. This makes installing rdos on another blockdev much easier.
This commit is contained in:
parent
8ed9fe7465
commit
31eac279c2
8
Makefile
8
Makefile
@ -1,5 +1,5 @@
|
|||||||
PROGRAMS = hello.com
|
PROGRAMS = hello.com
|
||||||
DISTFILES = $(PROGRAMS)
|
DISTFILES = kernel.bs $(PROGRAMS)
|
||||||
ROMS =
|
ROMS =
|
||||||
|
|
||||||
QEMU = qemu-system-i386
|
QEMU = qemu-system-i386
|
||||||
@ -59,10 +59,10 @@ fat6.bs: boot/fat.asm
|
|||||||
%.rom: rom/%.asm utils/fix-rom
|
%.rom: rom/%.asm utils/fix-rom
|
||||||
$(NASM) $(NASM_ARGS) -o $@ $< && utils/fix-rom $@
|
$(NASM) $(NASM_ARGS) -o $@ $< && utils/fix-rom $@
|
||||||
|
|
||||||
fd%.img: kernel.bs $(DISTFILES)
|
fd%.img: fat1.bs $(DISTFILES)
|
||||||
mformat -C -i $@ -f $* -R 8 -v "$(LABEL)" -B kernel.bs ::
|
mformat -C -i $@ -f $* -R 8 -v "$(LABEL)" -B fat1.bs ::
|
||||||
dd if=kernel.bs conv=notrunc bs=512 skip=1 seek=1 of=$@
|
|
||||||
mcopy -i $@ $(DISTFILES) ::
|
mcopy -i $@ $(DISTFILES) ::
|
||||||
|
mattrib -i $@ +s ::kernel.bs
|
||||||
|
|
||||||
hdimage.img: mbr.bs fd1440.img
|
hdimage.img: mbr.bs fd1440.img
|
||||||
cat mbr.bs fd1440.img >$@
|
cat mbr.bs fd1440.img >$@
|
||||||
|
@ -248,9 +248,6 @@ main: ; Set up BP to point to BPB
|
|||||||
; load root directory
|
; load root directory
|
||||||
call loadr
|
call loadr
|
||||||
|
|
||||||
; search for first system directory
|
|
||||||
mov ah, 0x14
|
|
||||||
call loadf
|
|
||||||
; search for first system file
|
; search for first system file
|
||||||
mov ah, 0x04
|
mov ah, 0x04
|
||||||
call loadf
|
call loadf
|
||||||
|
@ -7,16 +7,6 @@
|
|||||||
; kernel stack size in words
|
; kernel stack size in words
|
||||||
%define stacksize 512
|
%define stacksize 512
|
||||||
|
|
||||||
jmp near init
|
|
||||||
|
|
||||||
%defstr STRVER VERSION
|
|
||||||
%define INTVER 0x %+ VERSION
|
|
||||||
|
|
||||||
db STRVER
|
|
||||||
|
|
||||||
; mformat writes stuff until 0x3E
|
|
||||||
params: times ( 0x3E - ($-$$) ) nop
|
|
||||||
|
|
||||||
init: cli
|
init: cli
|
||||||
xor ax, ax
|
xor ax, ax
|
||||||
mov ds, ax
|
mov ds, ax
|
||||||
@ -24,31 +14,13 @@ init: cli
|
|||||||
mov ss, ax
|
mov ss, ax
|
||||||
mov sp, ( stack+stacksize )
|
mov sp, ( stack+stacksize )
|
||||||
|
|
||||||
mov ax, [params+bpb.sectoroffset]
|
|
||||||
mov dx, [params+bpb.sectoroffset+2]
|
|
||||||
|
|
||||||
mov ax, 0x0201
|
|
||||||
mov cx, 0x0002
|
|
||||||
mov dh, 0
|
|
||||||
mov bx, 0x7E00
|
|
||||||
int 0x13
|
|
||||||
|
|
||||||
mov ax, [0x7E00]
|
|
||||||
mov cx, [0x7E02]
|
|
||||||
mov dx, [0x7E04]
|
|
||||||
|
|
||||||
int 3
|
int 3
|
||||||
|
|
||||||
hlt: hlt
|
hlt: hlt
|
||||||
jmp hlt
|
jmp hlt
|
||||||
|
|
||||||
times (0x1FE - ($-$$)) db 0
|
|
||||||
dw 0xAA55
|
|
||||||
|
|
||||||
db "rdos kernel"
|
db "rdos kernel"
|
||||||
|
|
||||||
dd INTVER
|
|
||||||
|
|
||||||
end: align 512
|
end: align 512
|
||||||
|
|
||||||
section .bss
|
section .bss
|
||||||
|
Loading…
Reference in New Issue
Block a user