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
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
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
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
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
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
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
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
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
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
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
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