Re: Question about UMBs
"Arkady V.Belousov" <[email protected]>
| Newsgroups | gmane.os.freedos.devel |
|---|---|
| Message-ID | <[email protected]> |
X-Comment-To: Paul Case Hi! 31-Окт-2002 17:11 [email protected] (Paul Case) wrote to [email protected]: >> Whay you not clear there? You only should implement above mentioned >>three functions to support UMB. Of course, you also should implement code, >>which will insert your code into existing XMS chain (or create new XMS chain >>and implement installation check). PC> Hmmmm... problem is, I want this program to get out of memory as soon as PC> it's finished making the UMBs available. It can't. MS-DOS not supports exiting drivers _if they installed_. But, probably, your code may be implemented not as driver (i.e. you code will be installed by driver, which will be not remained in memory itself) - in this case you may exit resident code later (in autoexec.bat). PC> Failing that, I'd like the memory footprint to be as small as possible PC> (if it detected ROM shadowing was in use, and there was enough memory free PC> in one of the UMB blocks used for shadowing, I could possibly relocate the PC> resident code in there... but that's just speculation). Why not? If upper memory block will too small for your code, then this mean that your code too big to be useful or that upper memory too small. >> You can't, DOS itself gather this info from XMS services if it >>instructed by DOS=UMB statement in config.sys. PC> Okay... so, would DOS allocate all of the UMBs at once, or would it PC> allocate them as needed? MS-DOS allocates all available upper memory, other DOSes may have other strategies. Matthias states in one his letter, that DR-DOS allocates memory when required. >> Yes. For example, I have driver, which runs, changes video BIOS fonts >>in shadow memory (localization), then exit without remaining resident code. PC> Could you provide the source? Unfortunately, no. :( This is closed source shareware program (S_FONT - Shadow memory font loader). But, I suggest, you may found sources for some other drivers, which not remains resident without error messages. But on the first stages you may try to write plain driver and add other features (moving resident code high, for example) later. Fot this you may get sources of any driver as template - for example, MS' himem.sys. PC> I've never written a .sys file before (never needed to), "Me too". PC> so I need to look at one that works to get an idea of PC> how it works (the only book I have that talks about it, doesn't provide PC> any example code except on the disk that came with it, and I lost that PC> the last time I moved).