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=3149&alloc_id=8166&op=click
_______________________________________________
Freedos-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-devel