diff options
-rw-r--r-- | aclocal/canonicalize-tools.m4 | 4 | ||||
-rw-r--r-- | aclocal/prog-cc.m4 | 58 | ||||
-rw-r--r-- | aclocal/prog-cxx.m4 | 61 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/Makefile.in | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/outch.c | 388 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/include/Makefile.in | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/include/bsp.h | 35 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/start/start.s | 43 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/startup/exit.c | 7 | ||||
-rw-r--r-- | configure.in | 17 |
10 files changed, 265 insertions, 357 deletions
diff --git a/aclocal/canonicalize-tools.m4 b/aclocal/canonicalize-tools.m4 index a3825cb746..1689d315ca 100644 --- a/aclocal/canonicalize-tools.m4 +++ b/aclocal/canonicalize-tools.m4 @@ -21,10 +21,6 @@ fi dnl check whether the tools exist dnl FIXME: What shall be done if they don't exist? -dnl NOTE: CC_FOR_TARGET should always be valid at this point, -dnl cf. RTEMS_PROG_CC -AC_PATH_PROG(CC_FOR_TARGET,"$program_prefix"gcc,no) - dnl FIXME: This may fail if the compiler has not been recognized as gcc dnl and uses tools with different names AC_PATH_PROG(AR_FOR_TARGET,"$program_prefix"ar,no) diff --git a/aclocal/prog-cc.m4 b/aclocal/prog-cc.m4 index 7d8a286ec3..864a3c3e07 100644 --- a/aclocal/prog-cc.m4 +++ b/aclocal/prog-cc.m4 @@ -3,22 +3,29 @@ dnl $Id$ dnl dnl Check for target gcc dnl -dnl Adaptation of autoconf-2.12's AC_PROG_CC to rtems -dnl -dnl 98/02/10 Ralf Corsepius (corsepiu@faw.uni-ulm.de) -dnl +dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) +dnl Completely reworked AC_DEFUN(RTEMS_PROG_CC, [ AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_BEFORE([$0], [AC_PROG_CC])dnl -AC_CHECK_PROG(CC, gcc, gcc) -if test -z "$CC"; then - AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) - test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -fi +AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl + +dnl Only accept gcc and cc +dnl NOTE: This might be too restrictive for native compilation +AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) +test -z "$CC_FOR_TARGET" \ + && AC_MSG_ERROR([no acceptable cc found in \$PATH]) + +dnl backup +rtems_save_CC=$CC +rtems_save_CFLAGS=$CFLAGS + +dnl temporarily set CC +CC=$CC_FOR_TARGET -RTEMS_PROG_CC_WORKS +AC_PROG_CC_WORKS AC_PROG_CC_GNU if test $ac_cv_prog_gcc = yes; then @@ -42,34 +49,17 @@ else test "${CFLAGS+set}" = set || CFLAGS="-g" fi -CC_FOR_TARGET=$CC rtems_cv_prog_gcc=$ac_cv_prog_gcc rtems_cv_prog_cc_g=$ac_cv_prog_cc_g +rtems_cv_prog_cc_works=$ac_cv_prog_cc_works +rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross dnl restore initial values -unset CC +CC=$rtems_save_CC +CFLAGS=$rtems_save_CFLAGS + unset ac_cv_prog_gcc unset ac_cv_prog_cc_g -unset ac_cv_prog_CC -]) - - -dnl Almost identical to AC_PROG_CC_WORKS -dnl added malloc to program fragment, because rtems has its own malloc -dnl which is not available while bootstrapping rtems - -AC_DEFUN(RTEMS_PROG_CC_WORKS, -[AC_MSG_CHECKING([whether the target C compiler ($CC $CFLAGS $LDFLAGS) works]) -AC_LANG_SAVE -AC_LANG_C -AC_TRY_COMPILER( -[main(){return(0);}], -rtems_cv_prog_cc_works, rtems_cv_prog_cc_cross) -AC_LANG_RESTORE -AC_MSG_RESULT($rtems_cv_prog_cc_works) -if test $rtems_cv_prog_cc_works = no; then - AC_MSG_ERROR([installation or configuration problem: target C compiler cannot create executables.]) -fi -AC_MSG_CHECKING([whether the target C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler]) -AC_MSG_RESULT($rtems_cv_prog_cc_cross) +unset ac_cv_prog_cc_works +unset ac_cv_prog_cc_cross ]) diff --git a/aclocal/prog-cxx.m4 b/aclocal/prog-cxx.m4 index 740b91df08..5875692943 100644 --- a/aclocal/prog-cxx.m4 +++ b/aclocal/prog-cxx.m4 @@ -3,18 +3,29 @@ dnl $Id$ dnl dnl Check for target g++ dnl -dnl Adaptation of autoconf-2.12's AC_PROG_CXX to rtems -dnl -dnl 98/02/10 Ralf Corsepius (corsepiu@faw.uni-ulm.de) -dnl - +dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) +dnl Completely reworked + AC_DEFUN(RTEMS_PROG_CXX, [ AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl AC_BEFORE([$0], [AC_PROG_CXX])dnl -AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) +AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl + +dnl Only accept g++ and c++ +dnl NOTE: This might be too restrictive for native compilation +AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++) +test -z "$CXX_FOR_TARGET" \ + && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) -RTEMS_PROG_CXX_WORKS +dnl backup +rtems_save_CXX=$CXX +rtems_save_CXXFLAGS=$CXXFLAGS + +dnl temporarily set CXX +CXX=$CXX_FOR_TARGET + +AC_PROG_CXX_WORKS AC_PROG_CXX_GNU if test $ac_cv_prog_gxx = yes; then @@ -37,32 +48,18 @@ else GXX= test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" fi -CXX_FOR_TARGET=$CXX - -dnl restore initial values -unset CXX -unset ac_cv_prog_gxx -]) +rtems_cv_prog_gxx=$ac_cv_prog_gxx +rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g +rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works +rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross -dnl Almost identical to AC_PROG_CXX_WORKS -dnl Additional handling of malloc -dnl NOTE: using newlib with a native compiler is cross-compiling, indeed. -AC_DEFUN(RTEMS_PROG_CXX_WORKS, -[AC_MSG_CHECKING([whether the target C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) -AC_LANG_SAVE -AC_LANG_CPLUSPLUS +CXX=$rtems_save_CXX +CXXFLAGS=$rtems_save_CXXFLAGS -dnl this fails if rtems uses newlib, because rtems has its own malloc which -dnl is not available at bootstrap -AC_TRY_COMPILER( - [main(){return(0);}], - rtems_cv_prog_cxx_works, rtems_cv_prog_cxx_cross) -AC_LANG_RESTORE -AC_MSG_RESULT($rtems_cv_prog_cxx_works) -if test $rtems_cv_prog_cxx_works = no; then - AC_MSG_ERROR([installation or configuration problem: target C++ compiler cannot create executables.]) -fi -AC_MSG_CHECKING([whether the target C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler]) -AC_MSG_RESULT($rtems_cv_prog_cxx_cross) +dnl restore initial values +unset ac_cv_prog_gxx +unset ac_cv_prog_cc_g +unset ac_cv_prog_cxx_works +unset ac_cv_prog_cxx_cross ]) diff --git a/c/src/lib/libbsp/i386/pc386/console/Makefile.in b/c/src/lib/libbsp/i386/pc386/console/Makefile.in index 2d22757c7c..bcfd781dd9 100644 --- a/c/src/lib/libbsp/i386/pc386/console/Makefile.in +++ b/c/src/lib/libbsp/i386/pc386/console/Makefile.in @@ -17,8 +17,13 @@ C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) H_FILES= +# Assembly source names, if any, go here -- minus the .s +S_PIECES=videoAsm +S_FILES=$(S_PIECES:%=%.s) +S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) + SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) +OBJS=$(C_O_FILES) $(S_O_FILES) include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg include $(RTEMS_ROOT)/make/leaf.cfg diff --git a/c/src/lib/libbsp/i386/pc386/console/outch.c b/c/src/lib/libbsp/i386/pc386/console/outch.c index 6073ee4fb9..4b56bb7ca4 100644 --- a/c/src/lib/libbsp/i386/pc386/console/outch.c +++ b/c/src/lib/libbsp/i386/pc386/console/outch.c @@ -1,33 +1,28 @@ -/*-------------------------------------------------------------------------+ -| outch.c v1.1 - PC386 BSP - 1997/08/07 -+--------------------------------------------------------------------------+ -| (C) Copyright 1997 - -| - NavIST Group - Real-Time Distributed Systems and Industrial Automation -| -| http://pandora.ist.utl.pt -| -| Instituto Superior Tecnico * Lisboa * PORTUGAL -+--------------------------------------------------------------------------+ -| Disclaimer: -| -| This file is provided "AS IS" without warranty of any kind, either -| expressed or implied. -+--------------------------------------------------------------------------+ -| This code is based on: -| outch.c,v 1.4 1995/12/19 20:07:27 joel Exp - go32 BSP -| With the following copyright notice: -| ************************************************************************** -| * COPYRIGHT (c) 1989-1998. -| * On-Line Applications Research Corporation (OAR). -| * Copyright assigned to U.S. Government, 1994. -| * -| * The license and distribution terms for this file may be -| * found in found in the file LICENSE in this distribution or at -| * http://www.OARcorp.com/rtems/license.html. -| ************************************************************************** -| -| $Id$ -+--------------------------------------------------------------------------*/ +/* + * outch.c - This file contains code for displaying characters + * on the console uisng information that should be + * maintained by the BIOS in its data Area. + * + * Copyright (C) 1998 valette@crf.canon.fr + * + * Canon Centre Recherche France. + * + * This code is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This code is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this file; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ #include <bsp.h> @@ -35,227 +30,117 @@ #include <stdlib.h> #include <string.h> -/*-------------------------------------------------------------------------+ -| Constants -+--------------------------------------------------------------------------*/ -#define DISPLAY_CELL_COUNT (MAX_ROW * MAX_COL) - /* Number of display cells. */ -#define TABSIZE 4 /* Number of spaces for TAB (\t) char. */ -#define WHITE 0x0700 /* White on Black background colour. */ -#define BLANK (WHITE | ' ') /* Blank character. */ - - -/*-------------------------------------------------------------------------+ -| Global Variables -+--------------------------------------------------------------------------*/ -static rtems_unsigned16 *videoRam = TVRAM; - /* Physical address of start of video text memory. */ -static rtems_unsigned16 *videoRamPtr = TVRAM; - /* Pointer for current output position in display. */ -static rtems_unsigned8 videoRows = MAX_ROW; /* Number of rows in display. */ -static rtems_unsigned8 videoCols = MAX_COL; /* Number of columns in display. */ -static rtems_unsigned8 cursRow = 0; /* Current cursor row. */ -static rtems_unsigned8 cursCol = 0; /* Current cursor column. */ - +#include <crt.h> -/*-------------------------------------------------------------------------+ -| Function: setHardwareCursorPos -| Description: Set hardware video cursor at given offset into video RAM. -| Global Variables: None. -| Arguments: videoCursor - Offset into video memory. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static inline void -setHardwareCursorPos(rtems_unsigned16 videoCursor) -{ - outport_byte(GDC_REG_PORT, 0xe); - outport_byte(GDC_VAL_PORT, (videoCursor >> 8) & 0xff); - outport_byte(GDC_REG_PORT, 0xf); - outport_byte(GDC_VAL_PORT, videoCursor & 0xff); -} /* setHardwareCursorPos */ +extern void wr_cursor(int, unsigned short); +#define TAB_SPACE 4 +static unsigned short *bitMapBaseAddr; +static unsigned short ioCrtBaseAddr; +static unsigned short maxCol; +static unsigned short maxRow; +static unsigned char row; +static unsigned char column; +static unsigned short attribute; +static unsigned int nLines; -/*-------------------------------------------------------------------------+ -| Function: updateVideoRamPtr -| Description: Updates value of global variable "videoRamPtr" based on -| current window's cursor position. -| Global Variables: videoRamPtr, cursRow, cursCol. -| Arguments: None. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static inline void -updateVideoRamPtr(void) -{ - videoRamPtr = videoRam + cursRow * videoCols + cursCol; -} /* updateVideoRamPtr */ - - -/*-------------------------------------------------------------------------+ -| Function: scrollUp -| Description: Scrolls display up n lines. -| Global Variables: None. -| Arguments: lines - number of lines to scroll. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static void -scrollUp(rtems_unsigned8 lines) -{ - rtems_unsigned16 blankCount; - /* Number of blank display cells on bottom of window. */ - rtems_unsigned16 *ptrDst, *ptrSrc; - /* Source and destination pointers for memory copy operations. */ - - if (lines < videoRows) /* Move window's contents up. */ - { - rtems_unsigned16 nonBlankCount; - /* Number of non-blank cells on upper part of display (total - blank). */ - - blankCount = lines * videoCols; - nonBlankCount = DISPLAY_CELL_COUNT - blankCount; - ptrSrc = videoRam + blankCount; - ptrDst = videoRam; - - while(nonBlankCount--) - *ptrDst++ = *ptrSrc++; - } - else /* Clear the whole display. */ - { - blankCount = DISPLAY_CELL_COUNT; - ptrDst = videoRam; - } - - /* Fill bottom with blanks. */ - while (blankCount-- > 0) - *ptrDst++ = BLANK; -} /* scrollUp */ - - -/*-------------------------------------------------------------------------+ -| Function: printCHAR -| Description: Print printable character to display. -| Global Variables: videoRamPtr, cursRow, cursCol. -| Arguments: c - character to write to display. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static void -printCHAR(char c) + static void +scroll() { - *videoRamPtr++ = c | WHITE; - cursCol++; - if (cursCol == videoCols) - { - cursCol = 0; - cursRow++; - if (cursRow == videoRows) - { - cursRow--; - scrollUp(1); - videoRamPtr -= videoCols; + int i, j; /* Counters */ + unsigned short *pt_scroll, *pt_bitmap; /* Pointers on the bit-map */ + + pt_bitmap = bitMapBaseAddr; + j = 0; + pt_bitmap = pt_bitmap + j; + pt_scroll = pt_bitmap + maxCol; + for (i = j; i < (maxRow - 1) * maxCol; i++) { + *pt_bitmap++ = *pt_scroll++; } - } -} /* printCHAR */ - + + /* + * Blank characters are displayed on the last line. + */ + for (i = 0; i < maxCol; i++) { + *pt_bitmap++ = (short) (' ' | attribute); + } +} -/*-------------------------------------------------------------------------+ -| Function: printBS -| Description: Print BS (BackSpace - '\b') character to display. -| Global Variables: videoRamPtr, cursRow, cursCol. -| Arguments: None. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static inline void -printBS(void) + static void +endColumn() { - /* Move cursor back one cell. */ - if (cursCol > 0) - cursCol--; - else if (cursRow > 0) - { - cursRow--; - cursCol = videoCols - 1; - } - else - return; - - /* Write a whitespace. */ - *(--videoRamPtr) = BLANK; -} /* printBS */ - + if (++row == maxRow) { + scroll(); /* Scroll the screen now */ + row = maxRow - 1; + } + column = 0; + nLines++; + /* Move cursor on the next location */ + wr_cursor(row * maxCol + column, ioCrtBaseAddr); +} -/*-------------------------------------------------------------------------+ -| Function: printHT -| Description: Print HT (Horizontal Tab - '\t') character to display. -| Global Variables: cursCol. -| Arguments: None. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static inline void -printHT(void) -{ - do - printCHAR(' '); - while (cursCol % TABSIZE); -} /* printHT */ -/*-------------------------------------------------------------------------+ -| Function: printLF -| Description: Print LF (Line Feed - '\n') character to display. -| Global Variables: cursRow. -| Arguments: None. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static inline void -printLF(void) + static void +videoPutChar(char car) { - cursRow++; - if (cursRow == videoRows) - { - cursRow--; - scrollUp(1); - } - updateVideoRamPtr(); -} /* printLF */ - + unsigned short *pt_bitmap = bitMapBaseAddr + row * maxCol; + + switch (car) { + case '\b': { + if (column) column--; + /* Move cursor on the previous location */ + wr_cursor(row * maxCol + column, ioCrtBaseAddr); + return; + } + case '\t': { + int i; + + i = TAB_SPACE - (column & (TAB_SPACE - 1)); + pt_bitmap += column; + column += i; + if (column >= maxCol) { + endColumn(); + return; + } + while (i--) *pt_bitmap++ = ' ' | attribute; + wr_cursor(row * maxCol + column, ioCrtBaseAddr); + return; + } + case '\n': { + endColumn(); + return; + } + case 7: { /* Bell code must be inserted here */ + return; + } + case '\r' : { /* Already handled via \n */ + return; + } + default: { + pt_bitmap += column; + *pt_bitmap = car | attribute; + if (++column == maxCol) endColumn(); + else wr_cursor(row * maxCol + column, + ioCrtBaseAddr); + return; + } + } +} -/*-------------------------------------------------------------------------+ -| Function: printCR -| Description: Print CR (Carriage Return - '\r') to display. -| Global Variables: cursCol. -| Arguments: None. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static inline void -printCR(void) + void +clear_screen() { - cursCol = 0; - updateVideoRamPtr(); -} /* printCR */ - - -/*-------------------------------------------------------------------------+ -| Function: consPutc -| Description: Print a character to display at current position. -| Global Variables: videoRamPtr, videoRam. -| Arguments: c - character to write to display. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static void -consPutc(char c) -{ - switch (c) - { - case '\b': printBS(); break; - case '\t': printHT(); break; - case '\n': printLF(); break; - case '\r': printCR(); break; - default: printCHAR(c); break; - } /* switch */ - - setHardwareCursorPos(videoRamPtr - videoRam); - /* At current offset into videoRam */ -} /* consPutc */ + int i,j; + for (j = 0; j <= maxRow; j++) { + for (i = 0; i <= maxCol; i++) { + videoPutChar(' '); + } + } + column = 0; + row = 0; +} /*-------------------------------------------------------------------------+ | Function: _IBMPC_outch @@ -267,20 +152,41 @@ consPutc(char c) void _IBMPC_outch(char c) { - consPutc(c); + videoPutChar(c); } /* _IBMPC_outch */ /*-------------------------------------------------------------------------+ | Function: _IBMPC_initVideo | Description: Video system initialization. Hook for any early setup. -| Global Variables: videoRows. +| Global Variables: bitMapBaseAddr, ioCrtBaseAddr, maxCol, maxRow, row +| column, attribute, nLines; | Arguments: None. | Returns: Nothing. +--------------------------------------------------------------------------*/ void _IBMPC_initVideo(void) { - scrollUp(videoRows); /* Clear entire screen */ - setHardwareCursorPos(0); /* Cursor at upper left corner */ + unsigned char* pt = (unsigned char*) (VIDEO_MODE_ADDR); + + if (*pt == VGAMODE7) { + bitMapBaseAddr = (unsigned short*) V_MONO; + } + else { + bitMapBaseAddr = (unsigned short*) V_COLOR; + } + ioCrtBaseAddr = *(unsigned short*) DISPLAY_CRT_BASE_IO_ADDR; + maxCol = * (unsigned short*) NB_MAX_COL_ADDR; + maxRow = * (unsigned char*) NB_MAX_ROW_ADDR; + column = 0; + row = 0; + attribute = ((BLACK << 4) | WHITE)<<8; + nLines = 0; + clear_screen(); +#ifdef DEBUG_EARLY_STAGE + printk("bitMapBaseAddr = %X, display controller base IO = %X\n", + (unsigned) bitMapBaseAddr, + (unsigned) ioCrtBaseAddr); + videoPrintf("maxCol = %d, maxRow = %d\n", (unsigned) maxCol, (unsigned) maxRow); +#endif } /* _IBMPC_initVideo */ diff --git a/c/src/lib/libbsp/i386/pc386/include/Makefile.in b/c/src/lib/libbsp/i386/pc386/include/Makefile.in index 09228bd496..8f02fc9b25 100644 --- a/c/src/lib/libbsp/i386/pc386/include/Makefile.in +++ b/c/src/lib/libbsp/i386/pc386/include/Makefile.in @@ -8,7 +8,7 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ -H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/irq.h +H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/irq.h $(srcdir)/crt.h # # Equate files are for including from assembly preprocessed by diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h index 09758020a1..fc998144fc 100644 --- a/c/src/lib/libbsp/i386/pc386/include/bsp.h +++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h @@ -10,6 +10,14 @@ | | Instituto Superior Tecnico * Lisboa * PORTUGAL +--------------------------------------------------------------------------+ +| Modified by Eric Valette the 20/05/98 in order to add definitions used +| to enhance video putchar capabilities. +| +| Copyright (C) 1998 valette@crf.canon.fr +| +| Canon Centre Recherche France. +| ++--------------------------------------------------------------------------+ | Disclaimer: | | This file is provided "AS IS" without warranty of any kind, either @@ -57,32 +65,9 @@ extern "C" { /*-------------------------------------------------------------------------+ | Video (console) related constants. +--------------------------------------------------------------------------*/ -#define COLOUR 1 /* Assume colour console */ - -#if COLOUR - -# define GDC_REG_PORT 0x3D4 -# define GDC_VAL_PORT 0x3D5 -# define TVRAM ((rtems_unsigned16 *)0xB8000) - -#else - -# define GDC_REG_PORT 0x3B4 -# define GDC_VAL_PORT 0x3B5 -# define TVRAM ((rtems_unsigned16 *)0xB0000) - -#endif /* COLOUR */ - -/* Number of Video Lines & Columns */ - -#define MAX_COL 80 - -#ifdef RTEMS_VIDEO_80x50 -#define MAX_ROW 50 -#else -#define MAX_ROW 25 -#endif /* RTEMS_VIDEO_80x50 */ +#include <crt.h> + /*-------------------------------------------------------------------------+ | Constants relating to the 8254 (or 8253) programmable interval timers. +--------------------------------------------------------------------------*/ diff --git a/c/src/lib/libbsp/i386/pc386/start/start.s b/c/src/lib/libbsp/i386/pc386/start/start.s index 9501af12b8..3ed542c255 100644 --- a/c/src/lib/libbsp/i386/pc386/start/start.s +++ b/c/src/lib/libbsp/i386/pc386/start/start.s @@ -12,6 +12,11 @@ | | Instituto Superior Tecnico * Lisboa * PORTUGAL +--------------------------------------------------------------------------+ +| +| Modified the 20/05/1998 by valette@crf.canon.fr in order to give a working +| example of eraly stage debugging via the DEBUG_EARLY_START define. +| ++--------------------------------------------------------------------------+ | Disclaimer: | | This file is provided "AS IS" without warranty of any kind, either @@ -62,11 +67,39 @@ BEGIN_CODE EXTERN (boot_card) EXTERN (load_segments) EXTERN (exit) - + EXTERN (_IBMPC_initVideo) + EXTERN (debugPoolingGetChar) + +/* + * In case it crash on your machine and this is not due + * to video mode set by the loader, you may try to define + * the follwoing variable +#define DEBUG_EARLY_START + */ + SYM (start): nop cli # DISABLE INTERRUPTS!!! +#ifdef DEBUG_EARLY_START + cld + /* + * Must get video attribute to have a working printk. + * Note that the following code assume we already have + * valid segments and a stack. It should be true for + * any loader starting RTEMS in protected mode (or + * at least I hope so : -)). + */ + call _IBMPC_initVideo + /* + * try printk and a getchar in polling mode ASAP + */ + pushl $welcome_msg + call printk + addl $4, esp + + call debugPoolingGetChar +#endif /*----------------------------------------------------------------------------+ | Load the segment registers (this is done by the board's BSP) and perform any @@ -265,6 +298,14 @@ SYM (start_frame): SYM (stack_start): .long 0 +#ifdef DEBUG_EARLY_START + + PUBLIC (welcome_msg) +SYM (welcome_msg) : + .string "Ready to debug RTEMS ?\nEnter <CR>\n" + +#endif + END_DATA /*----------------------------------------------------------------------------+ diff --git a/c/src/lib/libbsp/i386/pc386/startup/exit.c b/c/src/lib/libbsp/i386/pc386/startup/exit.c index 4946e3451f..ca95371c26 100644 --- a/c/src/lib/libbsp/i386/pc386/startup/exit.c +++ b/c/src/lib/libbsp/i386/pc386/startup/exit.c @@ -39,15 +39,14 @@ /*-------------------------------------------------------------------------+ | External Prototypes +--------------------------------------------------------------------------*/ -extern rtems_boolean _IBMPC_scankey(char *); /* define in 'inch.c' */ - +extern rtems_boolean _IBMPC_scankey(char *); /* defined in 'inch.c' */ /*-------------------------------------------------------------------------+ | Function: rtemsReboot -| Description: Reboot the PC. +| Description: Reboot the PC. | Global Variables: None. | Arguments: None. -| Returns: Nothing. +| Returns: Nothing. +--------------------------------------------------------------------------*/ inline void rtemsReboot(void) { diff --git a/configure.in b/configure.in index 993479e61d..f8674f6e3f 100644 --- a/configure.in +++ b/configure.in @@ -165,18 +165,9 @@ else AC_MSG_ERROR(no) fi -dnl NOTE: host_os is automatically set by autoconf - -if [[ "${program_prefix}" = "NONE" ]] ; then - if [[ "${target}" = "${host}" ]] ; then - program_prefix= - else - program_prefix=${target}- - fi -fi +RTEMS_TOOL_PREFIX dnl check target cc -CC="$program_prefix"gcc RTEMS_PROG_CC dnl check if the compiler supports --specs RTEMS_GCC_SPECS @@ -190,25 +181,23 @@ if test "$RTEMS_USE_GCC272" != "yes" ; then RTEMS_USE_GCC272=yes fi fi +test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" dnl check for g++ if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then - CXX="$program_prefix"g++ RTEMS_PROG_CXX if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then AC_MSG_ERROR([***] [Inconsistency in compiler configuration:] [Target C compiler and Target C++ compiler] [must both ether be cross compilers or native compilers] - [Hint: LD_LIBRARY_PATH ?] ) + [Hint: If building a posix bsp: LD_LIBRARY_PATH?] ) fi - AC_PATH_PROG(CXX_FOR_TARGET,"$program_prefix"g++,no) else CXX_FOR_TARGET="no" fi RTEMS_CANONICALIZE_TOOLS -test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" dnl check host cc AC_PROG_CC |