Hi Marcel,

Oh well, wrong again, story of my life!

I knew about the stack format with the word telling how many channels and the 
word for the parameter string length, but not the two pipes.

Nowhere I know has any docs on these mysterious pipes. Running Qpac2's jobs 
utility and picking my dummy job does indeed show that it has two pipes open.

I think if I pass a channel to the job as well, ex #3 to test_bin. I het 
another 2 pies listed. I need to look further.

Thanks again.

Cheers,
Norm.

Sent from my HTC

----- Reply message -----
From: "Marcel Kilgus" <ql-us...@mail.kilgus.net>
To: <ql-us...@q-v-d.com>
Subject: [Ql-Users] Job data space - foibles?
Date: Wed, Oct 9, 2013 09:46


Norman Dunbar wrote:
> In my code size 30 example, I get 42 which is an extra 12 as well.
> What's so special about 12 I wonder?
>
> <insert delay while I rummage in the source code>
>
> Right, it must be something in the allocation of memory. I found the 
> code that creates a job and it simply allocates memory for 
> #jcb_end+d2+d3 and jcb_end is $68. This is what it requests of the 
> memory allocation code - so whatever is being allocated must be coming
> from that.

Wrong. As I wrote, the caller of sms.crjb must be the culprit. You
wrote you used EX to call the job, so we now look at that:
win1_sbsext_ext_exsbas_bas

prog_create
        move.l  a0,a4           save channel id
        move.l  job_id(sp),d1   owned by 0 or previous job
        move.l  d7,d3           number of files
        addq.l  #3,d3           plus two pipes (and two counts)
        lsl.l   #2,d3           *4
        add.l   d5,d3           plus string length
        add.l   d0,d3           plus data space required
        moveq   #sms.crjb,d0    create job
        trap    #1

EX adds 12 bytes for "two pipes (and two counts)". Reading the source
the counts seem to refer to two words counting the number of channels
and the bytes of the command string (EX test_exe;'command string').
Now that we have found this out the next thought must be "wow, this
standard must surely be documented somewhere", and lo and behold, it
is (QDOS/SMS reference manual, section 3):

(A6,A5)    | Command string  length(word) + bytes  |
           |                                       |
           | Channel ID long                       |
           | Channel ID long                       |
           | "                                     |
           | "                                     |
           | Channel ID long                       |
           |                                       |
(A7)       | Number of Channel IDs word            |
           |                                       |
(A6,A4)    | Data area                             |
           |                                       |
           | Code area                             |
           |                                       |
           | Job name length(word) + bytes         |
           |                                       |
           | $4AFB word                            |
           |                                       |
(A6)       | JMP.L JOB_START                       |

Morale of the story: I should have looked at the documentation first
;-)

Marcel

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to