Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Int2f/1217 incorrect return value for CDS #3

Closed
andrewbird opened this issue Oct 22, 2018 · 1 comment
Closed

Int2f/1217 incorrect return value for CDS #3

andrewbird opened this issue Oct 22, 2018 · 1 comment

Comments

@andrewbird
Copy link
Contributor

I'm seeing an odd effect with current GIT compiled with gcc-ia16-elf. If I use the int2f/1217 function to get a drive's CDS entry (from within a int2f/11 redirector call so I have a valid DOS stack) I get an incorrect value for the CDS returned. I also notice that the value never changes if a different drive is queried. I've pushed a test patch to https://github.com/andrewbird/fdkernel/tree/int2f-12-issue which makes it work for me. It seems normal that a (struct *) should be used for exchanging registers with the called function, but I can find no problem with the Watcom compiled FreeDOS 1.20 release which presumably uses the (struct).

These snippets of log from Dosemu2's redirector show the values returned by two differing
methods of obtaining CDS:
    The drive_cds() function returns the CDS by means of the int21/52 SYSVARS/LOL function.
    The GetCDSInDOS() function uses int2f/1217 (with DOS stack).
    
Previously with gcc-ia16-elf compiled git the return value would always be the same fixed
address:
    MFS: GetCDSInDOS for C:
    MFS: GetCDSInDOS ret 1:
    MFS: GetCDSInDOS CDS ptr is 0x0xb01e4000
    MFS: drive_cds ptr is       0x0xb017b640
    
    MFS: GetCDSInDOS for D:
    MFS: GetCDSInDOS ret 1:
    MFS: GetCDSInDOS CDS ptr is 0x0xb01e4000
    MFS: drive_cds ptr is       0x0xb017b698
    
With this patch the return values are identical:
    MFS: GetCDSInDOS for C:
    MFS: GetCDSInDOS ret 1:
    MFS: GetCDSInDOS CDS ptr is 0x0xb017b2f0
    MFS: drive_cds ptr is       0x0xb017b2f0
    
    MFS: GetCDSInDOS for D:
    MFS: GetCDSInDOS ret 1:
    MFS: GetCDSInDOS CDS ptr is 0x0xb017b348
    MFS: drive_cds ptr is       0x0xb017b348
@andrewbird
Copy link
Contributor Author

Since this is a new issues list and not many people are subscribed, I'll shout out to @bartoldeman and @tkchia as it seems to be specific to the gcc build. This is the compiler I'm using:

Using built-in specs.
COLLECT_GCC=ia16-elf-gcc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/ia16-elf/6.3.0/lto-wrapper
Target: ia16-elf
Configured with: ../configure --build=i686-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir='/usr/lib/i386-linux-gnu' --libexecdir='/usr/lib/i386-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --target=ia16-elf --infodir=/usr/ia16-elf/info --enable-libssp --enable-languages=c,c++ --with-newlib --disable-libstdcxx-dual-abi --disable-extern-template --disable-wchar_t --disable-libstdcxx-verbose
Thread model: single
gcc version 6.3.0 (GCC) 

$ dpkg -l gcc-ia16-elf
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                      Version                   Architecture              Description
+++-=========================================-=========================-=========================-========================================================================================
ii  gcc-ia16-elf                              6.3.0-20181013.16-ppa1810 i386                      GNU C and C++ compilers for ia16-elf target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant