Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!emory!att!cbfsb!cbnewsc!tjr From: tjr@cbnewsc.att.com (thomas.j.roberts) Newsgroups: comp.os.msdos.programmer Subject: Re: Load config.sys driver as TSR ??? Message-ID: <1990Nov21.162051.20401@cbnewsc.att.com> Date: 21 Nov 90 16:20:51 GMT References: Organization: AT&T Bell Laboratories Lines: 31 From article , by valley@uchicago (Doug Dougherty): > motti@ocsmd.ocs.com (Motti Bazar) writes: > > My question is a related one. I am currently developing an "ASK" device > driver. You put it in your CONFIG.SYS like this: > > device=ASK.SYS VDISK.SYS 384 /X > > and it asks you whether or not you want to load VDISK. During the loading of device drivers, MS-DOS loads the ENTIRE config.sys into memory, munges it with '\0'-s following each line and each DEVICE=NAME, and then indexes through the list, calling the INIT function of drivers, etc... Thus, it should be simple to implement ASK.SYS so: DEVICE=ASK.SYS // asks about the NEXT driver in config.sys DEVICE=VDISK.SYS 384 /x if the answer is NO, ASK.SYS would change the '\0' following its command line, and the '\0' following VDISK.SYS to be '\n' (or any non-zero char), thus 'eating' the next line; if the answer is YES, ASK.SYS would do nothing, but merely exit with no memory allocated. [Actually, it is possible that a very long CONFIG.SYS would not all be loaded at once - I haven't checked; I suspect that the entire file is read, because of the complicated pre-processing performed before calling any driver's INIT entry.] Tom Roberts att!ihlpl!tjrob TJROB@IHLPL.ATT.COM