Run-time selection of pc386 BSP console

Quality Quorum qqi at world.std.com
Fri Jul 12 02:56:35 UTC 2002



On Thu, 11 Jul 2002, Eric Norum wrote:

> I've got an embedded processor module (PC-104) with no video adapter.  I
> now use gdb to poke the BSPConsolePort and BSPPrintkPort values to 1 and
> 0, respectively, but this is a bit of a pain.  I think that it would be
> more useful to have the pc386 console driver detect the fact that
> there's no video adapter present and automatically switch to the
> serial-line console.
>
> Something in console_initialize like:
> 	if ((BSPConsolePort == BSP_CONSOLE_PORT_CONSOLE)
> 	  && (<<<NO VIDEO DRIVER PRESENT>>>)) {
> 		BSPConsolePort=BSP_UART_COM2;
> 		BSPPrintkPort= BSP_UART_COM1;
> 	}
>
>
> My questions are:
> 1) Do others think that this is a good idea?
> 2) What code goes in the <<<NO VIDEO DRIVER PRESENT>>> expression?
>
> Thanks,
> --
> Eric Norum <eric.norum at usask.ca>
> Department of Electrical Engineering
> University of Saskatchewan
> Saskatoon, Canada.
> Phone: (306) 966-5394   FAX:   (306) 966-5407
>


You can override bspstart function in your app code (it is defined
as a weak alias to bsp_start_default).

E.g.


void bsp_start(void)
{
   BSPConsolePort = BSP_UART_COM2;
   BSPPrintkPort = BSP_UART_COM1;

   /* The rest of iniialization is standard */
   bsp_start_default();
}


Thanks,

Aleksey





More information about the users mailing list