Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 444 → Rev 443

/shark/trunk/oslib/ll/i386/int.h
36,10 → 36,3
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,6 → 43,7
 
.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)
64,7 → 65,7
INT(13)
INT(14)
INT(15)
NONE(16)
INT(16)
INT(17)
INT(18)
INT(19)
581,22 → 582,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
movw %ax,%ds
movw %ax,%fs
movw %ax,%gs
mov %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)
613,17 → 614,18
popl %ebx
movl %ebx,68(%edi)
 
movw SYMBOL_NAME(VM86_ret_ctx), %ax
movw %ax,SYMBOL_NAME(currCtx)
movw %ax,JmpSel
#ifdef __VIRCSW__
movw SYMBOL_NAME(VM86_ret_ctx), %ax
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 8192
#define VM86_STACK_SIZE 1024
 
extern DWORD ll_irq_table[256];
 
63,6 → 63,7
struct registers *global_regs;
WORD VM86_ret_ctx;
 
 
#ifdef __DUMB_CODE__
static LIN_ADDR vm86_code;
static BYTE prova86[] = {
84,9 → 85,7
0};
#endif
 
static BYTE vm86_retAddr[] = {0xcd, 0x48, /* int 48h */
0xf4,
0};
static BYTE vm86_retAddr[] = {0xcd, 0x48}; /* int 48h */
 
TSS *vm86_get_tss(void)
{
115,6 → 114,9
{
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
133,6 → 135,10
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__
172,10 → 178,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();
189,7 → 195,7
vm86_tmpAddr = (DWORD)(vm86_iretAddress);
vm86_cs = (vm86_tmpAddr & 0xFF000) >> 4;
vm86_ip = (vm86_tmpAddr & 0xFFF);
vm86_flags = 0;
vm86_flags = 0; /* CPU_FLAG_VM | CPU_FLAG_IOPL; */
vm86_stackPtr = vm86_stack + VM86_STACK_SIZE;
lmempokew(vm86_stackPtr-6,vm86_ip);
lmempokew(vm86_stackPtr-4,vm86_cs);
212,16 → 218,18
(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);
 
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);
 
257,16 → 265,19
#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);
sti();
 
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);
 
297,8 → 308,7
}
#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,7 → 120,9
if (type == UNKNOWN) {
return -1;
}
 
if (type == VESA) {
return vbe_check_id();
}
return -2;
}
 
194,10 → 196,9
}
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,6 → 288,9
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;
304,8 → 307,7
vm86_callBIOS(0x10, &inregs, &outregs, &sregs);
#endif
 
return 1; //vbe_check_status (outregs.x.ax);
 
return vbe_check_status (outregs.x.ax);
}
 
WORD vbe_getbpr(ModeInfoBlock *ModeInfo)
/shark/trunk/drivers/grx/glib.c
227,12 → 227,19
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;
}