[Vm-dev] Porting to Alpine Linux aarch64 Raspberry Pi 3B

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 4 16:29:22 UTC 2019

Hi Ken,

On Wed, Dec 4, 2019 at 7:25 AM <ken.dickey at whidbey.com> wrote:

> > I would try two things.  One is to find out where FILE is defined by
> > searching the system's include files.  There has to be some kind of
> > definition because e.g. open answers a FILE *.  So one /has/ to be able
> > to
> > write e.g.
> >   FILE *f = open("foo.txt",...
> >
> > and that's all the code is doing, trying to declare a small array of
> > FILE
> > *'s.
> Ya.  Attached.
> The code array uses 'FILE', not 'FILE *', btw.
>    static FILE stdoutStack[STDOUT_STACK_SZ];
> Hey, I once used '***' in EPROM boot code -- because I had to!
> My ol' brain has now rotted and no longer does cdecl.  Back to the
> '80's.
> I am just confused by this. I don't know enough memory usage context to
> safely convert to 'FILE *'
> > The second thing would be to commit a change to sqVirtualMachine.c
> > which
> > simply ifdef's out push/popOutputFile if some manifest constant, such
> > as
> > CANT_USE_FILE_STAR or DONT_USE_FILE_STAR is defined in the makefile (so
> > that files are compiled with -DDONT_USE_FILE_STAR=1 or some such).
> I will continue to play around.  Thanks!
> Part of my confusion is lack of understanding as to why pushOutputFile()
> side-effects stdout rather than using a global 'output' variable
> universally.
>    *stdout = *output
> Just initialize 'output' global on startup an side effect that.

It does this to ensure that any and all references to stdout in the system
now refer to the new file as established by pushOutputFile, or the old one
as restored by popOutputFile.  You could try changing it to be an array of
FILE *'s and see if that works for you.  Then we could have a define that
mandates that usage.

> Thanks again much for all,
> -KenD

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20191204/ef208297/attachment.html>

More information about the Vm-dev mailing list