hiworld, "Hello world" in C, for Atari 8-bit

By Bill Kendrick


Purpose

This is a simple C program that compiles on Linux and runs on an Atari 8-bit computer. (Two great tastes, ...)


Motivation and Goals

For a very long time, I knew of the cc65 6502 cross-compiler for modern platforms, like Linux. (In fact, it began its life in the 1980s as a compiler that ran on the Atari 8-bit.) I also know that people occasionally use it (often with some assembly language thrown in) to do some awesome stuff, like His Dark Majesty.

So, beginning in August 2013, I've finally (in my "copious" free time; 2 kids and a busy day job!) began tinkering. My goals include:


Requirements:


Some features:


Download:


How it makes a bootable disk:

I'm really novice / naiive when it comes to under-the-hood stuff on the Atari, despite having owned them since 1983 and having so many great books and magazines sitting here. Therefore, please don't laugh too hard when you read the following:

  1. Uses Franny to create a new single-density disk image (.atr)
  2. Uses Franny to format ("initialize") that disk image
  3. Uses Franny to copy the "DOS.SYS" and "DUP.SYS" files of MyDOS 4.53/3 into this new disk image
    (It is not bootable, yet. Copying files onto the disk this way is like using the [C]opy command in Atari DOS or MyDOS. We therefore need to make it know how to boot into "DOS.SYS", as though we wrote the DOS files using the [H] Write DOS Files command. Franny does not seem to currently support such a method of copying a file into a disk image.)
  4. Uses XXD to replace the first 3 sectors (384 bytes) of this new disk images with those 'stolen' from a bootable, single-density MyDOS 4.53/3 disk image.
    A disk image was created and formatted with Franny, then I used Atari800, booted into an existing MyDOS 4.53/3 disk image, to write the DOS files to the disk image. Finally, I used XXD's "-l" option to grab a hex-dump of the first 3 sectors of that bootable disk and stick it into a text file.

So in the end (as of January 2014, at least), I am distributing the "hiworld" source code and Makefile, together with MyDOS's binary ".SYS" files, and a hex-dump of the first 3 sectors of a bootable MyDOS disk (not included). Atrocious, but it works for now! (I'm happy to learn of a more sane process for this; or perhaps someone wants to provide the author of Franny with a boot-disk-making patch?)


Contact Me: