- Delete bios.c and usertrap.c
authorAlex Ionescu <aionescu@gmail.com>
Mon, 21 Aug 2006 03:49:02 +0000 (03:49 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 21 Aug 2006 03:49:02 +0000 (03:49 +0000)
- Add Ke entries to KernelFun!

svn path=/trunk/; revision=23637

reactos/ntoskrnl/KrnlFun.c
reactos/ntoskrnl/ke/i386/bios.c [deleted file]
reactos/ntoskrnl/ke/i386/trap.s
reactos/ntoskrnl/ke/i386/usertrap.c [deleted file]
reactos/ntoskrnl/ke/i386/v86m.c
reactos/ntoskrnl/ntoskrnl.rbuild

index a9aa4ab..cd8b0b0 100644 (file)
 //  - Add Directory Lock.\r
 //  - Use Object Type Mutex/Lock.\r
 //\r
+// Ke:\r
+//  - Make sure IRQ trap code is synchronized with current trap code.\r
+//  - Reimplement the V86 support using a mode that will be compatible with\r
+//    VDM and the future and use ABIOS gates.\r
+//  - Implement Invalid Opcode and GPD handlers for V86-mode.\r
+//  - Implement stack fault and segment fault handlers.\r
+//  - Implement kernel-mode GPF handler, possibly fixing below:\r
+//  - Figure out why ES/DS gets messed up in VMWare, when doing KiServiceExit only,\r
+//    and only when called from user-mode, and returning to user-mode.\r
+//  - Figure out what the DEBUGEIP hack is for and how it can be moved away.\r
+//  - Add DR macro/save and VM macro/save.\r
+//  - Implement KiCallbackReturn, KiGetTickCount, KiRaiseAssertion.\r
+//\r
+//\r
 // Ex:\r
 //  - Use pushlocks for handle implementation.\r
 //\r
diff --git a/reactos/ntoskrnl/ke/i386/bios.c b/reactos/ntoskrnl/ke/i386/bios.c
deleted file mode 100644 (file)
index 58cb5bb..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $Id$
- *
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS kernel
- * FILE:            ntoskrnl/ke/i386/bios.c
- * PURPOSE:         Support for calling the BIOS in v86 mode
- *
- * PROGRAMMERS:     David Welch (welch@cwcom.net)
- */
-
-/* INCLUDES *****************************************************************/
-
-#include <ntoskrnl.h>
-#define NDEBUG
-#include <internal/debug.h>
-
-/* GLOBALS *******************************************************************/
-
-#define TRAMPOLINE_BASE    (0x10000)
-
-extern VOID Ki386RetToV86Mode(PKV86M_REGISTERS InRegs,
-                             PKV86M_REGISTERS OutRegs);
-
-/* FUNCTIONS *****************************************************************/
-
-NTSTATUS STDCALL
-Ke386CallBios(ULONG Int, PCONTEXT regs)
-{
-  PUCHAR Ip;
-  KV86M_REGISTERS ORegs;
-  NTSTATUS Status;
-  PKV86M_REGISTERS Regs = (PKV86M_REGISTERS)regs;
-
-  /*
-   * Set up a trampoline for executing the BIOS interrupt
-   */
-  Ip = (PUCHAR)TRAMPOLINE_BASE;
-  Ip[0] = 0xCD;              /* int XX */
-  Ip[1] = Int;
-  Ip[2] = 0x63;              /* arpl ax, ax */
-  Ip[3] = 0xC0;
-  Ip[4] = 0x90;              /* nop */
-  Ip[5] = 0x90;              /* nop */
-
-  /*
-   * Munge the registers
-   */
-  Regs->Eip = 0;
-  Regs->Cs = TRAMPOLINE_BASE / 16;
-  Regs->Esp = 0xFFFF;
-  Regs->Ss = TRAMPOLINE_BASE / 16;
-  Regs->Eflags = (1 << 1) | (1 << 17) | (1 << 9);     /* VM, IF */
-  Regs->RecoveryAddress = TRAMPOLINE_BASE + 2;
-  Regs->RecoveryInstruction[0] = 0x63;       /* arpl ax, ax */
-  Regs->RecoveryInstruction[1] = 0xC0;
-  Regs->RecoveryInstruction[2] = 0x90;       /* nop */
-  Regs->RecoveryInstruction[3] = 0x90;       /* nop */
-  Regs->Flags = KV86M_EMULATE_CLI_STI | KV86M_ALLOW_IO_PORT_ACCESS;
-  Regs->Vif = 1;
-  Regs->PStatus = &Status;
-
-  /*
-   * Execute the BIOS interrupt
-   */
-  Ki386RetToV86Mode(Regs, &ORegs);
-
-  /*
-   * Copy the return values back to the caller
-   */
-  memcpy(Regs, &ORegs, sizeof(KV86M_REGISTERS));
-
-  return(Status);
-}
-
-
-
-
-
index 425f18b..62c77ee 100644 (file)
 #include <internal/i386/asmmacro.S>
 .intel_syntax noprefix
 
-/*
-  * FIXMEs:
-  *         - Implement kernel-mode GPF handler, possibly fixing below:
-  *         - Figure out why ES/DS gets messed up in VMWare, when doing KiServiceExit only,
-  *           and only when called from user-mode, and returning to user-mode.
-  *         - Implement Invalid Opcode handler.
-  *         - Figure out what the DEBUGEIP hack is for and how it can be moved away.
-  *         - Add DR macro/save and VM macro/save.
-  *         - Implement KiCallbackReturn, KiGetTickCount, KiRaiseAssertion.
-  */
-
 /* GLOBALS ******************************************************************/
 
 .globl _KiIdt
diff --git a/reactos/ntoskrnl/ke/i386/usertrap.c b/reactos/ntoskrnl/ke/i386/usertrap.c
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
index df5e988..6391d93 100644 (file)
 
 #define VALID_FLAGS         (0xDFF)
 
+#define TRAMPOLINE_BASE    (0x10000)
+
+VOID Ki386RetToV86Mode(KV86M_REGISTERS* InRegs,
+                  KV86M_REGISTERS* OutRegs);
 /* FUNCTIONS *****************************************************************/
 
 ULONG
@@ -807,5 +811,52 @@ KeV86Exception(ULONG ExceptionNr, PKTRAP_FRAME Tf, ULONG address)
     }
 }
 
