Commit Graph

106 Commits

Author SHA1 Message Date
Joel Sherrill
3b38683e92 Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
* Use $(PACKHEX) instead of $(PROJECT_TOOLS)/packhex
  * Set HAS_RDBG=no for ts_386ex otherwise building it will attempt to
    compile librdbg for pc386
1999-06-14 18:33:39 +00:00
Joel Sherrill
b290da4c0a Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
* RTEMS_CPU for score603e should be "powerpc" instead of "ppc" (Should
    not have any side-effects, because RTEMS_CPU in make/custom/*.cfg
    already is overridden in make/target.cfg.in)
  * Use $(PACKHEX) instead of $(PROJECT_TOOLS)/packhex
1999-06-14 18:33:38 +00:00
Joel Sherrill
ba46ffa616 This is a large patch from Eric Valette <valette@crf.canon.fr> that was
described in the message following this paragraph.  This patch also includes
a mcp750 BSP.

From valette@crf.canon.fr Mon Jun 14 10:03:08 1999
Date: Tue, 18 May 1999 01:30:14 +0200 (CEST)
From: VALETTE Eric <valette@crf.canon.fr>
To: joel@oarcorp.com
Cc: raguet@crf.canon.fr, rtems-snapshots@oarcorp.com, valette@crf.canon.fr
Subject: Questions/Suggestion regarding RTEMS PowerPC code (long)


Dear knowledgeable RTEMS powerpc users,

As some of you may know, I'm currently finalizing a port
of RTEMS on a MCP750 Motorola board. I have done most
of it but have some questions to ask before submitting
the port.

In order to understand some of the changes I have made
or would like to make, maybe it is worth describing the
MCP750 Motorola board.

the MCP750 is a COMPACT PCI powerpc board with :

	1) a MPC750 233 MHz processor,
	2) a raven bus bridge/PCI controller that
	implement an OPENPIC compliant interrupt controller,
	3) a VIA 82C586 PCI/ISA bridge that offers a PC
	compliant IO for keyboard, serial line, IDE, and
	the well known PC 8259 cascaded PIC interrupt
	architecture model,
	4) a DEC 21140 Ethernet controller,
	5) the PPCBUG Motorola firmware in flash,
	6) A DEC PCI bridge,

This architecture is common to most Motorola 60x/7xx
board except that :
	1) on VME board, the DEC PCI bridge is replaced by
	a VME chipset,
	2) the VIA 82C586 PCI/ISA bridge is replaced by
	another bridge that is almost fully compatible
	with the via bridge...

So the port should be a rather close basis for many
60x/7xx motorola board...

On this board, I already have ported Linux 2.2.3 and
use it both as a development and target board.

Now the questions/suggestions I have :

1)  EXCEPTION CODE
-------------------

As far as I know exceptions on PPC are handled like
interrupts. I dislike this very much as :

	a) Except for the decrementer exception (and
	maybe some other on mpc8xx), exceptions are
	not recoverable and the handler just need to print
	the full context and go to the firmware or debugger...
	b) The interrupt switch is only necessary for the
	decrementer and external interrupt (at least on
	6xx,7xx).
	c) The full context for exception is never saved and
	thus cannot be used by debugger... I do understand
	the most important for interrupts low level code
	is to save the minimal context enabling	to call C
	code for performance reasons. On non recoverable
	exception on the other hand, the most important is
	to save the maximum information concerning proc status
	in order to analyze the reason of the fault. At
	least we will need this in order to implement the
	port of RGDB on PPC

==> I wrote an API for connecting raw exceptions (and thus
raw interrupts) for mpc750. It should be valid for most
powerpc processors... I hope to find a way to make this coexist
with actual code layout. The code is actually located
in lib/libcpu/powerpc/mpc750 and is thus optional
(provided I write my own version of exec/score/cpu/powerpc/cpu.c ...)

See remark about files/directory layout organization in 4)

2) Current Implementation of ISR low level code
-----------------------------------------------

I do not understand why the MSR EE flags is cleared
again in exec/score/cpu/powerpc/irq_stubs.S

#if (PPC_USE_SPRG)
	mfmsr	r5
	mfspr   r6, sprg2
#else
        lwz	r6,msr_initial(r11)
	lis     r5,~PPC_MSR_DISABLE_MASK@ha
        ori     r5,r5,~PPC_MSR_DISABLE_MASK@l
	and	r6,r6,r5
	mfmsr	r5
#endif

Reading the doc, when a decrementer interrupt or an
external interrupt is active, the MSR EE flag is already
cleared. BTW if exception/interrupt could occur, it would
trash SRR0 and SRR1. In fact the code may be useful to set
MSR[RI] that re-enables exception processing. BTW I will need
to set other value in MSR to handle interrupts :

	a) I want the MSR[IR] and MSR[DR] to be set for
	performance reasons and also because I need DBAT
	support to have access to PCI memory space as the
	interrupt controller is in the PCI space.

Reading the code, I see others have the same kind of request :

/* SCE 980217
 *
 * We need address translation ON when we call our ISR routine

	mtmsr	r5

 */

This is just another prof that even the lowest level
IRQ code is fundamentally board dependent and
not simply processor dependent especially when
the processor use external interrupt controller
because it has a single interrupt request line...

Note that if you look at the PPC code high level interrupt
handling code, as the "set_vector" routine that really connects
the interrupt is in the BSP/startup/genpvec.c,
the fact that IRQ handling is BSP specific is DE-FACTO
acknowledged.

I know I have already expressed this and understand that this
would require some heavy change in the code but believe
me you will reach a point where you will not be able
to find a compatible while optimum implementation for low level
interrupt handling code...) In my case this is already true...

