[Coco] How can you make permanent directory changes in OS-9 ml programs?
Boisy G. Pitre
boisy at tee-boy.com
Sun Sep 4 15:59:08 EDT 2011
Robert,
Robert,
I'm not sure why GPrDsc would be failing. What is the error code that it returns?
The F$Move may be more problematic, however. It is a privileged system call and cannot be made from a user state process.
Best Regards,
Boisy G. Pitre
Join our forums at http://www.tee-boy.com/forums/ to exchange ideas and join other WeatherSnoop enthusiasts.
On Sep 4, 2011, at 2:32 PM, Robert Gault wrote:
> Boisy G. Pitre wrote:
> ><snip>
> > Such an extraordinary measure would be to (a) change the directory in the process using I$ChgDir, (b) find the process descriptor of that process in system RAM, (c) copy the P$DIO bytes in the process descriptor, (c) locate the parent's process descriptor, then (d) write the P$DIO bytes copied earlier into the parent's process descriptor at its P$DIO location.
>
> Best Regards,
> Boisy G. Pitre
>
> Right, Boisy or anyone else, I think I've implemented the above but keep getting errors. Will the following work and if not why?
>
> Code snippets
>
> DskName rmb 40
> Myproc rmb 512
> Prproc rmb 512
> rmb 255
> size equ .
>
> ... directories changed here
>
> OS9 F$ID get my ID
> leax Myproc,u get copy of my process descriptor
> OS9 F$GPrDsc
> lda Myproc+P$PID,u get my parent's ID
> leax Prproc,u get copy of parent's proc descriptor
> OS9 F$GPrDsc
> lda Prproc+P$ID,u get pointer to parent's proc desc in
> OS9 F$GProcP system task space
> pshs y save pointer
> lda Myproc+P$Task,u get my task number
> ldb Prproc+P$Task,u get parent's task number
> leax Myproc+P$DIO,u point to my P$DIO
> ldy #16 bytes to move
> puls u recover pointer to parent
> OS9 F$Move move my P$DIO to parent's P$DIO
>
> The main error seems to be the OS9 F$GProcP system call. If I insert an error trap of
> lp bcs lp
> immediately after the F$GProcP call, the program stalls out. Here is the description of this system call from NitrOS-9.
>
> **************************************************
> * System Call: F$GProcP
> *
> * Function: Get process pointer
> *
> * Input: A = Process ID
> *
> * Output: Y = Pointer to process descriptor
> *
> * Error: CC = C bit set; B = error code
> *
>
> Any ideas on the above and how to correct it? Assuming I got the pointer without an error, would F$Move send the data correctly?
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list