About me...

Our Journey...

  1. What is an 'OS'?
  2. A Brief History of the OS
  3. The OS Today
  4. Introducing: Neotron
1. What is an 'OS'?

Some Terms...

  • OS = Operating System
  • DOS = Disk Operating System
  • RTOS = Real-Time Operating System
1. What is an 'OS'?

What does a DOS do?

  • It runs applications
  • It runs on a computer
  • It manages files (on disk)
  • It provides portability
1. What is an 'OS'?

So what is an application?

1. What is an 'OS'?

So what is an application?

1. What is an 'OS'?

What does a DOS do?

  • It runs applications ✅
  • It runs on a computer
  • It manages files (on disk)
  • It provides portability
1. What is an 'OS'?

What is a computer?

  • Has a Central Processing Unit
    • Executes Instructions, has Registers
  • Has memory:
    • Each location (a byte?) has a numeric address
    • Volatile vs Non-Volatile
  • Has Input/Output devices
    • Often pretend to be memory
    • Display, Keyboard, Storage, Communications
1. What is an 'OS'?

IBM System/360 Model 30

Dave Ross - Flickr - CC BY 2.0
1. What is an 'OS'?

IBM PC 5150

Rama & Musée Bolo - Wikimedia - CC BY-SA 2.0 fr
1. What is an 'OS'?

Raspberry Pi Pico

Michael Henzler - Wikimedia - CC BY-SA 4.0
1. What is an 'OS'?

What does a DOS do?

  • It runs applications ✅
  • It runs on a computer ✅
  • It manages files (on disk)
  • It provides portability
1. What is an 'OS'?

centre

A - Track; B - Geometric Sector; C - Sector; D - Cluster

1. What is an 'OS'?

centre

1. What is an 'OS'?

What does a DOS do?

  • It runs applications ✅
  • It runs on a computer ✅
  • It manages files (on disk) ✅
  • It provides portability
1. What is an 'OS'?

What if there's no OS?

or if the OS and Application are compiled together...

  • The Application runs from boot-up
  • How do you load other Applications?
  • How do you run the Application on a different computer?
1. What is an 'OS'?

Can we save some work here?

  • Like, move the common parts out of each application?
  • The bits that operate the computer ... system ?

centre

1. What is an 'OS'?

So, can we save some work here?

  • Like, move the common parts out of each application?
  • The bits that operate the computer ... system ?

centre

1. What is an 'OS'?

What does a DOS do?

  • It runs applications ✅
  • It runs on a computer ✅
  • It manages files (on disk) ✅
  • It provides portability ✅

Our Journey...

  1. What is a 'DOS' (or even an 'OS')?
  2. A Brief History of the OS
  3. The OS Today
  4. Introducing: Neotron
2. A Brief History of the OS

The LEO "Master Programme"

  • LEO I was the first commercial computer
    • Built by J. Lyon's Tea Rooms
    • Based on EDSAC
    • 6000 tubes, 1200 relays
  • First ran the "Bakery Valuations" application in 1951
  • LEO III's "Master Programme" ran up to 12 applications
2. A Brief History of the OS

Debugging the LEO

centre

Automatic Digital Computation, 1953

2. A Brief History of the OS

IBM System/360 Operating System

  • 1964
  • Somewhat late and resource hungry
    • Various interim OSes launched, like BOS/360
  • Three versions: Single-task, fixed-tasks, variable-tasks
    • Switched tasks when the CPU was stuck waiting
  • System/360 shared peripherals, and mostly application compatible
2. A Brief History of the OS

MULTICS

  • MIT / General Electric / Bell Labs - 1969
  • Time-sharing for GE-645
    • 36-bit word; 18-bit address/segment
  • No distinction between files and RAM
  • Dynamic linking
  • Hierarchical File System
  • Kernel/User-space
  • Written in PL/I
2. A Brief History of the OS

UNIX (or Unix)

  • Bell Labs - 1969
  • Ken Thompson, Dennis Ritchie, et. al
  • Initially single-tasking; non-portable
    • written for the the DEC PDP-7, to play Space Travel
  • Processes, Device Files, Hierarchical File System
  • Proves useful for Word Processing (with roff)
  • Re-written in C in 1973
2. A Brief History of the OS

The UNIX family tree

  • Bell Labs' Research Unix V1..V10
  • AT&T System III & V
    • HP-UX, SGI IRIX, IBM AIX, Sun Solaris
  • Berkeley Software Distribution
    • SunOS
    • Net/Open/Free/DragonFlyBSD
    • NeXTSTEP (macOS)
  • Microsoft Xenix
