DJ
2004-06-22 21:21:25 UTC
Hola!
Estoy intentando escribir un pequeño programa para averiguar los
dispositivos instalados en un ordenador, a traves de la BIOS PNP. Tengo la
direccion en memoria donde esta ubicada la entrada a la rutina del BIOS q
hace esto (0xF000:0xC180). Lo he escrito con el Borland ++ 3.1 y con el GCC
(Rhide) para MS-DOS/WIN 98.En el Borland me va bien, pero cuando intento
asignar la direccion y luego llamarla se levanta una excepcion por fallo en
la segmentacion.
Borland
Prototipo
int far (*entrypoint)(int Funcion,uchar far *NumNodes,uint far *NodeSize,
uint BiosSelector);
...........
entrypoint = (void far *)MK_FP(0xF000,0xC180);
..........
GCC
Prototipo
"el mismo q para borland"
en la asignacion tengo dudas, he probado con los siguiente
entrypoint = (int (*)(int,ucha far*,uint far *,uint) 0xfc180; <-- Esto lo
admite.
resultado = entrypoint(Funcion,NumNodes,NodeSize,BiosSelector); <----- Aqui
es dnd falla, alguna idea?
Gracias.
Dj.
P.D.: He estado mirando en la ayuda y he visto la funcion
_go32_simulate_fcall (registros_dpmi), pero no me convence.Hay alguna otra
forma de hacerlo. Gracias de nuevo
Estoy intentando escribir un pequeño programa para averiguar los
dispositivos instalados en un ordenador, a traves de la BIOS PNP. Tengo la
direccion en memoria donde esta ubicada la entrada a la rutina del BIOS q
hace esto (0xF000:0xC180). Lo he escrito con el Borland ++ 3.1 y con el GCC
(Rhide) para MS-DOS/WIN 98.En el Borland me va bien, pero cuando intento
asignar la direccion y luego llamarla se levanta una excepcion por fallo en
la segmentacion.
Borland
Prototipo
int far (*entrypoint)(int Funcion,uchar far *NumNodes,uint far *NodeSize,
uint BiosSelector);
...........
entrypoint = (void far *)MK_FP(0xF000,0xC180);
..........
GCC
Prototipo
"el mismo q para borland"
en la asignacion tengo dudas, he probado con los siguiente
entrypoint = (int (*)(int,ucha far*,uint far *,uint) 0xfc180; <-- Esto lo
admite.
resultado = entrypoint(Funcion,NumNodes,NodeSize,BiosSelector); <----- Aqui
es dnd falla, alguna idea?
Gracias.
Dj.
P.D.: He estado mirando en la ayuda y he visto la funcion
_go32_simulate_fcall (registros_dpmi), pero no me convence.Hay alguna otra
forma de hacerlo. Gracias de nuevo