<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>ikejiのblog</title>
    <description>Tech memo.
</description>
    <link>http://blog.ikejima.org/</link>
    <atom:link href="http://blog.ikejima.org/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Tue, 08 Sep 2026 11:39:26 +0900</pubDate>
    <lastBuildDate>Tue, 08 Sep 2026 11:39:26 +0900</lastBuildDate>
    <generator>Jekyll v4.3.4</generator>
    
      <item>
        <title>2026W36</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260901
    &lt;ul&gt;
      &lt;li&gt;X260&lt;/li&gt;
      &lt;li&gt;サスペンドしてた状態で、&lt;/li&gt;
      &lt;li&gt;TanCon
        &lt;ul&gt;
          &lt;li&gt;ILI9488をつけた上で、消費電力を測りたい。&lt;/li&gt;
          &lt;li&gt;とりあえず付けたら5V250mAぐらいだった。
            &lt;ul&gt;
              &lt;li&gt;バックライトの輝度が100%だから、暗くしたら消費電力減るかも。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;プロンプトが出るまで8分ぐらいになる。&lt;/li&gt;
          &lt;li&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/52777c400f165b0b528c66cd72978105/2335205f-d53e-4a92-a57c-2b28a3994f47~1.jpg&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/vWOzhMeTD8I?si=2sPedw29CsbhSCFR&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;ul&gt;
  &lt;li&gt;20260902
    &lt;ul&gt;
      &lt;li&gt;TanCon
        &lt;ul&gt;
          &lt;li&gt;速くしてって頼んだら、30秒ぐらいでプロンプトが出るようになった。
            &lt;ul&gt;
              &lt;li&gt;文字出力が遅い。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/cMAgS_X1Kj0?si=5JInIqVSIxhbzyMF&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;ul&gt;
  &lt;li&gt;20260903
    &lt;ul&gt;
      &lt;li&gt;テトリス
        &lt;ul&gt;
          &lt;li&gt;AIに豪華なテトリスを作ってもらった。&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/ikeji/aitest&quot;&gt;https://github.com/ikeji/aitest&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;TanCon
        &lt;ul&gt;
          &lt;li&gt;10fpsをめざしてって頼んだら、4fpsまではできたらしい。&lt;/li&gt;
          &lt;li&gt;文字描画がハードウエアになった。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/iC3Pu0tuL6k?si=rw12JActaUSMZxTz&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;ul&gt;
  &lt;li&gt;20260904
    &lt;ul&gt;
      &lt;li&gt;テトリス
        &lt;ul&gt;
          &lt;li&gt;もっとAIに豪華なテトリスを作ってもらった。&lt;/li&gt;
          &lt;li&gt;indexページを作ってもらった。&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://ikeji.github.io/aitest/index.html&quot;&gt;https://ikeji.github.io/aitest/index.html&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260905
    &lt;ul&gt;
      &lt;li&gt;テトリス
        &lt;ul&gt;
          &lt;li&gt;もっとAIに豪華なテトリスを作ってもらった。
            &lt;ul&gt;
              &lt;li&gt;めぼしいモデルはカバーしたか?&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Maker Faire Tokyo 2026
        &lt;ul&gt;
          &lt;li&gt;新しい会場
            &lt;ul&gt;
              &lt;li&gt;広くなって、列と列の間があいた&lt;/li&gt;
              &lt;li&gt;企業ブースに企業サークルが入ってる&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;おもしろかったもの
            &lt;ul&gt;
              &lt;li&gt;ヒューマノイド販売中&lt;/li&gt;
              &lt;li&gt;スパチャ貯金箱&lt;/li&gt;
              &lt;li&gt;鳩時計&lt;/li&gt;
              &lt;li&gt;人力ホバークラフト&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260906
    &lt;ul&gt;
      &lt;li&gt;家のLAN
        &lt;ul&gt;
          &lt;li&gt;部屋間の配線を光ケーブルにしたい。&lt;/li&gt;
          &lt;li&gt;PCIe &amp;lt;-&amp;gt; SFP+のカードがみあたらない。&lt;/li&gt;
          &lt;li&gt;いっかいやすみ。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 08 Sep 2026 11:31:16 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/09/08/2026w36.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/09/08/2026w36.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
      <item>
        <title>2026W35</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260824
    &lt;ul&gt;
      &lt;li&gt;fakedl
        &lt;ul&gt;
          &lt;li&gt;DisplayLinkデバイスのふりをするRaspberryPi Picoファームウエア&lt;/li&gt;
          &lt;li&gt;作って動作確認せず放置してた。&lt;/li&gt;
          &lt;li&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/e8865fe296726bffaca8975263453da8/PXL_20260824_155149907.RAW-01.COVER.jpg&quot; alt=&quot;&quot; /&gt;
            &lt;ul&gt;
              &lt;li&gt;動いた。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;githubに置いた。&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/ikeji/fakedl&quot;&gt;https://github.com/ikeji/fakedl&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260826
    &lt;ul&gt;
      &lt;li&gt;PiCon2350
        &lt;ul&gt;
          &lt;li&gt;ちょっとはんだ付けを進めた。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260827
    &lt;ul&gt;
      &lt;li&gt;TanCon
        &lt;ul&gt;
          &lt;li&gt;TangNano 20kでRISCVを作ってもらいはじめた。&lt;/li&gt;
          &lt;li&gt;寝ておきたら、OSが動いてた。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260828
    &lt;ul&gt;
      &lt;li&gt;TanCon
        &lt;ul&gt;
          &lt;li&gt;1秒以下で起動するはずが、起動が20倍ぐらいおそかった&lt;/li&gt;
          &lt;li&gt;聞いたらFlashもメモリもCPUも遅いせいだと言われた&lt;/li&gt;
          &lt;li&gt;勧められるままDMAを付けてもらう&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Tue, 01 Sep 2026 22:43:54 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/09/01/2026w35.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/09/01/2026w35.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
      <item>
        <title>2026W34</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260818
    &lt;ul&gt;
      &lt;li&gt;mytinydock
        &lt;ul&gt;
          &lt;li&gt;dzen使ってたけど、別の欲しくなった。&lt;/li&gt;
          &lt;li&gt;wmdockとか探してたけど、packageにない。&lt;/li&gt;
          &lt;li&gt;作ればよくねってなって、作った。&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/ikeji/mytinydock&quot;&gt;https://github.com/ikeji/mytinydock&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260819
    &lt;ul&gt;
      &lt;li&gt;EVO X2
        &lt;ul&gt;
          &lt;li&gt;Qwen3.8&lt;/li&gt;
          &lt;li&gt;試した。&lt;/li&gt;
          &lt;li&gt;Q4でMTP入れても25tpsぐらい。&lt;/li&gt;
          &lt;li&gt;実用には遅いか?&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260820
    &lt;ul&gt;
      &lt;li&gt;Qwen3.8
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/ikeji/lmake&quot;&gt;lmake&lt;/a&gt;
            &lt;ul&gt;
              &lt;li&gt;10年前ぐらいにgaucheで書いたスクリプト&lt;/li&gt;
              &lt;li&gt;これをguileに移植するタスク&lt;/li&gt;
              &lt;li&gt;gemma4では成功しなかった。&lt;/li&gt;
              &lt;li&gt;Qwen3.8では数時間かかったが成功した。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;Opusにテストを書かせ、それが通るようにと指示したら、Qwen3.6でも成功した。
            &lt;ul&gt;
              &lt;li&gt;もっと難しいタスク考えないとな。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260822
    &lt;ul&gt;
      &lt;li&gt;fuchikoma
        &lt;ul&gt;
          &lt;li&gt;新しいリモートログイン用PC&lt;/li&gt;
          &lt;li&gt;Core(TM) i5-13500H&lt;/li&gt;
          &lt;li&gt;メモリが64GB、NUMEが1Tあるぞ。&lt;/li&gt;
          &lt;li&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/dc74fd9866f4db69f7546afe38d9ab6b/20260822091909.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
          &lt;li&gt;memtestは通った。&lt;/li&gt;
          &lt;li&gt;とりあえずDebianを入れる。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260823
    &lt;ul&gt;
      &lt;li&gt;fuchikoma
        &lt;ul&gt;
          &lt;li&gt;Octane benchmarkを走らせたい。&lt;/li&gt;
          &lt;li&gt;一旦Desktop入れるのも嫌なので、USB-SSDにUbuntuを入れて計測&lt;/li&gt;
          &lt;li&gt;Octane score: 80590&lt;/li&gt;
          &lt;li&gt;デスクトップ版のCore i5-12400と同等か。
            &lt;ul&gt;
              &lt;li&gt;なかなか速い。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;前のPCは38000点ぐらいだったはず。&lt;/li&gt;
          &lt;li&gt;llamafile 182tps/33tps
            &lt;ul&gt;
              &lt;li&gt;前のPC(Core i5-7267U)は 73tps/14tps&lt;/li&gt;
              &lt;li&gt;EvoX2は 632tps/98tps&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://huggingface.co/mozilla-ai/Llama-3.2-1B-Instruct-llamafile/resolve/main/Llama-3.2-1B-Instruct-Q6_K.llamafile
