Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

SEEKEXT and enabling unsigned 32-bit DOS int 0x21 fileseeks? (Users)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 20.10.2021, 12:50

> Quick question about SEEKEXT: I installed the TSR, (I'm using the Win95
> OSR2 "MS-DOS" v. 7.1) thinking it would make existing DOS programs using
> signed longint filesizes into unsigned longint seeks. As in, it would
> enable DOS programs to see "negative" file sizes from 2 GiB to 4 GiB-1 as
> valid sizes. It did not. With the TSR installed, all programs behaved as
> before. With files > 2 GiB programs report strange error messages (file
> cannot be opened, or can't seek in file, etc) and do not work with these
> large files.
>
> Do all the programs need to be recompiled (unlikely or impossible, as
> source isn't available) in order to work with SEEKEXT to enable longint
> unsigned seeks? Archivers like pkzip, RAR, or ACE only support creation of
> 2 GB archives in "pure" DOS.

SEEKEXT doesn't do anything for the programs that need signed 32-bit seeking. Plus, it doesn't do anything at all for non-redirected (local FAT FS) file systems on MS-DOS 7.10 (or any MS-DOS version).

The short seek (int 21.42) hook of SEEKEXT is only for handling 32-bit seeks using a 64-bit (long seek) interface. If your file system does not support the long seek int 21.7142 interface then SEEKEXT's short seek hook will pass all 21.42 calls to DOS unmodified. It is merely a convenience to sign-extend SEEK_CUR and SEEK_EOF seek offsets from a 32-bit value (interpreted as signed) to 64-bit, and zero-extend SEEK_SET seek offsets to 64-bit. (And it returns either a 32-bit value representing -4 GiB..+4 GiB or else FFFF_FFFFh as the resulting position.) This is only useful for programs which do not use absolute offsets and which operate on files with the 21.7142 long seek interface supported.

(The other hook of SEEKEXT is to redirect 21.7142 to 2F.1142, which is a special long seek redirector interface defined for dosemu2. To my awareness dosemu2 MFS-redirected file systems have the only implementation of this function.)

> Believe we had a discussion almost a decade ago on longseek and unsigned
> 32-bit and 64-bit file sizes in DOS. I know implementing 64-bit sized seeks
> would be much more involved than enabling unsigned (4 GiB-1) 32-bit
> fileseeks.
>
> Is it a DOS limitation, or a program limitation? The only program I've
> found which "seems" to creat filesizes > 2 GiB is the DOS compilation of
> 7zip. It creates such files, reads them, but is the only such DOS program
> I've found that will. It uses CWSDPMI as the extender.
>
> The Mplayer DOS port will not read large movie files from between 2 GiB and
> 4 GiB, failing to open them. Again, in "ms-dos" 7.1

Two possibilities there: The application may incorrectly check for negative seek results rather than only -1 (in 32 bit = FFFF_FFFFh) for errors. And as Rugxulo mentioned, a special flag may be required by MS-DOS 7.10 (though it seems to be valid for SFN 21.6C too, not only the LFN Extended Open/Create): BH = flags, bit 4 = (FAT32) extended size (allow 4GB files instead of 2GB).

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 128 users online (0 registered, 128 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum