pguyot / Einstein

NewtonOS running on other operating systems
GNU General Public License v2.0
415 stars 56 forks source link

REx Driver 2018 release #49

Closed MatthiasWM closed 2 years ago

MatthiasWM commented 6 years ago

Reinstate the build process for the ROM Extension (REx) that contains the drivers that link NewtonOS to Einstein. Recompiling the REx would allow us to integrate the network drivers and possibly another NewtonScript app that allows setting Einstein preferences from within NewtonOS (so mobile versions don't need to provide a native UI).

chuma commented 6 years ago

Am I insane to think about automating the MPW part of the build by using qemu to boot OS 9.2? Something like:

OK, so automating using VNC is a bit far-fetched. A console-based solution would be much nicer.

MatthiasWM commented 6 years ago

It may be easier to use "mosrun", https://github.com/MatthiasWM/dynee5/tree/master/Alienate/mosrun , mosrun (MacOS-run) emulates the MPW environment and wraps all the tools needed to generate the REx. mosrun uses mosmake to integrate a Classic MacOS binary into a new binary which runs natively on MacOS X. This has been proven to work.

I suggest that the build process depends on the "Native Developer Kit" archive in a specific location (for example .../_Data_/NewtonDev.sit, as found on Unna), which is then unpacked and the binaries are wrapped into mosrun. The next build step then builds the actual REx using the tools and includes form NewtonDev.sit.

It may be easiets to include mosrun into the Einstein source tree, just like the K library.

chuma commented 6 years ago

Ah. I get it now. Neat. I'm working on pulling all of the necessary bits together.

jake-b commented 6 years ago

Also should note that https://github.com/ksherlock/mpw is another option. I liked this one because it keeps the library/includes in a central location.

I haven't tried mpw-shell, but it might also be interesting: https://github.com/ksherlock/mpw-shell

chuma commented 6 years ago

@jake-b those are neat tools, but it they only run on OS X, which doesn't help me :(

So I did this:

https://gist.github.com/chuma/754038fb0da921782aad9825faf18346

I banged together an ugly-as-sin bash script that can download the NewtonDev disk image, unZIPs it, and uses various tools to extract the Newton C++ tools and headers into the correct formats. This works with readily available packages on my Fedora machine: hfsutils, dos2unix, and perl-Convert-BinHex. I did this in the _Build_/MPW_Drivers/ sub-directory, for some reason.

mosrun built and installed it into my PATH.

Then it was just a matter of hacking Drivers/Makefile to use only POSIX paths, point it to where the tools are, and comment out all of the SetFile commands so my build didn't blow up.

That's all it took (!) to build Einstein.rex on my Fedora Linux 28 workstation. I tried it and the emulator does not explode; in fact it runs just fine.

MatthiasWM commented 6 years ago

That is amazing! I assumed that mosrun would compile just fine on pretty much any platform, but getting the rest built too is really great!

MatthiasWM commented 2 years ago

I would like to ask what the status is on this build chain. Are modifications checked into the repo? Could you, @chuma , add a chapter to BUILDING.md, or is the process documented elsewhere? Thanks!

pguyot commented 2 years ago

Fixed in 152a55f2e9ef580de81191d4d3d2110631c904e7