Commit Graph

30 Commits

Author SHA1 Message Date
Blue Swirl 79c428d127 sparc32: avoid runtime relocations
The Forth dictionary was relocated at run time, incurring also
a copy operation. The source dictionary remained in memory.
It was not possible to run forthstrap without any input files
besides the base dictionary.

Make forthstrap generate a hex dump which can be included in C,
but also contains relocations, so that relocations are performed
by the linker at compile time. Allow dictionary compilation
with no source files.

Don't allocate the dictionary dynamically; reduce ofmem supply
accordingly.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1015 f158a5a8-5612-0410-a976-696ce0be7e32
2011-01-30 13:07:31 +00:00
Blue Swirl bb888b04b4 Generate Makefile dependencies also from Forth files
Dependencies between Forth files were not detected, so
dictionaries were not regenerated automatically in some cases.

Introduce '-M' flag to forthstrap to dump dependency information
in Makefile compatible format, based on the Forth 'include'
directives.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1013 f158a5a8-5612-0410-a976-696ce0be7e32
2011-01-02 09:56:19 +00:00
Andreas Färber c3b33b6610 Introduce forth_init() for trampoline initialization
Use init_trampoline() for trampoline variable initialization.

Add calls to a new forth_init() function for each architecture
to invoke it. Idea courtesy of Blue.

This fixes ppc64 compilation by avoiding a casted self-reference.

