/shark/trunk/oslib/ll/i386/int.h |
---|
36,3 → 36,10 |
movl $##n, %eax ; \ |
jmp ll_handler2 |
#endif |
#define NONE(n) \ |
.globl SYMBOL_NAME(h##n) ; \ |
SYMBOL_NAME_LABEL(h##n) ; \ |
iret ; \ |
#endif |
/shark/trunk/oslib/xlib/exc.s |
---|
43,7 → 43,6 |
.extern SYMBOL_NAME(ll_exc_hook) |
.extern SYMBOL_NAME(ll_FPU_hook) |
.extern SYMBOL_NAME(vm86_return) |
.globl SYMBOL_NAME(h13_bis) |
.globl SYMBOL_NAME(exc7) |
65,7 → 64,7 |
INT(13) |
INT(14) |
INT(15) |
INT(16) |
NONE(16) |
INT(17) |
INT(18) |
INT(19) |
582,22 → 581,22 |
iret |
ll_handler_vm86: |
pushl %ds |
pushl %ss |
pushl %es |
pushl %fs |
pushl %gs |
pushl %ds |
pushl %ss |
pushl %es |
pushl %fs |
pushl %gs |
pushl %eax |
movw $(X_FLATDATA_SEL),%ax |
movw %ax,%es |
mov %ax,%ds |
movw %ax,%fs |
movw %ax,%gs |
movw %ax,%ds |
movw %ax,%fs |
movw %ax,%gs |
popl %eax |
pushl %ebx |
popl %eax |
pushl %ebx |
movl SYMBOL_NAME(global_regs),%ebx |
movl %eax,56(%ebx) |
614,18 → 613,17 |
popl %ebx |
movl %ebx,68(%edi) |
#ifdef __VIRCSW__ |
movw SYMBOL_NAME(VM86_ret_ctx), %ax |
movw %ax,JmpSel |
movw SYMBOL_NAME(VM86_ret_ctx), %ax |
movw %ax,SYMBOL_NAME(currCtx) |
movw %ax,JmpSel |
ljmp *JmpZone |
#endif |
popl %gs |
popl %fs |
popl %es |
popl %ss |
popl %ds |
popal |
popl %gs |
popl %fs |
popl %es |
popl %ss |
popl %ds |
popal |
iret |
/shark/trunk/oslib/xlib/vm86.c |
---|
46,7 → 46,7 |
//#define __LL_DEBUG__ |
#define VM86_STACK_SIZE 1024 |
#define VM86_STACK_SIZE 8192 |
extern DWORD ll_irq_table[256]; |
63,7 → 63,6 |
struct registers *global_regs; |
WORD VM86_ret_ctx; |
#ifdef __DUMB_CODE__ |
static LIN_ADDR vm86_code; |
static BYTE prova86[] = { |
85,7 → 84,9 |
0}; |
#endif |
static BYTE vm86_retAddr[] = {0xcd, 0x48}; /* int 48h */ |
static BYTE vm86_retAddr[] = {0xcd, 0x48, /* int 48h */ |
0xf4, |
0}; |
TSS *vm86_get_tss(void) |
{ |
114,9 → 115,6 |
{ |
int register i; |
/* Init the DOS memory allocator */ |
DOS_mem_init(); |
/* First of all, we need to setup a GDT entries to |
* allow vm86 task execution. We just need a free 386 TSS, which |
* will be used to store the execution context of the virtual 8086 |
135,10 → 133,6 |
vm86_stack = DOS_alloc(VM86_STACK_SIZE*2); |
vm86_stack += VM86_STACK_SIZE/2; |
/* Create a location of DOS memory containing the |
* opcode sequence which will generate a GPF |
* We use the privileged instruction hlt to do it |
*/ |
vm86_iretAddress = DOS_alloc(sizeof(vm86_retAddr)); |
memcpy(vm86_iretAddress,vm86_retAddr,sizeof(vm86_retAddr)); |
#ifdef __LL_DEBUG__ |
178,10 → 172,10 |
DWORD vm86_flags, vm86_cs,vm86_ip; |
LIN_ADDR vm86_stackPtr; |
DWORD *IRQTable_entry; |
BYTE p1,p2; |
BYTE p1,p2; |
SYS_FLAGS f; |
if (service < 0x10 || in == NULL) return -1; |
f = ll_fsave(); |
195,7 → 189,7 |
vm86_tmpAddr = (DWORD)(vm86_iretAddress); |
vm86_cs = (vm86_tmpAddr & 0xFF000) >> 4; |
vm86_ip = (vm86_tmpAddr & 0xFFF); |
vm86_flags = 0; /* CPU_FLAG_VM | CPU_FLAG_IOPL; */ |
vm86_flags = 0; |
vm86_stackPtr = vm86_stack + VM86_STACK_SIZE; |
lmempokew(vm86_stackPtr-6,vm86_ip); |
lmempokew(vm86_stackPtr-4,vm86_cs); |
218,18 → 212,16 |
(DWORD)vm86_TSS.t.cs,vm86_TSS.t.eip,&prova86); |
message("(DUMB CODE) Go...\n"); |
#endif |
vm86_TSS.t.back_link = ll_context_save(); |
VM86_ret_ctx = vm86_TSS.t.back_link; |
p1 = inp(0x21); |
p2 = inp(0xA1); |
outp(0x21,0xFF); |
outp(0xA1,0xFF); |
sti(); |
vm86_TSS.t.back_link = ll_context_save(); |
VM86_ret_ctx = vm86_TSS.t.back_link |
ll_context_load(X_VM86_TSS); |
cli(); |
outp(0x21,p1); |
outp(0xA1,p2); |
265,19 → 257,16 |
#endif |
/* Let's use the ll standard call... */ |
vm86_TSS.t.back_link = ll_context_save(); |
VM86_ret_ctx = vm86_TSS.t.back_link; |
p1 = inp(0x21); |
p2 = inp(0xA1); |
outp(0x21,0xFF); |
outp(0xA1,0xFF); |
vm86_TSS.t.back_link = ll_context_save(); |
VM86_ret_ctx = vm86_TSS.t.back_link; |
sti(); |
ll_context_load(X_VM86_TSS); |
cli(); |
outp(0x21,p1); |
outp(0xA1,p2); |
308,7 → 297,8 |
} |
#endif |
ll_frestore(f); |
ll_frestore(f); |
return 1; |
return 1; |
} |
/shark/trunk/drivers/grx/gd.c |
---|
88,17 → 88,17 |
} |
/* VESA driver needs the V86 Mode... */ |
//vm86_init(); |
vm86_init(); |
/* First, check VESA... */ |
if (vbe_getinfo() == 1) { |
type = VESA; |
if (flags & NOLINEAR) { |
trylinear = 0; |
} else { |
trylinear = 1; |
} |
return 1; |
} |
/* Then, the other graph cards... Override VESA!!! */ |
120,9 → 120,7 |
if (type == UNKNOWN) { |
return -1; |
} |
if (type == VESA) { |
return vbe_check_id(); |
} |
return -2; |
} |
196,9 → 194,10 |
} |
if (type == VESA) { |
if (vbe_getmodeinfo(&vbemi, mode) < 0) { |
return -1; |
} |
return -1; |
} |
app = mode; |
if (trylinear) { |
/shark/trunk/drivers/grx/drivers/gdvesa.c |
---|
288,9 → 288,6 |
BYTE p1, p2; |
#endif |
/* Se volessimo il Linear Frame Buffer, dovremmo fare |
Vbe_Mode = Vbe_Mode | 0x4000; |
*/ |
memset (&inregs, 0, sizeof(inregs)); |
/* Set Vesa Vbe mode */ |
inregs.x.ax = 0x4f02; |
307,7 → 304,8 |
vm86_callBIOS(0x10, &inregs, &outregs, &sregs); |
#endif |
return vbe_check_status (outregs.x.ax); |
return 1; //vbe_check_status (outregs.x.ax); |
} |
WORD vbe_getbpr(ModeInfoBlock *ModeInfo) |
/shark/trunk/drivers/grx/glib.c |
---|
227,19 → 227,12 |
int mode; |
int ret; |
if ((ret = grx_init()) < 1) { |
return -1; |
} |
cprintf("Ret: %d\n", ret); |
mode = grx_getmode(x, y, depth); |
cprintf("Modenum:%d %u %x\n", mode, mode, mode); |
if (grx_setmode(mode) < 0) { |
return -1; |
} |
cprintf("Modenum:%x\n", mode); |
return 1; |
} |