summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/startup
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-06-27 18:51:49 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-06-27 18:51:49 +0000
commit5d18fb057a9158336a79953b88d481c74c6eb0ae (patch)
tree5762f11ed095f1236aa83bf386637423afb7638c /c/src/lib/libbsp/i386/pc386/startup
parentMonstrous patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>. I have (diff)
downloadrtems-5d18fb057a9158336a79953b88d481c74c6eb0ae.tar.bz2
PC386 BSP enhancements from Aleksey Romanov (Quality Quorum
<qqi@world.std.com>). Unfortunately after merging these, the pc386 will not boot using grub for for. It still does not work using netboot for me. Here is his summary of changes: rtems/c/src/lib/libbsp/i386/pc386/Makefile.in Added support for new sub-directory rtems/c/src/lib/libbsp/i386/pc386/bsp_specs Made possible to build COFF image rtems/c/src/lib/libbsp/i386/pc386/console/console.c Added support for serial consoles, selectable by patching binary image, added __assert(), use _IBMPC_inch_sleep() instaed of _IMBPC_inch() rtems/c/src/lib/libbsp/i386/pc386/console/inch.c Added _IMBPC_inch_sleep() rtems/c/src/lib/libbsp/i386/pc386/console/outch.c Oops - just formatting rtems/c/src/lib/libbsp/i386/pc386/include/Makefile.in Added support for new files rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h Added support for new features rtems/c/src/lib/libbsp/i386/pc386/include/pc386uart.h New file: definitions for serial ports rtems/c/src/lib/libbsp/i386/pc386/include/pcibios.h New file: definitions for PCI BIOS rtems/c/src/lib/libbsp/i386/pc386/pc386dev/Makefile.in New file: makefile in new directory rtems/c/src/lib/libbsp/i386/pc386/pc386dev/i386-stub-glue.c New file: i386-stub interface rtems/c/src/lib/libbsp/i386/pc386/pc386dev/i386-stub.c New file: i386-stub itself rtems/c/src/lib/libbsp/i386/pc386/pc386dev/pc386uart.c New file: serial ports rtems/c/src/lib/libbsp/i386/pc386/pc386dev/pcibios.c New file: PCI BIOS support rtems/c/src/lib/libbsp/i386/pc386/start/start.s Commented out DEBUG_EARLY stuff, everything is working fine rtems/c/src/lib/libbsp/i386/pc386/start/start16.s Cleaned up rtems/c/src/lib/libbsp/i386/pc386/startup/bspstart.c Added call to console_resereve_resources rtems/c/src/lib/libbsp/i386/pc386/startup/exit.c Added support for serial console rtems/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s Fixed typo in comments rtems/c/src/lib/libbsp/i386/pc386/tools/Makefile.in Changed to reflect cnages in code rtems/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c Trivialized, problem - I do not know how to make patch remove obsolete files - there are a lot of them there rtems/c/src/lib/libbsp/i386/pc386/tools/binpatch.c New file: utility to do binary patches rtems/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in Added support for new directory rtems/make/custom/pc386.cfg Add COFF image building
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.