mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 18:48:06 +11:00
Compare commits
No commits in common. "d7f002df98e60cabf2d590670f829b58198ef1ac" and "8d645405b39f6a0deb473a496fa26586b5f87b2f" have entirely different histories.
d7f002df98
...
8d645405b3
7
blk/760
7
blk/760
@ -1,10 +1,7 @@
|
|||||||
: MOVri, SWAP 0xb0 OR A, A, ;
|
: MOVri, SWAP 0xb0 OR A, A, ;
|
||||||
: MOVxI, SWAP 0xb8 OR A, A,, ;
|
: MOVxI, SWAP 0xb8 OR A, A,, ;
|
||||||
: MOVsx, 0x8e A, SWAP <<3 OR 0xc0 OR A, ;
|
: MOVsx, 0x8e A, SWAP 3 LSHIFT OR 0xc0 OR A, ;
|
||||||
: MOVrm, 0x8a A, SWAP <<3 0x6 OR A, A,, ;
|
: MOVxm, 0x8b A, SWAP 3 LSHIFT 0x6 OR A, A,, ;
|
||||||
: MOVxm, 0x8b A, SWAP <<3 0x6 OR A, A,, ;
|
|
||||||
: MOVmr, 0x88 A, <<3 0x6 OR A, A,, ;
|
|
||||||
: MOVmx, 0x89 A, <<3 0x6 OR A, A,, ;
|
|
||||||
: SUBxi, 0x83 A, SWAP 0xe8 OR A, A, ;
|
: SUBxi, 0x83 A, SWAP 0xe8 OR A, A, ;
|
||||||
: ADDxi, 0x83 A, SWAP 0xc0 OR A, A, ;
|
: ADDxi, 0x83 A, SWAP 0xc0 OR A, A, ;
|
||||||
: JMPr, 0xff A, 7 AND 0xe0 OR A, ;
|
: JMPr, 0xff A, 7 AND 0xe0 OR A, ;
|
||||||
|
6
blk/811
6
blk/811
@ -3,9 +3,9 @@ JMPs, L1 FWRs ( start )
|
|||||||
ORG @ 0x25 + HERE ! ( bypass BPB )
|
ORG @ 0x25 + HERE ! ( bypass BPB )
|
||||||
L1 FSET ( start )
|
L1 FSET ( start )
|
||||||
CLI, CLD, AX 0x800 MOVxI, DS AX MOVsx, ES AX MOVsx,
|
CLI, CLD, AX 0x800 MOVxI, DS AX MOVsx, ES AX MOVsx,
|
||||||
SS AX MOVsx, DX PUSHx, ( will be popped by OS ) STI,
|
SS AX MOVsx, STI,
|
||||||
AH 2 MOVri, DH 0 MOVri, CH 0 MOVri, CL 2 MOVri, AL 15 MOVri,
|
AH 2 MOVri, DX 0 MOVxI, CH 0 MOVri, CL 2 MOVri, AL 12 MOVri,
|
||||||
BX 0 MOVxI, 0x13 INT, ( read sectors 2-15 of boot floppy )
|
BX 0 MOVxI, 0x13 INT, ( read sectors 2-14 of boot floppy )
|
||||||
( TODO: reading 12 sectors like this probably doesn't work
|
( TODO: reading 12 sectors like this probably doesn't work
|
||||||
on real vintage PC/AT with floppy. Make this more robust. )
|
on real vintage PC/AT with floppy. Make this more robust. )
|
||||||
0x800 0 JMPf,
|
0x800 0 JMPf,
|
||||||
|
6
blk/812
6
blk/812
@ -1,11 +1,11 @@
|
|||||||
VARIABLE lblexec VARIABLE lblnext
|
VARIABLE lblexec VARIABLE lblnext
|
||||||
H@ ORG !
|
H@ ORG !
|
||||||
JMPn, 0 A,, ( 00, main ) 0 A, ( 03, boot driveno )
|
JMPn, 0 A,, ( 00, main ) 0 A, ( unused ) 0 A,, ( 04, BOOT )
|
||||||
0 A,, ( 04, BOOT )
|
|
||||||
0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST )
|
0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST )
|
||||||
0 A, 0 A, 0 A,, ( unused )
|
0 A, 0 A, 0 A,, ( unused )
|
||||||
0 A, 0 A,, ( unused ) JMPn, 0 A,, ( 11, pushRS )
|
0 A, 0 A,, ( unused ) JMPn, 0 A,, ( 11, pushRS )
|
||||||
JMPn, 0 A,, ( 14, popRS ) 0 A, 0 A,, ( unused )
|
JMPn, 0 A,, ( 14, popRS )
|
||||||
|
0 A, 0 A,, ( unused )
|
||||||
JMPn, 0 A,, ( 1a, next ) 0 A, 0 A,, ( unused )
|
JMPn, 0 A,, ( 1a, next ) 0 A, 0 A,, ( unused )
|
||||||
0 A, 0 A, 0 A, 0 A, ( unused )
|
0 A, 0 A, 0 A, 0 A, ( unused )
|
||||||
0 A, 0 A, 0 A, 0 A, ( unused )
|
0 A, 0 A, 0 A, 0 A, ( unused )
|
||||||
|
6
blk/821
6
blk/821
@ -1,9 +1,9 @@
|
|||||||
PC 3 - ORG @ 1+ ! ( main )
|
PC 3 - ORG @ 1+ ! ( main )
|
||||||
DX POPx, ( boot drive no ) 0x03 DL MOVmr,
|
|
||||||
SP PS_ADDR MOVxI, BP RS_ADDR MOVxI,
|
SP PS_ADDR MOVxI, BP RS_ADDR MOVxI,
|
||||||
DI 0x08 MOVxm, ( LATEST )
|
DI 0x08 MOVxm, ( LATEST )
|
||||||
( HERE begins at CURRENT )
|
( HERE begins at CURRENT )
|
||||||
RAMSTART 0x4 ( HERE ) + DI MOVmx,
|
BX RAMSTART MOVxI,
|
||||||
RAMSTART 0x2 ( CURRENT ) + DI MOVmx,
|
[BX] 0x04 ( HERE ) DI MOV[]+x,
|
||||||
|
[BX] 0x02 ( CURRENT ) DI MOV[]+x,
|
||||||
DI 0x04 ( BOOT ) MOVxm,
|
DI 0x04 ( BOOT ) MOVxm,
|
||||||
JMPn, lblexec @ RPCn, ( execute )
|
JMPn, lblexec @ RPCn, ( execute )
|
||||||
|
@ -13,14 +13,13 @@ os.bin: xcomp.fs $(STAGE)
|
|||||||
|
|
||||||
disk.bin: mbr.bin os.bin
|
disk.bin: mbr.bin os.bin
|
||||||
cat mbr.bin os.bin > $@
|
cat mbr.bin os.bin > $@
|
||||||
dd if=$(EDIR)/blkfs of=$@ bs=512 seek=16
|
|
||||||
|
|
||||||
$(STAGE):
|
$(STAGE):
|
||||||
$(MAKE) -C $(EDIR) stage
|
$(MAKE) -C $(EDIR) stage
|
||||||
|
|
||||||
.PHONY: emul
|
.PHONY: emul
|
||||||
emul: $(TARGET)
|
emul: $(TARGET)
|
||||||
qemu-system-i386 -drive file=$(TARGET),if=floppy,format=raw
|
qemu-system-i386 -fda $(TARGET)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
@ -10,46 +10,11 @@ CODE (emit) 1 chkPS,
|
|||||||
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
|
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
|
||||||
;CODE
|
;CODE
|
||||||
CODE (key)
|
CODE (key)
|
||||||
AH AH XORrr, 0x16 INT, AH AH XORrr, AX PUSHx,
|
AH AH XORrr, 0x16 INT, AH AH XORrr, AX PUSHx, ;CODE
|
||||||
;CODE
|
|
||||||
CODE 13H08H ( driveno -- cx )
|
|
||||||
DI POPx, DX PUSHx, ( protect ) DX DI MOVxx, AX 0x800 MOVxI,
|
|
||||||
DI DI XORxx, ES DI MOVsx,
|
|
||||||
0x13 INT, DX POPx, ( unprotect ) CX PUSHx,
|
|
||||||
DI 0x800 MOVxI, ES DI MOVsx,
|
|
||||||
;CODE
|
|
||||||
CODE 13H ( ax bx cx dx -- ax bx cx dx )
|
|
||||||
SI POPx, ( DX ) CX POPx, BX POPx, AX POPx,
|
|
||||||
DX PUSHx, ( protect ) DX SI MOVxx, DI DI XORxx,
|
|
||||||
0x13 INT, SI DX MOVxx, DX POPx, ( unprotect )
|
|
||||||
AX PUSHx, BX PUSHx, CX PUSHx, SI PUSHx,
|
|
||||||
;CODE
|
|
||||||
: FDSPT 0x70 RAM+ ;
|
|
||||||
: _ ( dest secno )
|
|
||||||
( AH=read sectors, AL=1 sector, BX=dest,
|
|
||||||
CH=trackno CL=secno DH=head DL=drive )
|
|
||||||
0x0201 ROT ROT ( AX BX sec )
|
|
||||||
FDSPT @ /MOD ( AX BX sec trk )
|
|
||||||
2 /MOD ( AX BX sec head trk )
|
|
||||||
8 LSHIFT ROT OR 1+ ( AX BX head CX )
|
|
||||||
SWAP 8 LSHIFT 0x03 C@ ( boot drive ) OR ( AX BX CX DX )
|
|
||||||
13H 2DROP 2DROP
|
|
||||||
;
|
|
||||||
: FD@
|
|
||||||
2 * 16 + ( blkfs starts at sector 16 )
|
|
||||||
BLK( OVER _ BLK( 0x200 + SWAP 1+ _ ;
|
|
||||||
: FD! DROP ;
|
|
||||||
: FD$
|
|
||||||
( get number of sectors per track with command 08H. )
|
|
||||||
0x03 ( boot drive ) C@ 13H08H 0x3f AND FDSPT !
|
|
||||||
;
|
|
||||||
380 LOAD ( xcomp core high )
|
380 LOAD ( xcomp core high )
|
||||||
(entry) _
|
(entry) _
|
||||||
( Update LATEST )
|
( Update LATEST )
|
||||||
PC ORG @ 8 + !
|
PC ORG @ 8 + !
|
||||||
," BLK$ FD$ "
|
|
||||||
," ' FD@ BLK@* ! "
|
|
||||||
," ' FD! BLK!* ! "
|
|
||||||
EOT,
|
EOT,
|
||||||
ORG @ 256 /MOD 2 PC! 2 PC!
|
ORG @ 256 /MOD 2 PC! 2 PC!
|
||||||
H@ 256 /MOD 2 PC! 2 PC!
|
H@ 256 /MOD 2 PC! 2 PC!
|
||||||
|
Loading…
Reference in New Issue
Block a user