./Llama-3.2-1B-Instruct-Q6_K.llamafile -p &apos;Please describe what is LLM and how it works?&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 25 Aug 2026 22:41:27 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/08/25/2026w34.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/08/25/2026w34.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
      <item>
        <title>2026W33</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260813
    &lt;ul&gt;
      &lt;li&gt;X260
        &lt;ul&gt;
          &lt;li&gt;また再起動した。&lt;/li&gt;
          &lt;li&gt;ヒンジを調節したとき。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260816
    &lt;ul&gt;
      &lt;li&gt;EVO X2
        &lt;ul&gt;
          &lt;li&gt;再セットアップした。&lt;/li&gt;
          &lt;li&gt;今度はDockerベースでセットアップしてる。&lt;/li&gt;
          &lt;li&gt;GemmaとQwenを動かしたい。
            &lt;ul&gt;
              &lt;li&gt;量子化とMTPの深さを追い込みたい。&lt;/li&gt;
              &lt;li&gt;Gemma4 26B-A4B: Q5KMでMTP=3が一番速かった。100tps&lt;/li&gt;
              &lt;li&gt;Qwen3.6-35B: Q4KXL MTP=3が75tps&lt;/li&gt;
              &lt;li&gt;MTPなしだとQ4のほうが速いけど、MTPありだとQ5の方が速いとか面白い。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260817
    &lt;ul&gt;
      &lt;li&gt;EVO X2
        &lt;ul&gt;
          &lt;li&gt;DeepSeekが動かなくなった。&lt;/li&gt;
          &lt;li&gt;再セットアップ前は動いたんだが。&lt;/li&gt;
          &lt;li&gt;メモリの設定だろうか。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 25 Aug 2026 22:41:06 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/08/25/2026w33.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/08/25/2026w33.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
      <item>
        <title>2026W32</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260805
    &lt;ul&gt;
      &lt;li&gt;新Linux Box
        &lt;ul&gt;
          &lt;li&gt;今のはメモリもSSDも足りない。&lt;/li&gt;
          &lt;li&gt;ファンレスだから熱くなると計算力も心配&lt;/li&gt;
          &lt;li&gt;今は時期がわるいのは承知の上で、新しいミニPC買いたい。&lt;/li&gt;
          &lt;li&gt;GMKTec M3 Proがよさそうかな?
            &lt;ul&gt;
              &lt;li&gt;64GBモデルがあり、N100(32GB上限)よりメモリが積める。&lt;/li&gt;
              &lt;li&gt;DDR4なので、DDR5よりはメモリが安そう。&lt;/li&gt;
              &lt;li&gt;Core i5-13500HはN100よりだいぶ早いだろう。&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260805
    &lt;ul&gt;
      &lt;li&gt;新Linux Box
        &lt;ul&gt;
          &lt;li&gt;買おうとしたら、カードが弾かれた。&lt;/li&gt;
          &lt;li&gt;1000ドル越えるとダメなのかとおもったが、500ドル越えでもダメなのかも。&lt;/li&gt;
          &lt;li&gt;とりあえず、CPU/Memory/NVMEを分けて買った。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260806
    &lt;ul&gt;
      &lt;li&gt;steptest
        &lt;ul&gt;
          &lt;li&gt;GUIとコードベースの間を行き来する感じのCADを作りたい。&lt;/li&gt;
          &lt;li&gt;真面目に設計するの面倒だけど、とりあえずPoCみたいなのをAIに作らせたらいいのでは?&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://ikeji.github.io/steptest/&quot;&gt;https://ikeji.github.io/steptest/&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;できた。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260807
    &lt;ul&gt;
      &lt;li&gt;steptest
        &lt;ul&gt;
          &lt;li&gt;ぽちぽち、機能強化してる。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Wed, 12 Aug 2026 12:03:54 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/08/12/2026w32.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/08/12/2026w32.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
      <item>
        <title>2026W31</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260727
    &lt;ul&gt;
      &lt;li&gt;PiCon2350
        &lt;ul&gt;
          &lt;li&gt;ケースとして動くようになってきた。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260729
    &lt;ul&gt;
      &lt;li&gt;PiCon2350
        &lt;ul&gt;
          &lt;li&gt;細かいところを修正&lt;/li&gt;
          &lt;li&gt;画面はもっと薄いし、キーボードはもっと厚い。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260730
    &lt;ul&gt;
      &lt;li&gt;PiCon2350
        &lt;ul&gt;
          &lt;li&gt;厚さを調節したら、開閉がきつくなった。&lt;/li&gt;
          &lt;li&gt;原因わからん。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260731
    &lt;ul&gt;
      &lt;li&gt;PiCon2350
        &lt;ul&gt;
          &lt;li&gt;調整したけど、解決できない。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 04 Aug 2026 12:01:10 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/08/04/2026w31.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/08/04/2026w31.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
      <item>
        <title>2026W30</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260720
    &lt;ul&gt;
      &lt;li&gt;HDD
        &lt;ul&gt;
          &lt;li&gt;10Tぐらい入れてscrubした。&lt;/li&gt;
          &lt;li&gt;問題なし&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260722
    &lt;ul&gt;
      &lt;li&gt;PiCon2350
        &lt;ul&gt;
          &lt;li&gt;腰が重過ぎたので、ケース作りをAIにやらせてみる。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260723
    &lt;ul&gt;
      &lt;li&gt;PiCon2350
        &lt;ul&gt;
          &lt;li&gt;印刷してみた。&lt;/li&gt;
          &lt;li&gt;アイディアはよさそう。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260724
    &lt;ul&gt;
      &lt;li&gt;PiCon2350&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260725
    &lt;ul&gt;
      &lt;li&gt;PiCon2350&lt;/li&gt;
      &lt;li&gt;P1S
        &lt;ul&gt;
          &lt;li&gt;印刷中にフィラメントが切れた。&lt;/li&gt;
          &lt;li&gt;21.5kgつかった。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Mon, 27 Jul 2026 22:40:33 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/07/27/2026w30.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/07/27/2026w30.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
      <item>
        <title>DOSCON: A Handheld MS-DOS Machine Running on Two AAA Batteries</title>
        <description>&lt;p&gt;&lt;a href=&quot;/make/8088/2026/07/21/doscon.html&quot;&gt;日本語版&lt;/a&gt;もあります。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/e016c15501219930d449bc7d539aeba0/PXL_20260511_052853973.RAW-01.jpg&quot; alt=&quot;DOSCON booted up on a cafe table, next to a latte and a waffle&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/make/8088/2026/02/11/cradle86-en.html&quot;&gt;Last time&lt;/a&gt;, I put a real V30 CPU on an RP2040 “cradle” and booted MS-DOS (HIDOS) on it.&lt;/p&gt;

&lt;p&gt;At the end of that article, I listed three things as “future work”:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Add disk write support, so I can develop software on the machine itself&lt;/li&gt;
  &lt;li&gt;Upgrade to the RP2350 to get more memory&lt;/li&gt;
  &lt;li&gt;Turn it into a portable terminal with its own screen and keyboard&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This time, I did all of them. The result is called &lt;strong&gt;DOSCON&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It still carries a &lt;strong&gt;real V30 chip&lt;/strong&gt;. It runs on two AAA batteries, and a few seconds after power-on you get the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;A&amp;gt;&lt;/code&gt; prompt. It has an LCD and a keyboard, it can read and write Japanese text on its own, and you can write a program in vi (self-made), assemble or compile it, and run it — all without leaving the machine.&lt;/p&gt;

&lt;p&gt;The PCB (KiCad), the case (3D printed), the firmware (C++), and the DOS tools running inside: I built the whole stack myself.&lt;/p&gt;

&lt;h2 id=&quot;motivation&quot;&gt;Motivation&lt;/h2&gt;

&lt;p&gt;The previous machine’s only connection to the outside world was USB, so it needed a PC. But putting a PC that is hundreds of times faster than a V30 next to it, just to use it as a dumb terminal, felt completely backwards. The V30 is the star of the show, so the V30 should be self-sufficient. This time, the goal was a standalone machine.&lt;/p&gt;

&lt;p&gt;And if it was going to be standalone, the shape was already decided. When I was in elementary school, I used to look at the Game Boy and daydream: “What if this had a keyboard instead of a controller, and I could write programs on it?” Take the V30 that was inside the PC-98 I used back then, and the C compiler I used back then, and put them into the box I wanted back then. In other words, this is answering a 30-year-old wish.&lt;/p&gt;

&lt;h2 id=&quot;what-changed-since-last-time&quot;&gt;What Changed Since Last Time&lt;/h2&gt;

&lt;p&gt;The CPU-side architecture is the same “cradle” approach as before. The real V30 is the bus master, and the RP2350 plays the role of memory, I/O, and every peripheral. The RP2350 has two cores, so I split the work:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;core1&lt;/strong&gt;: Dedicated to V30 bus control. It watches ALE/RD/WR and moves data in and out of memory in step with the bus cycles&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;core0&lt;/strong&gt;: Handles I/O requests, the screen, the keyboard, and USB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/5bfa0a490b69437d46cdbb705059b4f0/PXL_20260416_183855235.RAW-01.jpg&quot; alt=&quot;The real V30 chip visible through a round window in the case&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Since the V30 is the star, the case has a window so you can see the real chip.&lt;/p&gt;

&lt;p&gt;The essential differences from the previous machine are three:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;It runs standalone on batteries.&lt;/strong&gt; No PC required — it works as a complete machine on two AAA batteries, with its own screen and keyboard&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;More RAM, enough to run a C compiler.&lt;/strong&gt; Up from 128KB to 448KB. Not just MASM/LINK — even a C compiler runs on the machine now&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;It has a RAM disk.&lt;/strong&gt; The biggest piece of unfinished business from last time — “no way to save the programs you write” — is solved&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Last time, things like adjusting the clock speed were done from a monitor program on the connected PC. Now that the machine is standalone, it has a full configuration shell so you can do all of that on the device itself (the BootShell, described later).&lt;/p&gt;

&lt;h2 id=&quot;the-big-picture&quot;&gt;The Big Picture&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;+---------------------+
|  ILI9488 LCD 320×480|   Portrait. 40×30 text (8×16 halfwidth / 16×16 fullwidth)
|  + 4×12 keyboard    |   ANSI.SYS-compatible escape sequences built in
+---------------------+
            |
+---------------------+          +----------------+
|  RP2350 firmware    |   bus    | V30 (real chip)|
|   - HIDOS host      |&amp;lt;========&amp;gt;|  μPD70116      |
|   - USB CDC × 3     | AD0-15+  +----------------+
+---------------------+   core1 handles the bus
            |  USB FS
+---------------------+
| /dev/ttyACM0  stdio |   DOS standard I/O (with SJIS↔UTF-8 conversion)
| /dev/ttyACM1  debug |   firmware logs / monitor entry
| /dev/ttyACM2  aux   |   COM1 / AUX (raw bytes, used for YMODEM transfer)
+---------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Item&lt;/th&gt;
      &lt;th&gt;Previous (cradle86)&lt;/th&gt;
      &lt;th&gt;This time (DOSCON)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;CPU&lt;/td&gt;
      &lt;td&gt;Real V30 (μPD70116)&lt;/td&gt;
      &lt;td&gt;Same real V30&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Cradle&lt;/td&gt;
      &lt;td&gt;RP2040&lt;/td&gt;
      &lt;td&gt;RP2350 @ 250MHz&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Memory&lt;/td&gt;
      &lt;td&gt;128KB&lt;/td&gt;
      &lt;td&gt;448KB + 8MB PSRAM&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Display&lt;/td&gt;
      &lt;td&gt;Serial connection to a PC&lt;/td&gt;
      &lt;td&gt;Built-in LCD (40×30, Japanese support)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Keyboard&lt;/td&gt;
      &lt;td&gt;The PC’s&lt;/td&gt;
      &lt;td&gt;Built-in, 47 keys&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Disk&lt;/td&gt;
      &lt;td&gt;ROM only (no writes)&lt;/td&gt;
      &lt;td&gt;ROM disk + 4MB RAM disk&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;File transfer&lt;/td&gt;
      &lt;td&gt;XMODEM (monitor feature)&lt;/td&gt;
      &lt;td&gt;YMODEM (DOS commands)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Power&lt;/td&gt;
      &lt;td&gt;USB&lt;/td&gt;
      &lt;td&gt;Two AAA batteries (USB-C also works)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;hardware&quot;&gt;Hardware&lt;/h2&gt;

