diff --git a/emul/Makefile b/emul/Makefile index 751fb26..17805cd 100644 --- a/emul/Makefile +++ b/emul/Makefile @@ -14,24 +14,12 @@ $(BLKPACK): $(BIN2C): $(BLKPACK) $(BLKUNPACK): $(BLKPACK) -stage0.bin: stage2 xcomp.fs - cat xcomp.fs | ./stage2 > stage0.bin - -stage0-bin.h: stage0.bin $(BIN2C) - $(BIN2C) KERNEL < stage0.bin > $@ - -stage1: stage.c $(OBJS) stage0-bin.h - $(CC) stage.c $(OBJS) -o $@ - -stage1dbg: stage.c $(OBJS) stage0-bin.h - $(CC) -DDEBUG stage.c $(OBJS) -o $@ - # not dependent on forth.bin to avoid circular deps. forth-bin.h: $(BIN2C) $(BIN2C) KERNEL < forth.bin > $@ stage2: stage.c $(OBJS) forth-bin.h blkfs-bin.h - $(CC) -DSTAGE2 stage.c $(OBJS) -o $@ + $(CC) stage.c $(OBJS) -o $@ blkfs: $(BLKPACK) $(BLKPACK) ../blk > $@ @@ -51,8 +39,8 @@ emul.o: emul.c .PHONY: updatebootstrap -updatebootstrap: stage1 stage1.fs - ./stage1 < stage1.fs > forth.bin +updatebootstrap: stage2 xcomp.fs + ./stage2 < xcomp.fs > forth.bin .PHONY: pack pack: diff --git a/emul/forth.bin b/emul/forth.bin index 1003b0d..1f56f0a 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ diff --git a/emul/stage.c b/emul/stage.c index 36ec647..f33b63f 100644 --- a/emul/stage.c +++ b/emul/stage.c @@ -2,12 +2,8 @@ #include #include #include "emul.h" -#ifdef STAGE2 #include "forth-bin.h" #include "blkfs-bin.h" -#else -#include "stage0-bin.h" -#endif /* Staging binaries @@ -74,7 +70,6 @@ static void iowr_here(uint8_t val) end_here |= val; } -#ifdef STAGE2 static void iowr_blk(uint8_t val) { blkid <<= 8; @@ -86,7 +81,6 @@ static uint8_t iord_blkdata() { return BLKFS[blkpos++]; } -#endif int main(int argc, char *argv[]) { @@ -95,10 +89,8 @@ int main(int argc, char *argv[]) m->iord[STDIO_PORT] = iord_stdio; m->iowr[STDIO_PORT] = iowr_stdio; m->iowr[HERE_PORT] = iowr_here; -#ifdef STAGE2 m->iowr[BLK_PORT] = iowr_blk; m->iord[BLKDATA_PORT] = iord_blkdata; -#endif // initialize memory for (int i=0; imem[i] = KERNEL[i]; diff --git a/emul/stage1.fs b/emul/stage1.fs deleted file mode 100644 index 484c541..0000000 --- a/emul/stage1.fs +++ /dev/null @@ -1,28 +0,0 @@ -: EFS@ - 256 /MOD 3 PC! 3 PC! - 1024 0 DO - 4 PC@ - BLK( I + C! - LOOP -; -: EFS! - 256 /MOD 3 PC! 3 PC! - 1024 0 DO - BLK( I + C@ 4 PC! - LOOP -; - -: INIT - CURRENT @ HERE ! - BLK$ - ['] EFS@ BLK@* ! - ['] EFS! BLK!* ! - RDLN$ - LIT< _sys [entry] - ." Collapse OS" NL -; - -(entry) _ -H@ 0x08 BIN+ ! ( update LATEST ) - ," INIT " -H@ 256 /MOD 2 PC! 2 PC! diff --git a/emul/xcomp.fs b/emul/xcomp.fs index 400a9cc..4ffc47c 100644 --- a/emul/xcomp.fs +++ b/emul/xcomp.fs @@ -9,11 +9,32 @@ 393 LOAD ( xcomp core low ) : (emit) 0 PC! ; : (key) 0 PC@ ; +: EFS@ + 256 /MOD 3 PC! 3 PC! + 1024 0 DO + 4 PC@ + BLK( I + C! + LOOP +; +: EFS! + 256 /MOD 3 PC! 3 PC! + 1024 0 DO + BLK( I + C@ 4 PC! + LOOP +; + 420 LOAD ( xcomp core high ) (entry) _ ( Update LATEST ) PC ORG @ 8 + ! ," CURRENT @ HERE ! " -," ' (key) 12 RAM+ ! " +," : INIT " +," BLK$ " +," ['] EFS@ BLK@* ! " +," ['] EFS! BLK!* ! " +," RDLN$ " +," LIT< _sys [entry] " +," LIT< CollapseOS (print) NL " +," ; INIT " ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!