According to 80386 Programmers Reference Manual:
"To use sensitive instructions (IN, OUT etc.), a procedure must
execute at a privilege level at least as privileged as that specified
by the IOPL (CPL <= IOPL). Any attempt by a less privileged procedure
to use a sensitive instruction results in a general protection
exception"
The question is who sets the IOPL of a procedure at startup. Which
part of OS assigns IOPL to a procedure? What is the criterion for this
assignment? Is there any default value assigned to procedures at
CPL=3.