2. A Brief History of the OS

centre

2. A Brief History of the OS

Digital Research CP/M

  • For 8-bit Intel 8080 machines - 1974
    • Altair, IMSAI, Osborne, KayPro, Commodore, Sinclair, Amstrad
  • Needs an ASCII Terminal, floppy drive, 16 KiB RAM
  • OEM ports the BIOS, Digital Research supply BDOS + CCP
  • Hierarchical File System
  • pip understands CON: as a psuedo-file with special properties

Video

2. A Brief History of the OS

PC-DOS / MS-DOS

  • The IBM 5150 'Personal Computer' - 1981
    • 16-bit Intel 8088
    • Microsoft BASIC in ROM, Tape interface, 16 to 64KB RAM
  • Microsoft buy 16-bit CP/M clone 86-DOS and licence it to IBM
    • IBM do the BIOS, Microsoft provide DOS
  • First 'PC Compatible' from Columbia Data Products
    • Microsoft sell MS-DOS to anyone - CP/M is doomed
  • CON is a psuedo-file with special properties
2. A Brief History of the OS

Other Microsoft OSes

  • MS-DOS
  • Xenix UNIX
  • OS/2 with IBM
  • 16-bit Windows (1.x, 2.x, 3.x)
  • 16/32-bit Windows (95, 98, Me)
  • 32-bit Windows NT (3.1, 3.5, 4, 2000, XP, Vista, 7, 8, 10, 11)

Click me if you dare

2. A Brief History of the OS

centre

2. A Brief History of the OS

Microsoft Windows NT

  • Released in 1993 as Windows NT 3.1
  • Portable
    • MIPS, x86, DEC Alpha, PowerPC, Itanium, x86-64, arm
  • Compatible
    • OS/2, POSIX, Win16, Win32...
  • Dave Cutler + co. came from doing VMS at Digital
2. A Brief History of the OS

centre

Microsoft said sorry with $100M + added DEC Alpha port

2. A Brief History of the OS

Apple

  • Almost nothing on the Apple I
  • BASIC on the Apple II
  • Lisa OS
    • Includes a GUI based on the Xerox Star
  • Macintosh System
    • Cut-down Lisa OS
    • Later ported from 68k to a PowerPC microkernel
  • Mac OS X is UNIX'03 certified
2. A Brief History of the OS

centre

2. A Brief History of the OS

Commodore

  • Microsoft BASIC on the 8-bits
    • Commodore DOS ran on the Floppy Drive!
  • AmigaOS...
    • Exec was the multi-tasking Kernel
    • AmigaDOS was the OS (based on TRIPOS)
    • Intuition was the GUI
    • Partially in ROM (Kickstart)
2. A Brief History of the OS

centre

Chiffre01 - Wikipedia - CC BY-SA 4.0
2. A Brief History of the OS

Atari

  • Atari OS + Atari DOS + Atari BASIC on the 8-bits
  • TOS on the 16-bit machines
    • Digital Research GEM Desktop + GEMDOS
  • MultiTOS on the 32-bit machines
2. A Brief History of the OS

centre

MJaap - Wikipedia - CC BY-SA 4.0
2. A Brief History of the OS

Acorn

  • MOS on the 8-bit machines (like the BBC Micro)
    • Disk Filing System
    • BBC BASIC was amazing
  • RISC OS on the 32-bit machines
    • Advanced Disk Filing System
    • Still going!
2. A Brief History of the OS

centre

2. A Brief History of the OS

Linux

  • Is a Kernel
  • GNU is Not Unix: C compiler, C library, shell, utilities
    • (more and more non-GNU components these days...)
  • X11 compatible Display Server plus a Window Manager
  • Distributions like Ubuntu, Arch, Slackware
    • It's like pick-n-mix

Our Journey...

  1. What is a 'DOS' (or even an 'OS')?
  2. A Brief History of the OS
  3. The OS Today
  4. Introducing: Neotron
3. The OS Today

The OS Today

  • Commodore
  • CP/M
  • IBM (well...)
  • Apple System/Carbon
  • Microsoft Windows NT (Win32)
  • POSIX (Portable Operating System Interface ... X?)
  • Your web browser...?
3. The OS Today

Microsoft Windows NT

  • Kernel-space vs User-space
  • Kernel API is private
    • Must use OS supplied static libraries
  • EXEs and DLLs
  • Paths like C:\WINDOWS\CANYON.MID
  • Functions like CreateFileA()
