Menu

Tree [538c99] master /
 History

HTTPS access


File Date Author Commit
 FMSDK 2026-03-24 Albertina Meyer Albertina Meyer [de80d2] First Commit 0.1.0
 .dockerignore 2026-03-27 Albertina Meyer Albertina Meyer [538c99] Add Docker build flow and standardize Makefile ...
 .gitignore 2026-03-24 Albertina Meyer Albertina Meyer [de80d2] First Commit 0.1.0
 Dockerfile 2026-03-27 Albertina Meyer Albertina Meyer [538c99] Add Docker build flow and standardize Makefile ...
 Makefile 2026-03-27 Albertina Meyer Albertina Meyer [538c99] Add Docker build flow and standardize Makefile ...
 README.md 2026-03-27 Albertina Meyer Albertina Meyer [538c99] Add Docker build flow and standardize Makefile ...

Read Me

FM TOWNS SDK

English and Japanese documentation is provided below.

English

Overview

This project builds FM TOWNS .COM programs and .ISO images using a local i386-elf toolchain.

SDK status and design notes

This project is designed to become a complete FM TOWNS SDK. At the moment, it is still in an older/early stage.

Current focus:

  • Provide a practical cross-compilation path that can communicate with FM TOWNS through DOS interrupts and .COM binaries.
  • Keep runtime support small and explicit while the SDK surface is still evolving.

Because re-creating a full printf implementation from scratch is complex, the current runtime uses simpler DOS-oriented utility functions in FMSDK/lib/dos.c.

Examples currently available in dos.c include:

  • printS / printSRuntime
  • printInt
  • dosGetCharNoEcho
  • dosReadLine
  • dosExit

Supported build modes in this repository:

  • core flavor: C (.c/.C) and Assembly (.s)
  • integration flavor: C only, but requires external proprietary files (not included here)

Important: FM TOWNS Command Mode

FM TOWNS command mode works with 16-bit .COM programs.

  • Recommended for command mode: BITS=16
  • BITS=32 builds are available for experiments, but not for standard command mode execution

Requirements

  • Linux
  • make
  • gcc (with -m16 and -m32 support)
  • mkisofs or genisoimage
  • Local toolchain binaries in ./bin:
  • ./bin/i386-elf-as
  • ./bin/i386-elf-ld
  • ./bin/i386-elf-objcopy

Docker (Debian/Ubuntu)

You can build in a container using either Ubuntu or Debian as base image.

Build image (Ubuntu, recommended):

docker build --build-arg BASE_IMAGE=ubuntu:24.04 -t fmsdk-build-ubuntu .

Build image (Debian, glibc >= 2.38 required):

docker build --build-arg BASE_IMAGE=debian:trixie -t fmsdk-build-debian .

Run build inside container (mount current project):

docker run --rm -it -v "$(pwd)":/workspace -w /workspace fmsdk-build-ubuntu make iso16c

Output files are kept in your host build/ directory because the workspace is bind-mounted.

If you get GLIBC_2.38 not found, your image base is too old for the local ./bin/i386-elf-* tools. Rebuild with Ubuntu 24.04 or Debian trixie and use a different tag to avoid reusing an older image.

You can also use Makefile helper targets:

make docker-image-ubuntu
make docker-iso16c

Project layout (current)

  • FMSDK/inc
  • FMSDK/lib
  • FMSDK/src
  • FMSDK/startup
  • FMSDK/docs

Build output layout

Build output is grouped by flavor/bitness/source type:

  • build/core-16c
  • build/core-32c
  • build/core-16asm (when source is .s)
  • build/core-32asm (when source is .s)
  • build/integration-* (only when external integration files are provided)

Each variant includes:

  • obj (object files)
  • bin (.elf, .com)
  • iso (ISO and iso/root)

Main targets

make help
make com
make iso
make com-core
make iso-core
make iso16c
make iso32c
make clean
make clean-all

Integration/High C policy

This repository intentionally does not include proprietary High C integration files.

  • Integration targets exist for users who legally provide their own files
  • By default, integration mode does not work unless external files are installed locally

Expected external paths for integration mode:

  • FMSDK with High C/FMSDK/...
  • highc_vendor/INC
  • highc_vendor/HC386/INC
  • highc_vendor/HC386/TOWNSLIB/INCLUDE

Useful variables

PROJECT_FLAVOR=core|integration
INCLUDE_MODE=local|local+vendor
SRC=FMSDK/src/main.c
BITS=16|32
COM_NAME=Example.com
ISO_NAME=fm_towns.iso
ISO_LABEL=FMTOWNS

Examples

Core 16-bit C (recommended for command mode):

make iso PROJECT_FLAVOR=core INCLUDE_MODE=local BITS=16 SRC=FMSDK/src/main.c COM_NAME=Example.com ISO_NAME=fm_towns_core_16c.iso