So please consider removing low level IRQ handling from
exec/score/cpu/* and only let there exception handling code...
Exceptions are usually only processor dependent and do
not depend on external hardware mechanism to be masked or
acknowledged or re-enabled (there are probably exception but ...)

I have already done this for pc386 bsp but need to make it again.
This time I will even propose an API.

3) R2/R13 manipulation for EABI implementation
----------------------------------------------

I do not understand the handling of r2 and r13 in the
EABI case. The specification for r2 says pointer to sdata2,
sbss2 section => constant. However I do not see -ffixed-r2
passed to any compilation system in make/custom/*
(for info linux does this on PPC).

So either this is a default compiler option when choosing
powerpc-rtems and thus we do not need to do anything with
this register as all the code is compiled with this compiler
and linked together OR this register may be used by rtems code
and then we do not need any special initialization or
handling.

The specification for r13 says pointer to the small data
area. r13 argumentation is the same except that as far
as I know the usage of the small data area requires
specific compiler support so that access to variables is
compiled via loading the LSB in a register and then
using r13 to get full address... It is like a small
memory model and it was present in IBM C compilers.

=> I propose to suppress any specific code for r2 and
r13 in the EABI case.

4) Code layout organization (yes again :-))
-------------------------------------------

I think there are a number of design flaws in the way
the code is for ppc organized and I will try to point them out.
I have been beaten by this again on this new port, and
was beaten last year while modifying code for pc386.

a) exec/score/cpu/* vs lib/libcpu/cpu/*.

I think that too many things are put in exec/score/cpu that
have nothing to do with RTEMS internals but are rather
related to CPU feature.

This include at least :

	a) registers access routine (e.g GET_MSR_Value),
	b) interrupt masking/unmasking routines,
	c) cache_mngt_routine,
	d) mmu_mngt_routine,
	e) Routines to connect the raw_exception, raw_interrupt
	handler,

b) lib/libcpu/cpu/powerpc/*

With a processor family as exuberant as the powerpc family,
and their well known subtle differences (604 vs 750) or
unfortunately majors (8xx vs 60x)  the directory structure
is fine (except maybe the names that are not homogeneous)

	powerpc

ppc421 mpc821 ...

I only needed to add mpc750. But the fact that libcpu.a was not
produced was a pain and the fact that this organization may
duplicates code is also problematic.

So, except if the support of automake provides a better solution
I would like to propose something like this :

		powerpc

mpc421 	mpc821	...	mpc750	shared wrapup

with the following rules :

	a) "shared" would act as a source container for sources that may
	be shared among processors. Needed files would be compiled inside
	the processor specific directory using the vpath Makefile
	mechanism. "shared" may also contain compilation code
	for routine that are really shared and not worth to inline...
	(did not found many things so far as registers access routine
	ARE WORTH INLINING)... In the case something is compiled there,
	it should create libcpushared.a

	b) layout under processor specific directory is free provided
	that
		1)the result of the compilation process exports :

		libcpu/powerpc/"PROC"/*.h in $(PROJECT_INCLUDE)/libcpu

		2) each processor specific directory creates
		a library called libcpuspecific.a
	Note that this organization enables to have a file that
	is nearly the same than in shared but that must differ
	because of processor differences...

	c) "wrapup" should create libcpu.a using libcpushared.a
	libcpuspecific.a and export it $(PROJECT_INCLUDE)/libcpu

The only thing I have no ideal solution is the way to put shared
definitions in "shared" and only processor specific definition
in "proc". To give a concrete example, most MSR bit definition
are shared among PPC processors and only some differs. if we create
a single msr.h in shared it will have ifdef. If in msr.h we
include libcpu/msr_c.h we will need to have it in each prowerpc
specific directory (even empty). Opinions are welcomed ...

Note that a similar mechanism exist in libbsp/i386 that also
contains a shared directory that is used by several bsp
like pc386 and i386ex and a similar wrapup mechanism...

NB: I have done this for mpc750 and other processors could just use
similar Makefiles...

c) The exec/score/cpu/powerpc directory layout.

I think the directory layout should be the same than the
libcpu/powerpc. As it is not, there are a lot of ifdefs
inside the code... And of course low level interrupt handling
code should be removed...

Besides that I do not understand why

	1) things are compiled in the wrap directory,
	2) some includes are moved to rtems/score,

I think the "preinstall" mechanism enables to put
everything in the current directory (or better in a per processor
directory),


5) Interrupt handling API
-------------------------

Again :-). But I think that using all the features the PIC
offers is a MUST for RT system. I already explained in the
prologue of this (long and probably boring) mail that the MCP750
boards offers an OPENPIC compliant architecture and that
the VIA 82586 PCI/ISA bridge offers a PC compatible IO and
PIC mapping. Here is a logical view of the RAVEN/VIA 82586
interrupt mapping :


---------    0  ------
| OPEN	| <-----|8259|
| PIC	|	|    |    2  ------
|(RAVEN)|	|    | <-----|8259|
|	|	|    |	     |    |   11
|	|	|    |	     |    | <----
|	|	|    |	     |    |
|	|	|    |	     |    |
---------       ------	     |    |
    ^			     ------
    |		VIA PCI/ISA bridge
    |  x
    -------- PCI interrupts

OPENPIC offers interrupt priorities among PCI interrupts
and interrupt selective masking. The 8259 offers the same kind
of feature. With actual powerpc interrupt code :

	1) there is no way to specify priorities among
	interrupts handler. This is REALLY a bad thing.
	For me it is as importnat as having priorities
	for threads...
	2) for my implementation, each ISR should
	contain the code that acknowledge the RAVEN
	and 8259 cascade, modify interrupt mask on both
	chips, and reenable interrupt at processor level,
	..., restore then on interrupt return,.... This code
	is actually similar to code located in some
	genpvec.c powerpc files,
	3) I must update _ISR_Nesting_level because
	irq.inl use it...
	4) the libchip code connects the ISR via set_vector
	but the libchip handler code does not contain any code to
	manipulate external interrupt controller hardware
	in order to acknoledge the interrupt or re-enable
	them (except for the target hardware of course)
	So this code is broken unless set_vector adds an
	additionnal prologue/epilogue before calling/returning
	from in order to acknoledge/mask the raven and the
	8259 PICS... => Anyway already EACH BSP MUST REWRITE
	PART OF INTERRUPT HANDLING CODE TO CORRECTLY IMPLEMENT
	SET_VECTOR.

I would rather offer an API similar to the one provided
in libbsp/i386/shared/irq/irq.h so that :

	1) Once the driver supplied methods is called the
	only things the ISR has to do is to worry about the
	external hardware that triggered the interrupt.
	Everything on openpic/VIA/processor would have been
	done by the low levels (same things as set-vector)
	2) The caller will need to supply the on/off/isOn
	routine that are fundamental to correctly implements
	debuggers/performance monitoring is a portable way
	3) A globally configurable interrupt priorities
	mechanism...

I have nothing against providing a compatible
set_vector just to make libchip happy but
as I have already explained in  other
mails (months ago), I really think that the ISR
connection should be handled by the BSP and that no
code containing irq connection should exist the
rtems generic layers... Thus I really dislike
libchip on this aspect because in a long term
it will force to adopt the less reach API
for interrupt handling that exists (set_vector).

Additional note : I think the _ISR_Is_in_progress()
inline routine should be :

	1) Put in a processor specific section,
	2) Should not rely on a global variable,

As :
	a) on symmetric MP, there is one interrupt level
	per CPU,
	b) On processor that have an ISP (e,g 68040),
	this variable is useless (MSR bit testing could
	be used)
	c) On PPC, instead of using the address of the
	variable via __CPU_IRQ_info.Nest_level a dedicated
	SPR could be used.

NOTE:	most of this is also true for _Thread_Dispatch_disable_level


END NOTE
--------

Please do not take what I said in the mail as a criticism for
anyone who submitted ppc code. Any code present helped me
a lot understanding PPC behavior. I just wanted by this
mail to :
	1) try to better understand the actual code,
	2) propose concrete ways of enhancing current code
	by providing an alternative implementation for MCP750. I
	will make my best effort to try to brake nothing but this
	is actually hard due to the file layout organisation.
	3) make understandable some changes I will probably make
	if joel let me do them :-)

Any comments/objections are welcomed as usual.



--
   __
  /  `                   	Eric Valette
 /--   __  o _.          	Canon CRF
(___, / (_(_(__         	Rue de la touche lambert
				35517 Cesson-Sevigne  Cedex
				FRANCE
Tel: +33 (0)2 99 87 68 91	Fax: +33 (0)2 99 84 11 30
E-mail: valette@crf.canon.fr
1999-06-14 16:51:13 +00:00
Joel Sherrill
9e7d42dd14 Added C++ linking rule from Rosimildo DaSilva <rdasilva@connecttel.com>. 1999-05-14 16:26:47 +00:00
Joel Sherrill
123d4b7dc1 Removed -fomit-frame-pointer from all i386 BSPs since it breaks C++
exceptions and makes debug stack traces impossible.
1999-05-14 14:34:39 +00:00
Joel Sherrill
16a384cfb1 New BSP from Tony R. Ambardar <tonya@ece.ubc.ca> from the
University of British Columbia.  The BSP is for:

    Yes, this is the "entry model" of a series of boards from Technologic
    Systems. Costs <$200 I believe. They have a WWW page at www.t-systems.com.
    I am letting them know about the availability of this BSP too.
1999-04-23 16:35:11 +00:00
Joel Sherrill
0213bcfc6a Turned on console interrupts. 1999-04-19 17:14:11 +00:00
Joel Sherrill
9572c41d09 Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
This is an attempt to work-around a couple of nasty bugs in librdbg's
Makefiles and configuration:

Configure and build RTEMS as below:
  configure --enable-networking --enable-rdbg --target=i386-rtems
  make RTEMS_BSP=i386ex

After a few minutes you will notice that building aborts in librdbg ....

Analysis:

  1) librdbg is tried to be built, though librdbg is not supported and the
     required directory hierarchy librdbg/i386/i386ex/  is not existant.

     The cause for this is incorrect setting of HAS_RDBG in most
     make/custom/*.cfg files (except pc386.cfg). At the moment all
     custom/*.cfg files (except pc386.cfg) in general are required to contain
     HAS_RDBG=no. However, having HAS_NETWORKING=no in most custom/*.cfg
     files and the toplevel configure script suppress building librdbg for
     all CPUs except of i386.

     => The i386ex BSP falls though this scheme and librdbg is tried to be
        build (CPU=i386 and HAS_NETWORKING=yes).

  2) The Makefile.ins below lib/librdbg in general support i386/pc386 only
     and are not capable to be used for multiple CPUs or BSPs (RPCGEN
     generates it's target and bsp-specific files into librdbg/, therefore no
     other CPU or BSP can ever be built afterwards). This problem is hidden
     until now, because only a single CPU/BSP pair (i386/pc386) is really
     supported.

  3) The Makefile.ins below lib/librdbg can delete source files due to
     improper handling of source files (make clean removes the *.x files in
     the source-tree when configuring inside of the source-tree).


The patch below tries to work-around these problems for the i386ex and
the pc386 BSPs. This work-around is rather fragile (it applies rpcgen
-D, I don't know how portable this is) and incomplete (all custom/*.cfg
except of pc386.cfg should contain HAS_RDBG=no), nevertheless it should
work.
1999-04-19 13:11:13 +00:00
Joel Sherrill
6e27f58885 Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
Installing of bsp_specs for aliased bsps is broken. Instead of installing
  RTEMS_BSP_FAMILY/bsp_specs, RTEMS_BSP/bsp_specs was tried to be installed.

  The patch below should fix this problem (tested with mips64orion p4600 and
  p4650).
1999-04-12 20:27:14 +00:00
Joel Sherrill
c9b07e92d1 Automake II patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
With my most recent automake patch (automake II) we could even simplify more
  files below make/, because the host-compiler related parts of those files
  aren't used anymore :-.

  Whatsoever, the patch below should fix this problem.

  Note: This is a mere bug fix, it doesn't move any of the variables involved
  to target.cfg nor does it try to eliminate any variable.
1999-03-24 22:49:17 +00:00
Joel Sherrill
da7a73e02a Enable building the network stack. 1999-03-23 23:05:32 +00:00
Joel Sherrill
dfe7746ed9 Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de> 1999-03-17 23:43:32 +00:00
Joel Sherrill
a902441a25 Patch from John S. Gwynne <jgwynne@mrcday.com> to correct minor
problems that prevented the 19990302 snapshot from running on
the efi332.

    I'm happy to report that rtems-19990302 is running on the efi332
    board. I have enclosed a few minor patches below to the efi332 bsp. All
    patches are within that library but one. make/custom/efi332.cfg has a
    patch to select the right CPU_CFLAGS (at one time -m68332 was a
    problem... -mcpu32 or -m68332 work fine now).
1999-03-16 02:26:50 +00:00
Joel Sherrill
54d3d1e155 Added $(CPPFLAGS) to all gcc 2.8 style make-exe rules. 1999-03-08 21:41:09 +00:00
Joel Sherrill
7d7b2a3d8d Patch from Charles Gauthier <Charles.Gauthier@@iit.nrc.ca> to address
FP issues on this target:

The default variants of libc, libm and libgcc assume that a 68881
coprocessor is present. Without the FPSP, any floating point operation,
including printf() with a "%f" format specifier, is likely to cause an
unimplemented instruction exception.

The FPSP works with the default variants of libc, libm and libgcc. It does not
work in conjunction with the msoft-float variants. The paranoia test goes into
an infinite loop at milestone 40. I am guessing that floor() is returning an
incorrect value.

The msoft-float variants of libc, libm and libgcc appear to do floating point
I/O properly. They only failed in paranoia. Offhand, I can't think of why they
would conflict with the FPSP, so I think that there is something wrong with the
msoft-float code. It might be my installation.

Given my experiences, I decided to install the FPSP in bsp_start(), and to link
against the default variants of libc, libm and libgcc. This causes the
executables to increase in size by about 60 KB. The README file and the
mvme167.cfg specify how to remove the FPSP, and how to link against the
msoft-float variants of the libraries. This is not what Eric Norum had done: on
my host, his gen68360_040 port links RTEMS code with the msoft-float variants
of libc and libm, and the default variant of libgcc. In this configuration, the
output of printf() with "%f" is garbage on my target.
1999-02-24 15:46:25 +00:00
Joel Sherrill
d6f2820063 Added $(LIB_VARIANT) to start16.bin. 1999-02-24 14:39:24 +00:00
Joel Sherrill
98e8c7f2a0 Corrected spacing. 1999-02-24 14:39:03 +00:00
Joel Sherrill
9c448e1db3 BSP for Vista Score603e added. 1999-02-19 00:22:33 +00:00
Joel Sherrill
5d024595a7 MVME167 BSP submitted by Charles Gauthier <Charles.Gauthier@iit.nrc.ca>. 1999-02-18 19:23:28 +00:00
Joel Sherrill
a110b68252 Part of automake VI patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
> 2) rtems-rc-19990131-1.diff
>
> Rework of compilers/*.cfg files (esp. gcc-target-default.cfg) to adapt
> the flags/makefile variables to automake and make standards (cf.
> make.info - implicit rules/variables).
>
> This patch is rather risky and may probably break things, but is an
> essential step towards automake.
>
> FWIW: It also reverts the i386-ASMFLAGS/ASFLAGS-patch, which was wrong,
> as I had to experience ;-.
1999-02-18 17:55:49 +00:00
Joel Sherrill
011677f8fc Part of automake VI Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
> Adds variables to the custom/*cfg files to specify the location of
> tools. The purpose is to remove hard-coded paths from the Makefiles.
>
> In later steps this eases moving the tools to other locations.
1999-02-18 17:54:03 +00:00
Joel Sherrill
0c04c377bc ./clock/Makefile.in,v
./clock/clock.c,v
./console/Makefile.in,v
./console/config.c,v
./console/console.c,v
./console/console.h,v
./console/debugio.c,v
./console/i8042.c,v
./console/i8042_p.h,v
./console/i8042vga.c,v
./console/i8042vga.h,v
./console/ns16550.c,v
./console/ns16550.h,v
./console/ns16550_p.h,v
./console/ns16550cfg.c,v
./console/ns16550cfg.h,v
./console/vga.c,v
./console/vga_p.h,v
./console/z85c30.c,v
./console/z85c30.h,v
./console/z85c30_p.h,v
./console/z85c30cfg.c,v
./console/z85c30cfg.h,v
./include/Makefile.in,v
./include/bsp.h,v
./include/chain.h,v
./include/coverhd.h,v
./include/extisrdrv.h,v
./include/nvram.h,v
./include/pci.h,v
./include/tod.h,v
./network/Makefile.in,v
./network/amd79c970.c,v
./network/amd79c970.h,v
./nvram/Makefile.in,v
./nvram/ds1385.h,v
./nvram/mk48t18.h,v
./nvram/nvram.c,v
./nvram/prepnvr.h,v
./nvram/stk11c68.h,v
./pci/Makefile.in,v
./pci/pci.c,v
./start/Makefile.in,v
./start/start.s,v
./startup/Makefile.in,v
./startup/bspclean.c,v
./startup/bspstart.c,v
./startup/bsptrap.s,v
./startup/device-tree,v
./startup/genpvec.c,v
./startup/linkcmds,v
./startup/rtems-ctor.cc,v
./startup/sbrk.c,v
./startup/setvec.c,v
./startup/spurious.c,v
./startup/swap.c,v
./timer/Makefile.in,v
./timer/timer.c,v
./tod/Makefile.in,v
./tod/cmos.h,v
./tod/tod.c,v
./universe/Makefile.in,v
./universe/universe.c,v
./vectors/Makefile.in,v
./vectors/README,v
./vectors/align_h.s,v
./vectors/vectors.s,v
./wrapup/Makefile.in,v
./Makefile.in,v
./README,v
./STATUS,v
./bsp_specs,v
1999-02-18 16:48:14 +00:00
Joel Sherrill
ee73396529 Jay Monkman <jmonkman@frasca.com> submitted the eth_comm BSP for a PPC860
based board.
1999-02-17 20:24:53 +00:00
Joel Sherrill
b5e4eb746e Commented out disable of building network code so it is built. You can
hack through some paths to check error checking paths without a network
driver.
1999-02-05 00:30:30 +00:00
Joel Sherrill
2caa006b35 Added instruction and data cache enable. 1999-02-05 00:29:47 +00:00
Joel Sherrill
6a14ae56a3 Added comments to indicate what options are required to take advantage
of removal of unused function code found in newer binutils/egcs
snapshots.  Early test with psim and hello.exe showed about a 13%
gain.
1999-01-19 20:24:56 +00:00
Joel Sherrill
4721cf1ecb Patch from Emmanuel Raguet <raguet@crf.canon.fr> to add remote debug server
and RPC support to RTEMS.  Thanks. :)  Email follows:

    Hello,

    For Xmas, here is the Remote Debugger on RTEMS !

    Here are 2 patches for the Remote Debugger on RTEMS for pc386 from Linux
    host :

     - one for RTEMS it self,
     - one for GDB-4.17.


    1/ RTEMS patch
    --------------

    This patch adds 2 libraries :
     - a simplified SUN RPC library
     - the Remote Debugger library

    The configuration command is the following :
    ../rtems4/configure --target=i386-rtemself --enable-rtemsbsp=pc386
    --enable-rdbg

    The SUN RPC library is built only if networking is set.
    The RDBG library is built if networking and enable-rdbg are set.

    The function used to initialize the debugger is :
            rtems_rdbg_initialize ();

    A special function has been created to force a task to be
    in a "debug" state : enterRdbg().
    The use of this function is not mandatory.



    2/ GDB-4.17 patch
    -----------------

    This patch create a new RTEMS target for GDB-4.17.

    The configuration command is the following :
    ./configure --enable-shared --target=i386RTEMS

    To connect to a target, use :
      target rtems [your_site_address]

    Then, attach the target using : attach 1

    And... Debug ;)

    You can obtain the original GDB-4.17 on
    ftp://ftp.debian.org/debian/dists/stable/main/source/devel/gdb_4.17.orig.tar.gz

    This has been tested from a Debian 2.0.1 linux host.
1998-12-03 23:54:14 +00:00
Joel Sherrill
97e2729d1a Added --disable-multiprocessing flag and modified a lot of files to make
it work.
1998-11-23 17:38:09 +00:00
Joel Sherrill
35e5ae647b Removed "HAS_NETWORKING=no". 1998-11-23 16:38:13 +00:00
Joel Sherrill
588b68976f Bug report from Peter Mueller <pmueller@decrc.abb.de>:
I use the m68k/efi332 BSP together with a home made board. After some
  time of debugging I found  that the m68020 CPU is used to build rtems.
  This is not correct, because the 68332 does not have some of the 68020
  features (no separate int stack ...). It is necessary to change this to
  mcpu32. After a clean/make everything works fine.
1998-11-19 21:57:39 +00:00
Joel Sherrill
692b9f7fdd Merged Vista SCORE603e, Radstone PPCn_60x, and DY-4 DMV177 BSPs along
with libchip.
1998-10-28 19:17:16 +00:00
Joel Sherrill
6e0721ad0e Patch from Erik Ivanenko <erik.ivanenko@utoronto.ca>:
Please find attached a new i386ex.cfg.  It has been altered to change
    the files that get generated with the .nxe extension to .coff.   This
    change is necessary to align the file names generated by "make-exe" to
    the those referred to in the GDB.HOWTO found in the
    i386/shared/comm directory.  It has been successfully tested on ticker (
    without GDB), and base_sp( with GDB ) .  I just set a breakpoint and
    continue...
1998-10-22 18:16:25 +00:00
Joel Sherrill
fae18771ec Removed unnecessary settings. 1998-10-15 19:19:35 +00:00
Joel Sherrill
714137ef7c Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de> to correct minor
cosmetic things.
1998-10-13 15:03:27 +00:00
Joel Sherrill
09213ec317 Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
As mentioned in other mails before, there is are minor inconsistencies in the
  posix custom/*cfg files.

    Linux-posix.cfg sets RTEMS_BSP=posix
    FreeBSD-posix.cfg sets RTEMS_BSP=posix
    Solaris-posix.cfg first sets RTEMS_BSP=posix, later it sets
       RTEMS_BSP=solaris2

    1. Setting RTEMS_BSP=posix is redunant to settings in default.cfg
    2. The solaris variant of setting RTEMS_BSP is merely non-functional.

    The patch attached to this mail should clean up this issue.

    The patch was tested by building the posix bsp under
    i686-pc-linux-glibc1/glibc2 and Solaris2.6 (I did not run any
    rtems program, however) The HPUX9 and FreeBSD configuration files
    were adapted in analogy to the solaris and linux configurations.
1998-10-05 13:53:16 +00:00
Joel Sherrill
e125ad3471 Switched from HAS_KA9Q=no to HAS_NETWORKING=no. 1998-10-01 18:48:43 +00:00
Joel Sherrill
a0b7a078db Patch from Eric Norum <eric@skatter.usask.ca>:
Here's a patch to get rid of the `#define RTEMS__mcpu32p__ 1' when
    gen68360.cfg is being used as a companion for gen68360_040.cfg.  The
    old version worked because of the order of the conditional tests in
    m68k.h (the check for __mc68040__ is before the test for
    RTEMS__mcpu32p__) , but I think it might have been a little confusing
    to others just getting started.
1998-10-01 18:38:53 +00:00
Joel Sherrill
be4284d0f2 BSP submitted by Thomas Doerfler <td@imd.m.isar.de>:
Finally I am through: I have found the last bugs that made RTEMS-
    4.0-beta3 start on my ppc403 board from ROM. So now the '403
    support is up to date again.

    Roughly I have added the following features:
        - support for the on-chip interrupt controller (in a separate module)
        - interrupt support for the console device
        - termios support for the console device

    ==============================================
    Since the BSP behaivour changed in some details (console no
    longer is polling, other memory layout etc) I have created a new
    BSP "helas403" rather than changing the "papyrus" BSP. The old
    "polled" console driver still sticks around in "console.c.polled"
    To get the BSP up and running, I had to create the new BSP files
    (derived from papyrus). Besides that, the following source areas
    have been changed:

    - c/src/lib/libcpu/powerpc/ppc403: changes to console driver, small
    changes to clock driver, new "ictrl" interrupt controller driver

    - c/src/exec/score/cpu/powerpc/ppc.h: some small changes
    (added ppc403 characteristics like a exception vector prefix
    register, some special register definitions). I am quite sure, they
    are compatible with the existing sources, although I did not check

    - c/src/exec/score/cpu/powerpc/cpu.c: There is one severe
    limitation in the exception entries: Due to the current code
    arrangement, the "branch absolute" to the ISR handler may only
    jump to the first 128MByte or the last 128MByte of the 4GByte
    address range. When the ppc403 is running out of ROM, the ROM
    functions are located in the last 128MByte (0xFFF00000 and up).
    These addresses were not handled correctly (sign reduced) in
    "install_raw_handler". The change I added should work on existing
    ppc BSPs aswell...

    - c/src/lib/libc/termios.c: During my tests, I added one change you
    sent me, so this patch will already be incorporated in the current
    source tree.

    There are some smaller changes, see the attached diff file.

    =========================================
    Concerning the GNU toolchain:

    I tried several tool chains. Finally I almost succeeded with

    egcs-1.0.3a with patch  egcs-1.0.3-rtems-diff-19980527

    I had to add the following lines to the egcs files. Without them
    configure complaint that the cross compiler could not generate
    executable output.
    - additional lines needed in egcs distribution in file
      gcc/config/rs6000/rtems.h:

    +++ lines start
    #undef STARTFILE_DEFAULT_SPEC
    #define STARTFILE_DEFAULT_SPEC "ecrti.o%s"

    #undef  ENDFILE_DEFAULT_SPEC
    #define ENDFILE_DEFAULT_SPEC "ecrtn.o%s"
    ++++ lines end

    As far as I have seen in the Changelog of egcs, you have recently
    sent two patches affecting the powerpc support, but they were
    added in the wrong order.... :-(

    egcs-19980628 with patch egcs-19980628-rtems-diff-19980707 does
    not work!

    I used binutils 2.9.1 with patch binutils-2.9.1-rtems-diff-19980515
     (binutils 2.8.1 does not work, internal error in gas)
    and newlib-1.8.0 with patch newlib-1.8.0-rtems-diff-19980707

    Finally I had to poke a line in the "bit" script, since, on my LINUX
    machine, the GNU make is only available as "make", not as
    "gmake"...

    For all the tools and newlib I selected configuration "powerpc-
    rtems".

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    td@imd.m.isar.de
1998-09-30 21:50:42 +00:00
Joel Sherrill
17408b901b Patch from Eric Norum <eric@skatter.USask.Ca>:
I found that my 68040/68360 test programs would not run even after
    I fixed the `wrong BSP' problem.

    It seems that there's a bug in the interrupt handling code for
    processors with hardware interrupt stacks (e.g. 68040).  The wrong
    status register was getting pushed on the stack for the `return
    from exception' to call _ISR__Dispatch.   This ended up making
    the context switch code run on the interrupt stack, so interrupt-driven
    context switches would always fail.

    I guess that no one has tried running any of the RTEMS-4.0 snapshots
    on a 68040 machine!

    Anyhow, here are the patches for
        1) gen68360.cfg   ---   to fix the `wrong-BSP' problem.
        2) m68k/cpu_asm.s ---   to fix the hardware interrupt stack problem.

    With these patches in place, the network demo programs run on my
    68040/68360 system.  The paranoia program runs with no failures,
    defects nor flaws.
1998-09-30 13:02:30 +00:00
Joel Sherrill
bfcf4cb3db Updates to tree to make it build with all desired changes and the conversion
of the SONIC driver to the new FreeBSD stack instead of KA9Q.
1998-09-11 23:35:09 +00:00
Joel Sherrill
cce81a748f A patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
Here is another patch to hopefully enhance rtems' configuration.

    Motivation: Try to support other c-compilers besides gcc (I tried to
    build rtems under Solaris using sun's WSPro c-compiler).

    Here is a couple of small patches concerning the host compiler
    configuration, which fix/work-around the worst problems when using sun's
    WSPro c-compiler.

    Changes:
        * Replaced make/compilers/gcc.cfg with make/compilers/gcc.cfg.in, ie.
          gcc.cfg is generated by configure now.
        * Removed a line containing a hard-coded "gcc" from gcc.cfg (BUG-fix).
        * Add -g to host compiler flags only if configure reported -g to work
        * Add -Wall to host compiler flags only if configure reported that the
          host compiler is gcc (WSPro's cc chokes on -Wall).
        * Some modifications to make/Makefile.in
        * Adapted make/custom/default.cfg to the new location of gcc.cfg

    BTW, gcc.cfg/gcc.cfg.in seems to be full of unused code (DEBUG-VARIANTS
    etc.) which deserves to be cleaned up, IMO.

    IMO, a similar patch should be applied to gcc-target-default.cfg
1998-08-21 17:43:22 +00:00
Joel Sherrill
28e7d7faed Patches from Eric Norum 1998-08-20 22:04:22 +00:00
Joel Sherrill
0280cb66f5 FreeBSD stack compiles for the first time (except libc/strsep.c) 1998-08-20 14:39:09 +00:00
Joel Sherrill
2d7d605fdf Patch from Aleksey <qqi@world.std.com>:
It fixes netboot build problem, KA9Q configuration
    for pc386, some compiler wardning, it also removed some stuff
    ifdef'ed with '#if 0'.
1998-08-19 14:41:23 +00:00
Joel Sherrill
b93a1ab9ff Cleaned up the ka9q definition. 1998-08-19 12:42:35 +00:00
Joel Sherrill
0e3c009625 changed load address 1998-08-05 15:44:09 +00:00
Joel Sherrill
032c100ec2 Added HAS_RTC and enabled KA9Q. 1998-07-30 15:56:59 +00:00
Joel Sherrill
db29826d0f Switching console interrupts on and off as we test. 1998-07-25 16:20:57 +00:00
Joel Sherrill
dbaf51a44b Patch from Emmanuel Raguet <raguet@crf.canon.fr>:
Here is a patch for KA9Q stack.

    This patch contains an Ethernet Driver for Western Digital,
    some fixes for the UDP and TCP protocols (for endian conversion)
    and some little programs which allow the test of UDP and TCP
    sockets via Ethernet.

    I have tested that on an Intel machine. If someone can test it
    on a big-endian machine, ...
1998-07-23 22:13:10 +00:00
Joel Sherrill
9305e52a18 Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
Changes to make/custom/gensh1.cfg. Needed for shgen support
1998-07-17 15:18:08 +00:00