The Newton OS in a Mac OS X framework.
Switch branches/tags
Nothing to show
Clone or download
newtonresearch
Latest commit 4d49117 Jul 24, 2017
Permalink
Failed to load latest commit information.
Cards It has been a while... Feb 28, 2017
CommAPI It has been a while... Feb 28, 2017
CommServices First commit Mar 10, 2015
Communications It has been a while... Feb 28, 2017
Compression It has been a while... Feb 28, 2017
Frames Rationalise ROM data directory structure Jul 24, 2017
Graphics Fix debug output Jul 4, 2017
HAL First commit Mar 10, 2015
Lantern First commit Mar 10, 2015
MPW Tools It has been a while... Feb 28, 2017
Memory Manager It has been a while... Feb 28, 2017
NS Add NTKFunctions to ResMaker Apr 27, 2017
NTK Formatting changes only Mar 14, 2017
Newton.xcodeproj Update project for ROM data location Jul 24, 2017
Newton/Base.lproj It has been a while... Feb 28, 2017
OS Use DefGlobalVar, GetGlobalVar Mar 31, 2017
PCMCIA First commit Mar 10, 2015
PSS First commit Mar 10, 2015
Packages Add some package installation functions Mar 31, 2017
Platform It has been a while... Feb 28, 2017
Power First commit Mar 10, 2015
Printing First commit Mar 10, 2015
Protocols It has been a while... Feb 28, 2017
QD First commit Mar 10, 2015
ROMData Encapsulate 32-bit object support Jul 24, 2017
Recognition Use DefGlobalVar, GetGlobalVar Mar 31, 2017
Resources First commit Mar 10, 2015
Sound Use DefGlobalVar, GetGlobalVar Mar 31, 2017
Stores Always create virgin store Apr 27, 2017
Testing RefVar / RefArg type encapsulation Mar 14, 2017
Toolbox It has been a while... Feb 28, 2017
Utilities No longer using old-style NTK data Mar 14, 2017
UtilityClasses It has been a while... Feb 28, 2017
Views Reorder headers Jul 4, 2017
.gitignore No longer required Mar 18, 2015
ConfigGlobal.h First commit Mar 10, 2015
Dates.cc It has been a while... Feb 28, 2017
Dates.h IA: fixes for ParseUtter Mar 18, 2015
Debugger.h It has been a while... Feb 28, 2017
Dictionaries.cc Use DefGlobalVar, GetGlobalVar Mar 31, 2017
Dictionaries.h IA: fixes for ParseUtter Mar 18, 2015
Editor.exp Rationalise C function export format Jul 24, 2017
ErrorString.m It has been a while... Feb 28, 2017
HammerConfigBits.h First commit Mar 10, 2015
IA.cc Use DefGlobalVar, GetGlobalVar Mar 31, 2017
Info-AIFtoNTK.plist First commit Mar 10, 2015
Info-MessagePad.plist It has been a while... Feb 28, 2017
Info-Newton.plist It has been a while... Feb 28, 2017
Info-NewtonScript.plist First commit Mar 10, 2015
Inspector-Info.plist First commit Mar 10, 2015
Locales.cc Use DefGlobalVar, GetGlobalVar Mar 31, 2017
Locales.h First commit Mar 10, 2015
MessagePad.entitlements First commit Mar 10, 2015
NSOF.h First commit Mar 10, 2015
NSOF.mm First commit Mar 10, 2015
NTKStubs.cc It has been a while... Feb 28, 2017
NewtConfig.h First commit Mar 10, 2015
Newton.exp It has been a while... Feb 28, 2017
Newton.h First commit Mar 10, 2015
NewtonDebug.h First commit Mar 10, 2015
NewtonErrors.h First commit Mar 10, 2015
NewtonExceptions.h First commit Mar 10, 2015
NewtonMemory.h First commit Mar 10, 2015
NewtonOS-Info.plist First commit Mar 10, 2015
NewtonPackage.cc It has been a while... Feb 28, 2017
NewtonPackage.h It has been a while... Feb 28, 2017
NewtonTime.h Fixed C-linkage warnings Mar 14, 2017
NewtonTypes.h RefVar / RefArg type encapsulation Mar 14, 2017
NewtonWidgets.h It has been a while... Feb 28, 2017
ObjectSystem.cc No need for trailing ; Apr 27, 2017
ObjectSystem.h First commit Mar 10, 2015
Power.cc It has been a while... Feb 28, 2017
Power.h It has been a while... Feb 28, 2017
Preference.cc Use DefGlobalVar, GetGlobalVar Mar 31, 2017
Preference.h First commit Mar 10, 2015
REP.cc Use DefGlobalVar, GetGlobalVar Mar 31, 2017
REP.h First commit Mar 10, 2015
REPTranslators.h First commit Mar 10, 2015
ReadMe.md Reflects the new NewtonScript data creation method. Feb 28, 2017
SerialNumber.cc It has been a while... Feb 28, 2017
SerialNumber.h First commit Mar 10, 2015
SplashScreenProto.s First commit Mar 10, 2015
Startup.cc It has been a while... Feb 28, 2017
Stubs.cc Remove declarations of functions no longer stubbed Mar 31, 2017
Toolkit.exp Rationalise C function export format Jul 24, 2017
build-rex.sh It has been a while... Feb 28, 2017
historyCollectorMACRO.h First commit Mar 10, 2015
main.m First commit Mar 10, 2015
main.mm First commit Mar 10, 2015