&lt;h3 id=&quot;pcb&quot;&gt;PCB&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/7ba8e08aa9faab990a772db5d7c851f6/PXL_20260212_162147836.RAW-01.jpg&quot; alt=&quot;Two freshly arrived DOSCON boards, with the DOSCON logo in silkscreen&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Designed in KiCad: RP2350 + ILI9488 + key switches + USB-C + battery holder, all on one board.&lt;/p&gt;

&lt;p&gt;As before, component placement is generated by a Python script driving the KiCad API. For regular patterns like a key matrix, writing code beats placing parts by hand, and it makes redoing things painless.&lt;/p&gt;

&lt;h3 id=&quot;failure-i-miswired-the-sd-card&quot;&gt;Failure: I Miswired the SD Card&lt;/h3&gt;

&lt;p&gt;Last time the failure was “the board from the fab doesn’t work at all.” This time it was the SD card. The board has an SD card slot that was supposed to connect to the RP2350’s SPI module, but &lt;strong&gt;the clock and data lines ended up assigned to pins of two different SPI modules&lt;/strong&gt;. On the RP2350, each GPIO pin can only serve specific SPI channels, so this cannot work as hardware SPI.&lt;/p&gt;

&lt;p&gt;I had followed the AI’s recommended pin assignment, which makes this a sequel to last time’s “AI can’t read the timing charts in datasheets” incident. I did give the pin names a quick check, but I didn’t catch it. Wiring proposed by an AI should be carefully cross-checked against the pin multiplexing table.&lt;/p&gt;

&lt;p&gt;The mistake surfaced only after I started writing the firmware. The board had long since been ordered. I should have written the firmware &lt;em&gt;before&lt;/em&gt; ordering the board.&lt;/p&gt;

&lt;p&gt;Fortunately the RP2350 has PIO, so it should be possible to rescue it with a software SPI. That’s future work; for now the machine’s storage is an SD-less setup (ROM disk in flash + RAM disk in PSRAM + YMODEM transfer). The goal — write code and compile it on the machine — was achieved without the SD card.&lt;/p&gt;

&lt;h3 id=&quot;keyboard&quot;&gt;Keyboard&lt;/h3&gt;

&lt;p&gt;47 keys in 4 rows × 12 columns. The interesting part is how they’re read: a normal matrix scan would need 4+12 = 16 GPIOs, but this uses what I call a &lt;strong&gt;“double matrix”&lt;/strong&gt;, which reads everything with &lt;strong&gt;10 GPIOs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Split 10 pins into 4 rows + 6 columns and a normal matrix gives you only 4×6 = 24 keys. So instead, each intersection gets &lt;em&gt;two&lt;/em&gt; keys with their diodes facing opposite directions, and the scan runs both ways: “drive columns, read rows” and “drive rows, read columns.” That’s 2 keys per intersection, 48 positions total. The keyboard looks like 4×12 physically, but electrically its left half and right half share the same intersections in opposite directions.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/0acc3ec12dec020c7ed73cd4ac1bc46c/blog-double-matrix.svg&quot; alt=&quot;Double matrix wiring diagram: each intersection of R1–R4 and C1–C6 has two keys with opposite diode orientations&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After all, the V30 bus alone (AD0-19 plus control lines like ALE/RD/WR) eats close to 25 GPIOs, and then there’s the LCD’s SPI and the PSRAM’s CS. Not many pins were left for the keyboard.&lt;/p&gt;

&lt;h3 id=&quot;power&quot;&gt;Power&lt;/h3&gt;

&lt;p&gt;Two AAA batteries are &lt;strong&gt;boosted to 3.3V&lt;/strong&gt;, and both the RP2350 and the V30 run at 3.3V. The boost converter is an off-the-shelf module. “A 5V-era V30 runs fine at 3.3V” was already confirmed last time, so this time the whole design is 3.3V from the start.&lt;/p&gt;

&lt;p&gt;I later considered switching to a lithium-ion battery, but a fully charged li-ion cell exceeds 4.0V, which would probably fry this setup. Hence, dry cells.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/d99811f8c712f01aee331b157df497a2/PXL_20260324_230520608.RAW-01.jpg&quot; alt=&quot;The DOSCON board running DOS with two batteries connected&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Measured at the battery, the current draw is about 250mA. With AAA NiMH cells (around 750mAh), that’s roughly 3 hours by simple arithmetic. If you want more, AA cells (around 2000mAh) should give 8 hours, and doubling from 2 cells to 4 should double that again.&lt;/p&gt;

&lt;h3 id=&quot;case&quot;&gt;Case&lt;/h3&gt;

&lt;p&gt;3D printed. The modeling is not done in a CAD GUI but written as code — JavaScript for &lt;a href=&quot;https://replicad.xyz/&quot;&gt;replicad&lt;/a&gt;. The keycaps are self-made too; the legends are SVGs generated by my own script and printed in via multi-color 3D printing. Looking back at the commit log, late April through May went almost entirely into tweaking the case and keycaps.&lt;/p&gt;

&lt;p&gt;Why does the case take so long? Because &lt;strong&gt;you can’t run an AI agent loop on it&lt;/strong&gt;. For firmware, the loop of “AI writes code → tests fail → AI fixes it” runs on its own. For a case, the feedback loop is: print it, fit it against the real thing, adjust dimensions, print again… and a human has to do that with their body. One iteration takes hours, and you can’t write tests for it. In the AI era, the enclosure is the biggest bottleneck in electronics projects.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/6e686150aa7122e23b2878c4bc49e987/PXL_20260503_153412467.RAW-01.jpg&quot; alt=&quot;The finished DOSCON in its black 3D-printed case and keycaps&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;carrying-hidos-around-on-batteries&quot;&gt;Carrying HIDOS Around on Batteries&lt;/h2&gt;

&lt;p&gt;The OS is &lt;strong&gt;HIDOS&lt;/strong&gt;, same as last time. &lt;a href=&quot;https://github.com/hdk1983/HIDOS&quot;&gt;HIDOS&lt;/a&gt;, created by my senior hdk, is an environment for self-hosting builds of the MS-DOS 2.11 source that Microsoft open-sourced, and it comes with a minimal VM configuration (hidosvm): one do-everything virtual device, plus a BIOS with exactly one call that invokes it.&lt;/p&gt;

&lt;p&gt;I again use my &lt;a href=&quot;https://github.com/ikeji/HIDOS&quot;&gt;fork&lt;/a&gt; as a submodule, but the quick-and-dirty fixes I made last time have since been properly fixed upstream, so the fork’s only remaining diff is build script customization. &lt;strong&gt;Not a single line of HIDOS code is modified.&lt;/strong&gt; VM_IO.SYS is untouched too. The cradle went from RP2040 to RP2350, and the machine gained a screen, a keyboard, and Japanese text — yet the DOS side needed zero changes. I’d call that a victory for hidosvm’s design of “put all the complexity on the VM side.”
The beauty of this approach is that &lt;strong&gt;you implement no BIOS, no 8253 timer, no 8259 PIC, no CRT controller — none of it&lt;/strong&gt;. Every console, disk, and serial access from DOS arrives at the RP2350 as a simple protocol over I/O ports. When the V30 executes an I/O instruction, core1 — which is watching the bus — detects it and raises a shared flag, and core0’s host loop picks it up and dispatches to the console/disk/AUX handlers.&lt;/p&gt;

&lt;h3 id=&quot;memory-map&quot;&gt;Memory Map&lt;/h3&gt;

&lt;p&gt;The V30 sees 448KB of memory, 3.5× the previous 128KB. The memory’s real body is an array in the RP2350’s internal SRAM, with core1 moving data in and out in step with the V30’s bus cycles. In other words, the RP2350 also plays the role of the memory chips.&lt;/p&gt;

&lt;p&gt;The RP2350 has 520KB of internal SRAM in total; 448KB goes to the V30, and the rest is for the firmware itself — VRAM, bus control, and so on.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Virtual address&lt;/th&gt;
      &lt;th&gt;Purpose&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;0x00000〜&lt;/td&gt;
      &lt;td&gt;Interrupt vectors&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x00400〜&lt;/td&gt;
      &lt;td&gt;User program area&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x10000&lt;/td&gt;
      &lt;td&gt;VM_IO.SYS (virtual I/O driver) *initial placement&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x18000&lt;/td&gt;
      &lt;td&gt;MSDOS.SYS (DOS kernel) *initial placement&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;〜0x6FFFF&lt;/td&gt;
      &lt;td&gt;Free (DOS apps run here)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x70000〜0xFFFEF&lt;/td&gt;
      &lt;td&gt;Nothing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0xFFFF0&lt;/td&gt;
      &lt;td&gt;Reset vector + BIOS (16 bytes)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The addresses of VM_IO.SYS and MSDOS.SYS are just where they’re loaded at boot; HIDOS relocates itself during startup.&lt;/p&gt;

&lt;p&gt;The 448KB of RAM ends at 0x6FFFF, and there is nothing between there and the reset vector. Only the 16 bytes from the reset vector (0xFFFF0) — which the V30 fetches right after reset — get a special response from core1. The reset vector and the entire BIOS fit in those 16 bytes.&lt;/p&gt;

&lt;p&gt;At initialization, all of memory is filled with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0xF4&lt;/code&gt; (the HLT instruction) — same custom as the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;f&lt;/code&gt; command in last time’s monitor. If anything runs wild, it stops immediately.&lt;/p&gt;

&lt;h3 id=&quot;solving-the-disk-write-problem&quot;&gt;Solving the Disk Write Problem&lt;/h3&gt;

&lt;p&gt;Last time I wrote “there’s no way to save the programs you make.” That’s now solved with a two-tier setup:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Drive A&lt;/strong&gt;: A ROM disk baked into the firmware. COMMAND.COM and the full set of DOS tools live here&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Drive B&lt;/strong&gt;: A 4MB RAM disk (FAT) in PSRAM. Free to read and write&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Last time I wrote “a RAM disk seems hard with so little memory,” but the RP2350 lets you hang 8MB of PSRAM off the secondary interface of XIP (a mechanism that maps external memory directly into the address space for reads and writes), so it turned out to be easy. Being a RAM disk, it vanishes on power-off — but the warm reboot described later, plus YMODEM transfers, soften that considerably.&lt;/p&gt;

&lt;h2 id=&quot;the-terminal&quot;&gt;The Terminal&lt;/h2&gt;

&lt;p&gt;Last time ended with “showing it on a connected PC isn’t very moving.” This time, the screen and keyboard that DOS sees are implemented entirely in the firmware.&lt;/p&gt;

&lt;h3 id=&quot;ansisys-compatible-escapes&quot;&gt;ANSI.SYS-Compatible Escapes&lt;/h3&gt;

&lt;p&gt;In the DOS world, screen control conventionally goes through ANSI.SYS escape sequences, so I implemented the usual set: CUP (cursor movement), ED/EL (erase), SGR (colors), DECTCEM (cursor visibility). With this, DOS full-screen apps (like the vi described later) just work.&lt;/p&gt;

