mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 02:59:21 +02:00
+ ___v2prt0_rmcb_regs in text section for Windows NT
+ catch of calls into zero page for Windows 95 (creates Run Time error 216 or SIGILL exception if dpmiexcp is loaded !)
This commit is contained in:
parent
8e36b55d87
commit
2f38be7291
@ -50,7 +50,11 @@
|
||||
.globl ___v2prt0_ds_alias
|
||||
___v2prt0_ds_alias:
|
||||
.long 0
|
||||
|
||||
/* allocate 32*4 bytes for RMCB under the $ffff limit for Windows NT */
|
||||
.globl ___v2prt0_rmcb_regs
|
||||
___v2prt0_rmcb_regs:
|
||||
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
.data
|
||||
|
||||
___djgpp_memory_handle_pointer:
|
||||
@ -80,7 +84,6 @@ exit16_last_byte:
|
||||
|
||||
|
||||
.text
|
||||
|
||||
.globl start
|
||||
start:
|
||||
pushl %ds /* set %es same as %ds */
|
||||
@ -99,6 +102,8 @@ start:
|
||||
movl $1, %ecx /* Set one page */
|
||||
movl $zero, %edx
|
||||
int $0x31 /* Make null page uncommitted */
|
||||
jnc 1f
|
||||
call v2prt0_windows
|
||||
1:
|
||||
/* Create an alias for DS to be used by real-mode callbacks (exception handler messes with DS itself) */
|
||||
|
||||
@ -764,6 +769,37 @@ _swap_out:
|
||||
_v2prt0_exceptions_on:
|
||||
.long 0
|
||||
|
||||
// Fill null page with NOPs
|
||||
// and a jmp windows_error at the end
|
||||
.globl v2prt0_windows
|
||||
v2prt0_windows:
|
||||
movl $0x90909090,%eax
|
||||
xorl %edi,%edi
|
||||
movl $0x400,%ecx
|
||||
cld
|
||||
rep
|
||||
stosl
|
||||
movl $0xffB,%edi
|
||||
movb $0xe9,%al
|
||||
stosb
|
||||
movl $_fpc_windows_error-4,%eax
|
||||
subl %edi,%eax
|
||||
stosl
|
||||
ret
|
||||
|
||||
// Raise SIGILL with UD2 opcode
|
||||
|
||||
.globl _fpc_windows_error
|
||||
_fpc_windows_error:
|
||||
cmpl $0,_exception_exit
|
||||
je .L_error_216
|
||||
.byte 0x0f,0x0b
|
||||
.L_error_216:
|
||||
pushl $216
|
||||
call __exit
|
||||
jmp exit
|
||||
#enif
|
||||
|
||||
/* this was the prt0.s from the go32v1 version */
|
||||
//
|
||||
// call as start(argc, argv, envp) (C-calling convention)
|
||||
@ -864,7 +900,13 @@ ___PROXY_LEN:
|
||||
|
||||
/*
|
||||
$Log$
|
||||
Revision 1.3 1999-01-05 10:44:59 pierre
|
||||
Revision 1.4 1999-02-19 12:25:37 pierre
|
||||
+ ___v2prt0_rmcb_regs in text section for Windows NT
|
||||
+ catch of calls into zero page for Windows 95
|
||||
(creates Run Time error 216 or SIGILL exception
|
||||
if dpmiexcp is loaded !)
|
||||
|
||||
Revision 1.3 1999/01/05 10:44:59 pierre
|
||||
* suppressed fwaits to avoid FPU not present exceptions
|
||||
|
||||
Revision 1.2 1998/12/21 14:14:21 pierre
|
||||
|
Loading…
Reference in New Issue
Block a user