[OpenBIOS] Found out why replacing '\r' with '\n' works

Segher Boessenkool segher at kernel.crashing.org
Tue Apr 19 08:39:39 CEST 2016


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 -
      (evaluate)
      i 1+
    then
  loop
  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.


Segher



More information about the OpenBIOS mailing list