|
From: E. C. M. <pu...@ul...> - 2026-03-22 16:17:08
|
On at 2026-03-18 10:54 +0100, Sijmen J. Mulder via Freedos-user wrote: > Hi all, > > Thought someone might get a chuckle out of this: > > https://codeberg.org/sjmulder/sudo.com > >> An implementation of sudo for DOS, to run the given command with full privileges. > > Was a good DOS and x86-16 learning experience though! I have several programs with similar tasks: * The lMS-DOS "comloader" [1], setting up an embedded (flat-format or MZ) executable as if that executable itself was loaded rather than the comloader. This involves cutting the command name out of the PSP command line tail, then setting up the two default FCBs in the PSP and the "FCB drives valid" flags in AL and AH. * The lRxDOS comloader [2] which is the base for the lMS-DOS one. * Eric Auer's callver with some patches by me [3], this passes a command to a child process running a "%COMSPEC% /C " command. * The Comspec Load Utility (or Codified Likeness Utility) [4], a command shell launcher for the Multiple Command Payload (or Master Control Program). The MCP contains a (patched) copy of FreeCOM [5] in its lDOS comloader, but this requires the "COMMAND" command name be specified. That isn't expected for %COMSPEC% so clu.exe can be used for %COMSPEC%. It will find ldosmcp.com and load it, telling it to pass control to the FreeCOM executable. CLU can relocate its PSP to the top of the Low Memory Area [6], and will then load the MCP application executable using int 21h function 4B01h [7] and chain the current process to terminate into the loaded MCP [8]. The MCP comloader in turn can relocate the FreeCOM process that it builds into the Upper Memory Area [9], where the comloader itself cannot fit due to the many commands that it contains. Regards, ecm [1]: https://hg.pushbx.org/ecm/msdos4/file/5d7ba07e2e21/comload.asm [2]: https://hg.pushbx.org/ecm/ldos/file/4091fac59e21/comload.asm [3]: https://hg.pushbx.org/ecm/callver/file/fd67af5c53ee/callver.asm [4]: https://hg.pushbx.org/ecm/mcp/file/f885328d4bdf/clu.asm [5]: https://github.com/FDOS/freecom/issues/184 [6]: https://hg.pushbx.org/ecm/mcp/file/f885328d4bdf/clu.asm#l118 [7]: https://hg.pushbx.org/ecm/mcp/file/f885328d4bdf/clu.asm#l534 [8]: https://hg.pushbx.org/ecm/mcp/file/f885328d4bdf/clu.asm#l582 [9]: https://hg.pushbx.org/ecm/msdos4/file/5d7ba07e2e21/comload.asm#l483 |