Core 32-bit C (advanced/experimental):

make iso32c
  • ROM files are not distributed in this repository.
  • High C proprietary integration content is not distributed in this repository.

日本語

概要

このプロジェクトは、ローカルの i386-elf ツールチェーンを使って FM TOWNS 向け .COM.ISO を生成します。

SDK の現状と設計メモ

このプロジェクトは最終的に FM TOWNS 向けの完全な SDK を目指していますが、現時点ではまだ古い/初期段階の実装です。

現在の主な方針:

  • クロスコンパイルで生成した .COM と DOS 割り込みを通じて、FM TOWNS と実用的にやり取りできることを優先する。
  • SDK の機能面を拡張中のため、ランタイムは小さく明示的な構成にする。

printf をゼロから完全再実装するのは複雑なため、現状のランタイムでは FMSDK/lib/dos.c の DOS 向け補助関数を使用しています。

dos.c で現在利用できる関数例:

  • printS / printSRuntime
  • printInt
  • dosGetCharNoEcho
  • dosReadLine
  • dosExit

このリポジトリで利用できるビルドモード:

  • core フレーバー: C (.c/.C) と Assembly (.s)
  • integration フレーバー: C のみ。ただし外部の権利付きファイルが必要(同梱なし)

重要: FM TOWNS のコマンドモード

FM TOWNS のコマンドモードで実行する .COM16-bit が前提です。

  • コマンドモード推奨: BITS=16
  • BITS=32 ビルドは検証用途向けで、通常のコマンドモード実行向けではありません

必要環境

  • Linux
  • make
  • gcc-m16-m32 をサポート)
  • mkisofs または genisoimage
  • ./bin 内のローカルツール:
  • ./bin/i386-elf-as
  • ./bin/i386-elf-ld
  • ./bin/i386-elf-objcopy

Docker (Debian/Ubuntu)

Ubuntu または Debian をベースにしたコンテナでビルドできます。

イメージ作成(Ubuntu、推奨):

docker build --build-arg BASE_IMAGE=ubuntu:24.04 -t fmsdk-build-ubuntu .

イメージ作成(Debian、glibc 2.38 以上が必要):

docker build --build-arg BASE_IMAGE=debian:trixie -t fmsdk-build-debian .

コンテナ内でビルド(現在のプロジェクトをマウント):

docker run --rm -it -v "$(pwd)":/workspace -w /workspace fmsdk-build-ubuntu make iso16c

ワークスペースをバインドマウントしているため、生成物はホスト側の build/ に残ります。

GLIBC_2.38 not found が出る場合、./bin/i386-elf-* に対してベースイメージが古い可能性があります。Ubuntu 24.04 または Debian trixie で再ビルドし、古いイメージとタグを分けてください。

Makefile のヘルパーターゲットも使えます:

make docker-image-ubuntu
make docker-iso16c

現在のディレクトリ構成

  • FMSDK/inc
  • FMSDK/lib
  • FMSDK/src
  • FMSDK/startup
  • FMSDK/docs

出力構成

ビルド出力はフレーバー/ビット数/ソース種別ごとに分かれます。

  • build/core-16c
  • build/core-32c
  • build/core-16asm(ソースが .s の場合)
  • build/core-32asm(ソースが .s の場合)
  • build/integration-*(外部 integration ファイル導入時のみ)

各バリアントには以下が生成されます。

  • obj(オブジェクト)
  • bin.elf, .com
  • iso(ISO と iso/root

主なターゲット

make help
make com
make iso
make com-core
make iso-core
make iso16c
make iso32c
make clean
make clean-all

Integration/High C に関する方針

このリポジトリには High C 統合用の権利付きファイルを同梱していません。

  • 法的に自身で用意できるユーザー向けに integration ターゲットは残しています
  • そのため、外部ファイル未導入の初期状態では integration モードは動作しません

integration モードで期待される外部パス:

  • FMSDK with High C/FMSDK/...
  • highc_vendor/INC
  • highc_vendor/HC386/INC
  • highc_vendor/HC386/TOWNSLIB/INCLUDE

主な変数

PROJECT_FLAVOR=core|integration
INCLUDE_MODE=local|local+vendor
SRC=FMSDK/src/main.c
BITS=16|32
COM_NAME=Example.com
ISO_NAME=fm_towns.iso
ISO_LABEL=FMTOWNS

コマンドモード向けの core 16-bit C:

make iso PROJECT_FLAVOR=core INCLUDE_MODE=local BITS=16 SRC=FMSDK/src/main.c COM_NAME=Example.com ISO_NAME=fm_towns_core_16c.iso

core 32-bit C(上級者向け/検証用):

make iso32c

法的注意

  • ROM ファイルはこのリポジトリで配布しません。
  • High C の権利付き統合コンテンツはこのリポジトリで配布しません。
MongoDB Logo MongoDB