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 Khusraw E-mail, Bucharest, Romania, 02.03.2020, 19:39

> 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:

With DJGPP the flag is not set by default in __crt0_startup_flags (see crt0.S), normally you need to call __djgpp_nearptr_enable (see also nearptr.c).

---
Glory to God for all things

 

Complete thread:

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