aboutsummaryrefslogtreecommitdiff
path: root/forth/bootstrap
AgeCommit message (Collapse)AuthorFilesLines
2016-08-26bootstrap.fs: add 4+ word to bootstrap dictionaryMark Cave-Ayland1-0/+1
Old OS X bootloaders need this in order to execute without throwing an exception. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-07-17interpreter.fs: allow evaluate to split words on CR as well as LFCormac O'Brien1-1/+1
Otherwise the Forth intepreter fails due to lack of buffer space when trying to execute large boot scripts on platforms that use CR instead of LF for line endings (particularly MacOS 9). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Cormac O'Brien <cormac@c-obrien.org> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-07-17interpreter.fs: don't clobber stack across evaluate strings split on newlinesMark Cave-Ayland1-0/+2
When an evaluate string is split across a newline, the current string position is assumed to be the top-most item on the stack. However in the case of yaboot, items are left on the stack to be used by a subsequent line within the same evaluate statement and so subsequent lines are parsed incorrectly. Fix this by saving the current string position on the r-stack across calls to (evaluate) so the stack remains correct for subsequent lines. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2013-07-27bootstrap.fs: add debug-type and debug-cr wordsMark Cave-Ayland1-0/+2
These words always output to the debug (serial) port even if video mode is enabled. This makes debugging the video routines much easier when starting QEMU with the -serial stdio option. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1189 f158a5a8-5612-0410-a976-696ce0be7e32
2012-12-07Redefine "to" word in device.fs to allow the current package to be set like ↵Mark Cave-Ayland1-4/+8
a standard value. BootX appears to be able to want to change the current package phandle by executing Forth statements in the form "<value> to active-package". This won't work correctly in OpenBIOS, since changing packages requires calling the active-package! word to perform additional housekeeping such as changing wordlists. The proposed solution here is to redefine "to" at the end of device.fs so that if package support is included, we perform an additional check on the destination xt to see if it matches that of active-package. If it does, then we manually invoke the active-package! word to select the new package. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1077 f158a5a8-5612-0410-a976-696ce0be7e32
2012-11-23Implementation of Forth local variables for OpenBIOS.Mark Cave-Ayland1-0/+13
Some bootloaders, particularly OS X, execute Forth strings that make use of Forth local variables. This patch provides an implementation that allows OpenBIOS to execute such code. A couple of examples are included below: : diff.squares { A B -- A*A-B*B } A A * B B * - ; : myword { ; cat dog } 4 -> cat 5 -> dog cat \ cat's value pushed onto stack ( - cat) dog \ dog's value pushed onto stack (cat - cat dog ) + cr ." Total animals = " . cr ; Since the Forth locals stack and temporary dictionary take up extra space, the locals implementation is protected by a new CONFIG_LOCALS build variable. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1068 f158a5a8-5612-0410-a976-696ce0be7e32
2010-10-17Fix up the new 2>r, 2r> and 2r@ words.Mark Cave-Ayland1-3/+3
As pointed out by Tarl, since these are called as separate words (and not inline), we need to preserve the top-most R stack item as this is return address of the word itself. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@912 f158a5a8-5612-0410-a976-696ce0be7e32
2010-10-16Add Forth words 2>r, 2r> and 2r@ as described in the ANSI Forth core ↵Mark Cave-Ayland1-0/+11
extensions as they are required for OpenSolaris. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@911 f158a5a8-5612-0410-a976-696ce0be7e32
2010-10-03Implement the "to" Forth word for setting defers. This enables OpenSolaris ↵Mark Cave-Ayland1-0/+7
to execute "' kmem64-tte is va>tte-data" for setting the va>tte-data defer. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@878 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-28Fix up parse word so that it can correctly handle empty arguments and ↵Mark Cave-Ayland1-0/+5
(encode-bootpath) word so that it can handle optional arguments. With these fixes in place we can now switch the boot word to use (encode-bootpath) which means that the bootpath and bootarg properties are now set exactly the same when executing boot and/or load. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@803 f158a5a8-5612-0410-a976-696ce0be7e32
2010-04-30Move the temporary compilation buffer into dictionary space. This prevent ↵Mark Cave-Ayland1-1/+1
spurious dictionary overflow messages appearing due to setup-tmp-comp switching dictionaries to memory outside of the initial dictionary space. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@761 f158a5a8-5612-0410-a976-696ce0be7e32
2009-12-09Revert r638, apply previous patch to extend control flow stack items to 2 ↵Mark Cave-Ayland1-38/+57
data stack items, and fix the Fcode evaluator to use this new information to correctly resolve destination (b<mark) references. See the email archives for further discussion on why this is required. Hopefully this should finally resolve the Fcode backward branch problem; at least all previous incorrect resolutions now appear correct and the Fcode evaluator no longer crashes or gets stuck in a loop while attempting to boot Milax. git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@641 f158a5a8-5612-0410-a976-696ce0be7e32
2009-12-03Fix backwards Fcode branches (bbranch and b?branch). Mark Cave-Ayland1-0/+13
According to the specification, the destination for a backwards Fcode branch must be resolved from the bottom rather than the top of the cstack. The existing version of the code was simply doing a swap, and so nesting any branches within a backward branch would fail since the wrong destination would be resolved from the stack. This patch adds a new cstack-startdepth variable to keep track of the cstack base location within an execution context (setup-tmp-comp and execute-tmp-comp) and alters the backward branches to make use of it. With this patch in place, Milax under Qemu doesn't crash anymore but sits in an infinite loop reading sectors from the CDROM. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@638 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-17This patch replaces the string definitions in nvram.fs by the Stefan Reinauer1-8/+1
simpler version s" that does not contain a complex parser for " "(0a) type of strings. Also use handle-text in " instead of the hand crafted version. This fixes strings in "see". Signed-off-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@613 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-15Reworked version of Forth Source debugger (Mark Cave-Ayland)Blue Swirl1-1/+3
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-08-29Implement "$=" to compare two strings (needed by BootX)Laurent Vivier1-0/+14
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@572 f158a5a8-5612-0410-a976-696ce0be7e32
2009-07-12Minor tweaks to dump word output (Mark Cave-Ayland)Blue Swirl1-1/+2
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@511 f158a5a8-5612-0410-a976-696ce0be7e32
2009-06-06Don't add padding spaces when evaluating headerless words (Mark Cave-Ayland)Blue Swirl1-1/+8
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@502 f158a5a8-5612-0410-a976-696ce0be7e32
2009-05-24Fix b(case)...b(of)...b(endof)...b(endcase) (Mark Cave-Ayland)Blue Swirl1-3/+3
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@498 f158a5a8-5612-0410-a976-696ce0be7e32
2009-05-22forth: add more pocketsIgor Kovalenko1-3/+4
This changes pocket index calculation to support more than two pockets. As an example default number of pockets is set to 4. This should ease nesting more than two levels using pockets as temporary storage. Signed-off-by: Igor Kovalenko <igor.v.kovalenko@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@494 f158a5a8-5612-0410-a976-696ce0be7e32
2009-05-22Fix b(do) ... b(leaves) ... b(loop)/b(+loop) (Mark Cave-Ayland)Blue Swirl1-3/+3
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@492 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-13Remove unnecessary trailing newlinesBlue Swirl3-6/+0
git-svn-id: svn://coreboot.org/openbios/openbios-devel@285 f158a5a8-5612-0410-a976-696ce0be7e32
2008-08-30Fix pad alignmentBlue Swirl1-1/+1
git-svn-id: svn://coreboot.org/openbios/openbios-devel@231 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05small fixes/enhancements for solarisStefan Reinauer1-0/+1
git-svn-id: svn://coreboot.org/openbios/openbios-devel@43 f158a5a8-5612-0410-a976-696ce0be7e32
2006-04-26initial import of openbios--main--1.0--patch-26Stefan Reinauer7-0/+3071
git-svn-id: svn://coreboot.org/openbios/openbios-devel@1 f158a5a8-5612-0410-a976-696ce0be7e32