
 lib environment
 lib macdefs
 sttl System Startup Task
 pag
 name strtup
 global strtup


*
* strtup
*
* Startup regular system.  This is task 1.
*

strtup seti mask interrupts
 lda #$FF make sure kernal flag is OK
 sta kernal
 ldd #ts1cnt set pc on stack
 pshs d
 ldd #0 set rest to 0
 pshs d u reg
 pshs d y reg
 pshs d x reg
 ldd #0
 pshs d dp and b
 lda #$80 set e bit
 pshs d cc and a
 ldx maptbl point to maps
 inc 1,x set map 1 busy
 ldx #umem
 ldu #$f410 point to map 1
 ldb #16 set count
ts1lp lda 0,x+
 sta 0,u+
 decb
 bne ts1lp
 clr urelod no need to reload maps
 lda #1 set map no
 sta umapno
 clri
* ora #%01000000
 sta $f3ff write task reg *******
 ldx #bfhwms
 jmp blowup
bfhwms fcc 'UGH!',0

ts1cnt swi3
 fcb 2 exec
 fdb strtu4
 fdb strtu5
 seti error!
 lbra $f800
strtu4 fcc '/etc/init',0
strtu5 fdb strtu6,0
strtu6 fcc 'tty_wait',0
