Discussion:
compact memory model
(too old to reply)
muta...@gmail.com
2021-03-11 09:51:09 UTC
Permalink
It occurred to me. My boot sector loads IO.SYS.
Can I make IO.SYS a compact memory model,
thus avoiding needing to do any relocations?

The main thing I am after is far data pointers.

IO.SYS would then be in a position to load
MSDOS.SYS, doing relocations of the a.out
32-bit module.

I still need to stuff around with the fact that
my MSDOS.SYS is more than 64k, so without
compact model being able to automatically
normalize data pointers, I have to do that
myself.

But at least now I "know" that I need to request
the IA16 GCC to normalize and handle 32-bit
additions of far data pointers regardless of
memory model.

BFN. Paul.
muta...@gmail.com
2021-03-11 16:41:22 UTC
Permalink
Post by ***@gmail.com
But at least now I "know" that I need to request
the IA16 GCC to normalize and handle 32-bit
additions of far data pointers regardless of
memory model.
Another thing I realized is that if I have far data
pointers, I can actually have a couple of macros,
#define SETADDR(&p, unsigned long)
#define ADDADDR(&p, unsigned long)
which will do what I want while waiting for the
compiler to do that automatically. At least I will
eliminate use of the word "far", which really bugs
me.

I don't actually have many pointers that need to
access more than 64k, so it will be minimal code.
But if this is going to be something difficult, maybe
it should be in C90 standard. ie macros for dealing
with pointer manipulation that potentially exceeds
what an implementation is capable of. SETADDR
especially. Even if far pointers are magically corrected,
how are you supposed to set an absolute address?
ie SETADDR(&p, 0xb8000UL);

BFN. Paul.

Continue reading on narkive:
Loading...