Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.msdos.programmer > #4056
| From | Mateusz Viste <mateusz@xyz.invalid> |
|---|---|
| Newsgroups | comp.os.msdos.programmer |
| Subject | Re: Booting process 0: how to find out its full path? |
| Date | 2021-11-16 18:07 +0100 |
| Organization | . . . |
| Message-ID | <20211116180721.434ef838@mateusz> (permalink) |
| References | <20211116104416.2b3d207f@mateusz> <XnsADE464DA8276Bauricauricauricauric@144.76.35.252> |
2021-11-16 at 16:54 -0000, Auric__ wrote: > Mateusz Viste wrote: > > > I am working on a shell that would replace COMMAND.COM and I > > wonder: is there any way I can figure out where my shell is, once > > it is executed by the MS-DOS kernel? > > > > By default MS-DOS launches whatever it finds at > > [BOOTDRV]:\COMMAND.COM. This situation is easy, but there is also > > the possibility that the shell was configured through a "SHELL" or > > "SHELLHIGH" CONFIG.SYS directive: SHELL=X:\EXOTIC\PATH\CUSTOM.COM > > > > I am unable to find a way to discover the above path. Any ideas if > > this is feasible at all? I went through RBIL but with no luck so > > far. > > > > The environment contains the full path/name of the executed program, > > but this does not apply to process 0, as the MS-DOS kernel does not > > allocate any environment for it (env segment in PSP = 0x0000). > > Just throwing out the obvious here... have you considered just > looking through config.sys for the shell? Yes, of course, but this seemingly obvious solution is extremely complex and unreliable. Such parser would have not only to look for SHELL or SHELLHIGH directives in CONFIG.SYS, but also understand the logic behind conditional instructions (config menus), with possible dialect variations between DOS versions. There are also DOSes that use a file named differently than "CONFIG.SYS". And then, there's also the possibility that the user simply skipped the SHELL directive (F5/F8) or that the shell has been entered by hand at boot time (some DOSes ask for the command interpreter path if the default file cannot be found). Mateusz
Back to comp.os.msdos.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Booting process 0: how to find out its full path? Mateusz Viste <mateusz@xyz.invalid> - 2021-11-16 10:44 +0100
Re: Booting process 0: how to find out its full path? "Auric__" <not.my.real@email.address> - 2021-11-16 16:54 +0000
Re: Booting process 0: how to find out its full path? Mateusz Viste <mateusz@xyz.invalid> - 2021-11-16 18:07 +0100
Re: Booting process 0: how to find out its full path? "Auric__" <not.my.real@email.address> - 2021-11-16 18:49 +0000
Re: Booting process 0: how to find out its full path? Mateusz Viste <mateusz@xyz.invalid> - 2021-11-16 20:46 +0100
Re: Booting process 0: how to find out its full path? JJ <jj4public@gmail.com> - 2021-11-17 08:23 +0700
Re: Booting process 0: how to find out its full path? Mateusz Viste <mateusz@xyz.invalid> - 2021-11-17 09:11 +0100
csiph-web