• Good Old DOS and Ancient Windows: TSR

    From Lars Poulsen@21:1/5 to Carlos E.R. on Thu Aug 21 22:35:51 2025
    XPost: alt.comp.os.windows-11

    On 2025-08-11 05:12, c186282 wrote:
      There was an outfit that sold libs for TP that
      would let you do TSR and I think hotkeys. I used
      TSRs to probe external devices, to update values,
      while still sticking to the main display/control
      pgm.

    On 2025-08-17, Carlos E.R. <robin_listas@es.invalid> wrote:
    I think I remember that.

    What I bought was a thick book with many powerful examples, perhaps a
    floppy.

    On 2025-08-11 05:12, c186282 wrote:
      TSR is kinda-sorta 'multi-tasking' - within limits.

      You COULD make your own TSRs with TP, but it was
      easier to buy the pre-made/debugged.

    Way back in the early 1990s, I worked on a low-end device that loaded
    its "firmware" from a floppy on power-up, but the program loader in the
    cheap DOS-look-alike was really slow, so I wrote (in MASM as I recall) a
    TSR that hooked the BIOS call to the floppy and used track buffering
    instead of sector-at-a-time reads. Sped up the loading by a factor 5.

    It was a really simple process: You found the trap vector for a system
    call or BIOS call and replaced the pointer to the interrupt handler with
    a pointer to your own routine in memory; then if you still wanted to do
    the original traphandler, you jumped to it at the end. Oh, and before
    exiting, you patched the memory allocation so the the memory occuped by
    your handler was not released on exit.

    People hooked all sorts of interrupts and exceptions:
    - timer interrupts
    - keyboard interrupts
    - BIOS calls
    - system calls

    In a way, it was disappointing when DOS/Windows started to "sandbox" the programs so you couldn't overwrite the OS anymore!

    - Lars

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)