v2:
* Share init_trampoline() with kernel/bootstrap.c, suggested by Mark.
* Adopt QEMU coding style for new functions.

Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Blue Swirl <blauwirbel@gmail.com>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@954 f158a5a8-5612-0410-a976-696ce0be7e32
2010-11-13 13:04:34 +00:00
Blue Swirl 8a01c240b8 bootstrap: avoid a warning from OpenBSD linker
Avoid this link time warning by using strdup():
host/kernel/bootstrap.o(.text+0x854): In function `fopen_include':
../kernel/bootstrap.c:479: warning: strcpy() is almost always misused, please use strlcpy()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@953 f158a5a8-5612-0410-a976-696ce0be7e32
2010-11-13 10:56:45 +00:00
Mark Cave-Ayland 34d5a76f7e Revert the parts of the last commit which changed the exception function to use an exception pointer as it isn't really
required. Update forthstrap to add a new -c option that when specified will direct the Forth kernel console output to a file 
and integrate this into the build system. By default, when a dictionary is built using a base dictionary then a new log file 
called <dict>-console.log will be generated to help debugging if the build fails.

Also update the exception handler in kernel/bootstrap.c so that it matches the entire range of error codes in 
forth/bootstrap/interpreter.fs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@706 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-25 21:14:00 +00:00
Mark Cave-Ayland a288b3044b Change the sysdebug exception() callback so that it is now a function pointer, rather than a function. This enables us to setup an appropriate exception handler
for the task in hand; in particular it allows us to distinguish between an error that occurs when attempting to execute a base dictionary, and an error that 
occurs when interpreting source.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@705 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-24 11:49:41 +00:00
Mark Cave-Ayland 5c73290696 Add source file and line number tracking to forthstrap to allow the user to locate forth errors much more easily. An example of the new output is given below:
build@zeno:~/src/openbios/openbios-devel.pre$ ./config/scripts/switch-arch cross-ppc; make
Configuring OpenBIOS on amd64 for cross-ppc
Initializing build tree obj-ppc...ok.
Creating target Makefile...ok.
Creating config files...ok.
Building OpenBIOS for ppc
Building...error:
 HOSTCC host/kernel/stack.o
 HOSTCC forthstrap
  GEN   bootstrap.dict
bootstrap.fs:339 - foo is not defined.



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@704 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-24 10:28:51 +00:00
Mark Cave-Ayland 1dbe55b8e4 Move the basic OpenBIOS configuration header files from include/openbios to include/.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@695 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 17:19:58 +00:00
Mark Cave-Ayland c112720b01 Move the kernel header files into include/kernel to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@689 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:21:02 +00:00
Stefan Reinauer 99f0be82ab Another nice patch from Mark Cave-Ayland:
This patch corrects a couple of (minor) bugs in the Forth source 
debugger; firstly the number of wordlists is held in #order, rather than 
#vocs which is the total number of wordlists which can be held 
simultaneously.

Secondly, the initial interruptforth setting in kernel/bootstrap.c is 
actually wrong, but since this is reset by enterforth() it is not needed 
anyway. Hence this line can simply be removed.



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@623 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-20 19:04:41 +00:00
Blue Swirl d6aac5ffe2 Reworked version of Forth Source debugger (Mark Cave-Ayland)
This patch implements the following Forth words:

   debug <xt> - Mark word for debugging
   debug-off  - Unmark all words for debugging
   resume     - Return from subordinate Forth interpreter

The source debugger also implements the following commands when it has
been activated:

   Up - Unmark current word for debugging, mark parent and continue
   Down - Mark next word for debugging
   Trace - Continue execution until end of word displaying
           debug information
   Rstack - Display contents of the Rstack
   Forth - Launch subordinate Forth interpreter

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@611 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-15 21:03:51 +00:00
Blue Swirl 9162f1b584 Introduce quiet build
Make forthstrap quiet by default. Use generic rules when possible, unify
the rules and cleanup white space. Use ld flag --whole-archive to avoid
some local rule use. We can also remove some hacks introduced to avoid
missing symbols.

Fix problems brought in by ld flag --whole-archive:
 * x86: fix missing nvram symbols
 * PPC: disable misc.S build for qemu (conflicts with our libgcc)

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@556 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-17 16:58:42 +00:00
Blue Swirl d4b64752eb Improve version number handling
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@533 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 18:20:53 +00:00
Blue Swirl f13e795c12 Implement /x FCode (Mark Cave-Ayland)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@495 f158a5a8-5612-0410-a976-696ce0be7e32
2009-05-23 15:31:31 +00:00
Blue Swirl aa0441b762 Fix gcc 4.3 warning
git-svn-id: svn://coreboot.org/openbios/openbios-devel@454 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-16 18:38:07 +00:00
Blue Swirl a4a1319305 Fix Sparc64 cross compilation in 32 bit environment, closes #17
git-svn-id: svn://coreboot.org/openbios/openbios-devel@436 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-31 16:42:01 +00:00
Blue Swirl c683b2e5bd Exit with nonzero status if there are errors
git-svn-id: svn://coreboot.org/openbios/openbios-devel@435 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-31 13:33:07 +00:00
Blue Swirl 3af23c3fdc Suppress OpenBSD linker warning
git-svn-id: svn://coreboot.org/openbios/openbios-devel@417 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-17 20:28:21 +00:00
Blue Swirl d7208a6daf Fix Sparse warnings
git-svn-id: svn://coreboot.org/openbios/openbios-devel@296 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-20 18:36:23 +00:00
Blue Swirl c5d270009e Warning fixes for Sparc32, Sparc64, PPC
Fix warnings that would be caused by gcc flag -Wwrite-strings and
-Wmissing-prototypes. Also fix most PPC specific warnings.


git-svn-id: svn://coreboot.org/openbios/openbios-devel@288 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-14 12:54:23 +00:00
Blue Swirl 58ca864765 Delete extra whitespace at the end of line, which annoys quilt
git-svn-id: svn://coreboot.org/openbios/openbios-devel@284 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-11 20:30:53 +00:00
Blue Swirl d4eec07d55 Fix some more warnings
git-svn-id: svn://coreboot.org/openbios/openbios-devel@275 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-30 13:42:11 +00:00
Blue Swirl f34790fc87 Fix some warnings
git-svn-id: svn://coreboot.org/openbios/openbios-devel@269 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-29 13:10:17 +00:00
Laurent Vivier 71033f7bb8 This patch allows me to compile openbios using the cross-pcc target
on amd64 host.

Signed-off-by: Laurent Vivier <Laurent@lvivier.info>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/openbios/openbios-devel@251 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-24 12:13:40 +00:00
Blue Swirl 7e8e34ae70 Fix compilation on OpenBSD: avoid accidental system include file use
git-svn-id: svn://coreboot.org/openbios/openbios-devel@246 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-08 09:10:52 +00:00
Blue Swirl c76de95466 Fix memory corruption problems reported by glibc
git-svn-id: svn://coreboot.org/openbios/openbios-devel@139 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-05 10:03:56 +00:00
Stefan Reinauer e492087dbe 64-bit fixes
General 64-bit fixes and a hack for x86 to Sparc64 crosscompiling problem,
where x86 misses 128-bit types.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@68 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-18 21:42:16 +00:00
Stefan Reinauer 172438f171 - update dates
- fix address output of ls


git-svn-id: svn://coreboot.org/openbios/openbios-devel@34 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-26 11:14:20 +00:00
Stefan Reinauer 790e50099c clean out some warnings.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@2 f158a5a8-5612-0410-a976-696ce0be7e32
2006-04-26 15:14:50 +00:00
Stefan Reinauer 5c9eb9b45b initial import of openbios--main--1.0--patch-26
git-svn-id: svn://coreboot.org/openbios/openbios-devel@1 f158a5a8-5612-0410-a976-696ce0be7e32
2006-04-26 15:08:19 +00:00