[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch



joel> On Tue, 1 Sep 1998, VALETTE Eric wrote:

>> >>>>> "Quality" == Quality Quorum <qqi at world.std.com> writes:

joel> Actually this is a case where the libchip architecture is better. 
The
joel> libchip configuration tables include a per device "probe" routine
which
joel> returns TRUE if the device is present.  On the Radstone PPC2
board, the
joel> console driver supports about a dozen devices and there is a
priority
joel> order on which is "/dev/console".  The order is similar to what is
joel> happening on the pc386 BSP:


joel> This is a simplified version of the "console" routing mentioned
above.
joel> The PPC2 board mentioned above has PCI Mezzanine (PMC) so the
architecture
joel> is very portable.  

Gentlemen, I'm affraid I will play again the role of an old grandfather
but there is an IEEE standart for BOOT (initialization Configuration)
firmware IEEE 1275-1994.

This firmware is used on nearly all modern PPC board, Sun sparc
manufactured
board, ... This standarts defines many thing you can do in order to
setup a 
running system and also how to retrieve the configuration variable from
the
NVRAM.

In particular it defines how to chose :

	- the boot devices,
	- the boot file,
	- input device,
	- output device

I agree with alexsey that you may want to choose the output device 
independently of the hardware capabilities. I disagree with him that
printk should have an different output than printf...

As far as I'm concerned, I appreciate his patch. I just included a
very small patch that needs to be applied on top of its own patch to
fix the following things :
	- IBMPC_Init_video was called twice,
	- a cosmetic change to make the cpu.c code more easy to understand
	limit = (limit + 1) >> 3; => limit = (limit + 1)
/sizeof(interrupt_gate_descriptor);

The funny things is that the gererated code is the same as ggc is smart
enough to use shift to divise by 8...

-- 
   __                 
  /  `                   	Eric Valette
 /--   __  o _.          	Canon CRF
(___, / (_(_(__         	Rue de la touche lambert
				35517 Cesson-Sevigne  Cedex
				FRANCE
Tel: +33 (0)2 99 87 68 91	Fax: +33 (0)2 99 84 11 30
E-mail: valette at crf.canon.fr
-------------- next part --------------
diff -c -r -N rtems-980824/c/src/lib/libbsp/i386/pc386/console/console.c rtems-980824.new/c/src/lib/libbsp/i386/pc386/console/console.c
*** rtems-980824/c/src/lib/libbsp/i386/pc386/console/console.c	Fri Aug 28 15:47:13 1998
--- rtems-980824.new/c/src/lib/libbsp/i386/pc386/console/console.c	Tue Sep  1 15:49:16 1998
***************
*** 120,128 ****
  {
    rtems_status_code status;
  
-   /* Initialize video */
-   _IBMPC_initVideo();
- 
    if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
      {
  
--- 120,125 ----
***************
*** 155,162 ****
         */
        
        /* 9600-8-N-1 */
!       PC386_uart_init(PC386ConsolePort, 9600, 0);
!       
        
        /* Set interrupt handler */
        if(PC386ConsolePort == PC386_UART_COM1)
--- 152,158 ----
         */
        
        /* 9600-8-N-1 */
!       PC386_uart_init(PC386ConsolePort, 9600, 0);      
        
        /* Set interrupt handler */
        if(PC386ConsolePort == PC386_UART_COM1)
***************
*** 466,475 ****
                         (BSP_output_char_function_type) _IBMPC_outch;
  
  BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
- 
- void BSP_emergency_output_init()
- {
-   _IBMPC_initVideo();
- }
  
  
--- 462,466 ----
diff -c -r -N rtems-980824/c/src/lib/libbsp/i386/pc386/include/bsp.h rtems-980824.new/c/src/lib/libbsp/i386/pc386/include/bsp.h
*** rtems-980824/c/src/lib/libbsp/i386/pc386/include/bsp.h	Wed Aug  5 18:51:34 1998
--- rtems-980824.new/c/src/lib/libbsp/i386/pc386/include/bsp.h	Tue Sep  1 11:57:31 1998
***************
*** 161,166 ****
--- 161,167 ----
  void rtemsReboot(void);                  /* from 'exit.c'   */
  
  /* Definitions for PC386ConsolePort */
+ extern int PC386ConsolePort;
  #define PC386_CONSOLE_PORT_CONSOLE (-1)
  #define PC386_CONSOLE_PORT_COM1    (PC386_UART_COM1)
  #define PC386_CONSOLE_PORT_COM2    (PC386_UART_COM2)
diff -c -r -N rtems-980824/c/src/lib/libbsp/i386/pc386/startup/bspstart.c rtems-980824.new/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
*** rtems-980824/c/src/lib/libbsp/i386/pc386/startup/bspstart.c	Tue Sep  1 15:45:03 1998
--- rtems-980824.new/c/src/lib/libbsp/i386/pc386/startup/bspstart.c	Tue Sep  1 13:30:45 1998
***************
*** 38,49 ****
  #include <libcsupport.h>
  #include <rtems/libio.h>
  #include <libcpu/cpuModel.h>
  
  /*-------------------------------------------------------------------------+
  | Global Variables
  +--------------------------------------------------------------------------*/
  extern rtems_unsigned32 _end;         /* End of BSS. Defined in 'linkcmds'. */
- 
  /* 
   * Size of heap if it is 0 it will be dynamically defined by memory size, 
   * otherwise the value should be changed by binary patch 
--- 38,49 ----
  #include <libcsupport.h>
  #include <rtems/libio.h>
  #include <libcpu/cpuModel.h>
+ #include <pc386uart.h>
  
  /*-------------------------------------------------------------------------+
  | Global Variables
  +--------------------------------------------------------------------------*/
  extern rtems_unsigned32 _end;         /* End of BSS. Defined in 'linkcmds'. */
  /* 
   * Size of heap if it is 0 it will be dynamically defined by memory size, 
   * otherwise the value should be changed by binary patch 
***************
*** 149,154 ****
--- 149,155 ----
  {
    /* Initialize printk channel */
    _IBMPC_initVideo();
+ 
    rtemsFreeMemStart = (rtems_unsigned32)&_end + _stack_size;
                                      /* set the value of start of free memory. */
  
diff -c -r -N rtems-980824/c/src/lib/libcpu/i386/cpu.c rtems-980824.new/c/src/lib/libcpu/i386/cpu.c
*** rtems-980824/c/src/lib/libcpu/i386/cpu.c	Tue Sep  1 15:45:03 1998
--- rtems-980824.new/c/src/lib/libcpu/i386/cpu.c	Tue Sep  1 11:41:39 1998
***************
*** 47,53 ****
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  	
      /* Convert limit into number of entries */
!     limit = (limit + 1) >> 3;
  
      if(index >= limit) {
          return 0;
--- 47,53 ----
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  	
      /* Convert limit into number of entries */
!     limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
  
      if(index >= limit) {
          return 0;
***************
*** 68,74 ****
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) >> 3;
  
      if (irq->idtIndex >= limit) {
        return 0;
--- 68,74 ----
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
  
      if (irq->idtIndex >= limit) {
        return 0;
***************
*** 107,113 ****
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
      
      /* Convert limit into number of entries */
!     limit = (limit + 1) >> 3;
  
      if (vector >= limit) {
        return;
--- 107,113 ----
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
      
      /* Convert limit into number of entries */
!     limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
  
      if (vector >= limit) {
        return;
***************
*** 130,136 ****
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) >> 3;
  
      if (irq->idtIndex >= limit) {
        return 0;
--- 130,136 ----
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
  
      if (irq->idtIndex >= limit) {
        return 0;
***************
*** 151,157 ****
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) >> 3;
  
      if (irq->idtIndex >= limit) {
        return 0;
--- 151,157 ----
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
  
      if (irq->idtIndex >= limit) {
        return 0;
***************
*** 193,199 ****
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) >> 3;
        
      if (config->idtSize != limit) {
        return 0;
--- 193,199 ----
      i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
  
      /* Convert limit into number of entries */
!     limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
        
      if (config->idtSize != limit) {
        return 0;