DPMI - A bit of a noobish question.
Posted: Wed Jul 01, 2009 8:22 pm
If you're reading this, thanks. Now down to business: I've been reading extensively for a while now, and getting the theory down right. However, I've tried to really understand what DOS is, and the DPMI.
So far, this is what I see it as: DOS is a mini, underlying OS that is installed on motherboards, and provides basic I/O services when you make software interrupt calls to it. It was programmed by Bill Gates (?), and it comes, apparently with any motherboard made in the last decade.
The DPMI is, by extension, an encapsulating term for the DOS interrupt system, seeing as it imposes a measure of abstraction by hiding the memory mapped I/Os, data ranges etc, from the programmer. I make the assumption that if I wanted to, I could go ahead (in real mode at least), and write to the ports myself.
If I at least have a basic understanding from here: then my confusion begins here: I've been reading through tos of source form like...everywhere on the net, and I always see people just declare some 'dpmi.h'. Then, magically, they gain access to a function int86(), to __dpmi_int(), or another one whose name I cannot recall, even though it's not in the dpmi.h header.
Not only that, but they normally do something like this:
Then, magically, after that, they end up getting this thing that irritates me:
So, if not an explanation, which i understand would be tedious seeing as I'm most likely asking something rather basic, then could you please spare me the time to just post up a link to an article?
Main, important questions: (1) Where do those functions (int86(), __dpmi_int()), etc come from? Are they compiler linked into the executable, and the people just kind of do something like an 'extern TYPE __dpmi_int(TYPE, TYPE);'?
(2)How can I get to load registers into a variable like the above examples?
(3)This one may be going too far but canI have a comprehensive memory map of real mode mem?
So far, this is what I see it as: DOS is a mini, underlying OS that is installed on motherboards, and provides basic I/O services when you make software interrupt calls to it. It was programmed by Bill Gates (?), and it comes, apparently with any motherboard made in the last decade.
The DPMI is, by extension, an encapsulating term for the DOS interrupt system, seeing as it imposes a measure of abstraction by hiding the memory mapped I/Os, data ranges etc, from the programmer. I make the assumption that if I wanted to, I could go ahead (in real mode at least), and write to the ports myself.
If I at least have a basic understanding from here: then my confusion begins here: I've been reading through tos of source form like...everywhere on the net, and I always see people just declare some 'dpmi.h'. Then, magically, they gain access to a function int86(), to __dpmi_int(), or another one whose name I cannot recall, even though it's not in the dpmi.h header.
Not only that, but they normally do something like this:
Code: Select all
struct regs
{
ulong32 ax;
...
ushort32 ss;
};
struct regs reg_var;
Code: Select all
r.x.ax = ...;
...
r.x.dx = ...;
//Where the F did he get that r var? It just popped out of nowhere! >:(
Main, important questions: (1) Where do those functions (int86(), __dpmi_int()), etc come from? Are they compiler linked into the executable, and the people just kind of do something like an 'extern TYPE __dpmi_int(TYPE, TYPE);'?
(2)How can I get to load registers into a variable like the above examples?
(3)This one may be going too far but canI have a comprehensive memory map of real mode mem?