Hello Erich,
Within task-init from multitask.frt I think a task's entire tcb/user
area is filled with zeros and then only the values from the task's
(flash) tib are copied across to the task's tcb/user area. A value for
BASE is not stored within the tib. Only sp0, sp0-- and rp0 are stored
in the task's tib.
: tib>tcb ( tib -- tcb ) @i ;
: tib>rp0 ( tib -- rp0 ) i-cell+ @i ;
: tib>sp0 ( tib -- sp0 ) i-cell+ i-cell+ @i ;
: tib>size ( tib -- size )
dup tib>tcb swap tib>sp0 1+ swap -
;
: task-init ( tib -- )
dup tib>tcb over tib>size 0 fill \ clear RAM for tcb and stacks
dup tib>sp0 over tib>tcb #6 + ! \ store sp0 in tcb[6]
dup tib>sp0 cell- over tib>tcb #8 + ! \ store sp0-- in tcb[8], tos
dup tib>rp0 over tib>tcb #4 + ! \ store rp0 in tcb[4]
tib>tcb task-sleep \ store 'pass' in tcb[0]
;
I believe the interpreter user area is fully populated from eeprom
at boot time, but all other tasks rely on the programmer to fill in
what is relevant to their tasks. I did not appreciate that included a
value for BASE, but I do now.
> Having said that I feel inclined to add another: "Wouldn't it be
> nice, if I could run a second commandline task (quit) on an
> existing second serial connection (thing atmega644pa or
> similar)"? Thus effectively creating a *Two User AmForth on one
> AtMega644pa*? Actually I do have a use case for this. And I have
> started to implement something in small steps[2]:
Would the two users have separate dictionaries?
kind regards,
Tristan
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
[email protected]
https://lists.sourceforge.net/lists/listinfo/amforth-devel