MUX-AE (Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0)
On Mon, 24 May 2004, Eduardo Casino wrote: Hello Eduardo, Steffen Kaiser wrote: intercepted and executed by this hook. FreeCOM supports this mecanism, although in a slightly different (read incompatible) way than COMMAND.COM. what has to be changed in order to make FreeCOM compatible? I got your post, but I was a bit irritated, because ... FreeCOM blank-pads the command name to 11 chars, which is OK, but expects that the returned command is padded too, and displaces the start of the command line buffer by 11 characters, no matter what the actual length of the command is. This example will make it clearer: Imagine an installable command FOO with arg BAR that wants to execute SET BAR=ThisIsAnExample on return. If you type FOO BAR at the command prompt, FreeCOM will call function 2FAE1 with the command name in DS:SI and the command line in DS:BX in this way: [DS:SI]3 ; Command length [DS:SI+1] FOO ; Blank-padded to 11 chars [DS:BX]80h; Max length of cmd line (actual value may be different) [DS:BX+1] 15 ; Length of cmd line without final 0Dh [DS:BX+2] FOO BAR, 0Dh This is not how FreeCOM behaves: a) Both buffers [DS:SI] and [DS:BX] are 255 bytes in size. By default anyway. b) The command buffer is blank padded fully. (not just to 11 bytes) c) There are no spaces inserted into the argument. (behind FOO) The buffer is exactly as typed. Up to here, no problem, this is perfectly compatible, it just adds a few more spaces. As the installable command wants to execute the SET BAR thing on return, the standard way of doing it would be to update [DS:SI] and [DS:BX] in this way: [DS:SI]3, SET [DS:BX+1] 23, SET BAR=ThisIsAnExample, 0Dh The command interpreter should then compose the new command line with the command name followed by the command line, but skipping the first [DS:SI] characters. But FreeCOM assumes that the command name is blank-padded and ignores the command name length in [DS:SI], so it skips 11 characters of the command line and composes the following: SET sIsAnExample No, see http://cvs.sourceforge.net/viewcvs.py/freedos/freecom/lib/mux_ae.c?rev=1.3only_with_tag=MAINview=auto line #128 The PString is converted back to a CString starting at command + command[-1], hence, the end of the command itself. If there are spaces at the end, they are stripped, that's true. I think I got this blank padding stuff from reading the 4dos technote about quirks with the MUX-AE interface, I will check it. So the fix should be as easy as using the actual command name length in [DS:SI] when skipping the first characters in the command line. This will not break any command that relies in the curent behaviour. What an actual problem might become is the interpretation of RBIL's description of MUX-AE-01: Return: DS:SI buffer updated if length byte is nonzero, the following bytes contain the uppercase internal command to execute and the command line buffer contains the command's parameters (the first DS:[SI] bytes are ignored) FreeCOM uses the [DS:SI] on entry, but the setting on exit. To put in other words: FreeCOM remembers the starting pointer of the arguments and use this pointer without any adjustment when the extension returns, e.g.: The following scenario mapping SET -- DISP: In: CMD: \x3SET ARG: \xaSET 123456 ^ | argument pointer v Out: CMD: \x4DISP ARG: \xbDISP 123456 would be re-constructed when trying to run an external program (because DISP is no internal one) into the command line: DISPP 123456 I tried to ask MS DOS 6 about enlightment and discovered the very problem I had last time, too, I meddled with MUX-AE: Regardless of how I change either the command or argument buffer, DOS 6 always reacts with drive not ready. In fact, what you suggest by the standard way paragraphe above is that FreeCOM resets the argument pointer to argument[strlen(command)]. BTW: Do you have a sample program I can test the MUX-AE interface with, that actually does command re-writing? Bye, -- Steffen Kaiser --- This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: MUX-AE (Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0)
I tried to ask MS DOS 6 about enlightment and discovered the very problem I had last time, too, I meddled with MUX-AE: Regardless of how I change either the command or argument buffer, DOS 6 always reacts with drive not ready. Hmmm... I've encountered no problems with DOS 6 at all. You set up the command name buffer with the command you want and the command line buffer with the complete command line, and the command is executed without problems at exit. And this time I know exactly what I talk about, I've been there ;-) I mean _internal_ command, BTW. I've never tried external ones. Regards, Eduardo. --- This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Arkady V.Belousov escribi: Hi! 24--2004 10:12 [EMAIL PROTECTED] (Aitor Santamar?a Merino) wrote to [EMAIL PROTECTED]: ASM See for example the flags (B706h to get, B707h to set, both through BX): Where see? Which interrupt function? ASM 2Fh You mean: BX=0, AX=B706, INT 2F, append_state = BX if (BX 1) /* APPEND enabled */ BX = ~1, AX=B707, INT 2F ...perform searching... BX=append_state, AX=B707, INT 2F ? Yes... Aitor --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Steffen Kaiser wrote: intercepted and executed by this hook. FreeCOM supports this mecanism, although in a slightly different (read incompatible) way than COMMAND.COM. Hello Eduardo, what has to be changed in order to make FreeCOM compatible? Hi Steffen, FreeCOM blank-pads the command name to 11 chars, which is OK, but expects that the returned command is padded too, and displaces the start of the command line buffer by 11 characters, no matter what the actual length of the command is. This example will make it clearer: Imagine an installable command FOO with arg BAR that wants to execute SET BAR=ThisIsAnExample on return. If you type FOO BAR at the command prompt, FreeCOM will call function 2FAE1 with the command name in DS:SI and the command line in DS:BX in this way: [DS:SI]3 ; Command length [DS:SI+1] FOO ; Blank-padded to 11 chars [DS:BX]80h; Max length of cmd line (actual value may be different) [DS:BX+1] 15 ; Length of cmd line without final 0Dh [DS:BX+2] FOO BAR, 0Dh Up to here, no problem, this is perfectly compatible, it just adds a few more spaces. As the installable command wants to execute the SET BAR thing on return, the standard way of doing it would be to update [DS:SI] and [DS:BX] in this way: [DS:SI]3, SET [DS:BX+1] 23, SET BAR=ThisIsAnExample, 0Dh The command interpreter should then compose the new command line with the command name followed by the command line, but skipping the first [DS:SI] characters. But FreeCOM assumes that the command name is blank-padded and ignores the command name length in [DS:SI], so it skips 11 characters of the command line and composes the following: SET sIsAnExample So the fix should be as easy as using the actual command name length in [DS:SI] when skipping the first characters in the command line. This will not break any command that relies in the curent behaviour. Hope that this helps. Regards, Eduardo. --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
On Sat, 22 May 2004, Eduardo Casino Almao wrote: Aitor wrote: (b) If you check RBIL, Int 2F/AX=AE01h it says that APPEND hooks this intercepted and executed by this hook. FreeCOM supports this mecanism, although in a slightly different (read incompatible) way than COMMAND.COM. Hello Eduardo, what has to be changed in order to make FreeCOM compatible? Bye, -- Steffen Kaiser --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Arkady V.Belousov escribi: How to overcome presence of APPEND? I mean, APPENDed names, probably, may/should be ignored by ATTRIB? ASM APPEND will hook File Open, and with the /X modifier, also FindFirst and ASM Exec. ASM See for example the flags (B706h to get, B707h to set, both through BX): Where see? Which interrupt function? 2Fh ASM Bitfields for APPEND state: ASM Bit(s) Description (Table 02980) ASM 0 set if APPEND enabled ASM 1-11 reserved ASM 12 (DOS 5.0) set if APPEND applies directory search even if a drive ASM has been specified ASM 13 set if /PATH flag active ASM 14 set if /E flag active (environment var APPEND exists) ASM 15 set if /X flag active ASM By default, APPEND (NT-APPEND and FD-APPEND) sets the flags 0,12,13 (and ASM 14 with /X). 13 can be modified through commandline. ASM So one option would be to disable 12 through the API, then invoke ASM FindFirst with d:*.*, or the easiest, save, disable and restore the ASM flags. This is one way? There is not possible to disable APPEND while searching files (and restore its state later)? Yes, in the last sentence I forgot to add bit 0. Aitor --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Hi! 24--2004 10:12 [EMAIL PROTECTED] (Aitor Santamar?a Merino) wrote to [EMAIL PROTECTED]: ASM See for example the flags (B706h to get, B707h to set, both through BX): Where see? Which interrupt function? ASM 2Fh You mean: BX=0, AX=B706, INT 2F, append_state = BX if (BX 1) /* APPEND enabled */ BX = ~1, AX=B707, INT 2F ...perform searching... BX=append_state, AX=B707, INT 2F ? --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149alloc_id66op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Hi! 21--2004 21:54 [EMAIL PROTECTED] (Alain) wrote to [EMAIL PROTECTED]: How to overcome presence of APPEND? I mean, APPENDed names, probably, may/should be ignored by ATTRIB? A I believe that attrib uses findfirst/findnext Our attrib - yes. A that is not affected, and append affects only file opens... Am I right? Don't know. :( --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149alloc_id66op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Hi! 22--2004 12:18 [EMAIL PROTECTED] (Aitor Santamar?a Merino) wrote to [EMAIL PROTECTED]: How to overcome presence of APPEND? I mean, APPENDed names, probably, may/should be ignored by ATTRIB? ASM APPEND will hook File Open, and with the /X modifier, also FindFirst and ASM Exec. ASM See for example the flags (B706h to get, B707h to set, both through BX): Where see? Which interrupt function? ASM Bitfields for APPEND state: ASM Bit(s) Description (Table 02980) ASM 0 set if APPEND enabled ASM 1-11 reserved ASM 12 (DOS 5.0) set if APPEND applies directory search even if a drive ASM has been specified ASM 13 set if /PATH flag active ASM 14 set if /E flag active (environment var APPEND exists) ASM 15 set if /X flag active ASM By default, APPEND (NT-APPEND and FD-APPEND) sets the flags 0,12,13 (and ASM 14 with /X). 13 can be modified through commandline. ASM So one option would be to disable 12 through the API, then invoke ASM FindFirst with d:*.*, or the easiest, save, disable and restore the ASM flags. This is one way? There is not possible to disable APPEND while searching files (and restore its state later)? --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149alloc_id66op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Hi, Arkady V.Belousov escribi: Hi! 21--2004 23:07 [EMAIL PROTECTED] (Aitor Santamara Merino) wrote to [EMAIL PROTECTED]: ASM I mention this of backdoors in particular because: ASM (a) MS-DOS 6.22 help does say that COMMAND's DIR is not affected by ASM APPEND /X. FreeCOM DIR is not affected by FD-APPEND /X, even with no ASM modification on the side of FreeCOM How to overcome presence of APPEND? I mean, APPENDed names, probably, may/should be ignored by ATTRIB? APPEND will hook File Open, and with the /X modifier, also FindFirst and Exec. See for example the flags (B706h to get, B707h to set, both through BX): Bitfields for APPEND state: Bit(s) Description (Table 02980) 0 set if APPEND enabled 1-11 reserved 12 (DOS 5.0) set if APPEND applies directory search even if a drive has been specified 13 set if /PATH flag active 14 set if /E flag active (environment var APPEND exists) 15 set if /X flag active By default, APPEND (NT-APPEND and FD-APPEND) sets the flags 0,12,13 (and 14 with /X). 13 can be modified through commandline. So one option would be to disable 12 through the API, then invoke FindFirst with d:*.*, or the easiest, save, disable and restore the flags. Aitor --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Aitor wrote: (b) If you check RBIL, Int 2F/AX=AE01h it says that APPEND hooks this call, and not just APPEND USES this call (as could be used to SET APPEND= in APPEND /E, for example). I haven't hooked this call, I don't know exactly why to hook this. MS Append hooks this call because it becomes a resident command after it's first execution. Successive invocations from the command line are intercepted and executed by this hook. FreeCOM supports this mecanism, although in a slightly different (read incompatible) way than COMMAND.COM. Regards, Eduardo. --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Hi Aitor, Can I use this append with MS-DOS or in Win98se dos-box? thanks for this, Alain Aitor Santamaría Merino escreveu: Hi all, I'd like to announce FreeDOS APPEND 1.0, a very basic APPEND that I have created. With this, I could run WordStar Express in a mixed directory installation, as I intended. APPEND 1.0 is very basic. In particular, it is NOT implemented: - APPEND /E - FCB functions - The function 11 of the API You can get it from here: http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/append/aappend.zip (not to be confused with the other file present there). Regards and enjoy, Aitor --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Hi Alain, Alain escribió: Hi Aitor, Can I use this append with MS-DOS or in Win98se dos-box? MS-DOS: In theory, unless there is a backdoor somewhere, this APPEND is implemented following RBIL and MS-DOS 6.22 help (except that the functions mentioned are not implemented, but I doubt that you have programs using FCBs?), and it should even be compatible with MS-APPEND, except with MS-APPEND 3.21 (but I recommend not to mix them). I mention this of backdoors in particular because: (a) MS-DOS 6.22 help does say that COMMAND's DIR is not affected by APPEND /X. FreeCOM DIR is not affected by FD-APPEND /X, even with no modification on the side of FreeCOM (b) If you check RBIL, Int 2F/AX=AE01h it says that APPEND hooks this call, and not just APPEND USES this call (as could be used to SET APPEND= in APPEND /E, for example). I haven't hooked this call, I don't know exactly why to hook this. WindowsNT/XP: It seems that FD-APPEND works well under NT DOS Boxes, but you have to rename APPEND.EXE to other name (otherwise, the NT's APPEND is used). Win98SE dos-boxes: I ignore what the effects of locally hooking int21h could be, I suppose there will be bigger problems if you run it on AUTOEXEC.BAT or WINSTART.BAT, but I haven't tested this. So if you test, please tell us :) Aitor --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Hi! 21--2004 23:07 [EMAIL PROTECTED] (Aitor Santamara Merino) wrote to [EMAIL PROTECTED]: ASM I mention this of backdoors in particular because: ASM (a) MS-DOS 6.22 help does say that COMMAND's DIR is not affected by ASM APPEND /X. FreeCOM DIR is not affected by FD-APPEND /X, even with no ASM modification on the side of FreeCOM How to overcome presence of APPEND? I mean, APPENDed names, probably, may/should be ignored by ATTRIB? --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149alloc_id66op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] ANNOUNCE: FD APPEND 1.0
Arkady V.Belousov escreveu: Hi! 21--2004 23:07 [EMAIL PROTECTED] (Aitor Santamara Merino) wrote to [EMAIL PROTECTED]: ASM I mention this of backdoors in particular because: ASM (a) MS-DOS 6.22 help does say that COMMAND's DIR is not affected by ASM APPEND /X. FreeCOM DIR is not affected by FD-APPEND /X, even with no ASM modification on the side of FreeCOM How to overcome presence of APPEND? I mean, APPENDed names, probably, may/should be ignored by ATTRIB? I believe that attrib uses findfirst/findnext that is not affected, and append affects only file opens... Am I right? Alain --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel