[OpenBIOS] Found out why replacing '\r' with '\n' works
mark.cave-ayland at ilande.co.uk
Tue Apr 19 09:32:59 CEST 2016
On 19/04/16 07:39, Segher Boessenkool wrote:
> On Tue, Apr 19, 2016 at 01:17:30AM -0400, Programmingkid wrote:
>> The executing one line at a time idea turned out to be a pretty good idea. That is enough to make Mac OS 9.2 boot. It is also entertaining to watch each executed line be printed to the terminal. Here is the patch:
> [ LONG LINES ]
> If you look at forth/bootstrap/interpreter.fs, you see EVAL already
> handles multiple lines, but only with unix line endings:
> : evaluate ( str len -- ?? )
> 2dup + -rot
> over + over do
> i c@ 0a = if
> i over -
> i 1+
> swap over - (evaluate)
> So, change that instead? Or rewrite it, it's yucky. Bonus points if
> you also handle 0d 0a and 0a 0d line endings.
... which is what the original patch was trying to do last year:
This works for OS X but causes yaboot to throw errors on the console.
I still feel we're lacking a good explanation as to why processing this
on a line-by-line basis makes a difference, and how the r-stack problem
is being mitigated in this case.
More information about the OpenBIOS