Another 2 display question (maybe)

(Thanks to pete@qnx.com for getting me this far)

I have the 2 display setup working mostly.

What I need to do is have the boot information from the console displayed on
one of my monitors. (the one that gets it in the first place.)

Is there a way to NOT clear that out when starting the 2 display mode? Or
is there a way I could capture that info into a file and then just display
it myself? Is the console boot info already logged maybe?

Basically what I need is to keep the last of the boot information up on the
screen, and just add a message of my own at the end. The monitor will not
be used for anything but that afterwards.

Dave Dubeau <ddubeau@neptec.com> wrote:

(Thanks to > pete@qnx.com > for getting me this far)

I have the 2 display setup working mostly.

What I need to do is have the boot information from the console displayed on
one of my monitors. (the one that gets it in the first place.)

Is there a way to NOT clear that out when starting the 2 display mode? Or
is there a way I could capture that info into a file and then just display
it myself? Is the console boot info already logged maybe?

Basically what I need is to keep the last of the boot information up on the
screen, and just add a message of my own at the end. The monitor will not
be used for anything but that afterwards.

Are you saying that you just don’t want to run Photon on the
display that is active when you boot the machine?

Previously, Dave Dubeau wrote in qdn.public.qnx4.photon:

Is there a way to NOT clear that out when starting the 2 display mode? Or
is there a way I could capture that info into a file and then just display
it myself? Is the console boot info already logged maybe?

Well at the end of your sys.init file, you could have a program that
grabs what is on the screen.

Mitchell Schoenbrun --------- maschoen@pobox.com

pete@qnx.com wrote in message <8t1qs8$7oi$1@nntp.qnx.com>…

Dave Dubeau <> ddubeau@neptec.com> > wrote:
Basically what I need is to keep the last of the boot information up on
the
screen, and just add a message of my own at the end. The monitor will
not
be used for anything but that afterwards.

Are you saying that you just don’t want to run Photon on the
display that is active when you boot the machine?

If that leaves the display up with the last of the boot info there it’d be
great. Right now what happens if I don’t run photon for that one is that
the screen goes off after sysinit finishes.

Mitchell Schoenbrun wrote in message …

Well at the end of your sys.init file, you could have a program that
grabs what is on the screen.

Hmm. I’ll take a look into doing that. Thanks for the idea.

Dave Dubeau <ddubeau@neptec.com> wrote:

pete@qnx.com > wrote in message <8t1qs8$7oi$> 1@nntp.qnx.com> >…
Dave Dubeau <> ddubeau@neptec.com> > wrote:
Basically what I need is to keep the last of the boot information up on
the
screen, and just add a message of my own at the end. The monitor will
not
be used for anything but that afterwards.

Are you saying that you just don’t want to run Photon on the
display that is active when you boot the machine?

If that leaves the display up with the last of the boot info there it’d be
great. Right now what happens if I don’t run photon for that one is that
the screen goes off after sysinit finishes.

Hmm… if I was doing this, I would use the standard PCI calls
to just turn that baby off so no matter who tried to do what to
it, it wouldn’t respond.

It would still display everything… just be totally disconnected
from the bus…

If you’re interested in pursuing that, let me know and I’ll dig up some
code.

pete@qnx.com wrote in message <8t4b4o$ltj$3@nntp.qnx.com>…

Hmm… if I was doing this, I would use the standard PCI calls
to just turn that baby off so no matter who tried to do what to
it, it wouldn’t respond.

It would still display everything… just be totally disconnected
from the bus…

If you’re interested in pursuing that, let me know and I’ll dig up some
code.

That would let me avoid running an extra photon and drivers etc. Getting rid
of the ‘how much resource does this take?’ issue for the other method. All I
want is that monitor to sit there after boot with the boot info still on it,
so that sounds like an ideal solution for me.

I’d be very happy to see that code :wink: Thanks for all your help!

Would “ditto /dev/con1” in a pterm be useful in anyway?

Dave Dubeau wrote:

pete@qnx.com > wrote in message <8t1qs8$7oi$> 1@nntp.qnx.com> >…
Dave Dubeau <> ddubeau@neptec.com> > wrote:
Basically what I need is to keep the last of the boot information up on
the
screen, and just add a message of my own at the end. The monitor will
not
be used for anything but that afterwards.

Are you saying that you just don’t want to run Photon on the
display that is active when you boot the machine?

If that leaves the display up with the last of the boot info there it’d be
great. Right now what happens if I don’t run photon for that one is that
the screen goes off after sysinit finishes.

Dave Dubeau <ddubeau@neptec.com> wrote:

pete@qnx.com > wrote in message <8t4b4o$ltj$> 3@nntp.qnx.com> >…
Hmm… if I was doing this, I would use the standard PCI calls
to just turn that baby off so no matter who tried to do what to
it, it wouldn’t respond.

It would still display everything… just be totally disconnected
from the bus…

If you’re interested in pursuing that, let me know and I’ll dig up some
code.

That would let me avoid running an extra photon and drivers etc. Getting rid
of the ‘how much resource does this take?’ issue for the other method. All I
want is that monitor to sit there after boot with the boot info still on it,
so that sounds like an ideal solution for me.

I’d be very happy to see that code > :wink: > Thanks for all your help!

Here’s an overview…

Look at the CA_PCI… functions…

You need to zero out the two bottom bits in the command register for the
device you want to shut off.

The command register is word sized, and at an offset 4 bytes into the
devices configuration space.

So use the _CA_PCI_Write_Config_Word() routine to stuff a zero into
it… it will be lifeless afterwards.

If this isn’t enough, let me know and I’ll expand on it.

pete@qnx.com wrote in message <8t4p4a$ssv$2@nntp.qnx.com>…

Here’s an overview…

Look at the CA_PCI… functions…

You need to zero out the two bottom bits in the command register for the
device you want to shut off.

The command register is word sized, and at an offset 4 bytes into the
devices configuration space.

So use the _CA_PCI_Write_Config_Word() routine to stuff a zero into
it… it will be lifeless afterwards.

If this isn’t enough, let me know and I’ll expand on it.

Well, if ignorance is bliss, I’m a happy guy …

I’m pretty lost on how to find out where the device’s configuration space
is. Is there some sort of call I can make to find out info on the video
card or is it a standard type of address?

Thanks for all your help again.

Dave Dubeau <ddubeau@neptec.com> wrote:

pete@qnx.com > wrote in message <8t4p4a$ssv$> 2@nntp.qnx.com> >…

Here’s an overview…

Look at the CA_PCI… functions…

You need to zero out the two bottom bits in the command register for the
device you want to shut off.

The command register is word sized, and at an offset 4 bytes into the
devices configuration space.

So use the _CA_PCI_Write_Config_Word() routine to stuff a zero into
it… it will be lifeless afterwards.

If this isn’t enough, let me know and I’ll expand on it.

Well, if ignorance is bliss, I’m a happy guy …

I’m pretty lost on how to find out where the device’s configuration space
is. Is there some sort of call I can make to find out info on the video
card or is it a standard type of address?

Thanks for all your help again.

OK… here’s a bunch of code from one of the trappers. You should be
able to figure out how to modify this to find the card you want to
disable.

// Completely disable I/O and memory accesses to given card
void OffPCI(unsigned busnum, unsigned devfuncnum)
{
unsigned ati_short;

_CA_PCI_Read_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
ati_short &= ~3;
_CA_PCI_Write_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
}

// Enable I/O and memory access
void OnPCI(unsigned busnum, unsigned devfuncnum)
{
unsigned ati_short;

_CA_PCI_Read_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
ati_short |= 3;
_CA_PCI_Write_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
}

// Turn off I/O ports only
void OffPCIIO(unsigned busnum, unsigned devfuncnum)
{
unsigned ati_short;

_CA_PCI_Read_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
ati_short &= ~1;
_CA_PCI_Write_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
}

// Turn on I/O port access
void OnPCIIO(unsigned busnum, unsigned devfuncnum)
{
unsigned ati_short;

_CA_PCI_Read_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
ati_short |= 1;
_CA_PCI_Write_Config_Byte(busnum, devfuncnum, 4, 2, (char *)&ati_short);
}


int checkdevice(unsigned busnum, unsigned devfuncnum, unsigned long vendor, unsigned long product)
{
struct _pci_config_regs creg;
unsigned char ati_long;
unsigned short ati_short;

_CA_PCI_Read_Config_DWord(busnum, devfuncnum, 0, 16, (char *)&creg);

if (vendor == creg.Vendor_ID) // It’s the correct vendor
{
if (creg.Class_Code[2]==0x03) // It is a VGA compatible device
{
if (product == creg.Device_ID) // It’s the correct device ID
{
return(1);
}
}
}
return(0);
}

int check_pci(unsigned long vendor, unsigned long product, int n)
{
unsigned lastbus, busnum, device, function, num_fcns;
unsigned header_type, device_id, version, hardware;
int cc;

struct _osinfo info;

if(qnx_osinfo(0, &info) == -1)
{
return(0);
}

if(!(info.sflags & _PSF_PCI_BIOS)) // we have a PCI BIOS
{
return(0);
}

if(_CA_PCI_BIOS_Present(&lastbus, &version, &hardware) != PCI_SUCCESS)
{
printf(“No PCI BIOS\n”);
return(0);
}

lastbus &= 0x3F;

cc = 0;
which_card = n;

// Walk all the buses looking for the n’th occurence of
// a specific vendor/product
for(busnum = 0; busnum <= lastbus; busnum++)
{
for(device = 0; device < 32; device++)
{
_CA_PCI_Read_Config_Word(busnum, device << 3, offsetof(struct _pci_config_regs, Device_ID),
1, (char *)&device_id);
if(device_id == 0xffff)
continue;

_CA_PCI_Read_Config_Byte(busnum, device << 3, offsetof(struct _pci_config_regs, Header_Type),
1, (char *)&header_type);
if(header_type & 0x80) {
num_fcns = 8;
} else {
num_fcns = 1;
}
for(function = 0; function < num_fcns; function++)
{
if (checkdevice(busnum, (device << 3) | function, vendor, product))
{
cc++;
if (cc == n) return(1);
}
}
}
}
return(0);
}

pete@qnx.com wrote in message <8t9f5k$nfg$1@nntp.qnx.com>…

Dave Dubeau <> ddubeau@neptec.com> > wrote:

Thanks bunches! That should get me going.