PerditionC / fdkernel

FreeDOS kernel - implements the core MS-DOS/PC-DOS (R) compatible operating system. It is derived from Pat Villani's DOS-C kernel and released under the GPL v2. Please see http://www.freedos.org/ for more details about the FreeDOS (TM) Project. !!! This fork is no longer the primary fork -- Please post PRs and issues to https://github.com/FDOS/kernel !!!
http://dosc.fdos.org/
105 stars 0 forks source link

201806fixes #33

Closed ecm-pushbx closed 5 years ago

ecm-pushbx commented 5 years ago

Two fixes for bugs I found browsing the source.

andrewbird commented 4 years ago

@stsp it looks like https://github.com/PerditionC/fdkernel/pull/33/commits/bb0f1f6cf354e2c9c5727830ead26790c662d088 should be applied to fdpp also? @ecm-pushbx do you by chance know of any real world applications that use int21/43ff?

stsp commented 4 years ago

Lets take only what looks absolutely trivial. Freedos lists mentions regressions for the latest changes in this git, ands its challenging to fix them in fdpp w/o testing. Looking in the patch you mention, I only see 39, 3a, but not 43ff. So only if you want to review it.

andrewbird commented 4 years ago

It's difficult to see from such a small diff fragment, but the DOS function here is 43ff with BP=='PS' and subfunctions of it are 39, 3a and 56

https://github.com/PerditionC/fdkernel/blob/bb0f1f6cf354e2c9c5727830ead26790c662d088/kernel/inthndlr.c#L956-L975

The int21/43ff subfunctions seem to be quite interesting, but rbil is quite vague, as I'm unsure if they are to support LFN or SFN with very long pathnames?

stsp commented 4 years ago

It says they are equivalent to sfn ones, so let me guess it means sfn with larger buf for full path? In any case, I can just do git pull if you think the things are good to merge.

andrewbird commented 4 years ago

Ahh yes I see what you mean about SFN, but from what I can see it's not usable with MFS unless the SDA (and maybe CDS) can be changed. Thinking on a little further I wonder that since even FAT disks' current directory is represented in CDS, how that can work in FreeDOS (and Win98) as they have DOS 4 compatible CDS and SDA structures.

The AH -> CL change looks right to me, as it matches rbil now.

ecm-pushbx commented 4 years ago

Ahh yes I see what you mean about SFN, but from what I can see it's not usable with MFS unless the SDA (and maybe CDS) can be changed.

I think the SDA does already have 128-byte buffers for SFNs, just the CDS has a shorter buffer for its pathname. However, mkdir, rmdir, and ren all do not set the CDS's pathname, just use it as starting point (for relative pathnames).

@ecm-pushbx do you by chance know of any real world applications that use int21/43ff?

Unfortunately no. The fix just occurred to me one day while browsing the kernel source.

stsp commented 4 years ago

Since these functions only provide create/rename service, cds is not involved. Perhaps you can't cd to such dir later w/o lfn api? Anyway, perhaps we should move to our tracker and start looking into the code (but my pc burned so I can't)

stsp commented 4 years ago

Oh, and @ecm-pushbx already answered about cds, which I didn't see because of mobile (github does not offer to resolve collisions)

andrewbird commented 4 years ago

Thanks both!

andrewbird commented 4 years ago

Any idea how int21/43ff mkdir is supposed to work? If I use it create short relative directory e.g.

myprog 00000000

it works but if I do this it fails

mkdir 00000000
myprog 00000000\11111111

ultimately I want to do (where 77777777 path component is > 67 chars)

mkdir 00000000
mkdir 00000000\11111111
...
mkdir 00000000\11111111\22222222\33333333\44444444\55555555\66666666
myprog 00000000\11111111\22222222\33333333\44444444\55555555\66666666\77777777
cd 00000000\11111111\22222222\33333333\44444444\55555555\66666666
dir 77777777
stsp commented 4 years ago

On what dos?

andrewbird commented 4 years ago

FDPP at the moment, I haven't managed to build today's FreeDOS. I suppose I should try to find the Win98 DOS that supports this feature.

stsp commented 4 years ago

Exactly. :)