&lt;h3 id=&quot;japanese-shift_jis-fonts-utf-8-conversion&quot;&gt;Japanese: Shift_JIS, Fonts, UTF-8 Conversion&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;The LCD carries an 8×16 halfwidth font for English text and a 16×16 fullwidth font for Japanese, used as a 40-column × 30-row text screen. The fonts are converted from bitmap images to C++ source by a Ruby script&lt;/li&gt;
  &lt;li&gt;The DOS side’s character encoding is, of course, Shift_JIS. The LCD interprets SJIS directly&lt;/li&gt;
  &lt;li&gt;Meanwhile, the standard I/O over USB (/dev/ttyACM0) is &lt;strong&gt;converted bidirectionally between SJIS and UTF-8&lt;/strong&gt;, so a modern terminal emulator reads and writes Japanese as-is. The JIS X 0208 ↔ Unicode conversion tables are also script-generated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Existing Japanese-language software runs as-is.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/6ebc98552afb92e90a06110c4dfd18b5/PXL_20260411_080946100.RAW-02.ORIGINAL.jpg&quot; alt=&quot;DOSCON running existing Japanese-language display software&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;psram-scrollback-buffer&quot;&gt;PSRAM Scrollback Buffer&lt;/h3&gt;

&lt;p&gt;The text screen is only 40×30, so I gave it a &lt;strong&gt;4096-line scrollback buffer&lt;/strong&gt; in PSRAM. Tap the Fn key by itself to enter scroll mode, then move through past output with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;k&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;j&lt;/code&gt; or Ctrl-F/Ctrl-B. A DOS machine with less-style scrollback is surprisingly comfortable.&lt;/p&gt;

&lt;p&gt;Tapping the Sym key toggles a double-size text mode. Kind to aging eyes.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/d28ec5274ee8b331fc6b6dbdd4ba47f3/PXL_20260720_164439396.RAW-01.COVER.jpg&quot; alt=&quot;The normal screen&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/2844fe095eb779fb17f0e7bd72c3cc70/PXL_20260720_164412655.RAW-01.COVER.jpg&quot; alt=&quot;The same screen in double-size mode&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/5f97067118d776f982ce40624dc0a923/PXL_20260720_164246317.RAW-01.COVER.jpg&quot; alt=&quot;Scroll mode, going back through past output&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;packing-everything-into-47-keys&quot;&gt;Packing Everything Into 47 Keys&lt;/h2&gt;

