Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

FreeDOS and Protected Mode (Users)

posted by marcov, 13.09.2011, 13:35

> > So am I wrong to believe that Protected Mode would give me more Heap
> space?
>
> I don't know TP, but it might very well be that stack and (local) heap have
> to share a 64 kB (DGROUP) segment in both real- and protected-mode.

Afaik TP has one segment for (static)data for all compilation units combined, both initialized and not, and stack and heap are both FAR and grow from opposite parts of the memory.

In protected mode there IIRC is some segment descriptor limit (8192?) though, so sometimes programs with very finely grained allocations don't gain from PM because they exchange the memory limitation for the segment descriptor one.

IIRC there are ways (and alternate dpmi/rtm's) to do something about it
I'm not that deep into the PM bits though, since I quickly moved to 32-bit afterwards.

The problems sound a bit strange though, since stack and heap combined should be like in the magnitude of 16MB in PM . One wonders if there is not some infinite recursion or datacorruption somewhere.

> However, it should be possible to additionally create "far heaps", which
> are not limited to 64 kB - I guess this should be possible in both real-
> and protected-mode. Of course, "far heaps" will return FAR ( == 4 byte )
> pointers.

Heap and stack are afaik both FAR. So afaik it is like the C "large" model. (Huge adds a data segment per compilation unit iirc, which is not supported by C)

 

Complete thread:

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