Melchior FRANZ wrote:
>
> * Melchior FRANZ -- Thursday 07 June 2001 16:50:
> > * Kevin Lawton -- Thursday 07 June 2001 16:37:
> > [...]
> > > After the restore, you might check the IOPL value
> >
> > How? (iopl() doesn't output the current level.)
>
> I guess that requires some assembly commands. Unfortunately, I don't
> speak assembly. :-(
IOPL is a field in EFLAGS. Below is a diff for you to base your check from.
SOME_IOPL should be the IOPL you expect. No assembly required.
-Kevin
Index: monitor-host.c
===================================================================
RCS file: /cvsroot-plex86/plex86/kernel/monitor-host.c,v
retrieving revision 1.6
diff -u -r1.6 monitor-host.c
--- monitor-host.c 2001/06/07 15:38:42 1.6
+++ monitor-host.c 2001/06/07 16:00:01
@@ -1053,11 +1053,24 @@
soft_int(vm->redirect_vector); /* sets IF to 1 */
intRedirCount[vm->redirect_vector]++;
vm->mon_request = MON_REQ_NONE; /* Request satisfied */
+ #define SOME_IOPL 0
+ {
+ unsigned iopl = (eflags >> 12) & 0x03;
+ if (iopl != SOME_IOPL) {
+ hostprint("Argh, IOPL(%u) is wrong!\n", iopl);
+ }
}
+ }
/* Event was synchronous; monitor requested a switch back to host. */
else {
vm_restore_flags(eflags);
+ {
+ unsigned iopl = (eflags >> 12) & 0x03;
+ if (iopl != SOME_IOPL) {
+ hostprint("Argh, IOPL(%u) is wrong!\n", iopl);
+ }
+ }
/* Perform action requested by monitor */
switch ( vm->mon_request ) {