ReadMe.md

#Newton.framework for macOS The Newton OS in a framework. Well, enough of it to enable the Newton Connection and Newton Toolkit apps.

By Simon Bell simon@newtonresearch.org.

##NOTES ON THE NEWTON SOURCE Let's make no bones about it, the source is derived from close inspection of the symbols included in the Newton ROM v2.2, the header files distributed with the Newton C++ Tools and Lantern DDKs, and the Newton Programmer's Guide, etc. It's mostly faithful to the original, even down to things that really have no place on another platform. The most obvious change is in renaming classes having a T prefix (Apple's Pascal heritage) to a C prefix (because we are now in a C world). Comments are (I hope) sprinkled adequately, but there is no overall design document, hence these notes.

##BUILDING Open the Newton Xcode project. It builds for macOS Sierra, 64-bit. There are three targets within the project:

  • Framework builds the Newton.framework used by NCX (Newton Connection).
  • NTKFramework builds the NTK.framework used by NTX (Newton Toolkit).
  • MesagePad builds a standalone application that mimics a MP2000. This is very much a work still in progress.

The source is mostly C++, but there are also some NewtonScript Ref objects built with assembler.

##POINTS OF INTEREST

###ROM Data NewtonScript ROM data is extracted from a ROM image file and turned into assembler source by the ResourceMaker/ResMaker.xcodeproj Xcode project. This means we have access to all NewtonScript symbols, frames, functions, magic pointers, etc from the ROM (good) but they can not be changed (bad). The goal is to recreate the NewtonScript sources to those assets so they can be built into a package by NTK and extracted by ResMaker into assembler source for linkage into the C world.

###Native functions The Newton.exp file (Toolkit.exp for the NTK framework) defines native functions in the same way as the Newton C++ Tools for MPW.

###Virtual Memory Some MMU functions have been implemented as an aid to understanding Newton memory management, but there is of course no actual page faulting which leads to some memory management issues (stacks don’t grow, VBOs aren’t loaded when needed, etc).

###Memory Allocation The original OS mixes NewPtr, malloc and free (and sometimes calls the wrong function to free that memory). Here, all allocation (well, there are some exceptions) is done with a call to NewPtr/FreePtr (which replaces DisposPtr). Memory is actually allocated by malloc/free (see FakePointers.cc) or new/delete.

###Stores A flash store has been implemented. This is used for VBOs as well as soup storage. It uses a mmap’d file so is persistent. It would be interesting to know whether the implementation is faithful enough to read a real Newton store image.

###Recognisers Most high-level recogniser classes have been implemented, and there is a tap recogniser, but it needs more of the view system to be working to do anything useful.

###View System Transitioning away from QuickDraw to Quartz is still in a state of flux. Some bold design decisions need to be made here.

###NewtonScript Compiler & Interpreter Upgrading these components is a very interesting project in its own right. The original NewtonScript compiler was built using yacc and flex, defined in NewtonScript.y and NewtonScript.l. The source here is transitioning to LLVM so that both bytecode and native code can be produced.

###Multitasking Task switching is performed without using host platform tasks. Each Newton task has its own registers, stack and data area which are switched by pseudo-SWI using assembler. Only the MessagePad target uses task switching.

###Protocols Protocol classes are built using inline assembler and hand-mangled function names. Back in the day this process was automated, of course, but I never had the time or inclination to write the tools to do it.

###Communications Some classes have been implemented but there is no integration with the host platform.

###MPW Tools The REx tool builds a valid ROM extension. Other MPW tools are work in progress.