+NTSTATUS STDCALL
+Ke386CallBios(ULONG Int, PCONTEXT regs)
+{
+  PUCHAR Ip;
+  KV86M_REGISTERS ORegs;
+  NTSTATUS Status;
+  PKV86M_REGISTERS Regs = (PKV86M_REGISTERS)regs;
+
+  /*
+   * Set up a trampoline for executing the BIOS interrupt
+   */
+  Ip = (PUCHAR)TRAMPOLINE_BASE;
+  Ip[0] = 0xCD;              /* int XX */
+  Ip[1] = Int;
+  Ip[2] = 0x63;              /* arpl ax, ax */
+  Ip[3] = 0xC0;
+  Ip[4] = 0x90;              /* nop */
+  Ip[5] = 0x90;              /* nop */
+
+  /*
+   * Munge the registers
+   */
+  Regs->Eip = 0;
+  Regs->Cs = TRAMPOLINE_BASE / 16;
+  Regs->Esp = 0xFFFF;
+  Regs->Ss = TRAMPOLINE_BASE / 16;
+  Regs->Eflags = (1 << 1) | (1 << 17) | (1 << 9);     /* VM, IF */
+  Regs->RecoveryAddress = TRAMPOLINE_BASE + 2;
+  Regs->RecoveryInstruction[0] = 0x63;       /* arpl ax, ax */
+  Regs->RecoveryInstruction[1] = 0xC0;
+  Regs->RecoveryInstruction[2] = 0x90;       /* nop */
+  Regs->RecoveryInstruction[3] = 0x90;       /* nop */
+  Regs->Flags = KV86M_EMULATE_CLI_STI | KV86M_ALLOW_IO_PORT_ACCESS;
+  Regs->Vif = 1;
+  Regs->PStatus = &Status;
+
+  /*
+   * Execute the BIOS interrupt
+   */
+  Ki386RetToV86Mode(Regs, &ORegs);
+
+  /*
+   * Copy the return values back to the caller
+   */
+  memcpy(Regs, &ORegs, sizeof(KV86M_REGISTERS));
 
+  return(Status);
+}
 
index c88613b..54aa934 100644 (file)
@@ -27,7 +27,6 @@
                <if property="ARCH" value="i386">
                        <directory name="i386">
                                <file first="true">main_asm.S</file>
-                               <file>bios.c</file>
                                <file>cpu.S</file>
                                <file>ctxswitch.S</file>
                                <file>exp.c</file>
@@ -41,7 +40,6 @@
                                <file>trap.s</file>
                                <file>tss.c</file>
                                <file>usercall_asm.S</file>
-                               <file>usertrap.c</file>
                                <file>v86m.c</file>
                                <file>v86m_sup.S</file>
                                <file>vdm.c</file>