-
Notifications
You must be signed in to change notification settings - Fork 157
sys.c: in _dos_findfirst set DTA rather than copying from PSP:80h, and work around Xi8088 ROM-BIOS bug (13.41 ds=40h) #226
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
base: master
Are you sure you want to change the base?
Conversation
Running prior to this commit, a /K switch with a name at a certain position will write all-blanks into the boot sector loader. If that happens, lDOS instsect will not detect a valid load file name: C:\>sys a: /bootonly /k ldos.com System transferred. C:\>instsect /bo a: Detected FAT12 FS. Keeping original sector loader. Sector valid, FS ID match and proper jump. Type heuristic: "FreeDOS (FreeDOS)" No name detected. Unit selection code not found in sector. Keeping as is. Part info code not found in sector. Keeping as is. Query geometry code not found in sector. Keeping as is. Auto LBA detection (HDD only) found in sector. Keeping as is. Previous geometry: 2 CHS Heads, 18 CHS Sectors, 0 Hidden Writing boot sector to sector. C:\> Running after this commit sets the name as desired: C:\>sys a: /bootonly /k ldos.com System transferred. C:\>instsect /bo a: Detected FAT12 FS. Keeping original sector loader. Sector valid, FS ID match and proper jump. Type heuristic: "FreeDOS (FreeDOS)" 1st name: "LDOS.COM" Unit selection code not found in sector. Keeping as is. Part info code not found in sector. Keeping as is. Query geometry code not found in sector. Keeping as is. Auto LBA detection (HDD only) found in sector. Keeping as is. Previous geometry: 2 CHS Heads, 18 CHS Sectors, 0 Hidden Writing boot sector to sector. C:\> For reference, the libi86 implementation of _dos_findfirst also sets the DTA to the user buffer rather than copying around the resulting search record. So it is likely that Turbo C or Watcom do it similarly to this: https://gitlab.com/tkchia/libi86/-/blob/3ecc4164999a5807c40cf2c159dc94dd07f7df03/host-gcc/dos/dos-findfirst.c#L43
|
To clarify, the application's command line at PSP:80h is corrupted by the find first call. But the Lines 1758 to 1779 in 9b9b5b1
|
This commit contains a number of changes: 1. int86x gets and sets struct SREGS members ds and es 2. int86x patches itself (SMC) using a cs: segment override prefix, as ds may no longer equal cs. 3. int86x interrupt number is %7 rather than %5 4. int86x assembly part doesn't push and pop ds, it is handled by the compiler instead (in practice it puts a push ss \ pop ds at the end of the function to restore the near data segment). 5. int86 is implemented by calling int86x (with ds = es = 0) 6. findfirst, int2526readwrite, fat32readwrite also changed to use int86x because they need to set ds. This used to be implied as the same ds that the compiler already used by default. 7. Finally, haveLBA changed to set ds to 40h. The inline assembly constraints for gcc-ia16 are documented in https://gitlab.com/tkchia/gcc-ia16/-/blob/ca893320926dc93552390b892a202e9373d040c0/gcc/doc/md.texi#L2379
sys.c: work around Xi8088 ROM-BIOS bug for int 13.41 #156This commit contains a number of changes:
The inline assembly constraints for gcc-ia16 are documented in |
|
Testing that int 13.41 runs with ds = 40h as desired, with drive E: as a local FAT32 drive on dosemu2: |
|
Tested the OpenWatcom build a bit too. |
|
Any comments on this? |
|
imported into https://github.com/SvarDOS/sys |
Running prior to this commit, a /K switch with a name at a certain position will write all-blanks into the boot sector loader. If that happens, lDOS instsect will not detect a valid load file name:
Running after this commit sets the name as desired:
For reference, the libi86 implementation of _dos_findfirst also sets the DTA to the user buffer rather than copying around the resulting search record. So it is likely that Turbo C or Watcom do it similarly to this:
https://gitlab.com/tkchia/libi86/-/blob/3ecc4164999a5807c40cf2c159dc94dd07f7df03/host-gcc/dos/dos-findfirst.c#L43
(I may add a commit addressing #156 to this PR later.)