CirnOS icon indicating copy to clipboard operation
CirnOS copied to clipboard

Buildfixup

Open tilkinsc opened this issue 6 years ago • 8 comments

Added test repo Cleaned up imports Improved build and deploy scripts Shifted around build directory to make more sense and to have a place for everything (lib directory for libs, include directoy for includes, etc)

tilkinsc avatar Oct 01 '18 15:10 tilkinsc

aha just a name change okay. with rbpi3b+ I can run images off usb.

tilkinsc avatar Oct 02 '18 09:10 tilkinsc

Can't run the build.sh file, variety of reasons:

  • GCC_OPTS=-nostartfiles -ffreestanding needs to be GCC_OPTS="-nostartfiles -ffreestanding" in order to run on my system
  • OBJ and SRC should be obj and src to work with the new build.sh
  • mv: cannot stat '*.img': No such file or directory

If everything is being rearranged then build.sh should be transformed into a makefile so in the future different models can be built with make zero or make rpi2 etc.

mchlmmc avatar Oct 03 '18 03:10 mchlmmc

I develop on Windows so that's a caveat of not being able to test there. I'll add some cleanup commits.

tilkinsc avatar Oct 03 '18 14:10 tilkinsc

I have always been against makefile. Once you make it nobody in their right mind wants to maintain it. In fact in LuaConsole I just made it so the build script just executes commands.

tilkinsc avatar Oct 03 '18 14:10 tilkinsc

Being as ubiquitous as it is, I think it is safe to assume that all future contributors will be familiar with Makefile.

However, there are no current problems with build.sh, and perhaps not using Make may be a good sign of CirnOS' scale -- if it needs Make then it is getting too big.

mchlmmc avatar Oct 04 '18 00:10 mchlmmc

Well its not like make install is going to do anything. So familiarity isn't really prevalent. However, caching is nice. I wonder if we can develop a solution where we can just pass files through a program that returns the last edited time. This way we can easily test caching and have a simplex makefile or sh. I actually have a lua implementation of said makefile.

CirnOS' scale should be as big as it can be to accommodate everything developers want to do with their microcontroller. Tools that carry along the project. Maybe even a text editor somewhat like VIM for their lua scripts. I don't think you have to shut off or reboot every time you want to do something different.

tilkinsc avatar Oct 04 '18 16:10 tilkinsc

Caching can be handled later, if needed.

As for updates, I plan on allowing CirnOS to be updated directly over USB, once the USB driver is done. This will make programming very similar to Arduino.

Updates done this way will not require turning off the rPi, or even removing the SD card. The script execution will simply freeze, the 'kernel' updated, and then the script continues on. I'm still figuring out the details of how this is going to work, but should have a good idea shortly.

mchlmmc avatar Oct 04 '18 23:10 mchlmmc

I would entirely destroy the lua context and load a new one in its stead. Then make everything go back to default pin wise.

We could probably even benefit from LuaConsole, which, if we have shared library support somehow, we can load any version of lua we want on the fly and use the REPL engine. People could trigger pins high and low if they wanted to rather than running a program to do so. I did, however, create a LuaConsole version in which you can change all the symbols of each lua archive and import them to be of separate use. For example, the archive would hold l51_lua_* and l52_lua_* functions, be put into a struct, and executed from said struct.

This means we don't even require over-usb updating. You could do it all from your raspberry pi, which is something that would be nice on the Arduino to have.

tilkinsc avatar Oct 05 '18 00:10 tilkinsc