Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

I made my own DOS implementation (Announce)

posted by samwdpckr, 23.03.2024, 08:10

I prefer keeping the struct members word-aligned.

Modifying a memory allocation now also changes its owner in the new version.

> What other way would you propose?
Probably the best way would be to change the memory allocation strategy _before_ the TSR program is loaded from the disk, or alternatively make sure that the TSR program is loaded to the lower addresses, before other programs like the command prompt are loaded. That way the memory is not fragmented. This shows how well it works:

[image]

The program can change the memory allocation strategy and then load another instance of itself to the memory using normal DOS syscalls.

If that is not possible, there are other ways to stay resident in memory so that the part of the program that stays resident is not the memory block with the original PSP, but they are all either relatively difficult to do or need modifying the internal structures of the kernel.

For example, the program could free its environment segment and file handles, allocate memory for the resident part, copy its own PSP to the resident part (with memcpy to make sure that the parent PSP does not change), change the current PSP to the new PSP, jump to the new PSP, free the old PSP and then exit via int21,ah=31.

 

Complete thread:

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