Logo

» About

» Downloads

» GitHub

» GitLab

Mottek Blog

» Mottek

» Archive

2024 2023 2022 2020 2019 2018 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003

RSS

NewtonOS Internals

This is a very loose collection of information around the lower layers of the NewtonOS, namely, the kernel (OS600) and the associated user space classes and functions.

NewtonOS Concepts

A good overview of NewtonOS can be found on Walter Smith’s Newton pages. The OS is based on a microkernel, featuring these concepts:

  • Object Manager: The kernel encapsulates all internal structures in kernel objects, and exposes them to the user space outside the kernel. The user space interface is the TUObject class. Kernel space objects get by default deleted when the user space object is deleted.
  • Tasks: Lightweight, using pre-emptive multitasking. The kernel uses a flat memory model, which makes it possible to access memory across tasks, but it allows also to restrict memory access, and uses monitors to inject special memory management features into the memory access path. The user space interface is TUTask, and a convenience class for task creation exists with TUTaskWorld.
  • Semaphores: Allowing synchronization between tasks, interfaced via TUSemaphore.
  • Ports and Messages: Communication between tasks happens via ports, which allow synchronous and asynchronous data sending and receiving. Messages are encapsulated in the TUSharedMemMsg class, and synchronous communication use one shared instance of that class. Ports are accessed via the TUPort class.

The following concepts are not further described here:

  • Task Scheduler
  • Monitors
  • Timing Services

Interfacing with the microkernel

The kernel uses the generic ARM software interrupt (SWI) method to expose about twenty system calls (defined in UserGlobals.h). Each call usually takes one kernel object ID as the target of the operation, which is within the kernel converted into the actual kernel data structure.