Re: PilOS - File I/O and OpenGL

2015-07-24 Thread Alexander Burger
Hi Robert,

 I tried saving a file (3dtext.l) to the misc directory in PilOS, but I
 could not see it when using the (dir misc). I am suspecting I need to
 write it and save it from within PilOS?

You can put a file into a directory while building the PilOS image:

Enter the path in pilos/lib/init.l into the global *IniFiles, and
create that file in pilos/init/.

All files which have a 'T' in *IniFiles are automatically 'loaded' when
PilOS boots.

You may also add it to 'initFiles' in pilos/Makefile, but this is
needed only for the (temporal) dependency.


And, yes, you can also create a file at runtime, using 'out' just like
in normal PicoLisp.

   : (out my/path/file.l (println ...) (println ...) ..)


 How to add a library to PilOS such as the OpenGL one that is native to the
 64bit PicoLisp distribution? Do you have to add it to the source and
 recreate the img file?

This is rather meaningless. You can't execute a library written for
Linux (or any other operating system) under PilOS. For example, you
would first need the whole X11 system. Then you would need a loader
program which reads those libraries into memory, relocates them, and
links them with other libraries. And even then it would not work, as the
calling conventions, register usage (the ABI) are different.

So you must first port X11 and OpenGL to PilOS. A surely interesting
task ;)

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: PilOS - File I/O and OpenGL

2015-07-24 Thread Alexander Burger
On Fri, Jul 24, 2015 at 04:30:53PM +0200, Alexander Burger wrote:
 So you must first port X11 and OpenGL to PilOS. A surely interesting
 task ;)

.. especially as there is no C compiler yet (and probably also not in
the future). So it must be done in Lisp and/or pil-assembly.


Of course a full X11 is not needed.

A possible first step might be getting the flight simulator (in
misc/rcsim.l) up and running. The only library it uses is @lib/z3d.l
which - though in C - does no more than writing single pixels into a
window. This could perhaps be rewritten to write those pixels directly
to the frame buffer.

Still a daunting task ... ;)
♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


PilOS - File I/O and OpenGL

2015-07-24 Thread Robert Herman
I tried saving a file (3dtext.l) to the misc directory in PilOS, but I
could not see it when using the (dir misc). I am suspecting I need to
write it and save it from within PilOS?
How to add a library to PilOS such as the OpenGL one that is native to the
64bit PicoLisp distribution? Do you have to add it to the source and
recreate the img file?

Regards,

Rob


Re: PilOS - File I/O and OpenGL

2015-07-24 Thread Alexander Burger
Hi Rob,

 I'll keep hacking away at it, since the payoffs are big for me from a
 learning perspective.

Good :)

And you brought me to the idea of porting RcSim :) I think I'll
investigate that more. This should be the first real application
in PilOS.


 When you say @lib/z3d.l is in C, if I wanted to learn
 how to build upon PilOS, would it be preferable to use pil-assembly or Lisp
 (PicoLisp, I assume)?

I would start on the Lisp level. Only low-level and time-critical
parts need to be done in assembly.


 Can I learn pil-assembly from the source files, or do
 you have a reference somewhere?

The only reference is in doc64/asm. It describes the virtual PicoLisp
machine and its instruction set. The ultimate documentation are the
sources in src64/*.l and (as a modification of those) in
pilos/src/*.l.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe