summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/startup
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/startup')
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspstart.c2
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/exit.c49
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/ldsegs.s4
3 files changed, 48 insertions, 7 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
index d952457485..607e816d6d 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
@@ -126,6 +126,8 @@ void bsp_start( void )
BSP_Configuration.work_space_start = (void *)rtemsFreeMemStart;
rtemsFreeMemStart += BSP_Configuration.work_space_size;
+ console_reserve_resources(&BSP_Configuration);
+
/*
* The following information is very useful when debugging.
*/
diff --git a/c/src/lib/libbsp/i386/pc386/startup/exit.c b/c/src/lib/libbsp/i386/pc386/startup/exit.c
index 85b5282c36..328a0afa76 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/exit.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/exit.c
@@ -33,8 +33,14 @@
#include <stdio.h>
-
#include <bsp.h>
+#include <pc386uart.h>
+
+/*-------------------------------------------------------------------------+
+ | Which console is in use: either (-1) which means normal console or
+ | uart id if uart was used
+ +-------------------------------------------------------------------------*/
+extern int PC386ConsolePort;
/*-------------------------------------------------------------------------+
| External Prototypes
@@ -50,11 +56,44 @@ extern rtems_boolean _IBMPC_scankey(char *); /* defined in 'inch.c' */
+--------------------------------------------------------------------------*/
void _exit(int status)
{
- unsigned char ch;
- puts("\nEXECUTIVE SHUTDOWN! Any key to reboot...");
+ unsigned char ch, *cp;
+ static char line[]="EXECUTIVE SHUTDOWN! Any key to reboot...";
+
+ if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
+ {
- while(!_IBMPC_scankey(&ch))
- ;
+ printk("\n");
+ printk(line);
+ 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=line; *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');
+ }
rtemsReboot();
} /* _exit */
+
+
+
+
+
+
+
diff --git a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s
index a8eb935322..f2171575ce 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s
+++ b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s
@@ -66,10 +66,10 @@ SYM(delay):
| Function: _load_segments
| Description: Current environment is standard PC booted by grub.
| So, there is no value in saving current GDT and IDT
-| Settings we have to set it up ourseves. (Naturally
+| settings we have to set it up ourseves. (Naturally
| it will be not so in case we are booted by some
| boot monitor, however, then it will be different
-| BSP), After that we have to load board segment registers
+| BSP). After that we have to load board segment registers
| with apropriate values + reprogram PIC.
| Global Variables: None.
| Arguments: None.