cancel
Showing results for 
Search instead for 
Did you mean: 

KP services

SOLVED
Go to solution
ptrskg
Frequent Advisor

KP services

Hi,
I am trying to use the "new" KP services to replace an own "stack-switching" mechanims used in an old program. I have written a little test program in C but can't understand how to link it, which sharable or lib should be included in the linking.
Can anyone help me!

Thanks
Peter
9 REPLIES
Kris Clippeleyr
Honored Contributor
Solution

Re: KP services

Peter,
Compile:
CC source-file+SYS$SHARE:SYS$LIB_C.TLB/LIBR
Link:
LINK /SYSEXE object-file

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Ian Miller.
Honored Contributor

Re: KP services

sounds like fun :-)
I assuming you are working from
http://h71000.www7.hp.com/doc/82final/6673/6673pro_contents_001.html#toc_appendix_c
____________________
Purely Personal Opinion
ptrskg
Frequent Advisor

Re: KP services

Some more problems... so I reopened the thread.
Thanks to Kris I have managed to compile and link my C test code and also implemented some of the KP services in my target program. This is done on an IA64 running 8.2-1. But when i move the code to Alpha/8.2 it crashes in the exe$kp_restart routine. As I understand, the KP services in "user" mode are supported both on AXP and I64 from 8.2. Or not? Perhaps even for 7.3-2?(not likely).

Have anybody some ideas around this?

My test code is attached together with the crash output.

Thanks,
Peter
Jan van den Ende
Honored Contributor

Re: KP services

Peter,

AFAIK, KP stands for Keith Parris.
With his name spelled out, as I just did, there is a fair chance he will jump at it.

I guess that would constitute the ultimate in availabe help.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Ian Miller.
Honored Contributor

Re: KP services

KP is Kernel Process except its not a process so they just call them KP services now.

Whats on line 17418 of the C compiler listing kp.lis ?
____________________
Purely Personal Opinion
Volker Halle
Honored Contributor

Re: KP services

Ian,

I can easily reproduce this. Works on I64 V8.2, but fails on Alpha V8.2:

$ RUN kp
...
DBG> g
task1 start
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=00000A7472617471, PC=00000A7472617470, PS=0000001B
break on unhandled exception at 11495251473520
%DEBUG-I-SOURCESCOPE, source lines not available for %PC in scope number 0
Displaying source for 1\%PC
17426: exe$kp_restart(kpb1, status);


The address VA=PC+1 doesn't look right !

R26 has been loaded from @48(R2) and contains the bad address:

DBG> exa/ins 303EC-20:303ec
KP\main\%LINE 17424+24: STL R0,#X0008(FP)
KP\main\%LINE 17426: LDQ R16,#X0020(R2)
KP\main\%LINE 17426+4: LDL R16,(R16)
KP\main\%LINE 17426+8: LDL R17,#X0008(FP)
KP\main\%LINE 17426+0C: BIS R31,#X02,R25
KP\main\%LINE 17426+10: LDQ R26,#X0048(R2) <<< load R26
KP\main\%LINE 17426+14: LDQ R27,#X0050(R2)
KP\main\%LINE 17426+18: JSR R26,(R26)
KP\main\%LINE 17428: BIS R31,#X01,R0

DBG> exa/quad @r2+48
0000000000010168: 00000A7472617473


Volker.
Volker Halle
Honored Contributor

Re: KP services

Peter,

if you use the constant KPREG$K_HLL_REG_MASK as the reg-mask argument in the exe$kp_start call, the program also works on OpenVMS Alpha V8.2:

status = exe$kp_start(kpb1, (void *)task1, KPREG$K_HLL_REG_MASK);

AXPVMS $ run/nodeb kp
task1 start
task1 restart
end rtn


Volker.
Jan van den Ende
Honored Contributor

Re: KP services

So,

here I was utterly off-target.
Guess I am not yet too old to learn something new :-)

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
ptrskg
Frequent Advisor

Re: KP services

Volker, and the rest of you, thanks a lot for your help.
It's good to know that out there in the binary space, there is always someone willing to help a colleague in distress.

Peter
(I promise to read the documentation better next time)