3. The OS Today

POSIX/Linux

  • Kernel-space vs User-space
  • Kernel API is public
    • Use CPU syscall instructions
  • Executables and Shared Objects
  • Paths like /home/jonathan/canyon.mid
  • Functions like open()
3. The OS Today

POSIX/macOS

  • Kernel-space vs User-space
  • Kernel API is private
    • Must use OS supplied static libraries
  • Executables and Shared Objects
  • Paths like /Users/jonathan/canyon.mid
  • Functions like open()
3. The OS Today

Common APIs for Applications

  • File Handling
    • Open, Close, Read, Write, Directories
  • Program Start/Stop
  • Console Handling
    • Reading / Writing Text
  • Windows / 2D / 3D / Video
3. The OS Today

Common APIs for Applications (2)

  • Memory Management
  • Networking (with Sockets)
  • Processes and Threads
  • Locks and RPC
3. The OS Today

API vs ABI

  • Application Programming Interface (API)
    • Source-level compatiblity - function names, argument order
    • Support multiple CPU architectures
  • Application Binary Interface (ABI)
    • Binary-level compatibility - register/stack usage
    • Support single CPU architecture (although ... ARM64EC)
3. The OS Today

Making Portable Languages

  • Modern languages provide a portable API over the native API
    • C++ STL
    • Python
    • Go
    • Rust
  • Cygwin/MinGW brings POSIX to Windows NT

Our Journey...

  1. What is a 'DOS' (or even an 'OS')?
  2. A Brief History of the OS
  3. The OS Today
  4. Introducing: Neotron
4. Introducing Neotron

What is Neotron?

  • Just Enough Operating System
    • Loadable Applications
    • Portable
    • Understandable
  • Open Source
  • Open Hardware
4. Introducing Neotron

What's wrong with Windows/Mac/Linux?

  • OS APIs are learnable
    • Albeit growing...
  • Kernels are hugely complicated
    • Especially drivers!
  • Operating Systems even more so
    • They're both ancient...
4. Introducing Neotron

Neotron OS

  • Single address space
  • OS API is public
    • Jump Table given to every application
  • Executables, but no Shared Objects
  • Paths like 0:/FOLDER/CANYON.MID
  • Functions like:
    open_file: fn(path: &str, mode: os::Mode) -> os::Result<FileHandle, Error>
    
4. Introducing Neotron

Why not an embedded system?

  • Not general purpose
  • Well-solved problem
  • Nostalgia
4. Introducing Neotron

Why make an Open System?

  • Longevity
  • Education
  • Money
4. Introducing Neotron

centre

4. Introducing Neotron

What is the smallest amount of OS we can get away with?

  • File Handling
    • FAT32 on an SD Card
  • Console Handling
    • VGA Monitor, PS/2 Keyboard
  • Memory Management
    • Basic malloc/free
4. Introducing Neotron

What is the smallest amount of OS we can get away with?

  • Networking (with Sockets)
    • Nope (well, maybe later...)
  • Processes and Threads
    • Nope
  • Locks and RPC
    • Nope
4. Introducing Neotron

Portability

  • Solving the driver problem
    • I don't care about drivers for your machine
  • Neotron-BIOS provides hardware-specific code
  • The Neotron-OS provides hardware-independent code
  • You supply the Application!
4. Introducing Neotron

Why Rust?

  • Performance
  • Developer Experience
  • Community
4. Introducing Neotron

BIOS / DOS ABI

  • OS should be common for any BIOS
  • Rust versions may not match
  • Need to use extern "C" functions
  • BIOS supplies a struct of function-pointers
4. Introducing Neotron

BIOS / DOS ABI

#[repr(C)]
struct ApiStaticString {
	string: *const u8,
	length: usize
}

#[repr(C)]
struct BiosApi {
	get_version: extern "C" fn() -> ApiStaticString,
}
4. Introducing Neotron

BIOS / DOS ABI

static mut API: Option<&'static Api> = None;
static mut VGA_CONSOLE: Option<VgaConsole> = None;

#[no_mangle]
pub extern "C" fn main(api: &'static BiosApi) -> !
	unsafe { 
		API = Some(api);
		VGA_CONSOLE = Some(VgaConsole::new(api));
	}
	let version = (api.get_version)();
	println!("BIOS version: {}", version);
	panic!();
}
4. Introducing Neotron

BIOS / DOS ABI (redux)

static API: ApiWrapper = ApiWrapper::new();
static VGA_CONSOLE: VgaConsole = VgaConsole::new();

