Jump to content
IGNORED

MDOS Multitasking


9640News

Recommended Posts

Tim,

 

I used to have the information from Paul Charlton, but can not find it anymore. Looking at my Windows source, I do not believe I had the information there as well.

 

I have a program that is calling up another program with the Utility XOP. Program loads and executes, however, I do not recall the byte(s) I need to have the calling program write to >0102 to put the parent program to sleep with the byte(s) at >0102 of the child task to make it exclusive. I know the CLI is a unique task and it was different, but did not recall the bytes needed to write and I can not find my notes on the subject.

 

I seem to recall needing to stay in a loop waiting for the time slice to decrement to 0, but nothing I have tried thus far works.

 

The closest I have gotten thus far to anything that works is writing >FF01 to >0102 of the parent program and >FE06 to the child task at >0102. However, when I exit the child task, the parent does not re-awaken.

 

Beery

 

 

 

Link to comment
Share on other sites

Low and behold, I found my notes on the subject and someone had posted them on the internet;

 

The link is: http://ti994a.cwfk.net/9640news/volume1-5.html

 

The notes I needed are:

 

Notes on >0102 as the 'task' state used by the interrupt routine to determine the status of each task

if the state is >00, the task is in run mode and can be swapped to another task by the interrupt routine.

if the state is >FF (reserved for the CLI), the interrupt routine ignores the task if there are other tasks present.

if the task is >FE, the task is locked and can not be multi-tasked

if the task is >FD, the task is ignored and prgrams like the CLI in state >FF can still run (used to lock a tasks memory pages so they can't be freed, like the graphics drivers, or other code for a library)

if the state is >01...>fc, the task is assumed to be asleep, waiting for the I/O or something and the interrupt routine ignores the CLI

What Paul says about >0102 is it is a counter that is decremented by the interrupt routine that runs every 1/60 second. When it reaches >0000, another task is mapped in and runs until it is is decremented. The interrupt routine first determines the state of those tasks. That is why I mapped >0000 into the CLI to make it an even run time task. When I move >0001 into my task (can't go smaller), it is decremented to zero and only stays in the task about 1/16 the time it would have normally been there. Note this is only good for v0.96H (I haven't checked V1.14F to see if those bytes are in the same location. If you use DISkASSEMBLER and disassemble pages >06 and find where it moves bytes into location >0102, you can check for other versions if those bytes assembled out of position.

  • Like 4
Link to comment
Share on other sites

Just a snippit of code for anyone should they ever want to do something similar.

 

LI R0,>27
LI R1,STRING
LI R2,10
XOP @VID,0
LI R0,9
LI R1,STR
XOP @UTIL,0
LIMI 0
MOV R1,@>F112
MOV @HEXFE06,@>6102
MOV @HEXFF01,@>0102
MOV @HEX0602,@>F112 Mapping the CLI in.
MOV @HEXFC01,@>4102 Changing the state of the CLI
LIMI 2
REDO
LI R0,>27
LI R1,STRING1
LI R2,10
XOP @VID,0
LI R0,>27
LI R1,STRING2
LI R2,10
XOP @VID,0
JMP REDO
BLWP @0
STRING TEXT 'Hello '
BYTE >0D,>0A,0
EVEN
VID DATA 6
UTIL DATA 9
HEXFE DATA >FEFE
HEX0003 DATA >0003
HEXFD00 DATA >FB00
HEXFDFF DATA >FDFF
HEXFE06 DATA >FE06
HEXFF01 DATA >FF01
HEX0602 DATA >0602
HEXFC01 DATA >FC01
STR BYTE 18
TEXT 'HDS1.MDOS1.PROGRAM"
EVEN
STRING1 TEXT 'GO UK '
BYTE >0D,>0A,0
EVEN
STRING2 TEXT 'HEY '
BYTE >0D,>0A,0
EVEN
Edited by BeeryMiller
Link to comment
Share on other sites

i had to add 4 lines of code to the above code. I needed to change the state of the CLI so it would not preempt the parent program after its state had changed. This means, once you have exited the child program and the parent program takes over, you need to allow enough time to then change the state of the CLI back to its original state. This can be done on a timer loop, or during a clean exit of the calling program.

 

Beery

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...