Re: Old messages (part II)
Posted: Thu Dec 20, 2018 7:42 pm
Alex Bervoets 3.31.2005
2SamuelIOPL: I can imagine that certain existing programs use the IOPL feature for strict I/O
timing purposes. So running IOPL code in ring 3, which results in a GPF at each IN/OUT instruction,
and then emulating this in the kernel will certainly introduce a serious performance degradation,
which could break compatibility with these apps.
Another issue: IOPL code is 16 bit code, so a new application loader has to load an application with
mixed 16 and 32 bit segments correctly and has to replace the call gates with some sort of thunking
mechanism.
Concerning the CLI instruction issue: I assume that certain applications disable interrupts in IOPL mode
to prevent the kernel from accessing the same I/O ports, should the code become preemted by an interrupt.
Now a quick and dirty solution could be to only disable the IRQ (mask out in PIC) which corresponds to the
I/O port being accessed. The kernel could maintain a list of I/O port ranges and corresponding IRQ's. Also,
there could be an extra CLI/STI GPF flag in the process information block. A GPF on a CLI instruction will
set this flag. Now if there's an I/O GPF and this flag is set, then the corresponding IRQ should be disabled.
However, I see already an issue here: what in the case of code like "PUSHF CLI ... POPF" (no STI) : popf should
enable the interrupts again but there's no GPF to clear the flag. The question is of course "Are we going to
keep on supporting this old, unsafe and potentially dangerous stuff ?".
2SamuelQEMU: I've done some googling and apparently there're also other OS-es having problems with QEMU's
ide emulation. I've read several suggestions: one was to use the latest CVS version, another one was to use the
switch -isa when launching qemu. If you want to see the ide detection process in OS/2, then add the 2 switches
/V /W to the line basedev=ibm1s506.add in config.sys. If you want to disable bus mastering in OS/2, then add
the 2 switches /a:0 /!bm to this line in config.sys.
2All: Can we use Program Commander/2 as a WPS replacement ? PC/2 is freeware with the source code included.
2SamuelIOPL: I can imagine that certain existing programs use the IOPL feature for strict I/O
timing purposes. So running IOPL code in ring 3, which results in a GPF at each IN/OUT instruction,
and then emulating this in the kernel will certainly introduce a serious performance degradation,
which could break compatibility with these apps.
Another issue: IOPL code is 16 bit code, so a new application loader has to load an application with
mixed 16 and 32 bit segments correctly and has to replace the call gates with some sort of thunking
mechanism.
Concerning the CLI instruction issue: I assume that certain applications disable interrupts in IOPL mode
to prevent the kernel from accessing the same I/O ports, should the code become preemted by an interrupt.
Now a quick and dirty solution could be to only disable the IRQ (mask out in PIC) which corresponds to the
I/O port being accessed. The kernel could maintain a list of I/O port ranges and corresponding IRQ's. Also,
there could be an extra CLI/STI GPF flag in the process information block. A GPF on a CLI instruction will
set this flag. Now if there's an I/O GPF and this flag is set, then the corresponding IRQ should be disabled.
However, I see already an issue here: what in the case of code like "PUSHF CLI ... POPF" (no STI) : popf should
enable the interrupts again but there's no GPF to clear the flag. The question is of course "Are we going to
keep on supporting this old, unsafe and potentially dangerous stuff ?".
2SamuelQEMU: I've done some googling and apparently there're also other OS-es having problems with QEMU's
ide emulation. I've read several suggestions: one was to use the latest CVS version, another one was to use the
switch -isa when launching qemu. If you want to see the ide detection process in OS/2, then add the 2 switches
/V /W to the line basedev=ibm1s506.add in config.sys. If you want to disable bus mastering in OS/2, then add
the 2 switches /a:0 /!bm to this line in config.sys.
2All: Can we use Program Commander/2 as a WPS replacement ? PC/2 is freeware with the source code included.