RD/WR MSR register on Pentium

It requires ring 0 privilege to do this.

One way is to do that in the ISR routine and have an API issues any software
ISR.

Is there any sample to show how to issue an software ISR in NTO?

-Tony
Nokia Network.

“Tony Lee” <tl_168168@hotmail.com> wrote in
news:a693bs$2hs$1@inn.qnx.com:

It requires ring 0 privilege to do this.

One way is to do that in the ISR routine and have an API issues any
software ISR.

Is there any sample to show how to issue an software ISR in NTO?

AFAIK, it’s not supported. Accessing the MSR register is going to require
a nasty kludge. Basicly you can attach to the timer interupt to do your
Ring 0 work, and implement some sort of flag/spin to have your app signal
the ISR to do the work, and return the result.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Thanks for the answer.


But timer isr is not sychronized with the CPU events (load, store, branch
miss, etc)
I tried to measured in relation to my API.


\

-Tony Lee
Nokia Networks

“Adam Mallory” <amallory@qnx.com> wrote in message
news:Xns91CEB62C5C5B4amalloryqnxcom@209.226.137.4

“Tony Lee” <> tl_168168@hotmail.com> > wrote in
news:a693bs$2hs$> 1@inn.qnx.com> :

It requires ring 0 privilege to do this.

One way is to do that in the ISR routine and have an API issues any
software ISR.

Is there any sample to show how to issue an software ISR in NTO?

AFAIK, it’s not supported. Accessing the MSR register is going to require
a nasty kludge. Basicly you can attach to the timer interupt to do your
Ring 0 work, and implement some sort of flag/spin to have your app signal
the ISR to do the work, and return the result.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

“Tony Lee” <tl_168168@hotmail.com> wrote in
news:a6jj8l$b9h$1@inn.qnx.com:

Thanks for the answer.


But timer isr is not sychronized with the CPU events (load, store,
branch miss, etc)
I tried to measured in relation to my API.

Then perhaps you could use the parallel port or serial (or someother piece
of hardware) in a loopback config + InterruptAttach() to it. This way, you
send some info to the device, InteruptWait(), and you’ll be hit with a
Interrupt, which you could have a handler do your Ring0 work.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Thanks Adam,

I know this hack. It is slow to route the ISR out to HW and back.
It is much better via syscall hook or software ISR.

In linux/NT, I can do device IOCTL call/handler and get into the ring 0.

QNX should let user enter ring 0 in software without HW ISR loopback hack.


I will try out instrucmented kernel, which means I can code for ring 0.
Do you know a harmless syscall that I can call and hook to from
instructmented
kernel to return the data I wanted?


-Tony Lee
Nokia Networks


“Adam Mallory” <amallory@qnx.com> wrote in message
news:Xns91CFAD7C67B1amalloryqnxcom@209.226.137.4

“Tony Lee” <> tl_168168@hotmail.com> > wrote in
news:a6jj8l$b9h$> 1@inn.qnx.com> :


Thanks for the answer.


But timer isr is not sychronized with the CPU events (load, store,
branch miss, etc)
I tried to measured in relation to my API.

Then perhaps you could use the parallel port or serial (or someother piece
of hardware) in a loopback config + InterruptAttach() to it. This way,
you
send some info to the device, InteruptWait(), and you’ll be hit with a
Interrupt, which you could have a handler do your Ring0 work.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

Tony Lee <tl_168168@hotmail.com> wrote:

Thanks Adam,

I know this hack. It is slow to route the ISR out to HW and back.
It is much better via syscall hook or software ISR.

In linux/NT, I can do device IOCTL call/handler and get into the ring 0.

QNX should let user enter ring 0 in software without HW ISR loopback hack.



I will try out instrucmented kernel, which means I can code for ring 0.
Do you know a harmless syscall that I can call and hook to from
instructmented
kernel to return the data I wanted?

Assuming you’re at a high-priority, a couple of the most harmless
kernel calls around are, I would say, ThreadCancel() or SchedYield().

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.