Warmaster199
May 1st, 2002, 11:06 AM
Hello.
I am currently designing the ISA Plug and Play support for my operating system. I have code to detect the ISAPnP BIOS - it gets the address of the certain function...
...But how exactly do I set the function prototype to point to the address that the BIOS specifies?
It took me a while to get the BIOS detect code running, but I think that setting this pointer will be even more bothersome. There are actually 3 different prototypes for the function because it is called 3 different ways, but they ALL point to the same address(Or they are supposed to).
The following code needs to be set to the address:
int FAR (*entryPoint)(Function, NumNodes, NodeSize, BiosSelector);
int Function; /* PnP BIOS Function 0 */
unsigned char FAR *NumNodes; /* Number of nodes the BIOS will return */
unsigned int FAR *NodeSize; /* Size of the largest device node */
unsigned int BiosSelector; /* PnP BIOS readable/writable selector */
That piece gives the function prototype. Also, the funtion should not be "int FAR" because my OS is protected mode ready, so it should be "unsigned long"(It works better).
Isn't it something like:
unsigned long (*entrypointfunc)(Function, numnodes, nodesize, BIOSsel) = (unsigned long *)BIOS->pmode_entrypoint;
This is a crucial part of my OS, so I request your help as soon as possible...
I am currently designing the ISA Plug and Play support for my operating system. I have code to detect the ISAPnP BIOS - it gets the address of the certain function...
...But how exactly do I set the function prototype to point to the address that the BIOS specifies?
It took me a while to get the BIOS detect code running, but I think that setting this pointer will be even more bothersome. There are actually 3 different prototypes for the function because it is called 3 different ways, but they ALL point to the same address(Or they are supposed to).
The following code needs to be set to the address:
int FAR (*entryPoint)(Function, NumNodes, NodeSize, BiosSelector);
int Function; /* PnP BIOS Function 0 */
unsigned char FAR *NumNodes; /* Number of nodes the BIOS will return */
unsigned int FAR *NodeSize; /* Size of the largest device node */
unsigned int BiosSelector; /* PnP BIOS readable/writable selector */
That piece gives the function prototype. Also, the funtion should not be "int FAR" because my OS is protected mode ready, so it should be "unsigned long"(It works better).
Isn't it something like:
unsigned long (*entrypointfunc)(Function, numnodes, nodesize, BIOSsel) = (unsigned long *)BIOS->pmode_entrypoint;
This is a crucial part of my OS, so I request your help as soon as possible...