[OpenBIOS] ping [PATCH] bootinfo_load.c: Translate \r to \n for Mac OS 9 compatibility

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Fri Apr 15 12:45:42 CEST 2016


On 14/04/16 23:55, Programmingkid wrote:

> Mac OS 9's bootscript uses '\r' a lot. These interfere with how
> OpenBIOS functions. So the solution is to translate them to '\n'
> characters. This will allow Mac OS 9 to boot.
> 
> Signed-off-by: John Arbuckle <programmingkidx at gmail.com>
> 
> These are the operating systems I used to test my patch.
> - Mac OS 10.4.0
> - Mac OS 9.2
> - Fedora Linux 17
> - Debian Linux 5
> 
> No regressions have been detected.
> 
> 
> Index: libopenbios/bootinfo_load.c
> ===================================================================
> --- libopenbios/bootinfo_load.c	(revision 1391)
> +++ libopenbios/bootinfo_load.c	(working copy)
> @@ -190,7 +190,10 @@
>  	while (current < size) {
>  
>  		c = base[current++];
> -
> +        if(c == '\r') {
> +            c = '\n';
> +        }
> +        
>  		if (c == '<') {
>  			script = 0;
>  			tag = 1;
> 
> 

Some thoughts on this patch: compared with the other patch for
interpreter.fs my feeling on reflection is that if we're going to have a
hack for OS 9, a nice isolated piece of code in the loader is going to
be preferable for the reason that it doesn't involve changes to the
Forth interpreter which can affect all architectures.

Can you demonstrate how the patch breaks down the OS 9 loader into
sections terminated by LF so we can see the individual chunks that are
passed to "interpret". With this it is possible to get a good
understanding as to how the patch works and determine how it will affect
other OSs.

Also according to my inbox this workaround was originally authored by
Cormac and I don't see any attribution at all?


ATB,

Mark.




More information about the OpenBIOS mailing list