Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.misc > #1649

Re: 'Exception C000009D - Privileged Instruction' - why only on some systems?

From Lars Erdmann <lars.erdmann@arcor.de>
Newsgroups comp.os.os2.programmer.misc
Subject Re: 'Exception C000009D - Privileged Instruction' - why only on some systems?
Date 2019-02-02 17:59 +0100
Organization solani.org
Message-ID <q34iaa$apf$2@solani.org> (permalink)
References <q34f9m$4c1$1@dont-email.me>

Show all headers | View raw


In order to execute the in/out/ins/outs/cli/sti instructions:
The old W4 kernel requires the code segment to be an IOPL segment in 
order to execute these instructions. Since IOPL segments are limited
to 16-bit segments, that also means that you need to thunk to 16-bit 
code. Additionally, you need to define a callgate to transition from
32-bit ring3 to 16-bit ring2.

The SMP and UNI kernels have no such requirement. They will trap and the 
trap will be handled by the kernel which will allow to execute these 
instructions. There is a reason for that but I forgot what that was.

I therefore believe that your problem is that you are using these 2 
different kernels. It has nothing to do with ACPI.PSD.

If you want to write compatible code, you need to go via an 16-bit IOPL 
segment as that still works ok with the SMP/UNI kernel.


Lars



On 02.02.19 17.08, Andi B. wrote:
> I get this exception on my T42p but not my T60 nor on my desktop. I know
> it is triggered by IN from serial port register but I don't understand
> why it only traps on the T42.
>
> The same on all systems -
> PROTECTONLY=NO
> IOPL=YES
>
> The T42p is the only system without ACPI.PSD. But I do not understand
> why this should make a difference.
>
> Following code triggers the exception (icc3.65) -
>
>       while ( !(__inpb(0x3F8 + 5) & 0x20) );
>       __outpb(0x3F8, *s);
>
>
> Below is the start of the .trp file if it helps.
>
> Regards, Andreas

Back to comp.os.os2.programmer.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

'Exception C000009D - Privileged Instruction' - why only on some systems? "Andi B." <andi.b@gmx.net> - 2019-02-02 17:08 +0100
  Re: 'Exception C000009D - Privileged Instruction' - why only on some systems? Lars Erdmann <lars.erdmann@arcor.de> - 2019-02-02 17:59 +0100
    Re: 'Exception C000009D - Privileged Instruction' - why only on some systems? Dave Yeo <dave.r.yeo@gmail.com> - 2019-02-02 20:45 -0800
      Re: 'Exception C000009D - Privileged Instruction' - why only on some systems? "Andi B." <andi.b@gmx.net> - 2019-02-03 13:24 +0100
        Re: 'Exception C000009D - Privileged Instruction' - why only on some systems? Lars Erdmann <lars.erdmann@arcor.de> - 2019-02-03 17:53 +0100
      Re: 'Exception C000009D - Privileged Instruction' - why only on some systems? Lars Erdmann <lars.erdmann@arcor.de> - 2019-02-03 18:10 +0100

csiph-web