Hi,

On Feb 18, 2013 10:44 AM, "dmccunney" <dennis.mccun...@gmail.com> wrote:
>
> On Mon, Feb 18, 2013 at 10:29 AM, kurt godel <wb2...@gmail.com> wrote:
>
> > Exactly *where* is the string of characters for the path variable
stored?
>
> In the environment block for the program.

What do you intend to do? C and Turbo Pascal both support getenv / GetEnv.
IIRC, at least from asm experience, ES: at program startup usually holds
the PSP segment, and offset 2Ch is the segment of the environment (usually
sized in CONFIG.SYS "SHELL=" with /E:1024 or whatever). I can provide a
snippet in ASM if needed, at least for GetEnv. (PutEnv is much trickier,
esp. if trying to modify the global "master" environment.)

> > For that matter, where are stdin/out/and err?
>
> They are file descriptors 0, 1, and 2.  By default, they are assigned
> to the terminal, and read from/written to there.

Mono text mode 0 is at 0B000h:0, color text mode (e.g. default mode 3,
CO80, 16 colors) is at 0B800h:0, VGA (256 color) graphics is at 0A000h:0.
So you can peek and poke if direly needed.

> I/O redirection can
> be used to assign them elsewhere, using the < , >, and | operators .
> DOS is like Unix in this regard, save that vanilla DOS can't handle
> stdout and stderr separately.  4DOS can, and there are other third
> party utilities for doing it.

It's the shell (usually COMMAND.COM) that handles redirection to/from file.
Redirecting stderr is somewhat rare as such errors are usually meant to be
verbose anyways and not silenced. But yes, there are ways around that (e.g.
DJGPP's REDIR.EXE). Check the sources if desired, it's just dup() or such,
duplicating the file handle.
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to