Hello there. I have what hopes to be a somewhat simple question.
In real mode, the Kernel is limited to 64k, correct? That beig said, if I write a memory manager, am I able to use multiple segments for one program? Say 256k, or am I limited to 64k in a program as well.
I am not wanting to be spoonfed, I have done a lot of googling and haven't come up with much. point in the right direction is all I ask.
Thanks.
Real Mode Memory Addressing
Re: Real Mode Memory Addressing
No single segment can be larger than 64k in real-mode, but it doesn't mean that kernels or programs are confined to 64k. There are various memory models that deals with this problem: compact (single code, many data), medium (single data, many code) and large (many code, many data).
-
- Member
- Posts: 26
- Joined: Fri Oct 14, 2011 4:32 pm
Re: Real Mode Memory Addressing
Thank you for the reply. I have somewhere to look now!
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Real Mode Memory Addressing
Lies!No single segment can be larger than 64k in real-mode
Re: Real Mode Memory Addressing
That's unreal mode.Combuster wrote:Lies!No single segment can be larger than 64k in real-mode
But you are right. If you switch to protected mode and back to real mode, you could enable larger segments (with 32-bit addressing!). However, without that, it is not possible.
-
- Member
- Posts: 26
- Joined: Fri Oct 14, 2011 4:32 pm
Re: Real Mode Memory Addressing
I was considering this. In my research, I see that the "code" segment is limited to 64k, can someone expand on this? Does this mean that the kernel is limited to 64k unless you use your own memory model?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Real Mode Memory Addressing
Define "your own"
You can do all program calls by default as near calls, or you can do them by default as far calls. Using the first method exclusively gives you a 64k code max. The second form gives you a code size limited to 1MB, but is slower. The same goes for data references which can be 16-bit with a fixed segment register value, or 32-bit seg:off pointers.
If the compiler supports memory models, you can tell it which choices to make on these matters. There's nothing new here.
You can do all program calls by default as near calls, or you can do them by default as far calls. Using the first method exclusively gives you a 64k code max. The second form gives you a code size limited to 1MB, but is slower. The same goes for data references which can be 16-bit with a fixed segment register value, or 32-bit seg:off pointers.
If the compiler supports memory models, you can tell it which choices to make on these matters. There's nothing new here.
-
- Member
- Posts: 26
- Joined: Fri Oct 14, 2011 4:32 pm
Re: Real Mode Memory Addressing
Excellent. Thanks for the quick responses, it is appreciated.