#[no_mangle]
pub extern "C" fn main(api: &'static BiosApi) -> !
	API.init(api);
	VGA_CONSOLE.init();
	let version = API.get_version();
	println!("BIOS version: {}", version);
	panic!();
}
4. Introducing Neotron

DOS / Application ABI

  • Works the same way
  • Entry point gets &'static OsApi
  • CRT sets up args/env and calls normal C-style main
4. Introducing Neotron

Where is Neotron at right now?

Neotron 32

  • Texas Instruments TM4C processor
  • 80 MHz Cortex-M4
  • 32 KiB RAM
  • Real-time VGA over SPI
  • PWM Audio, SDMMC, 2x Joytick, MIDI
4. Introducing Neotron

Where is Neotron at right now?

Neotron Pico

  • Raspberry Pi RP2040 processor
  • 2x 133 MHz Cortex-M0+
  • 256 KiB RAM
  • Hardware-accelerated VGA over PIO
  • 16-bit Audio CODEC, SDMMC, Slots
4. Introducing Neotron

Bonus goodies!

  • Neotron Pico is micro-ATX sized
  • Design includes a Board Management Controller (BMC)
    • Keyboard controller
    • Power control
    • Status LEDs, Power button, Reset button
    • Extra UART
4. Introducing Neotron

Expanding your computer

  • The DEC PDP-11 has Unibus
  • 8080/Z80 machine have the S-100 bus
  • The PC-compatibles had the ISA bus
  • We have the Neotron Bus!
4. Introducing Neotron

The Neotron Bus

Pin Function Pin Function
1 SPI COPI 2 Ground
3 SPI CIPO 4 Ground
5 SPI CLK 6 Ground
7 SPI /CS 8 /IRQ
9 I²C SDA 10 I²C SCL
11 EEPROM Addr0 12 EEPROM Addr1
13 EEPROM Addr2 14 /RESET
15 5V 16 5V
17 3.3V 18 3.3V
19 Ground 20 Ground
4. Introducing Neotron

Neotron Pico

4. Introducing Neotron

That's all folks!

  • @therealjpster on Twitter (@thejpster everywhere else)
  • Visit #neotron on Matrix
  • See https://neotron-compute.github.io
  • Follow these fine people:
    • @bitshiftmask @rustembedded @rustlang
    • @foone @ekuber @computermuseum
  • Find me later - let's chat!

let's play a game! Everytime I mention a company that's no longer with us, you wave your hands in the air

OS is general purpose, RTOS is embedded, DOS is an OS loaded from and/or for managing (floppy) disks

Talk about batch processing, paper tapes, etc

You will need *some* non-volatile memory to boot, unless you want to flip toggle switches

1965-1978; 64Kx8 memory; 8-bit; microcoded; 1 MHz; 35k op/sec; 8 cycle register access; 2x 5MB Magnetic disk drives; $133k

1982; 4.77 MHz 8088; 64K RAM; 320K FDD; BASIC in ROM; Cassette interface...

2021; 256K RAM; 2MB Flash; 2x 32-bit @ 133 MHz; $3. Let's play higher-lower

Name, Timestamp, Directory, Size, Location of Contents

bitsavers_onrASurveyomputers1953_8778395

Needed 32K, but really 128K or more. CPU speeds out-stripped disk speeds. Written in ASM. z/OS is compatible

Multiplexed Information and Computing Service Honeywell bought GE's computer division

Uniplexed Information and Computing Service. Ported to PDP-11/20 in 1970, roff written for processing patents

This is the simple version!!

single user, single tasking

it was also sold with CP/M-86 and UCSD p-System but not at launch. You can't make a file called CON even on Windows 11

Windows 1.0, with non-overlapping windows!

256 bytes of Wozmon! System isn't multi-tasking, and has a dumb name

systemd, pipewire, Wayland - it's a pick-and-mix OS!

Used to be user-space APIs for buttons and widgets, but it's more common to just provide a blank 'canvas' for the application to draw on

Debian has no fixed API across x86/ARM/PPC/etc. FreeBSD AMD64 presents ABI compatibility with Linux AMD64

Rust on Windows comes in MSVC or MinGW flavours

Applications can load more code into RAM and jump to it if they wish (overlays)

2.5m lines of AMDGPU driver, out of around 28m lines total in Linux 5.9, of which 1.8m is auto-genenerated header file

Rust-run-time?

EEPROM Addr pins give the slot number; wire to a 24C256 EEPROM, which indicates what is fitted to that slot