Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

AMIS, Optimize memory usage (Developers)

posted by Ninho E-mail, 13.05.2011, 02:07

> > > Anyway, if your goal is to optimize the memory usage of this driver:
> > ...
> > All done (credit Japheth), no fragmentation nor PSP remains in any case.
>
>
> I downloaded your program while I wrote that post and verified all of my
> points. (I also discarded one point I had in mind at first that didn't
> apply here.) Assuming you didn't silently update the program just now, they
> still all apply.

What DOS type and version please ? Under MSDOS 7, Japheth's scheme (really it's his loader I can't and won't take credit) does not create fragmentation and does remove the PSP. Zero overhead besides the 16-byte MCB. I assumed\\\hoped it would in other important DOSes too (hey! that's why I begged for beta testing out there! Thank you for actually launching the critter, in the end :=)

>> ... flags image on the stack ...
>
> Enough said.
>
> > For anybody who wouldn't believe we do not need to pass the flags along
> the
> > chain as we received "from upwards", while writing this I've been
> checking
> > a famous int 15 "hooker", MS-Smartdrv (which is willing to
> catch the "3
> > finger salute" if you wonder why it is hooking int 15). Well, MS got
> it
> > right, it doesn't lose time in needlessly preserving the flags.
>
> Yes. Right. Because if Microsoft does something some way, then it
> absolutely must be right to do it that way.

No, but maybe my example was somehow tongue in cheek, you know ?

(In case you can't tell, this
> is sarcasm. Independent of whether you should or shouldn't save the flags
> separately, I do not think reasoning with Microsoft's implementation is
> necessarily good.)

The right way (as I mentioned) is to study software int 15 (from BIOs listings, printed books, Ralf Brown's infamous list and build a few years' experience like you and me have. And brains). The MS example however is not worthless. MS systems programming (whether done in house or bought/"borrowed" I don't care) usually is excellent stuff. But there is another reason I chose that example, which is : in the terrible case that I, and MS, were wrong... it wouldn't matter that others were (in that absurd hypothesis) right : the mere existence of be it /one/ program which did not preserve the flags around its hook would make all the others' precaution useless. <G>

---
Ninho

 

Complete thread:

Back to the forum
Board view  Mix view
22755 Postings in 2121 Threads, 402 registered users (2 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum