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

Programmingkid programmingkidx at gmail.com
Fri Apr 15 18:05:28 CEST 2016


On Apr 15, 2016, at 6:45 AM, Mark Cave-Ayland wrote:

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

Which file do you have in mind?

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

Why do you think the loader terminates sections by Line Feed? Did you mean New Line?

Were you able to test out this patch on any of your operating systems? If there are any incompatibilities with any of them, I would like to try to reproduce the problem on my computer.


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

I found out this was Cormac's idea later and I had just rediscovered it. The next patch will see an acknowledgement of his work. 


More information about the OpenBIOS mailing list