mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
- Delete bios.c and usertrap.c
- Add Ke entries to KernelFun! svn path=/trunk/; revision=23637
This commit is contained in:
@@ -24,6 +24,20 @@
|
||||
// - Add Directory Lock.
|
||||
// - Use Object Type Mutex/Lock.
|
||||
//
|
||||
// Ke:
|
||||
// - Make sure IRQ trap code is synchronized with current trap code.
|
||||
// - Reimplement the V86 support using a mode that will be compatible with
|
||||
// VDM and the future and use ABIOS gates.
|
||||
// - Implement Invalid Opcode and GPD handlers for V86-mode.
|
||||
// - Implement stack fault and segment fault handlers.
|
||||
// - 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.
|
||||
// - 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.
|
||||
//
|
||||
//
|
||||
// Ex:
|
||||
// - Use pushlocks for handle implementation.
|
||||
//
|
||||
|
||||
@@ -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 ([email protected])
|
||||
*/
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,17 +12,6 @@
|
||||
#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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user