why does it get a diffrent output

hi,

I have a program that finds a pci device’s base address!

It works well ,when i use it respectively.

main(){

FindPCIDev( …);

}

FindPCIDev(…);

But when i use it as a function in a a large programe. It produces a
different output(the pci device base address ) ,but the device is the same
as first. why?

In the makefile:

OBJS = … FindPCIDev.o …

large_program : $(OBJS)
cc -T1 -Wc -s -o large_program $(OBJS)

FindPCIDev.o : FindPCIDev.c
cc -T1 -c FindPCIDev.c


Thanks!

With QNX4 the pci functions don’t work in program with segment
64K ( I don’t remember what segment exactly)

“ycao” <ycao@mail.ipp.ac.cn> wrote in message
news:agla7a$b6p$1@inn.qnx.com

hi,

I have a program that finds a pci device’s base address!

It works well ,when i use it respectively.

main(){

FindPCIDev( …);

}

FindPCIDev(…);

But when i use it as a function in a a large programe. It produces a
different output(the pci device base address ) ,but the device is the same
as first. why?

In the makefile:

OBJS = … FindPCIDev.o …

large_program : $(OBJS)
cc -T1 -Wc -s -o large_program $(OBJS)

FindPCIDev.o : FindPCIDev.c
cc -T1 -c FindPCIDev.c


Thanks!








\

Mario Charest postmaster@127.0.0.1 wrote:

With QNX4 the pci functions don’t work in program with segment
64K ( I don’t remember what segment exactly)

Actually, it will fail if you stack is bigger than 64k, or starts
at an address above 64K – these routines call directly into the
PCI BIOS and those restrictions are a side-effect of this.

The solution is to turn those into a library that talks to a server
that doesn’t have too big a stack.

I wrote a library and server that does exactly that a while back.
You should be able to get it from:

ftp.qnx.com:/usr/free/qnx4/os/samples/misc/ca_pci_msg.tgz

-David


“ycao” <> ycao@mail.ipp.ac.cn> > wrote in message
news:agla7a$b6p$> 1@inn.qnx.com> …
hi,

I have a program that finds a pci device’s base address!

It works well ,when i use it respectively.

main(){

FindPCIDev( …);

}

FindPCIDev(…);

But when i use it as a function in a a large programe. It produces a
different output(the pci device base address ) ,but the device is the same
as first. why?

In the makefile:

OBJS = … FindPCIDev.o …

large_program : $(OBJS)
cc -T1 -Wc -s -o large_program $(OBJS)

FindPCIDev.o : FindPCIDev.c
cc -T1 -c FindPCIDev.c


-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.