English and Japanese documentation is provided below.
This project builds FM TOWNS .COM programs and .ISO images using a local i386-elf toolchain.
This project is designed to become a complete FM TOWNS SDK. At the moment, it is still in an older/early stage.
Current focus:
.COM binaries.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 / printSRuntimeprintIntdosGetCharNoEchodosReadLinedosExitSupported 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)FM TOWNS command mode works with 16-bit .COM programs.
BITS=16BITS=32 builds are available for experiments, but not for standard command mode executionmakegcc (with -m16 and -m32 support)mkisofs or genisoimage./bin:./bin/i386-elf-as./bin/i386-elf-ld./bin/i386-elf-objcopyYou 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
FMSDK/incFMSDK/libFMSDK/srcFMSDK/startupFMSDK/docsBuild output is grouped by flavor/bitness/source type:
build/core-16cbuild/core-32cbuild/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)make help
make com
make iso
make com-core
make iso-core
make iso16c
make iso32c
make clean
make clean-all
This repository intentionally does not include proprietary High C integration files.
integration mode does not work unless external files are installed locallyExpected external paths for integration mode:
FMSDK with High C/FMSDK/...highc_vendor/INChighc_vendor/HC386/INChighc_vendor/HC386/TOWNSLIB/INCLUDEPROJECT_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 (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
このプロジェクトは、ローカルの i386-elf ツールチェーンを使って FM TOWNS 向け .COM と .ISO を生成します。
このプロジェクトは最終的に FM TOWNS 向けの完全な SDK を目指していますが、現時点ではまだ古い/初期段階の実装です。
現在の主な方針:
.COM と DOS 割り込みを通じて、FM TOWNS と実用的にやり取りできることを優先する。printf をゼロから完全再実装するのは複雑なため、現状のランタイムでは FMSDK/lib/dos.c の DOS 向け補助関数を使用しています。
dos.c で現在利用できる関数例:
printS / printSRuntimeprintIntdosGetCharNoEchodosReadLinedosExitこのリポジトリで利用できるビルドモード:
core フレーバー: C (.c/.C) と Assembly (.s)integration フレーバー: C のみ。ただし外部の権利付きファイルが必要(同梱なし)FM TOWNS のコマンドモードで実行する .COM は 16-bit が前提です。
BITS=16BITS=32 ビルドは検証用途向けで、通常のコマンドモード実行向けではありませんmakegcc(-m16 と -m32 をサポート)mkisofs または genisoimage./bin 内のローカルツール:./bin/i386-elf-as./bin/i386-elf-ld./bin/i386-elf-objcopyUbuntu または 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/incFMSDK/libFMSDK/srcFMSDK/startupFMSDK/docsビルド出力はフレーバー/ビット数/ソース種別ごとに分かれます。
build/core-16cbuild/core-32cbuild/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
このリポジトリには High C 統合用の権利付きファイルを同梱していません。
integration モードは動作しませんintegration モードで期待される外部パス:
FMSDK with High C/FMSDK/...highc_vendor/INChighc_vendor/HC386/INChighc_vendor/HC386/TOWNSLIB/INCLUDEPROJECT_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