forked from Imagelibrary/rtems
Patch from Ralf Corseipus to fix latent configure problems suddenly triggered:
The breakdown:
* CC_FOR_TARGET and CXX_FOR_TARGET were not correctly re-read
from autoconf's configuration cache (config.cache)
* If <target>-[gcc|g++] was not found while running configure,
the config macros tried to use other (wrong) compilers (e.g. cc).
Changes:
* New RTEMS_PROG_CC macro (aclocal/prog-cc.m4).
* New RTEMS_PROG_CXX macro (aclocal/prog-cxx.m4)
* Moved a shell script fragment from configure.in to a
new m4-autoconf macro (New file: aclocal/tool-prefix.m4)
* Minor changes to configure.in
I tested it with linux/posix (native gcc/primary libc) and
sh-rtems/gensh1 on a linux host and didn't notice any bugs
related to the problems mentioned above. There seem to be
more bugs with the posix bsp, but I consider them minor as
the build run completed successfully. It is just too late
for me to attempt to fix them now.
This commit is contained in:
@@ -21,10 +21,6 @@ fi
|
|||||||
dnl check whether the tools exist
|
dnl check whether the tools exist
|
||||||
dnl FIXME: What shall be done if they don't 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 FIXME: This may fail if the compiler has not been recognized as gcc
|
||||||
dnl and uses tools with different names
|
dnl and uses tools with different names
|
||||||
AC_PATH_PROG(AR_FOR_TARGET,"$program_prefix"ar,no)
|
AC_PATH_PROG(AR_FOR_TARGET,"$program_prefix"ar,no)
|
||||||
|
|||||||
@@ -3,22 +3,29 @@ dnl $Id$
|
|||||||
dnl
|
dnl
|
||||||
dnl Check for target gcc
|
dnl Check for target gcc
|
||||||
dnl
|
dnl
|
||||||
dnl Adaptation of autoconf-2.12's AC_PROG_CC to rtems
|
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||||
dnl
|
dnl Completely reworked
|
||||||
dnl 98/02/10 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
|
||||||
dnl
|
|
||||||
|
|
||||||
AC_DEFUN(RTEMS_PROG_CC,
|
AC_DEFUN(RTEMS_PROG_CC,
|
||||||
[
|
[
|
||||||
AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||||
AC_BEFORE([$0], [AC_PROG_CC])dnl
|
AC_BEFORE([$0], [AC_PROG_CC])dnl
|
||||||
AC_CHECK_PROG(CC, gcc, gcc)
|
AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
|
||||||
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
|
|
||||||
|
|
||||||
RTEMS_PROG_CC_WORKS
|
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
|
||||||
|
|
||||||
|
AC_PROG_CC_WORKS
|
||||||
AC_PROG_CC_GNU
|
AC_PROG_CC_GNU
|
||||||
|
|
||||||
if test $ac_cv_prog_gcc = yes; then
|
if test $ac_cv_prog_gcc = yes; then
|
||||||
@@ -42,34 +49,17 @@ else
|
|||||||
test "${CFLAGS+set}" = set || CFLAGS="-g"
|
test "${CFLAGS+set}" = set || CFLAGS="-g"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CC_FOR_TARGET=$CC
|
|
||||||
rtems_cv_prog_gcc=$ac_cv_prog_gcc
|
rtems_cv_prog_gcc=$ac_cv_prog_gcc
|
||||||
rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
|
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
|
dnl restore initial values
|
||||||
unset CC
|
CC=$rtems_save_CC
|
||||||
|
CFLAGS=$rtems_save_CFLAGS
|
||||||
|
|
||||||
unset ac_cv_prog_gcc
|
unset ac_cv_prog_gcc
|
||||||
unset ac_cv_prog_cc_g
|
unset ac_cv_prog_cc_g
|
||||||
unset ac_cv_prog_CC
|
unset ac_cv_prog_cc_works
|
||||||
])
|
unset ac_cv_prog_cc_cross
|
||||||
|
|
||||||
|
|
||||||
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)
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,18 +3,29 @@ dnl $Id$
|
|||||||
dnl
|
dnl
|
||||||
dnl Check for target g++
|
dnl Check for target g++
|
||||||
dnl
|
dnl
|
||||||
dnl Adaptation of autoconf-2.12's AC_PROG_CXX to rtems
|
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||||
dnl
|
dnl Completely reworked
|
||||||
dnl 98/02/10 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
|
||||||
dnl
|
|
||||||
|
|
||||||
AC_DEFUN(RTEMS_PROG_CXX,
|
AC_DEFUN(RTEMS_PROG_CXX,
|
||||||
[
|
[
|
||||||
AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
||||||
AC_BEFORE([$0], [AC_PROG_CXX])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
|
||||||
|
|
||||||
RTEMS_PROG_CXX_WORKS
|
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])
|
||||||
|
|
||||||
|
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
|
AC_PROG_CXX_GNU
|
||||||
|
|
||||||
if test $ac_cv_prog_gxx = yes; then
|
if test $ac_cv_prog_gxx = yes; then
|
||||||
@@ -37,32 +48,18 @@ else
|
|||||||
GXX=
|
GXX=
|
||||||
test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
|
test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
|
||||||
fi
|
fi
|
||||||
CXX_FOR_TARGET=$CXX
|
|
||||||
|
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
|
||||||
|
|
||||||
|
CXX=$rtems_save_CXX
|
||||||
|
CXXFLAGS=$rtems_save_CXXFLAGS
|
||||||
|
|
||||||
dnl restore initial values
|
dnl restore initial values
|
||||||
unset CXX
|
|
||||||
unset ac_cv_prog_gxx
|
unset ac_cv_prog_gxx
|
||||||
])
|
unset ac_cv_prog_cc_g
|
||||||
|
unset ac_cv_prog_cxx_works
|
||||||
|
unset 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
|
|
||||||
|
|
||||||
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)
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -17,8 +17,13 @@ C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
|||||||
|
|
||||||
H_FILES=
|
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)
|
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/custom/$(RTEMS_BSP).cfg
|
||||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||||
|
|||||||
@@ -1,33 +1,28 @@
|
|||||||
/*-------------------------------------------------------------------------+
|
/*
|
||||||
| outch.c v1.1 - PC386 BSP - 1997/08/07
|
* outch.c - This file contains code for displaying characters
|
||||||
+--------------------------------------------------------------------------+
|
* on the console uisng information that should be
|
||||||
| (C) Copyright 1997 -
|
* maintained by the BIOS in its data Area.
|
||||||
| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
|
*
|
||||||
|
|
* Copyright (C) 1998 valette@crf.canon.fr
|
||||||
| http://pandora.ist.utl.pt
|
*
|
||||||
|
|
* Canon Centre Recherche France.
|
||||||
| Instituto Superior Tecnico * Lisboa * PORTUGAL
|
*
|
||||||
+--------------------------------------------------------------------------+
|
* This code is free software; you can redistribute it and/or
|
||||||
| Disclaimer:
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
|
* License as published by the Free Software Foundation; either
|
||||||
| This file is provided "AS IS" without warranty of any kind, either
|
* version 2 of the License, or (at your option) any later version.
|
||||||
| expressed or implied.
|
*
|
||||||
+--------------------------------------------------------------------------+
|
* This code is distributed in the hope that it will be useful,
|
||||||
| This code is based on:
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
| outch.c,v 1.4 1995/12/19 20:07:27 joel Exp - go32 BSP
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
| With the following copyright notice:
|
* Library General Public License for more details.
|
||||||
| **************************************************************************
|
*
|
||||||
| * COPYRIGHT (c) 1989-1998.
|
* You should have received a copy of the GNU Library General Public
|
||||||
| * On-Line Applications Research Corporation (OAR).
|
* License along with this file; if not, write to the Free Software
|
||||||
| * Copyright assigned to U.S. Government, 1994.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
| *
|
*
|
||||||
| * The license and distribution terms for this file may be
|
* $Header$
|
||||||
| * found in found in the file LICENSE in this distribution or at
|
*/
|
||||||
| * http://www.OARcorp.com/rtems/license.html.
|
|
||||||
| **************************************************************************
|
|
||||||
|
|
|
||||||
| $Id$
|
|
||||||
+--------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
@@ -35,227 +30,117 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
#include <crt.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. */
|
|
||||||
|
|
||||||
|
extern void wr_cursor(int, unsigned short);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
#define TAB_SPACE 4
|
||||||
| Global Variables
|
static unsigned short *bitMapBaseAddr;
|
||||||
+--------------------------------------------------------------------------*/
|
static unsigned short ioCrtBaseAddr;
|
||||||
static rtems_unsigned16 *videoRam = TVRAM;
|
static unsigned short maxCol;
|
||||||
/* Physical address of start of video text memory. */
|
static unsigned short maxRow;
|
||||||
static rtems_unsigned16 *videoRamPtr = TVRAM;
|
static unsigned char row;
|
||||||
/* Pointer for current output position in display. */
|
static unsigned char column;
|
||||||
static rtems_unsigned8 videoRows = MAX_ROW; /* Number of rows in display. */
|
static unsigned short attribute;
|
||||||
static rtems_unsigned8 videoCols = MAX_COL; /* Number of columns in display. */
|
static unsigned int nLines;
|
||||||
static rtems_unsigned8 cursRow = 0; /* Current cursor row. */
|
|
||||||
static rtems_unsigned8 cursCol = 0; /* Current cursor column. */
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
|
||||||
| 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 */
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
|
||||||
| 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
|
static void
|
||||||
scrollUp(rtems_unsigned8 lines)
|
scroll()
|
||||||
{
|
{
|
||||||
rtems_unsigned16 blankCount;
|
int i, j; /* Counters */
|
||||||
/* Number of blank display cells on bottom of window. */
|
unsigned short *pt_scroll, *pt_bitmap; /* Pointers on the bit-map */
|
||||||
rtems_unsigned16 *ptrDst, *ptrSrc;
|
|
||||||
/* Source and destination pointers for memory copy operations. */
|
|
||||||
|
|
||||||
if (lines < videoRows) /* Move window's contents up. */
|
pt_bitmap = bitMapBaseAddr;
|
||||||
{
|
j = 0;
|
||||||
rtems_unsigned16 nonBlankCount;
|
pt_bitmap = pt_bitmap + j;
|
||||||
/* Number of non-blank cells on upper part of display (total - blank). */
|
pt_scroll = pt_bitmap + maxCol;
|
||||||
|
for (i = j; i < (maxRow - 1) * maxCol; i++) {
|
||||||
blankCount = lines * videoCols;
|
*pt_bitmap++ = *pt_scroll++;
|
||||||
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)
|
* Blank characters are displayed on the last line.
|
||||||
*ptrDst++ = BLANK;
|
*/
|
||||||
} /* scrollUp */
|
for (i = 0; i < maxCol; i++) {
|
||||||
|
*pt_bitmap++ = (short) (' ' | attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
|
||||||
| Function: printCHAR
|
|
||||||
| Description: Print printable character to display.
|
|
||||||
| Global Variables: videoRamPtr, cursRow, cursCol.
|
|
||||||
| Arguments: c - character to write to display.
|
|
||||||
| Returns: Nothing.
|
|
||||||
+--------------------------------------------------------------------------*/
|
|
||||||
static void
|
static void
|
||||||
printCHAR(char c)
|
endColumn()
|
||||||
{
|
{
|
||||||
*videoRamPtr++ = c | WHITE;
|
if (++row == maxRow) {
|
||||||
cursCol++;
|
scroll(); /* Scroll the screen now */
|
||||||
if (cursCol == videoCols)
|
row = maxRow - 1;
|
||||||
{
|
|
||||||
cursCol = 0;
|
|
||||||
cursRow++;
|
|
||||||
if (cursRow == videoRows)
|
|
||||||
{
|
|
||||||
cursRow--;
|
|
||||||
scrollUp(1);
|
|
||||||
videoRamPtr -= videoCols;
|
|
||||||
}
|
}
|
||||||
|
column = 0;
|
||||||
|
nLines++;
|
||||||
|
/* Move cursor on the next location */
|
||||||
|
wr_cursor(row * maxCol + column, ioCrtBaseAddr);
|
||||||
}
|
}
|
||||||
} /* printCHAR */
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
|
||||||
| Function: printBS
|
static void
|
||||||
| Description: Print BS (BackSpace - '\b') character to display.
|
videoPutChar(char car)
|
||||||
| Global Variables: videoRamPtr, cursRow, cursCol.
|
|
||||||
| Arguments: None.
|
|
||||||
| Returns: Nothing.
|
|
||||||
+--------------------------------------------------------------------------*/
|
|
||||||
static inline void
|
|
||||||
printBS(void)
|
|
||||||
{
|
{
|
||||||
/* Move cursor back one cell. */
|
unsigned short *pt_bitmap = bitMapBaseAddr + row * maxCol;
|
||||||
if (cursCol > 0)
|
|
||||||
cursCol--;
|
switch (car) {
|
||||||
else if (cursRow > 0)
|
case '\b': {
|
||||||
{
|
if (column) column--;
|
||||||
cursRow--;
|
/* Move cursor on the previous location */
|
||||||
cursCol = videoCols - 1;
|
wr_cursor(row * maxCol + column, ioCrtBaseAddr);
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Write a whitespace. */
|
|
||||||
*(--videoRamPtr) = BLANK;
|
|
||||||
} /* printBS */
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
|
||||||
| 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)
|
|
||||||
{
|
|
||||||
cursRow++;
|
|
||||||
if (cursRow == videoRows)
|
|
||||||
{
|
|
||||||
cursRow--;
|
|
||||||
scrollUp(1);
|
|
||||||
}
|
}
|
||||||
updateVideoRamPtr();
|
case '\t': {
|
||||||
} /* printLF */
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
void
|
||||||
| Function: printCR
|
clear_screen()
|
||||||
| Description: Print CR (Carriage Return - '\r') to display.
|
|
||||||
| Global Variables: cursCol.
|
|
||||||
| Arguments: None.
|
|
||||||
| Returns: Nothing.
|
|
||||||
+--------------------------------------------------------------------------*/
|
|
||||||
static inline void
|
|
||||||
printCR(void)
|
|
||||||
{
|
{
|
||||||
cursCol = 0;
|
int i,j;
|
||||||
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 */
|
|
||||||
|
|
||||||
|
for (j = 0; j <= maxRow; j++) {
|
||||||
|
for (i = 0; i <= maxCol; i++) {
|
||||||
|
videoPutChar(' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
column = 0;
|
||||||
|
row = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
| Function: _IBMPC_outch
|
| Function: _IBMPC_outch
|
||||||
@@ -267,20 +152,41 @@ consPutc(char c)
|
|||||||
void
|
void
|
||||||
_IBMPC_outch(char c)
|
_IBMPC_outch(char c)
|
||||||
{
|
{
|
||||||
consPutc(c);
|
videoPutChar(c);
|
||||||
} /* _IBMPC_outch */
|
} /* _IBMPC_outch */
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
| Function: _IBMPC_initVideo
|
| Function: _IBMPC_initVideo
|
||||||
| Description: Video system initialization. Hook for any early setup.
|
| Description: Video system initialization. Hook for any early setup.
|
||||||
| Global Variables: videoRows.
|
| Global Variables: bitMapBaseAddr, ioCrtBaseAddr, maxCol, maxRow, row
|
||||||
|
| column, attribute, nLines;
|
||||||
| Arguments: None.
|
| Arguments: None.
|
||||||
| Returns: Nothing.
|
| Returns: Nothing.
|
||||||
+--------------------------------------------------------------------------*/
|
+--------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
_IBMPC_initVideo(void)
|
_IBMPC_initVideo(void)
|
||||||
{
|
{
|
||||||
scrollUp(videoRows); /* Clear entire screen */
|
unsigned char* pt = (unsigned char*) (VIDEO_MODE_ADDR);
|
||||||
setHardwareCursorPos(0); /* Cursor at upper left corner */
|
|
||||||
|
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 */
|
} /* _IBMPC_initVideo */
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ VPATH = @srcdir@
|
|||||||
RTEMS_ROOT = @top_srcdir@
|
RTEMS_ROOT = @top_srcdir@
|
||||||
PROJECT_ROOT = @PROJECT_ROOT@
|
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
|
# Equate files are for including from assembly preprocessed by
|
||||||
|
|||||||
@@ -10,6 +10,14 @@
|
|||||||
|
|
|
|
||||||
| Instituto Superior Tecnico * Lisboa * PORTUGAL
|
| 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:
|
| Disclaimer:
|
||||||
|
|
|
|
||||||
| This file is provided "AS IS" without warranty of any kind, either
|
| This file is provided "AS IS" without warranty of any kind, either
|
||||||
@@ -57,31 +65,8 @@ extern "C" {
|
|||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
| Video (console) related constants.
|
| Video (console) related constants.
|
||||||
+--------------------------------------------------------------------------*/
|
+--------------------------------------------------------------------------*/
|
||||||
#define COLOUR 1 /* Assume colour console */
|
|
||||||
|
|
||||||
#if COLOUR
|
#include <crt.h>
|
||||||
|
|
||||||
# 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 */
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
| Constants relating to the 8254 (or 8253) programmable interval timers.
|
| Constants relating to the 8254 (or 8253) programmable interval timers.
|
||||||
|
|||||||
@@ -12,6 +12,11 @@
|
|||||||
|
|
|
|
||||||
| Instituto Superior Tecnico * Lisboa * PORTUGAL
|
| 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:
|
| Disclaimer:
|
||||||
|
|
|
|
||||||
| This file is provided "AS IS" without warranty of any kind, either
|
| This file is provided "AS IS" without warranty of any kind, either
|
||||||
@@ -62,11 +67,39 @@ BEGIN_CODE
|
|||||||
EXTERN (boot_card)
|
EXTERN (boot_card)
|
||||||
EXTERN (load_segments)
|
EXTERN (load_segments)
|
||||||
EXTERN (exit)
|
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):
|
SYM (start):
|
||||||
|
|
||||||
nop
|
nop
|
||||||
cli # DISABLE INTERRUPTS!!!
|
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
|
| 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):
|
SYM (stack_start):
|
||||||
.long 0
|
.long 0
|
||||||
|
|
||||||
|
#ifdef DEBUG_EARLY_START
|
||||||
|
|
||||||
|
PUBLIC (welcome_msg)
|
||||||
|
SYM (welcome_msg) :
|
||||||
|
.string "Ready to debug RTEMS ?\nEnter <CR>\n"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
END_DATA
|
END_DATA
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------+
|
/*----------------------------------------------------------------------------+
|
||||||
|
|||||||
@@ -39,8 +39,7 @@
|
|||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
| External Prototypes
|
| External Prototypes
|
||||||
+--------------------------------------------------------------------------*/
|
+--------------------------------------------------------------------------*/
|
||||||
extern rtems_boolean _IBMPC_scankey(char *); /* define in 'inch.c' */
|
extern rtems_boolean _IBMPC_scankey(char *); /* defined in 'inch.c' */
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
| Function: rtemsReboot
|
| Function: rtemsReboot
|
||||||
|
|||||||
17
configure.in
17
configure.in
@@ -165,18 +165,9 @@ else
|
|||||||
AC_MSG_ERROR(no)
|
AC_MSG_ERROR(no)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl NOTE: host_os is automatically set by autoconf
|
RTEMS_TOOL_PREFIX
|
||||||
|
|
||||||
if [[ "${program_prefix}" = "NONE" ]] ; then
|
|
||||||
if [[ "${target}" = "${host}" ]] ; then
|
|
||||||
program_prefix=
|
|
||||||
else
|
|
||||||
program_prefix=${target}-
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl check target cc
|
dnl check target cc
|
||||||
CC="$program_prefix"gcc
|
|
||||||
RTEMS_PROG_CC
|
RTEMS_PROG_CC
|
||||||
dnl check if the compiler supports --specs
|
dnl check if the compiler supports --specs
|
||||||
RTEMS_GCC_SPECS
|
RTEMS_GCC_SPECS
|
||||||
@@ -190,25 +181,23 @@ if test "$RTEMS_USE_GCC272" != "yes" ; then
|
|||||||
RTEMS_USE_GCC272=yes
|
RTEMS_USE_GCC272=yes
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
|
||||||
|
|
||||||
dnl check for g++
|
dnl check for g++
|
||||||
if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
|
if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
|
||||||
CXX="$program_prefix"g++
|
|
||||||
RTEMS_PROG_CXX
|
RTEMS_PROG_CXX
|
||||||
if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
|
if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
|
||||||
AC_MSG_ERROR([***]
|
AC_MSG_ERROR([***]
|
||||||
[Inconsistency in compiler configuration:]
|
[Inconsistency in compiler configuration:]
|
||||||
[Target C compiler and Target C++ compiler]
|
[Target C compiler and Target C++ compiler]
|
||||||
[must both ether be cross compilers or native compilers]
|
[must both ether be cross compilers or native compilers]
|
||||||
[Hint: LD_LIBRARY_PATH ?] )
|
[Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
|
||||||
fi
|
fi
|
||||||
AC_PATH_PROG(CXX_FOR_TARGET,"$program_prefix"g++,no)
|
|
||||||
else
|
else
|
||||||
CXX_FOR_TARGET="no"
|
CXX_FOR_TARGET="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RTEMS_CANONICALIZE_TOOLS
|
RTEMS_CANONICALIZE_TOOLS
|
||||||
test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
|
|
||||||
|
|
||||||
dnl check host cc
|
dnl check host cc
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|||||||
Reference in New Issue
Block a user