summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-24 16:58:39 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-24 16:58:39 +0000
commit69036586b5807eaf78f2a9e123d88a54b2338a25 (patch)
tree76e0e53a6b7f6c04adad8cb9214fd3bf08cb190a /c
parentRegenerated (diff)
downloadrtems-69036586b5807eaf78f2a9e123d88a54b2338a25.tar.bz2
Patch from Eric Valette <valette@crf.canon.fr>:
Celso Labinaz <labinaz@tin.it> pointed to me thatthe console on serial line was not working. After spending quite a time to find the right cable and software, I confirm this. I'm going to debug this in the next days because I want to use the serial line for debugging. In the meantime, in order to be sure that this was a driver initialization/bug, I made printk work on the serial line in order to be sure the receiver part and configuration was OK. Here is the for printk on serial line. BTW, does anyone else use the serial line facilities for PC? printf seems to output nothing (hello.exe output everything that has a printk but application printf seems to be broken).
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/console.c79
1 files changed, 16 insertions, 63 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/console/console.c b/c/src/lib/libbsp/i386/pc386/console/console.c
index e57d077bcd..734c4b6efd 100644
--- a/c/src/lib/libbsp/i386/pc386/console/console.c
+++ b/c/src/lib/libbsp/i386/pc386/console/console.c
@@ -45,6 +45,7 @@
int PC386ConsolePort = PC386_CONSOLE_PORT_CONSOLE;
static int conSetAttr(int minor, const struct termios *);
+extern BSP_polling_getchar_function_type BSP_poll_char;
/*-------------------------------------------------------------------------+
| External Prototypes
@@ -76,9 +77,7 @@ void console_reserve_resources(rtems_configuration_table *conf)
void __assert(const char *file, int line, const char *msg)
{
- static char buf[20];
static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
- static char assert_msg[] = "assert failed: ";
unsigned char ch;
const unsigned char *cp;
@@ -87,66 +86,12 @@ void __assert(const char *file, int line, const char *msg)
* Note we cannot call exit or printf from here,
* assert can fail inside ISR too
*/
- if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
- {
- printk("\nassert failed: %s: ", file);
- printk("%d: ", line);
- printk("%s\n\n", msg);
- printk(exit_msg);
- while(!_IBMPC_scankey(&ch));
- printk("\n\n");
- }
- else
- {
- PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_DISABLE);
-
- PC386_uart_polled_write(PC386ConsolePort, '\r');
- PC386_uart_polled_write(PC386ConsolePort, '\n');
-
- for(cp=assert_msg; *cp!=0; cp++)
- {
- PC386_uart_polled_write(PC386ConsolePort, *cp);
- }
-
- for(cp=file; *cp!=0; cp++)
- {
- PC386_uart_polled_write(PC386ConsolePort, *cp);
- }
-
- PC386_uart_polled_write(PC386ConsolePort, ':');
- PC386_uart_polled_write(PC386ConsolePort, ' ');
-
- sprintf(buf, "%d: ", line);
-
- for(cp=buf; *cp!=0; cp++)
- {
- PC386_uart_polled_write(PC386ConsolePort, *cp);
- }
-
- for(cp=msg; *cp!=0; cp++)
- {
- PC386_uart_polled_write(PC386ConsolePort, *cp);
- }
-
- PC386_uart_polled_write(PC386ConsolePort, '\r');
- PC386_uart_polled_write(PC386ConsolePort, '\n');
- PC386_uart_polled_write(PC386ConsolePort, '\r');
- PC386_uart_polled_write(PC386ConsolePort, '\n');
-
- for(cp=exit_msg; *cp != 0; cp++)
- {
- PC386_uart_polled_write(PC386ConsolePort, *cp);
- }
-
- PC386_uart_polled_read(PC386ConsolePort);
-
- PC386_uart_polled_write(PC386ConsolePort, '\r');
- PC386_uart_polled_write(PC386ConsolePort, '\n');
- PC386_uart_polled_write(PC386ConsolePort, '\r');
- PC386_uart_polled_write(PC386ConsolePort, '\n');
-
- }
-
+ printk("\nassert failed: %s: ", file);
+ printk("%d: ", line);
+ printk("%s\n\n", msg);
+ printk(exit_msg);
+ ch = BSP_poll_char();
+ printk("\n\n");
rtemsReboot();
}
@@ -215,7 +160,12 @@ console_initialize(rtems_device_major_number major,
console_isr_data.hdl = PC386_uart_termios_isr_com2;
}
- status =pc386_install_rtems_irq_handler(&console_isr_data);
+ status = pc386_install_rtems_irq_handler(&console_isr_data);
+
+ if (!status){
+ printk("Error installing serial console interrupt handler!\n");
+ rtems_fatal_error_occurred(status);
+ }
/*
* Register the device
*/
@@ -234,6 +184,9 @@ console_initialize(rtems_device_major_number major,
{
printk("Initialized console on port COM2 9600-8-N-1\n\n");
}
+ printk("Warning : This will be the last message displayed on console\n");
+ BSP_output_char = (BSP_output_char_function_type) BSP_output_char_via_serial;
+ BSP_poll_char = (BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
}
#define DISPLAY_CPU_INFO
#ifdef DISPLAY_CPU_INFO