Using overlays to hide initialization code (Developers)
Eeek, I posted in "Announcements!" I fixed that.
Some quick follow-ups:
* The code needs to be 16 bit real-mode. I want it to run on an 8088.
* The code fits in 512KB easily. I'm just offended that I have to keep initialization code around that I'll never use again. I'd rather use the RAM space for more features.
* It the mTCP HTTP server; it's too big to turn it into a TSR, so it's going to be C code forever.
Overlay support seems to be the correct way to handle this situation. I defined my "root" code (always stays resident) and then two sections that can overlay each other. One section was for the init code and the other section was for code that gets used often. I was hoping the initialization code would be forced out of memory but it's possible that the overlay manager is allocating too much space and not evicting it. It's also possible that the overlay manager itself is just so large that it is hiding the savings.
When you think about it, this model of "throw away the init code when you are done with it" is a simplification of the overlay scheme and almost any non-trivial program can benefit from it. I'm just kind of surprised that compilers like Open Watcom addressed the more complicated general overlay mechanism without having a simple path for this more limited use of it.
Complete thread:
- Using overlays to hide initialization code - mbbrutman, 06.08.2026, 07:29 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Using overlays to hide initialization code - mceric, 06.08.2026, 10:27
- Using overlays to hide initialization code - Laaca, 06.08.2026, 11:14
- Using overlays to hide initialization code - Japheth, 06.08.2026, 21:36
- Using overlays to hide initialization code - Oso2k, 06.08.2026, 22:07
- Using overlays to hide initialization code - bretjohn, 06.08.2026, 23:14
- Using overlays to hide initialization code - marcov, 06.08.2026, 23:17
- Using overlays to hide initialization code - mbbrutman, 07.08.2026, 01:15
- Using overlays to hide initialization code - bretjohn, 07.08.2026, 02:02
- Using overlays to hide initialization code - marcov, 07.08.2026, 10:06
- Using overlays to hide initialization code - bretjohn, 07.08.2026, 02:02
Mix view