~vdupras/duskos-deployments

1ea97220200fba3fa0df9fb93601409347106107 — Virgil Dupras 2 months ago d2712d0
pc-piix: Target Dusk v8
7 files changed, 34 insertions(+), 32 deletions(-)

M common.mk
M pc-piix/Makefile
M pc-piix/buildpc.fs
M pc-piix/glue.fs
M pc-piix/init.fs
D pc-piix/minify.fs
M rpi/Makefile
M common.mk => common.mk +5 -1
@@ 11,4 11,8 @@ $(DUSK): $(DUSKDIR)

.PHONY: clean
clean:
	rm -f $(TARGETS)
	rm -f $(TARGETS) $(TOCLEAN)

.PHONY: fullclean
fullclean: clean
	$(MAKE) -C $(DUSKDIR) clean

M pc-piix/Makefile => pc-piix/Makefile +9 -11
@@ 1,9 1,11 @@
DUSKVER = v7
DUSKVER = v8
TARGET = pc.img
TARGETS = $(TARGET)
TOCLEAN = kernel payload1.fs payload2.fs
include ../common.mk
include $(DUSKDIR)/mk/vars.mk
# sector to target for "secld" max: 59
TGTSEC = 43
TGTSEC = 48
KERNELSRC = $(FS)/xcomp/i386/pc/kernel.fs

QEMU_FLAGS = -accel kvm -accel tcg -machine q35 \


@@ 17,16 19,12 @@ kernel: $(DUSK) $(KERNELSRC)
	$(DUSK) < buildkernel.fs 4< $(KERNELSRC) 3> $@

payload1.fs: $(DUSK)
	echo " $(TGTSEC) secload " \
		| cat $(FS)/xcomp/boot.fs $(FS)/drv/pc/int13h.fs $(FS)/io/secld.fs - \
		| $(DUSK) 4<&0 < minify.fs 3> $@
	$(DUSKDIR)/inlinefs.sh $(FS)/xcomp/boot.fs $(FS)/drv/pc/int13h.fs \
		$(FS)/io/secld.fs > $@
	echo " $(TGTSEC) secload " >> $@

payload2.fs:
	cat $(FS)/lib/bm.fs $(FS)/io/stream.fs $(FS)/fs/core.fs \
		$(FS)/io/drive.fs $(FS)/io/secwin.fs \
		$(FS)/lib/str.fs $(FS)/mem/endian.fs \
		$(FS)/fs/fat.fs glue.fs \
		| $(DUSK) 4<&0 < minify.fs 3> $@
	$(DUSKDIR)/inlinefs.sh $(BM_SRC) $(FS_SRC) $(FAT_SRC) glue.fs > $@

$(TARGET): $(DUSK) kernel init.fs payload1.fs payload2.fs
	dd if=/dev/zero of=$@ bs=512 count=16384 # 8M


@@ 34,7 32,7 @@ $(TARGET): $(DUSK) kernel init.fs payload1.fs payload2.fs
	cat kernel payload1.fs | dd of=$@ bs=512 seek=1 conv=notrunc
	dd if=payload2.fs of=$@ bs=512 seek=$(TGTSEC) conv=notrunc
	mcopy -sQ -i $@ $(FS)/* ::
	cat init.fs $(FS)/xcomp/init.fs | mcopy -sQ -i $@ - ::init.fs
	mcopy -sQ -i $@ init.fs ::

.PHONY: emul
emul: $(TARGET)

M pc-piix/buildpc.fs => pc-piix/buildpc.fs +1 -1
@@ 14,7 14,7 @@ org value mbr
"pc.img" mountImage ( drv ) value mydrv
fatopts$
4 to secperclus
110 to rsvdsec
120 to rsvdsec
mydrv newFAT
mydrv setupMBR
bye

M pc-piix/glue.fs => pc-piix/glue.fs +1 -1
@@ 1,3 1,3 @@
INT13hDrive newfatfs bootfs!
f<< /init.fs
init
quit

M pc-piix/init.fs => pc-piix/init.fs +17 -11
@@ 21,25 21,31 @@ needs drv/pc/ps28042 drv/ps2

8042ps2$
:realias (ps2@?) 8042kbd@? ;
PS2Set1Keyboard :new keyboard' !
newps2set1kbd to keyboard

needs io/prompt
prompt$

8042mouse$
PS2Mouse :new mouse' !
640 480 4 mouse :configure
new8042mouse to mouse
640 480 4 mouse configuremouse

needs sys/screen
f<< /drv/pc/vesa.fs \ TODO: if loaded with "needs", it crashes. why?
VESA2Screen :new screen' !
needs drv/pc/vesa
newvesa2screen to screen

needs gr/cursor
screen :self Cursor :new bind{'@&} Cursor cursor
screen newcursor value cursor

needs sys/loop
0 value hidemousecursor
: mousemove ( -- )
  mouseupdate screen :activated? if
    hidemousecursor not if mouse :x mouse :y cursor :move then
  mouseupdate screen activated? if
    hidemousecursor not if mouse x mouse y cursor movecursor then
  else
    mouse :x 16 lshift mouse :y or grid dbgnum1!
    mouse :buttons grid dbgnum2! then ;
    mouse x 16 lshift mouse y or grid dbgnum1!
    mouse buttons grid dbgnum2! then ;
current loopadd

needs lib/fmt lib/diag
0 showprogress !
."Dusk OS\n" .free

D pc-piix/minify.fs => pc-piix/minify.fs +0 -7
@@ 1,7 0,0 @@
needs xcomp/tools
: minify ( -- )
  begin
    begin dataio getc keepc? until
    dup 0>= while dataio putc repeat ( c )
  drop ;
minify bye

M rpi/Makefile => rpi/Makefile +1 -0
@@ 1,5 1,6 @@
DUSKVER = v8
TARGETS = rpifat.img
TOCLEAN = rpikernel1.img rpikernel2.img payload
include ../common.mk
include $(DUSKDIR)/mk/vars.mk
KERNELSRC1 = $(FS)/xcomp/arm/rpi/kernel1.fs