Files
Claude b2533ef145 Atari TOS SDK for clang-dos (m68k-atari-tos)
- build-sysroot.sh: picolibc with its TOS layer, compiler-rt builtins,
  the headers below and libgem.a
- include/osbind.h (generated by tools/gen-osbind.py), mint/osbind.h:
  GEMDOS, BIOS and XBIOS calls
- include/aes.h, vdi.h, gem.h and gem/: AES and VDI bindings with
  gemlib-compatible names, built into libgem.a
- include/natfeats.h: NatFeats (print to the emulator's console, exit)
- examples: hello, sysinfo, abitest (ABI and libc checks), gemhello
- tools/hatari-run.sh: run a program headless in Hatari with EmuTOS
- tests/run-tests.sh: the examples on ST, STe, TT and Falcon
- CI: shell syntax, osbind.h up to date

Everything here is freely licensed; no Atari ROM is used or included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSR31kZKGZkPydqzvy
2026-11-03 05:29:01 +00:00

21 lines
671 B
C

// Prints a greeting with the C library, its arguments, and the TOS and
// GEMDOS versions.
#include <osbind.h>
#include <stdio.h>
static long tos_version(void) {
// The OS header, at _sysbase (0x4f2), has the TOS version at offset 2.
// Low memory can only be read in supervisor mode.
return *(unsigned short *)(*(char **)0x4f2 + 2);
}
int main(int argc, char **argv) {
unsigned tos = (unsigned)Supexec(tos_version);
unsigned gemdos = Sversion();
printf("Hello from clang on TOS %x.%02x (GEMDOS %d.%02d)!\n", tos >> 8,
tos & 0xff, gemdos & 0xff, gemdos >> 8);
for (int i = 1; i < argc; ++i)
printf("arg %d: %s\n", i, argv[i]);
return 0;
}