Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 312 → Rev 313

/shark/trunk/oslib/xlib/vm86.c
44,6 → 44,8
#define __CHK_IO__
*/
 
#define __LL_DEBUG__
 
#define VM86_STACK_SIZE 1024
 
extern DWORD ll_irq_table[256];
123,7 → 125,7
cs = (a & 0xFF000) >> 4;
eip = (a & 0xFFF);
message("Real-Mode Address is CS=%lx IP=%lx\nLinear=%lx\n",cs,eip,a);
esp = /* (void *)(tos)*/ 0x69;
esp = /* (void *)(tos)*/ (void *)0x69;
message("Stack frame: %p %lx %lx\n",
esp, vm86_TSS.t.esp0, vm86_TSS.t.esp);
message("%lx ",lmempeekd(esp)); /* bp */
187,10 → 189,7
GDT_place(X_VM86_TSS,(DWORD)(&vm86_TSS),
sizeof(vm86_TSS),FREE_TSS386,GRAN_16);
 
/* HACKME!!! */
// IDT_place(0x48,vm86_exc);
l1_int_bind(0x48, vm86_return);
// ll_irq_table[0x48] = (DWORD)vm86_return;
IDT_place(0x48, (void *)(vm86_return));
 
/* Prepare a real-mode stack, obtaining it from the
* DOS memory allocator!
334,16 → 333,6
out->x.di = (WORD)vm86_TSS.t.edi;
out->x.cflag = (WORD)vm86_TSS.t.eflags;
*/
#ifdef __LL_DEBUG__
#error Fix the following: use global_regs->xxx ???
message("%x\n", (WORD)*(GLOBesp));
message("%x\n", (WORD)*(GLOBesp+1)); /*EDI*/
message("%x\n", (WORD)*(GLOBesp+2)); /*ESI*/
message("%x\n", (WORD)*(GLOBesp+3)); /*EBP*/
message("%x\n", (WORD)*(GLOBesp+4)); /*ESP*/
message("%x\n", (WORD)*(GLOBesp+5)); /*EBX*/
message("%x\n", (WORD)*(GLOBesp+6)); /*EDX*/
#endif
out->x.ax = global_regs->eax;
out->x.bx = global_regs->ebx;
out->x.cx = global_regs->ecx;
/shark/trunk/oslib/xlib/xbios.c
26,6 → 26,9
#include <ll/i386/x-bios.h>
#include <ll/i386/mem.h>
 
#include <ll/i386/advtimer.h>
#include <ll/i386/apic.h>
 
FILE(X-BIOS);
 
/* The interface between X (and 32 bit PM) and BIOS (which runs at 16 bits */
36,16 → 39,24
/* Assembler gate JMP instruction */
extern void _x_callBIOS(void);
X_CALLBIOS *xbc = x_bios_address();
DWORD msr1 = 0,msr2 = 0;
 
/* Send interrupt request & register through the X_Info structure */
xbc->_irqno = service;
memcpy(&(xbc->_ir),in,sizeof(X_REGS16));
memcpy(&(xbc->_sr),s,sizeof(X_SREGS16));
#ifdef __APIC__
rdmsr(APIC_BASE_MSR,msr1,msr2);
disable_APIC_timer();
#endif
/* Back to RM to execute the BIOS routine */
_x_callBIOS();
 
/* Get the return register values */
#ifdef __APIC__
wrmsr(APIC_BASE_MSR,msr1,msr2);
enable_APIC_timer();
#endif
memcpy(out,&(xbc->_or),sizeof(X_REGS16));
memcpy(s,&(xbc->_sr),sizeof(X_SREGS16));
}