[OpenBIOS] ping [PATCH] bootinfo_load.c: Translate \r to \n for Mac OS 9 compatibility
Programmingkid
programmingkidx at gmail.com
Fri Apr 15 20:49:31 CEST 2016
On Apr 15, 2016, at 12:20 PM, Mark Cave-Ayland wrote:
> On 15/04/16 17:05, Programmingkid wrote:
>
>>> 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?
>
> Simply extract the OS 9 bootloader and break it into individual sections
> terminated by either a CR/LF so we can see how bootinfo_load.c segments
> its calls into the Forth interpreter.
Well I did a few tests to see if I could break feval() using the '\r' character. To my surprise, it didn't break.
I placed this code near the top of the bootinfo_init_program() in bootinfo_load.c:
char *fword;
fword = malloc(10 * sizeof(char));
sprintf(fword, "%s", "banner");
feval(fword);
sprintf(fword, "%s%c", "banner", '\r');
feval(fword);
sprintf(fword, "%s%c%c", "banner", '\r', '\r');
feval(fword);
If the '\r' character does break feval(), then the last two calls would fail. They instead work. I will continue to investigate why the translation works.
More information about the OpenBIOS
mailing list