Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DOSLFN, intermediate handler issued calls; "retiring" (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 14.06.2011, 18:51

> It is to presume that DOSLFN does its thing safely, with proper attention
> to DOS internal stacks and so on.

Yes.

> Not /all/ such recursion is bad, otherwise we wouldn't have TSRs
> (and DOS itself recurrs).

What DOSLFN does isn't recursion as far as DOS is concerned. Recursion occurs in MS-DOS only with functions which execute on the user stack frame (USF) entirely, such as 21.62. (Those are marked in RBIL as "not [using] any of the DOS-internal stacks", and it is correctly noted that these functions "may thus be called at any time, even during another INT 21h call".) There's some specific exceptions but generally only functions executing on the USF may be called when DOS is really re-entered.

> At 1st glance the
> case of LFN functions carefully calling down into short name file functions
> does not compare, in terms of renterancy, with trying to call memory
> allocation functions from the interior of functions of the same kind. The
> latter is not even meaningful.

You must have misunderstood me. What I proposed is the same. DOSLFN does this:

i21:
  cmp ah, 71h
  jne .next
  ...
  mov ax, 3D00h
  int 21h
  ...
  mov ah, 3Eh
  int 21h
  ...


(Note that DOSLFN does actually use the int 21h opcodes as shown above - therefore re-entering intermediate handlers before itself, as well as itself partially. That isn't relevant here though.)

Clearly, DOS is never re-entered.*

What I proposed is conceptually the same, just with memory allocation functions instead of file access functions:

i21:
  cmp ah, 48h
  jne .next
  ...
  mov ah, 48h
  pushf
  push cs
  call .next
  ...


Again, DOS is never re-entered.*

* To be precise, it isn't re-entered more often than the intercepted call would re-enter DOS anyway. Assuming DOS wouldn't be re-entered by the user-issued 21.48 call, the intermediate-handler-issued 21.48 calls aren't re-entering DOS either.

> - keep my loading scheme as is - not only is is working in practice, also
> thought 'attacks' have not succeeded in breaking it in the least (safe in
> dream).

Yes, it is safe. As stated, the current critical section is already unnecessary. (Notwithstanding the (im)possibility of always optimal placement, which has nothing to do with safety.)



> I'll be "off" the stage for some unpredictable time for reasons which I've
> alluded to earlier, health foremost

Get well soon!

> compounded by a load of material problems which will be surmounted,

Ah.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 191 users online (0 registered, 191 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum