Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Memory mapped devices from resl mode (Developers)

posted by marcov, 02.03.2020, 15:43

> If you don't want to change the DS segment limit and DS is limited to your
> program's space, I think that your only choice is INT 31H/0508H, if the
> DPMI hosts supports it and if you can get the handle of the memory block
> which FPC allocates to your program. You can change the DS limit in both
> Win98 and Win XP (up to 0x7FFFFFFF under Win XP), but I don't know to which
> compatibility do you refer (for example under Win98 you can access the LFB,
> but trying to access the sound card's memory mapped registers usually
> doesn't work, while under Win XP you can not access even the LFB).

Freepascal uses an own version of a (probably very old) djgpp stub.asm.

See https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/go32v2/v2prt0.as?view=co

It seems it has some support for increasing the ds limit depending on __crt0_startup_flags, but I don't know how to set those.

/* Maybe set our DS limit to 4Gb in size if flag set */
testb $0x80, __crt0_startup_flags /* include/crt0.h */
jz 2f
movw $0xffff, %cx
movl %ecx, %edx
movw $0x0008, %ax /* reset alias limit to -1 */
int $0x31
movw %cs, %bx
movw $0x0008, %ax /* reset DS limit to -1 */
int $0x31
movw %ds, %bx
movw $0x0008, %ax /* reset DS limit to -1 */
int $0x31
lsl %ebx, %ebx /* Should be -1 */
incl %ebx
jz 2f
andb $0x7f, __crt0_startup_flags /* clear it if failure */
2:

 

Complete thread:

Back to the forum
Board view  Mix view
22752 Postings in 2119 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum