starting graphics drivers

We are initializing the modeswitcher and video card through our software
and I wanted to get input as to whether there is a better method. We have
had success with the method but on a particular platform with a Media GX,
it works on some devices all the time and other devices some of the time.
When the initialization does fail it is during the vesabios.ms call and it
takes the network drivers with it. I.e., the device is on the network and
we are able to see it until the graphics drivers are initialized.

Here is the initialization code:

//vesabios.ms -i0x102 -r -r;
//Pg.vga4 -HNqnx/crt -g800x600x4 -A0xA0000,0x10000 -WB100 -WV200000;
//#800,600,4,100,1D,vga4 - VGA 16 color

// run modeswitch
sprintf( dest_dir, “%s%s”, open_dir, “qnx4/graphics/drivers/vesabios.ms” );
param1 = dest_dir;
//param1 = “/qnx4/graphics/drivers/vesabios.ms”;
param1[++i] = “-i0x102”;
param1[++i] = “-r -r”;
param1[++i] = NULL;
mode_switch_pid = run_bg(param1, env, 1 );
sleep( 2 ); // This time needed for modeswitcher to initialize

// start window manager - optional
sprintf( dest_dir, “%s%s”, open_dir, “qnx4/photon/bin/pwm” );
param1 = dest_dir;
//param1 = “/qnx4/photon/bin/pwm”;
param1[++i] = “-STW”;
param1[++i] = NULL;
run_bg(param1,env,net_console);


// start graphics driver
sprintf( dest_dir, “%s%s”, open_dir, “qnx4/graphics/drivers/Pg.vga4” );
param1 = dest_dir;
//param1 = “/qnx4/graphics/drivers/Pg.vga4”;
param1[++i] = “-HNqnx/crt”;
param1[++i] = “-g800x600x4”;
param1[++i] = “-A0xA0000,0x10000”;
param1[++i] = “-WB100”;
param1[++i] = “-WV200000”;
param1[++i] = NULL;
run_bg(param1,env,net_console);