&lt;p&gt;With only 47 keys, I went with the QMK-style layer approach familiar from the custom keyboard community. There are Ctrl / Shift / Sym (symbols) / Num (digits) / Fn modifiers, with priority &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl &amp;gt; Fn &amp;gt; Sym &amp;gt; Num &amp;gt; Shift &amp;gt; Base&lt;/code&gt;. A key with no definition on a layer falls through to the layer below (like QMK’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_______&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The Fn key additionally gets QMK Layer-Tap-style treatment:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Held with another key&lt;/strong&gt; → Fn layer (F1–F12, cursor keys, PgUp/PgDn)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Tapped alone&lt;/strong&gt; → toggles scroll mode&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Both left and right Fn together&lt;/strong&gt; → launches the MonitorShell (described later)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A neat side effect of the layer system: the chord detection needed no special logic — I just placed the shell-entry key at the Fn key positions &lt;em&gt;on the Fn layer&lt;/em&gt;.&lt;/p&gt;

&lt;h2 id=&quot;the-monitor-lives-on-bootshell-and-monitorshell&quot;&gt;The Monitor Lives On: BootShell and MonitorShell&lt;/h2&gt;

&lt;p&gt;The spirit of last time’s monitor program (memory dump, disassembler, XMODEM…) carries over, and the firmware contains two “shells” besides DOS.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;BootShell&lt;/strong&gt; is a settings menu you enter by holding ESC at power-on. Toggle the CPU clock, whether standard I/O goes to CDC or UART, drive configuration, UTF-8 conversion, and so on, then hit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;b&lt;/code&gt; to boot DOS.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;MonitorShell&lt;/strong&gt; is entered while DOS is running by pressing both Fn keys (or typing anything into /dev/ttyACM1). It offers memory dump, disassembly, reset, and jumping to BOOTSEL (firmware update mode). Being able to peek into the running V30’s memory from outside is invaluable for debugging the DOS side.&lt;/p&gt;

&lt;p&gt;My favorite feature is &lt;strong&gt;warm reboot&lt;/strong&gt;: restart the machine while preserving the contents of the RAM disk (drive B).&lt;/p&gt;

&lt;p&gt;It didn’t work on the first try, though. Once implemented, &lt;strong&gt;files on the RAM disk came out corrupted across reboots&lt;/strong&gt;. To find where the corruption happened, I wrote &lt;a href=&quot;https://github.com/ikeji/sha1sum&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHA1SUM.EXE&lt;/code&gt;&lt;/a&gt;, a DOS program, took hashes of files before and after reboot, and narrowed down which data broke when.&lt;/p&gt;

&lt;p&gt;The culprit was the XIP cache. The RP2350 accesses PSRAM through the XIP cache, so some of the data “written to the RAM disk” was actually still sitting in dirty cache lines, never having reached the PSRAM itself. Reset in that state and the cache evaporates — that was the punchline. The fix: explicitly flush the cache before jumping into the reboot.&lt;/p&gt;

&lt;p&gt;SHA1SUM, born as a debugging tool, now ships on the disk and lives a second life as the file-transfer verification tool.&lt;/p&gt;

&lt;h2 id=&quot;talking-to-a-pc-three-usb-serial-ports&quot;&gt;Talking to a PC: Three USB Serial Ports&lt;/h2&gt;

&lt;p&gt;Plug in USB-C and three CDC ACM devices appear. Thanks to the pico-sdk, this kind of composite serial device was easy to build.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Device&lt;/th&gt;
      &lt;th&gt;Role&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;/dev/ttyACM0&lt;/td&gt;
      &lt;td&gt;DOS standard I/O (parallel with the LCD, with SJIS↔UTF-8 conversion)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;/dev/ttyACM1&lt;/td&gt;
      &lt;td&gt;Firmware debug log + monitor entry&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;/dev/ttyACM2&lt;/td&gt;
      &lt;td&gt;Direct line to DOS AUX (COM1), raw bytes&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Last time I wrote “the serial port is already taken by the display, so I’ll need multiplexing or something.” A USB composite device solved it: one USB cable carries console, debug, and file transfer simultaneously.&lt;/p&gt;

&lt;p&gt;File transfer is YMODEM over AUX. The disk ships with &lt;a href=&quot;https://github.com/ikeji/xmodem&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SX.EXE&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RX.EXE&lt;/code&gt;&lt;/a&gt;, and on the Linux side plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lrzsz&lt;/code&gt; works.&lt;/p&gt;

&lt;p&gt;To send a file from the PC to DOSCON, run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RX&lt;/code&gt; on the DOSCON side, then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sb&lt;/code&gt; on the Linux side:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;A&amp;gt; RX /Y
$ sb HELLO.TXT &amp;lt; /dev/ttyACM2 &amp;gt; /dev/ttyACM2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the other way around:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;A&amp;gt; SX /Y HELLO.TXT
$ rb &amp;lt; /dev/ttyACM2 &amp;gt; /dev/ttyACM2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For verifying transfers, the checksum programs written for the warm reboot debugging (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CRC32SUM.EXE&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHA1SUM.EXE&lt;/code&gt;) work as-is. Workflows like last time’s “LHA didn’t run, so unpack on Linux” got much smoother.&lt;/p&gt;

&lt;h2 id=&quot;developing-on-this-machine-alone-with-vi-and-tut-code&quot;&gt;Developing on This Machine Alone, With vi and TUT-Code&lt;/h2&gt;

&lt;p&gt;For the leftover homework of “developing software on the machine itself,” the disk carries the HIDOS build artifacts (COMMAND.COM, EDLIN, DEBUG, MASM, LINK, …) plus my own &lt;a href=&quot;https://github.com/ikeji/tiny-vi-clone&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VI.EXE&lt;/code&gt;&lt;/a&gt; — a vi-style editor doing full-screen control via ANSI escapes.&lt;/p&gt;

&lt;p&gt;With RAM up to 448KB, a C compiler runs on the machine too. I installed the &lt;strong&gt;&lt;a href=&quot;https://www.vector.co.jp/soft/maker/lsi/se001169.html&quot;&gt;LSI C-86 trial version&lt;/a&gt;&lt;/strong&gt;. The compiler I used in elementary school, running on the same V30 as back then — but this time on a machine I built myself. It just works.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/b747e195cd4db1a35b55c31a30967335/PXL_20260304_232636227.RAW-01.jpg&quot; alt=&quot;DOSCON compiling and running hoge.c with LSI C-86&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Write FizzBuzz with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copy con&lt;/code&gt;, compile it, run it. All inside this machine.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/c073fad3672742b1570825051e5d6a5b/PXL_20260304_234815293.RAW-01.jpg&quot; alt=&quot;Compiling and running a FizzBuzz written via copy con&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And perhaps the strangest part of DOSCON is kanji input: instead of an IME, vi has &lt;strong&gt;TUT-Code&lt;/strong&gt; built in — a system where each kanji is typed directly with 2–3 keystrokes. I skipped the IME because there’s no memory for a dictionary. Among direct-input systems, T-Code needs more keys than this keyboard has, so I settled on TUT-Code. No candidate window, no dictionary lookup — a good match for a DOS machine with only 448KB. Japanese &lt;em&gt;display&lt;/em&gt; works everywhere in DOS, but &lt;em&gt;input&lt;/em&gt; currently works only inside vi.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/3bd6093261e361934140b11d16aac25b/PXL_20260720_164113767.RAW-01.COVER.jpg&quot; alt=&quot;Typing &amp;quot;Hello world! こんにちは世界&amp;quot; in vi.exe&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So now the whole cycle — write source in vi → build with MASM or the C compiler → run → pull the result to a PC over YMODEM — completes on a battery-powered pocket machine, on a real V30.&lt;/p&gt;

&lt;p&gt;Here’s Hello World assembled with MASM:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/e04af889e149d92d71ffb5cd7b89623c/PXL_20260302_160058083.RAW-01.jpg&quot; alt=&quot;HELLO.ASM source and MASM assembly output on DOSCON&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/d80c30ad729be145e6ab3ddcc2042894/PXL_20260302_160142030.RAW-02.ORIGINAL.jpg&quot; alt=&quot;Building HELLO.COM with LINK and EXE2BIN, then running it and getting Hello World&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;development-log&quot;&gt;Development Log&lt;/h2&gt;

&lt;p&gt;Reconstructed from the commit log, it went roughly like this. The previous article was published on February 11 — and by then, I had actually already started designing the next board.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Early February&lt;/strong&gt;: PCB design in KiCad, ordered&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Mid February&lt;/strong&gt;: Verified the LCD/keyboard standalone with MicroPython → firmware skeleton in C++&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;February 23&lt;/strong&gt;: First implementation of the V30 bus interface and I/O handling&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Late February&lt;/strong&gt;: HIDOS as a submodule, disk image build, DOS boots&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;March&lt;/strong&gt;: I/O work, SJIS/UTF-8, scrollback buffer, BootShell/MonitorShell, warm reboot&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;April&lt;/strong&gt;: DOS-side tools (vi, YMODEM), README&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Late April–May&lt;/strong&gt;: Case and keycap tweaking, double-size mode, finishing touches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;About four months, 74 commits.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/45af89da7b1d7a477ff7b64b3d435626/PXL_20260222_165732481.RAW-01.jpg&quot; alt=&quot;The screen the first time MS-DOS booted on the assembled board&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The first time DOS came up on the LCD. From here on it was the fun phase: poking at and extending a working DOS machine.&lt;/p&gt;

&lt;p&gt;Since I planned to hand the implementation to AI again, &lt;strong&gt;I built tests to excess&lt;/strong&gt;. Every firmware class is template-parameterized and swappable, with FakeHAL/FakeScreen and friends injected into host-side gtest (no Pico SDK required), so all the logic that’s painful to debug on hardware — escape sequence interpretation, keyboard layer resolution — is verified in tests on a PC. If you build an environment where the AI can run the tests and fix its own code, software development hums along.&lt;/p&gt;

&lt;p&gt;On the other hand, as mentioned, you can’t write tests for a case. Software where the AI loop runs, versus an enclosure where it can’t — the time spent on each flipped. That was this project’s lesson.&lt;/p&gt;

&lt;p&gt;One more thing: I kept writing design memos in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;firmware/docs/&lt;/code&gt; before implementing — memory map, logical key mapping, I/O specs, 13 in all. They’re good to look back on, and they became the first draft of this article.&lt;/p&gt;

&lt;h2 id=&quot;wrap-up-and-whats-next&quot;&gt;Wrap-up and What’s Next&lt;/h2&gt;

&lt;p&gt;All three items of last time’s future work (disk writes, memory, screen and keyboard) are done. Japanese display and kanji input came along for the ride.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Having every layer from PCB to OS in your own hands means &lt;em&gt;you&lt;/em&gt; get to decide where the boundaries between layers go (like throwing out the whole BIOS in favor of a single I/O port protocol). That’s the best part&lt;/li&gt;
  &lt;li&gt;The RP2350 has more than enough power to play “everything except the CPU.” V30 bus control, USB, and the display together still leave headroom&lt;/li&gt;
  &lt;li&gt;MS-DOS 2.11 lives comfortably in 448KB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And above all: the “Game Boy with a keyboard that I can program on” I daydreamed about in elementary school now runs on two batteries, in my hands.&lt;/p&gt;

&lt;p&gt;Future work:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Rescue the miswired SD card with a PIO-based software SPI&lt;/li&gt;
  &lt;li&gt;And next, I’d like to move away from the V30 and build something different. I originally chose DOS on the theory that I could leverage existing DOS software — but if AI is this good at development, maybe a self-made OS, compiler, or even CPU should be on the table&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Repositories:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;DOSCON: &lt;a href=&quot;https://github.com/ikeji/doscon&quot;&gt;https://github.com/ikeji/doscon&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;VI.EXE: &lt;a href=&quot;https://github.com/ikeji/tiny-vi-clone&quot;&gt;https://github.com/ikeji/tiny-vi-clone&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;SX.EXE/RX.EXE: &lt;a href=&quot;https://github.com/ikeji/xmodem&quot;&gt;https://github.com/ikeji/xmodem&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;SHA1SUM.EXE/CR32SUM.EXE: &lt;a href=&quot;https://github.com/ikeji/sha1sum&quot;&gt;https://github.com/ikeji/sha1sum&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;HIDOS (fork): &lt;a href=&quot;https://github.com/ikeji/HIDOS/tree/doscon&quot;&gt;https://github.com/ikeji/HIDOS/tree/doscon&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;HIDOS upstream: &lt;a href=&quot;https://github.com/hdk1983/HIDOS&quot;&gt;https://github.com/hdk1983/HIDOS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-end&quot;&gt;The End&lt;/h2&gt;

&lt;p&gt;Once again, I learned a lot.&lt;/p&gt;

&lt;p&gt;Thanks to those who came before:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;hdk, my senior, who created HIDOS&lt;/li&gt;
  &lt;li&gt;The people who devised TUT-Code&lt;/li&gt;
  &lt;li&gt;The custom keyboard culture exemplified by QMK&lt;/li&gt;
  &lt;li&gt;The people still maintaining lrzsz&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 21 Jul 2026 22:09:28 +0900</pubDate>
        <link>http://blog.ikejima.org/make/8088/2026/07/21/doscon-en.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/make/8088/2026/07/21/doscon-en.html</guid>
        
        <category>V30 PC Cyberdeck HIDOS</category>
        
        
        <category>Make</category>
        
        <category>8088</category>
        
      </item>
    
      <item>
        <title>乾電池で動く携帯MS-DOS機「DOSCON」を作った</title>
        <description>&lt;p&gt;Here is a &lt;a href=&quot;/make/8088/2026/07/21/doscon-en.html&quot;&gt;English version&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/e016c15501219930d449bc7d539aeba0/PXL_20260511_052853973.RAW-01.jpg&quot; alt=&quot;カフェのテーブルの上、ラテとワッフルの横で起動しているDOSCON&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/make/8088/2026/02/11/cradle86.html&quot;&gt;前回&lt;/a&gt;、本物のV30 CPUをRP2040の「ゆりかご」に乗せてMS-DOS (HIDOS) を起動した。&lt;/p&gt;

&lt;p&gt;その記事の最後に「今後の展望」として3つ書いた。&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;ディスク書き込みができるようにして、マシン上でソフトウエア開発をしたい&lt;/li&gt;
  &lt;li&gt;RP2350にアップグレードしてメモリを増やしたい&lt;/li&gt;
  &lt;li&gt;専用の画面とキーボードをそなえたポータブル端末にしたい&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;今回、これを全部やった。名前は &lt;strong&gt;DOSCON&lt;/strong&gt;。&lt;/p&gt;

&lt;p&gt;今回も&lt;strong&gt;本物のV30チップ&lt;/strong&gt;が乗っている。単4電池2本で動き、電源を入れると数秒で &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;A&amp;gt;&lt;/code&gt; プロンプトが出る。LCDとキーボードが付いていて、単体で日本語の読み書きもできるし、vi (自作) でプログラムを書いてアセンブル・コンパイルして実行、までがこのマシンの中で完結する。&lt;/p&gt;

&lt;p&gt;基板 (KiCad)、ケース (3Dプリント)、ファームウエア (C++)、中で動くDOSツールまで、フルスタックで必要なものを自作した。&lt;/p&gt;

&lt;h2 id=&quot;動機&quot;&gt;動機&lt;/h2&gt;

&lt;p&gt;前作のマシンは、外部との接点がUSBのみだったので、別途PCが要った。でも、V30の何百倍も速いPCを隣に置いて、それをただの端末として使うのは、どうにも本末転倒だ。V30が主役なのだから、V30だけで完結してほしい。だから今回は、スタンドアローンで動作する事を目指した。&lt;/p&gt;

&lt;p&gt;そして、スタンドアローンにするなら形は決まっていた。小学生の頃、ゲームボーイを見ながら「これのコントローラの代わりにキーボードが付いていて、プログラムが書けたらいいのに」と夢想していた。あの頃使っていたPC-98に入っていたV30と、あの頃使っていたCコンパイラを、あの頃欲しかった形の箱に入れる。つまりこれは、30年越しの答え合わせだ。&lt;/p&gt;

&lt;h2 id=&quot;前作から何が変わったか&quot;&gt;前作から何が変わったか&lt;/h2&gt;

&lt;p&gt;CPUまわりの構成は前作と同じ「ゆりかご」方式だ。本物のV30がバスマスタで、RP2350がメモリ・I/O・周辺回路のすべてを演じる。RP2350にはコアが2つあるので、分業させている。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;core1&lt;/strong&gt;: V30のバス制御専用。ALE/RD/WRを監視して、バスサイクルに合わせてメモリの中身を出し入れする&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;core0&lt;/strong&gt;: I/Oハンドラ、画面、キーボード、USBの面倒を見る&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/5bfa0a490b69437d46cdbb705059b4f0/PXL_20260416_183855235.RAW-01.jpg&quot; alt=&quot;ケースの丸い窓から見える本物のV30チップ&quot; /&gt;&lt;/p&gt;

&lt;p&gt;主役なので、ケースの窓から本物のV30が見えるようにしてある。&lt;/p&gt;

&lt;p&gt;前作からの本質的な違いは3つ。&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;スタンドアローンでバッテリ動作する。&lt;/strong&gt; PCに繋がなくても、単4電池2本で完結したマシンとして動く。画面もキーボードも付いた&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;RAMが増えて、Cコンパイラが動く。&lt;/strong&gt; 前作の128KBから448KBになり、MASM/LINKどころかCコンパイラまでマシン上で動くようになった&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;RAMディスクがある。&lt;/strong&gt; 前作最大の宿題だった「作ったプログラムを保存できない」問題が解決した&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;前作ではクロックの調節などはPCから繋いだモニタプログラムで行っていたが、スタンドアローンになった今作では、それも本体だけでできるように設定シェルを完備した (後述のBootShell)。&lt;/p&gt;

&lt;h2 id=&quot;dosconの全体像&quot;&gt;DOSCONの全体像&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;+---------------------+
|  ILI9488 LCD 320×480|   縦長。テキスト 40×30 (8×16 半角 / 16×16 全角)
|  + 4×12 キーボード   |   ANSI.SYS 互換エスケープを内蔵
+---------------------+
            |
+---------------------+          +----------------+
|  RP2350 firmware    |   bus    |  V30 (実チップ) |
|   - HIDOS host      |&amp;lt;========&amp;gt;|  μPD70116      |
|   - USB CDC × 3     | AD0-15他 +----------------+
+---------------------+   core1がバスを捌く
            |  USB FS
+---------------------+
| /dev/ttyACM0  stdio |   DOS の標準入出力 (SJIS↔UTF-8 変換つき)
| /dev/ttyACM1  debug |   firmware のログ / モニタ起動
| /dev/ttyACM2  aux   |   COM1 / AUX (生バイト。YMODEM転送に使う)
+---------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;項目&lt;/th&gt;
      &lt;th&gt;前作 (cradle86)&lt;/th&gt;
      &lt;th&gt;今作 (DOSCON)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;CPU&lt;/td&gt;
      &lt;td&gt;本物のV30 (μPD70116)&lt;/td&gt;
      &lt;td&gt;同じく本物のV30&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ゆりかご側&lt;/td&gt;
      &lt;td&gt;RP2040&lt;/td&gt;
      &lt;td&gt;RP2350 @ 250MHz&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;メモリ&lt;/td&gt;
      &lt;td&gt;128KB&lt;/td&gt;
      &lt;td&gt;448KB + PSRAM 8MB&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;画面&lt;/td&gt;
      &lt;td&gt;PCにシリアル接続&lt;/td&gt;
      &lt;td&gt;内蔵LCD (40×30、日本語対応)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;キーボード&lt;/td&gt;
      &lt;td&gt;PCの物&lt;/td&gt;
      &lt;td&gt;内蔵47キー&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ディスク&lt;/td&gt;
      &lt;td&gt;ROMのみ (書き込み不可)&lt;/td&gt;
      &lt;td&gt;ROMディスク + 4MB RAMディスク&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ファイル転送&lt;/td&gt;
      &lt;td&gt;XMODEM (モニタ機能)&lt;/td&gt;
      &lt;td&gt;YMODEM (DOS上のコマンド)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;電源&lt;/td&gt;
      &lt;td&gt;USB&lt;/td&gt;
      &lt;td&gt;単4電池2本 (USB-Cも可)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;ハードウエア&quot;&gt;ハードウエア&lt;/h2&gt;

&lt;h3 id=&quot;基板&quot;&gt;基板&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/7ba8e08aa9faab990a772db5d7c851f6/PXL_20260212_162147836.RAW-01.jpg&quot; alt=&quot;届いたDOSCONの基板2枚。表にはDOSCONのロゴのシルク印刷&quot; /&gt;&lt;/p&gt;

&lt;p&gt;KiCadで設計して、RP2350 + ILI9488 + キースイッチ + USB-C + 電池ボックスを1枚に載せた。&lt;/p&gt;

&lt;p&gt;前作同様、部品配置はPythonスクリプトでKiCad APIを叩いて生成している。キーマトリクスのような規則的な配置は、手で並べるよりコードで書いた方が楽だし、やり直しも効く。&lt;/p&gt;

&lt;h3 id=&quot;失敗-sdカードの配線を間違えた&quot;&gt;失敗: SDカードの配線を間違えた&lt;/h3&gt;

&lt;p&gt;前作は「工場から届いた基板が全く動かない」だったが、今回の失敗はSDカードだった。基板にはSDカードスロットを載せていて、RP2350のSPIモジュールに繋ぐつもりだったのだが、&lt;strong&gt;クロックとデータが別々のSPIモジュールのピンに割り当たってしまっていた&lt;/strong&gt;。RP2350のGPIOはピンごとに使えるSPIチャネルが決まっているので、これではハードウエアSPIとして使えない。&lt;/p&gt;

&lt;p&gt;AIのおすすめのピン割り当てに合わせたら失敗した、という点で前作の「AIにデータシートのタイミングチャートは読めない」事件の続編でもある。一応ピン名を軽くチェックはしたのだが、見つけられなかった。AIの提案する配線は、ピンマルチプレクサの表ときちんと突き合わせるべきだった。&lt;/p&gt;

&lt;p&gt;このミスが発覚したのは、ファームウエアを書き始めてからだった。基板はとっくに発注済み。基板を発注する前に、ファームウエアを先に作っておくべきだった。&lt;/p&gt;

&lt;p&gt;幸いRP2350にはPIOがあるので、ソフトウエアでSPIを生やして救済できそうではある。これは今後の課題として、現状このマシンのストレージはSDカードなしの構成 (Flash上のROMディスク + PSRAMのRAMディスク + YMODEM転送) に落ち着いた。コードを書いてコンパイルするという目標は、SDカードなしで達成できた。&lt;/p&gt;

&lt;h3 id=&quot;キーボード&quot;&gt;キーボード&lt;/h3&gt;

&lt;p&gt;4行×12列で47キー。面白いのは読み取り方で、普通のマトリクススキャンだと4+12 = 16本のGPIOが要るところを、&lt;strong&gt;「倍マトリクス」と呼んでいる配線で、10本のGPIOで読んでいる&lt;/strong&gt;。&lt;/p&gt;

&lt;p&gt;10本を行4本+列6本に分けると、普通のマトリクスでは4×6 = 24キーしか読めない。そこで各交点に、ダイオードの向きを逆にした2つのキーをぶら下げて、「列を駆動して行を読む」「行を駆動して列を読む」の両方向でスキャンする。これで交点1つから2キー、合計48ポジションが読める。物理的には4行×12列に見えるキーボードの左半分と右半分が、電気的には同じ交点を逆向きに共有している形だ。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/0acc3ec12dec020c7ed73cd4ac1bc46c/blog-double-matrix.svg&quot; alt=&quot;倍マトリクスの配線図。R1〜R4とC1〜C6の各交点に、向きの違うキーが2つずつ付く&quot; /&gt;&lt;/p&gt;

&lt;p&gt;なにしろV30のバス (AD0-19 + ALE/RD/WRなどの制御線) だけでGPIOを25本近く持っていかれる上に、LCDのSPIやPSRAMのCSもあるので、キーボードに回せるピンは限られていた。&lt;/p&gt;

&lt;h3 id=&quot;電源&quot;&gt;電源&lt;/h3&gt;

&lt;p&gt;単4電池2本を&lt;strong&gt;3.3Vに昇圧&lt;/strong&gt;して、RP2350もV30も3.3Vで動かしている。昇圧は市販の昇圧モジュールをそのまま載せた。「5V用のV30を3.3Vで動かしても動く」というのは前作で確認済みなので、今回は最初から3.3V一本の設計にした。&lt;/p&gt;

&lt;p&gt;後から、リチウムイオン電池にしようかとも考えた。しかし、フル充電のリチウムイオン電池は4.0Vを超えるので、この構成では壊れそうだ。というわけで乾電池にしている。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/d99811f8c712f01aee331b157df497a2/PXL_20260324_230520608.RAW-01.jpg&quot; alt=&quot;電池2本を繋いでDOSが起動しているDOSCONの基板&quot; /&gt;&lt;/p&gt;

&lt;p&gt;電池側で消費電流を実測してみたら約250mAだった。単4のニッケル水素電池 (750mAhくらい) なら、単純計算で3時間くらいは動く事になる。もっと動かしたいなら、単3 (2000mAhくらい) にすれば8時間動くはずだし、2本を4本にしたら、更に倍の時間動くはずだ。&lt;/p&gt;

&lt;h3 id=&quot;ケース&quot;&gt;ケース&lt;/h3&gt;

&lt;p&gt;3Dプリント。モデリングはCADのGUIではなく、&lt;a href=&quot;https://replicad.xyz/&quot;&gt;replicad&lt;/a&gt;用のJavaScriptでコードとして書いている。キーキャップも自作で、刻印は自作のスクリプトでSVGを生成して多色3Dプリントで入れた。コミットログを見返すと4月末〜5月はほぼケースとキーキャップの調整に費やしていた。&lt;/p&gt;

&lt;p&gt;なぜケースにこんなに時間がかかるかというと、&lt;strong&gt;AIのエージェントループが回せないから&lt;/strong&gt;だ。ファームウエアなら「AIが書く → テストが落ちる → AIが直す」のループを勝手に回してくれるが、ケースは印刷して、実物に合わせて、寸法を直して、また印刷して…のフィードバックを人間が身体でやるしかない。1周に数時間かかるし、テストも書けない。AI時代の電子工作は「ガワ」が一番のボトルネックだ。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/6e686150aa7122e23b2878c4bc49e987/PXL_20260503_153412467.RAW-01.jpg&quot; alt=&quot;3Dプリントした黒いケースとキーキャップに収まった完成形のDOSCON&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;hidosを電池で持ち歩く&quot;&gt;HIDOSを電池で持ち歩く&lt;/h2&gt;

&lt;p&gt;動かしているOSは前作と同じ &lt;strong&gt;HIDOS&lt;/strong&gt; だ。hdk先輩の&lt;a href=&quot;https://github.com/hdk1983/HIDOS&quot;&gt;HIDOS&lt;/a&gt;は、Microsoftが公開したMS-DOS 2.11のソースをセルフビルドできる環境で、「何でもできる仮想デバイスが1つ+それを呼ぶBIOSコールが1つだけ」というミニマルなVM構成 (hidosvm) が用意されている。&lt;/p&gt;

&lt;p&gt;今回も&lt;a href=&quot;https://github.com/ikeji/HIDOS&quot;&gt;fork&lt;/a&gt;をサブモジュールとして組み込んでいるが、前作で適当に動くようにした修正は、本家で正式に修正されたので、今のforkの差分はビルドスクリプトのカスタマイズだけ。&lt;strong&gt;HIDOSのコードには一切手を入れていない&lt;/strong&gt;。VM_IO.SYSもそのままだ。ゆりかごがRP2040からRP2350になり、画面もキーボードも日本語も付いたのに、DOS側はノータッチで済んだ。「複雑さは全部VM側に置く」というhidosvmの設計の勝利だと思う。&lt;/p&gt;

&lt;p&gt;この方式の何が良いって、&lt;strong&gt;BIOSも8253タイマも8259 PICもCRTコントローラも一切実装しなくていい&lt;/strong&gt;事だ。DOSからのコンソール・ディスク・シリアルへのアクセスは、全部I/Oポート経由のシンプルなプロトコルになってRP2350に届く。V30がI/O命令を実行すると、バスを見ているcore1がそれを検出して共有フラグを立て、core0のホストループが拾ってコンソール/ディスク/AUXのハンドラに振り分ける。&lt;/p&gt;

&lt;h3 id=&quot;メモリマップ&quot;&gt;メモリマップ&lt;/h3&gt;

&lt;p&gt;V30から見えるメモリは448KB。前作の128KBから3.5倍だ。メモリの実体はRP2350の内蔵SRAM上の配列で、core1がV30のバスサイクルに合わせて出し入れしている。つまりRP2350が「メモリチップ」の役も演じている。&lt;/p&gt;

&lt;p&gt;RP2350の内蔵SRAMは全部で520KBあり、そのうち448KBをV30に渡して、残りをVRAMやバス制御などファームウエア自身のために使っている。&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;仮想アドレス&lt;/th&gt;
      &lt;th&gt;用途&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;0x00000〜&lt;/td&gt;
      &lt;td&gt;割り込みベクタ&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x00400〜&lt;/td&gt;
      &lt;td&gt;ユーザプログラム領域&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x10000&lt;/td&gt;
      &lt;td&gt;VM_IO.SYS (仮想I/Oドライバ) ※初期配置&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x18000&lt;/td&gt;
      &lt;td&gt;MSDOS.SYS (DOSカーネル) ※初期配置&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;〜0x6FFFF&lt;/td&gt;
      &lt;td&gt;空き (DOSアプリはここで動く)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0x70000〜0xFFFEF&lt;/td&gt;
      &lt;td&gt;何もない&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0xFFFF0&lt;/td&gt;
      &lt;td&gt;リセットベクタ + BIOS (16バイト)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;VM_IO.SYSとMSDOS.SYSのアドレスはブート時にロードされる初期値で、HIDOSが起動する過程で自分で移動する。&lt;/p&gt;

&lt;p&gt;448KBのRAMの上限は0x6FFFFで、そこからリセットベクタまでの間には何もない。V30が起動直後に読みに来るリセットベクタ (0xFFFF0) 以降の16バイトだけは、core1が特別に応答するようにしてある。この16バイトにリセットベクタとBIOSがまるごと収まっている。&lt;/p&gt;

&lt;p&gt;初期化時にメモリ全体を &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0xF4&lt;/code&gt; (HLT命令) で埋めておくのは前作のモニタの &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;f&lt;/code&gt; コマンドと同じ流儀で、暴走したらすぐ止まる。&lt;/p&gt;

&lt;h3 id=&quot;ディスク書き込み問題の解決&quot;&gt;ディスク書き込み問題の解決&lt;/h3&gt;

&lt;p&gt;前作で「作ったプログラムを保存する方法がない」と書いた問題は、2段構えで解決した。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Aドライブ&lt;/strong&gt;: ファームウエアに焼き込んだROMディスク。COMMAND.COMやDOSツール一式が入っている&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Bドライブ&lt;/strong&gt;: PSRAM上の4MB RAMディスク (FAT)。読み書き自由&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;前作は「メモリに余裕がないからRAMディスクは難しそう」と書いたが、RP2350はXIP (外部メモリをアドレス空間に直接マップして読み書きできる仕組み) のセカンダリインターフェースに8MBのPSRAMをぶら下げられるので、あっさり解決した。RAMディスクなので電源を切ると消えるが、それも後述のwarm rebootとYMODEM転送でだいぶ緩和されている。&lt;/p&gt;

&lt;h2 id=&quot;ターミナル&quot;&gt;ターミナル&lt;/h2&gt;

&lt;p&gt;前作は「PCに繋いで表示させていると感動も薄い」で終わったが、今回はDOSから見た画面とキーボードを全部ファームウエアで実装した。&lt;/p&gt;

&lt;h3 id=&quot;ansisys互換エスケープ&quot;&gt;ANSI.SYS互換エスケープ&lt;/h3&gt;

&lt;p&gt;DOSの世界では画面制御にANSI.SYSのエスケープシーケンスを使うのが定番だったので、CUP (カーソル移動) / ED・EL (消去) / SGR (色) / DECTCEM (カーソル表示) あたりを実装した。これでDOS側のフルスクリーンアプリ (後述のvi) がそのまま動く。&lt;/p&gt;

&lt;h3 id=&quot;日本語-sjisフォントutf-8変換&quot;&gt;日本語: SJIS、フォント、UTF-8変換&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;LCDには8×16の半角と16×16の全角フォントを載せ、40列×30行のテキスト画面として使う。フォントはビットマップ画像からRubyスクリプトでC++ソースに変換&lt;/li&gt;
  &lt;li&gt;DOS側の文字コードは当然Shift_JIS。LCDはSJISを直接解釈する&lt;/li&gt;
  &lt;li&gt;一方、USBでPCに繋いだときの標準入出力 (/dev/ttyACM0) は&lt;strong&gt;SJIS↔UTF-8を双方向変換&lt;/strong&gt;してから流す。現代の端末エミュレータでそのまま日本語が読み書きできる。JIS X 0208↔Unicodeの変換テーブルもスクリプトで生成した&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;既存の日本語表示ソフトウエアもそのまま動く。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/6ebc98552afb92e90a06110c4dfd18b5/PXL_20260411_080946100.RAW-02.ORIGINAL.jpg&quot; alt=&quot;既存の日本語表示ソフトウエアを動かしているDOSCONの画面&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;psramスクロールバッファ&quot;&gt;PSRAMスクロールバッファ&lt;/h3&gt;

&lt;p&gt;テキスト画面は40列×30行しかないので、PSRAMに&lt;strong&gt;4096行分のスクロールバッファ&lt;/strong&gt;を持たせた。Fnキーを単独タップするとスクロールモードに入り、&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;k&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;j&lt;/code&gt; やCtrl-F/Ctrl-Bで過去の出力を遡れる。DOS機なのにless的なスクロールバックがあるのはなかなか快適だ。&lt;/p&gt;

&lt;p&gt;Symキーのタップで文字を倍角表示にするモードも付けた。老眼にやさしい。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/d28ec5274ee8b331fc6b6dbdd4ba47f3/PXL_20260720_164439396.RAW-01.COVER.jpg&quot; alt=&quot;通常の画面&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/2844fe095eb779fb17f0e7bd72c3cc70/PXL_20260720_164412655.RAW-01.COVER.jpg&quot; alt=&quot;同じ画面を倍角表示にしたところ&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/5f97067118d776f982ce40624dc0a923/PXL_20260720_164246317.RAW-01.COVER.jpg&quot; alt=&quot;スクロールモードで過去の出力を遡っているところ&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;47キーに全部を詰め込む&quot;&gt;47キーに全部を詰め込む&lt;/h2&gt;

&lt;p&gt;47キーしかないので、自作キーボード界隈でおなじみのQMK風レイヤ方式にした。Ctrl / Shift / Sym (記号) / Num (数字) / Fnの修飾キーがあり、優先順位は &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl &amp;gt; Fn &amp;gt; Sym &amp;gt; Num &amp;gt; Shift &amp;gt; Base&lt;/code&gt;。レイヤ上で定義がないキーは下のレイヤに「透過」する (QMKの &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_______&lt;/code&gt; と同じ)。&lt;/p&gt;

&lt;p&gt;Fnキーはさらに QMKのLayer-Tap相当の判定をしていて:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;押しながら他のキー&lt;/strong&gt; → Fnレイヤ (F1〜F12、カーソル、PgUp/PgDn)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;単独タップ&lt;/strong&gt; → スクロールモードのトグル&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;左右のFnを同時押し&lt;/strong&gt; → MonitorShell (後述) 起動&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;同時押しの検出を専用ロジックにせず「FnレイヤのFnキー位置にシェル突入キーを仕込んでおく」だけで実現できたのは、レイヤ方式のきれいな副産物だった。&lt;/p&gt;

&lt;h2 id=&quot;モニタは今回も居る-bootshellとmonitorshell&quot;&gt;モニタは今回も居る: BootShellとMonitorShell&lt;/h2&gt;

&lt;p&gt;前作のモニタプログラム (メモリダンプ、逆アセンブル、XMODEM…) の精神は今作にも引き継がれていて、ファームウエアにはDOS以外に2つの「シェル」が入っている。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BootShell&lt;/strong&gt;は起動時にESCを押していると入る設定メニュー。CPUクロック、標準入出力をCDC/UARTどちらに繋ぐか、ドライブ構成、UTF-8変換の有無などをトグルして &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;b&lt;/code&gt; でDOSを起動する。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MonitorShell&lt;/strong&gt;はDOS実行中にFn両押し (または /dev/ttyACM1 に何か入力) で入れるモニタで、メモリダンプ、逆アセンブル、リセット、BOOTSEL (ファームウエア書き込みモード) 突入などができる。実行中のV30のメモリを外から覗けるので、DOS側のデバッグに重宝する。&lt;/p&gt;

&lt;p&gt;お気に入りが &lt;strong&gt;warm reboot&lt;/strong&gt; だ。RAMディスク (Bドライブ) の内容を保持したまま再起動できる。&lt;/p&gt;

&lt;p&gt;ただ、これはすんなり動いたわけではなかった。実装してみると、&lt;strong&gt;再起動をまたぐとRAMディスク上のファイルが化ける&lt;/strong&gt;。どこで化けているのかを調べるために、DOS上で動く&lt;a href=&quot;https://github.com/ikeji/sha1sum&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHA1SUM.EXE&lt;/code&gt;&lt;/a&gt; を作った。reboot前後でファイルのハッシュを取って突き合わせ、どのデータがいつ壊れるのかを絞り込んでいった。&lt;/p&gt;

&lt;p&gt;犯人はXIPキャッシュだった。RP2350のPSRAMはXIPキャッシュ越しにアクセスするので、RAMディスクに書いたつもりのデータの一部はまだキャッシュ上のダーティラインに居て、PSRAM本体には届いていない。その状態でリセットするとキャッシュごと消える、というオチだ。再起動前にキャッシュを明示的にflushしてから飛ぶようにして解決した。&lt;/p&gt;

&lt;p&gt;デバッグのために作ったSHA1SUMは、そのままディスクに同梱してファイル転送の照合ツールとして第二の人生を送っている。&lt;/p&gt;

&lt;h2 id=&quot;pcとの連携-3本のusbシリアル&quot;&gt;PCとの連携: 3本のUSBシリアル&lt;/h2&gt;

&lt;p&gt;USB-CでPCに繋ぐとCDC ACMが3本生える。pico-sdkのおかげで、この手のコンポジットシリアルデバイスは簡単に作れた。&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;デバイス&lt;/th&gt;
      &lt;th&gt;役割&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;/dev/ttyACM0&lt;/td&gt;
      &lt;td&gt;DOSの標準入出力 (LCDと並行、SJIS↔UTF-8変換つき)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;/dev/ttyACM1&lt;/td&gt;
      &lt;td&gt;ファームウエアのデバッグログ + モニタ起動&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;/dev/ttyACM2&lt;/td&gt;
      &lt;td&gt;DOSのAUX (COM1) 直結、生バイト&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;前作で「シリアルポートは画面のために使ってしまっているので多重化するか別の方法を考えないといけない」と書いた問題は、USBのコンポジットデバイスにして解決した。1本のUSBケーブルでコンソール・デバッグ・ファイル転送が同時に使える。&lt;/p&gt;

&lt;p&gt;ファイル転送はAUX経由のYMODEM。DOS側に&lt;a href=&quot;https://github.com/ikeji/xmodem&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SX.EXE&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RX.EXE&lt;/code&gt;&lt;/a&gt; を同梱していて、Linux側は &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lrzsz&lt;/code&gt; がそのまま使える。&lt;/p&gt;

&lt;p&gt;PCからDOSCONにファイルを送るには、DOSCON側で &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RX&lt;/code&gt; を実行してから、Linux側で &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sb&lt;/code&gt; を実行する:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;A&amp;gt; RX /Y
$ sb HELLO.TXT &amp;lt; /dev/ttyACM2 &amp;gt; /dev/ttyACM2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;逆にDOSCONからPCに送るには:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;A&amp;gt; SX /Y HELLO.TXT
$ rb &amp;lt; /dev/ttyACM2 &amp;gt; /dev/ttyACM2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;転送後の照合には、warm rebootのデバッグ用に作ったチェックサムプログラム (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CRC32SUM.EXE&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHA1SUM.EXE&lt;/code&gt;) がそのまま使える。前作でLHAが動かなくてLinux側で解凍した、みたいな運用が今回はだいぶ楽になった。&lt;/p&gt;

&lt;h2 id=&quot;viとtut-codeでこのマシンだけで開発する&quot;&gt;viとTUT-Codeで、このマシンだけで開発する&lt;/h2&gt;

&lt;p&gt;前作からの宿題だった「このマシン上でのソフトウエア開発」のために、ディスクにはHIDOSのビルド成果物 (COMMAND.COM、EDLIN、DEBUG、MASM、LINKなど) に加えて、自作の&lt;a href=&quot;https://github.com/ikeji/tiny-vi-clone&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VI.EXE&lt;/code&gt;&lt;/a&gt; を入れた。vi風のエディタで、ANSIエスケープで全画面制御する。&lt;/p&gt;

&lt;p&gt;RAMが448KBに増えたので、Cコンパイラもこのマシンの上で動く。入れたのは&lt;strong&gt;&lt;a href=&quot;https://www.vector.co.jp/soft/maker/lsi/se001169.html&quot;&gt;LSI C-86 試食版&lt;/a&gt;&lt;/strong&gt;。小学生の頃に使っていたコンパイラが、あの頃と同じV30の上で、今度は自分で作ったマシンで普通に動く。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/b747e195cd4db1a35b55c31a30967335/PXL_20260304_232636227.RAW-01.jpg&quot; alt=&quot;LSI C-86でhoge.cをコンパイルして実行しているDOSCONの画面&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copy con&lt;/code&gt; でFizzBuzzを書いて、コンパイルして、実行する。全部このマシンの中だ。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/c073fad3672742b1570825051e5d6a5b/PXL_20260304_234815293.RAW-01.jpg&quot; alt=&quot;copy conで書いたFizzBuzzをコンパイルして実行しているDOSCONの画面&quot; /&gt;&lt;/p&gt;

&lt;p&gt;そしてDOSCONで一番変なところかもしれないのが漢字入力で、IMEを積む代わりに &lt;strong&gt;TUT-Code&lt;/strong&gt; (2〜3打鍵で漢字を直接入力するコード体系) をviに内蔵した。IMEにしなかったのは、辞書を置くメモリがないから。同じ漢直でもT-Codeはこのキーボードではキーが足りないので、TUT-Codeに落ち着いた。変換候補ウィンドウも辞書引きも不要なので、448KBしかないDOSマシンと相性が良い。なお、日本語の表示はDOS全体でどこでもできるが、入力ができるのは今のところviの中だけだ。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/3bd6093261e361934140b11d16aac25b/PXL_20260720_164113767.RAW-01.COVER.jpg&quot; alt=&quot;vi.exeで『Hello world! こんにちは世界』と入力しているところ&quot; /&gt;&lt;/p&gt;

&lt;p&gt;これで、viでソースを書く → MASMやCコンパイラでビルド → 実行 →YMODEMでPCに吸い出す、までが電池駆動のポケットマシンで、しかも本物のV30の上で完結するようになった。&lt;/p&gt;

&lt;p&gt;MASMでHello Worldをアセンブルして動かした様子:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/e04af889e149d92d71ffb5cd7b89623c/PXL_20260302_160058083.RAW-01.jpg&quot; alt=&quot;HELLO.ASMのソースとMASMでのアセンブル結果を表示しているDOSCONの画面&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/d80c30ad729be145e6ab3ddcc2042894/PXL_20260302_160142030.RAW-02.ORIGINAL.jpg&quot; alt=&quot;LINKとEXE2BINでHELLO.COMを作って実行し、Hello Worldが表示されたDOSCONの画面&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;開発の記録&quot;&gt;開発の記録&lt;/h2&gt;

&lt;p&gt;コミットログから振り返ると、だいたいこんな流れだった。前作の記事を書いたのが2月11日。実はその頃には、もう次の基板の設計を始めていた。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;2月上旬&lt;/strong&gt;: KiCadで基板設計、発注&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;2月中旬&lt;/strong&gt;: MicroPythonでLCD/キーボードの単体動作確認 →C++でファームウエアの骨組み&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;2月23日&lt;/strong&gt;: V30バスインターフェースとI/O処理の初期実装&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;2月末&lt;/strong&gt;: HIDOSをサブモジュール化してディスクイメージのビルド、DOS起動&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;3月&lt;/strong&gt;: I/Oまわりの整備、SJIS/UTF-8、スクロールバッファ、BootShell/MonitorShell、warm reboot&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;4月&lt;/strong&gt;: DOS側ツール (vi、YMODEM)、README整備&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;4月末〜5月&lt;/strong&gt;: ケースとキーキャップの調整、倍角モードなど仕上げ&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;約4ヶ月、74コミット。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://uploader.apps.ikeji.ma/file/45af89da7b1d7a477ff7b64b3d435626/PXL_20260222_165732481.RAW-01.jpg&quot; alt=&quot;組み立てた基板の上で初めてMS-DOSが起動した時の画面&quot; /&gt;&lt;/p&gt;

&lt;p&gt;初めてLCDの上でDOSが起動した時の様子。ここから先は「動くDOSマシンをいじって拡張していく」楽しいフェーズだった。&lt;/p&gt;

&lt;p&gt;今回もAIに実装を任せるつもりだったので、&lt;strong&gt;テストは過剰なぐらいに整備した&lt;/strong&gt;。ファームウエアの全クラスをテンプレートで差し替え可能にして、FakeHAL/FakeScreenなどを注入したホスト側gtest (Pico SDK不要)を用意し、エスケープシーケンスの解釈やキーボードのレイヤ判定のような「実機だとデバッグが面倒なロジック」は全部PC上のテストで検証できるようにした。AIが自分でテストを回して自分で直せる環境を作れば、ソフトウエアの開発はよく回る。&lt;/p&gt;

&lt;p&gt;一方で、前述の通りケースはテストが書けない。AIループが回るソフトと回らないガワで、かかる時間が逆転したのが今回の学びだった。&lt;/p&gt;

&lt;p&gt;もうひとつ、実装前に設計メモを &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;firmware/docs/&lt;/code&gt; に書き溜めながら進めるスタイルを取った。メモリマップ、キーの論理化、I/Oの仕様など13本。あとから見返せるし、この記事の下書きにもなった。&lt;/p&gt;

&lt;h2 id=&quot;まとめと今後&quot;&gt;まとめと今後&lt;/h2&gt;

&lt;p&gt;前作の展望3つ (ディスク書き込み・メモリ・画面とキーボード) は全部回収した。ついでに日本語表示と漢字入力まで付いた。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;基板からOSまで全レイヤが自分の手元にあると、レイヤ間の「境界」を自分で決められるのが最高に楽しい (BIOSを丸ごと捨ててI/Oポートプロトコル1本にする、など)&lt;/li&gt;
  &lt;li&gt;RP2350は「CPU以外の全部」を演じる筐体として十分すぎる性能。V30のバス制御とUSBと画面を回してもまだ余裕がある&lt;/li&gt;
  &lt;li&gt;MS-DOS 2.11は448KBあれば快適に住める&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;そして何より、小学生の頃に夢想した「キーボード付きのゲームボーイでプログラムを書く」が、電池2本で手の中にある。&lt;/p&gt;

&lt;p&gt;今後の展望:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;配線を間違えたSDカードを、PIOでソフトSPIを生やして救済する&lt;/li&gt;
  &lt;li&gt;そして次は、V30からは離れて、もっと別の物を作ってみたい。そもそも今回DOSを選んだのは「既存のDOS資産が活かせるのでは」という目論見だったからだが、ここまでAIの開発力が高いなら、OSもコンパイラも、なんならCPUも、自作を視野に入れていいのかもしれない&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;リポジトリ:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;DOSCON 本体: &lt;a href=&quot;https://github.com/ikeji/doscon&quot;&gt;https://github.com/ikeji/doscon&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;VI.EXE: &lt;a href=&quot;https://github.com/ikeji/tiny-vi-clone&quot;&gt;https://github.com/ikeji/tiny-vi-clone&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;SX.EXE/RX.EXE: &lt;a href=&quot;https://github.com/ikeji/xmodem&quot;&gt;https://github.com/ikeji/xmodem&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;SHA1SUM.EXE/CR32SUM.EXE: &lt;a href=&quot;https://github.com/ikeji/sha1sum&quot;&gt;https://github.com/ikeji/sha1sum&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;HIDOS (fork): &lt;a href=&quot;https://github.com/ikeji/HIDOS/tree/doscon&quot;&gt;https://github.com/ikeji/HIDOS/tree/doscon&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;HIDOS 本家: &lt;a href=&quot;https://github.com/hdk1983/HIDOS&quot;&gt;https://github.com/hdk1983/HIDOS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;おわり&quot;&gt;おわり&lt;/h2&gt;

&lt;p&gt;今回もいろいろ勉強になりました。&lt;/p&gt;

&lt;p&gt;先人の知恵に感謝します。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;HIDOSを作ったhdk先輩&lt;/li&gt;
  &lt;li&gt;TUT-Codeを考えた人達&lt;/li&gt;
  &lt;li&gt;QMKに代表される自作キーボード文化&lt;/li&gt;
  &lt;li&gt;lrzszを今もメンテしている人達&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 21 Jul 2026 22:06:28 +0900</pubDate>
        <link>http://blog.ikejima.org/make/8088/2026/07/21/doscon.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/make/8088/2026/07/21/doscon.html</guid>
        
        <category>V30 PC Cyberdeck HIDOS</category>
        
        
        <category>Make</category>
        
        <category>8088</category>
        
      </item>
    
      <item>
        <title>2026W29</title>
        <description>&lt;ul&gt;
  &lt;li&gt;20260714
    &lt;ul&gt;
      &lt;li&gt;DOSCON
        &lt;ul&gt;
          &lt;li&gt;消費電力を計測した。&lt;/li&gt;
          &lt;li&gt;エネループ2本で給電して250mA消費だった。7-8時間ぐらい?&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260715
    &lt;ul&gt;
      &lt;li&gt;X260
        &lt;ul&gt;
          &lt;li&gt;持ち上げて、トンと置いたら再起動した。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;20260719
    &lt;ul&gt;
      &lt;li&gt;HDD
        &lt;ul&gt;
          &lt;li&gt;バックアップ用に14TBの外付けHDDを買った。&lt;/li&gt;
          &lt;li&gt;MicroUSB3.0だった。まじか。&lt;/li&gt;
          &lt;li&gt;luksとzfsで初期化&lt;/li&gt;
          &lt;li&gt;とりあえず、データで埋めてみる。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 21 Jul 2026 22:04:13 +0900</pubDate>
        <link>http://blog.ikejima.org/weekly/2026/07/21/2026w29.html</link>
        <guid isPermaLink="true">http://blog.ikejima.org/weekly/2026/07/21/2026w29.html</guid>
        
        
        <category>Weekly</category>
        
      </item>
    
  </channel>
</rss>
