On 12 Jan 2005 at 13:25, P Witte wrote:

(...)
> As long as you dont mean that this has to be done on the EX command line, I
> agree with the above description.

No, that wouldn't make much sense.

> Having said that, it /would/ perhpas be nice to add something like this as
> an option to
> overwrite the default home directory, although is does complicate an already
> overloaded parameter list:
> 
>     EX <filename> ; <command string> ! <different homedir>

Before IMPROVING the service, let's already get it...
(grin)
(...)


> Its first of all a matter of finding the job's dataspace. 

No,no!

To recap:

job start                                       (a6)
(generally a bra to the real code)

pointed to by A6 on job execution

....
code area

...
data area                                       (a6,a4)

....
stack                                           (a7)
containing
nbr of channels
channels

command line                            (a6,a5)


So the command line doesn't lie in the data area itself, but above the stack 
(the diagram above is upside down). So a pointer to the dataspace doesn't 
make any sense, you don't know how large your dataspace is (once the program 
executes, the loader does, though).

A "normal" prog should be able to find its command string as it should 'know" 
how it has manipulated its own stack.

But a compiled basic prog? Nothing points to it anymore.
If one were *sure* there is nothing on the stack, one might even get at it 
through the stack pointer. which, after all, lies just above the commnd 
string and thus the home dir in this scheme.

One way around it: precede the home dir with a unique long word and search 
for that in the stack area. This presumes that the home dir is of a fixed 
maximum length....



>The Homedir string
> is at the top of that, past where the QLiberated job has any legitimate
> business to poke around 

"legitimate".
Says it all....

(...)

> I havent looked in detail how the dataspace may be found, but I presume it
> possible to find any executing job's dataspace by legitimate means.  It is
> also possible that the QLibbed job's a6 points to its dataspace. Either that
> or it stores the its location somewhere, as it needs to find its own command
> string on demand.

Nope, see above

> Alternatively, EX could be made to identify a QLibbed program and store its
> dataspace address in a known safe location before activation.

Err, like what? And how do you get at it from within your basic keyword 
(which should also work for normal uncompiled basic....)
(...)
> 
> Better to flame now than once it is implemented ;)

Of course. We're far from it, anyway....


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


----------------------------------------
www.scp-paulet-lenerz.com

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

Reply via email to