[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH v2 2/3] kernel2: vm86: in/out-Instruktionen mit Immediate-Port
+ kernel2: Der Instruktionsemulator unterstützt jetzt auch die
in/out-Varianten, die die Portnummer als Immediatewert statt in dx
bekommen.
Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
src/kernel2/src/arch/i386/vm86.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/src/kernel2/src/arch/i386/vm86.c b/src/kernel2/src/arch/i386/vm86.c
index 566f2af..53bb04e 100644
--- a/src/kernel2/src/arch/i386/vm86.c
+++ b/src/kernel2/src/arch/i386/vm86.c
@@ -375,6 +375,38 @@ int vm86_exception(interrupt_stack_frame_t* isf)
isf->eip = emulator_pop(isf);
break;
+ case 0xe4: /* in al, imm8 */
+ isf->eax &= ~0xFF;
+ isf->eax |= inb(ops[1]);
+ isf->eip += 2;
+ break;
+
+ case 0xe5: /* in ax, imm8 */
+ isf->eax &= ~0xFFFF;
+ isf->eax |= inw(ops[1]);
+ isf->eip += 2;
+ break;
+
+ case 0x66e5: /* in eax, imm8 */
+ isf->eax = inl(ops[2]);
+ isf->eip += 3;
+ break;
+
+ case 0xe6: /* out imm8, al */
+ outb(ops[1], isf->eax);
+ isf->eip += 2;
+ break;
+
+ case 0xe7: /* out imm8, ax */
+ outw(ops[1], isf->eax);
+ isf->eip += 2;
+ break;
+
+ case 0x66e7: /* outl imm8, eax */
+ outl(ops[2], isf->eax);
+ isf->eip += 3;
+ break;
+
case 0xec: /* inb al, dx */
isf->eax &= ~0xFF;
isf->eax |= inb(isf->edx);
--
2.1.4