frank-386 README

The project's README from github.com/rh1tech/frank-386. As one markdown file: README.md.

FRANK 386

Official page: frank.rh1.tech — hub for all FRANK boards and firmware.

i386 PC Emulator for RP2350 (Raspberry Pi Pico 2) with VGA/HDMI output, SD card storage, PS/2 and USB keyboard/mouse, NES gamepad, and audio output.

Based on Tiny386 by Chunhui He.

Features

Screenshots

FRANK 386 in Action

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5

Supported Boards

This firmware is designed for RP2350-based boards with integrated VGA/HDMI, SD card, and keyboard input:

Hardware Requirements

Note: When USB HID is enabled, the native USB port is used for keyboard/mouse input. USB serial console (CDC) is disabled in this mode; use UART for debug output.

Board Configurations

Four GPIO layouts are supported: M1, M2, PC (Olimex), and Z2 (Waveshare).

VGA / HDMI

Signal M1 GPIO M2 GPIO
Base 6 12
Range 6-13 12-19

SD Card (SPI mode)

Signal M1 GPIO M2 GPIO
CLK 2 6
CMD 3 7
DAT0 4 4
DAT3/CS 5 5

PS/2 Keyboard

Signal M1 GPIO M2 GPIO
CLK 0 2
DATA 1 3

PS/2 Mouse

Signal M1 GPIO M2 GPIO
CLK 14 0
DATA 15 1

NES/SNES Gamepad

Signal M1 GPIO M2 GPIO
CLK 14 20
DATA 16 26
LATCH 15 21

I2S Audio

Signal M1 GPIO M2 GPIO
DATA 26 9
BCLK 27 10
LRCLK 28 11

SD Card Setup

Directory Structure

Create a 386/ directory on your SD card:

SD Card Root/
└── 386/
    ├── config.ini      # Configuration file
    ├── bios.bin        # SeaBIOS ROM (required)
    ├── vgabios.bin     # VGA BIOS ROM (required)
    ├── dos622.img      # Hard disk image
    ├── boot.img        # Floppy image
    └── ...             # Other disk images

BIOS Files

Download SeaBIOS and VGA BIOS from the SeaBIOS releases or use bios.bin/vgabios.bin from sdcard/386.

Configuration File (config.ini)

Create 386/config.ini:

[pc]
mem=8M
bios=bios.bin
vga_bios=vgabios.bin

[frank-386]
cpu_freq=504
psram_freq=166

Preparing Disk Images

Floppy Images (.img):

Hard Disk Images (.img):

CD-ROM Images (.iso):

Loading Disk Images

At Boot: Configure disk images in config.ini as shown above.

At Runtime (Disk Manager):

  1. Press Win+F12 to open the Disk Manager
  2. Use arrow keys to select a drive (A:, B:, C:, D:, E:)
  3. Press Enter to browse disk images in the 386/ directory
  4. Select an image file to insert, or eject the current disk
  5. Press Escape to close the Disk Manager

Changes made via Disk Manager are saved to config.ini automatically.

Controls

Keyboard Shortcuts

Shortcut Action
Win+F12 Open Disk Manager
Win+F11 Open Settings Menu
Ctrl+Alt+Delete System reset (sent to guest OS)

Settings Menu (Win+F11)

Configure emulator settings at runtime:

Settings are saved to config.ini and take effect after restart.

Disk Manager (Win+F12)

Manage disk images without restarting:

Building

Prerequisites

  1. Install the Raspberry Pi Pico SDK (version 2.0+)
  2. Set environment variable: export PICO_SDK_PATH=/path/to/pico-sdk
  3. Install ARM GCC toolchain

Build Steps

# Clone the repository
git clone https://github.com/rh1tech/frank-386.git
cd frank-386

# Build with default settings (M2 board, 378MHz, PS/2 keyboard)
./build.sh

# Build for M1 board
./build.sh -M1

# Build with USB keyboard support
./build.sh --usb-hid

# Custom build
./build.sh -b M1 -c 504 -p 166 --debug

Build Options (build.sh)

Option Description
-b, --board <M1|M2|PC|Z2> Board variant (default: M2)
-c, --cpu <MHz> CPU speed: 378 (default), 504
-p, --psram <MHz> PSRAM speed: 133 (default), 166
--usb-hid Enable USB keyboard (disables USB serial)
--hdmi Force HDMI output
--debug Enable debug output
-clean Clean build directory first

Build Options (CMake)

Option Description
-DPICO_BOARD=pico2 Build for RP2350 (default)
-DBOARD=M1 Use M1 GPIO layout
-DBOARD=M2 Use M2 GPIO layout (default)
-DBOARD=PC Use Olimex PICO-PC layout
-DBOARD=Z2 Use Waveshare RP2350-PiZero layout
-DCPU_SPEED=378 CPU clock in MHz (378, 504)
-DPSRAM_SPEED=133 PSRAM clock in MHz (133, 166)
-DUSB_HID_ENABLED=ON Enable USB keyboard (disables USB serial)
-DDEBUG_ENABLED=ON Enable verbose debug logging
-DFORCE_HDMI=ON Force HDMI output

Release Builds

To build all firmware variants:

# Interactive (prompts for version)
./release.sh

# With version number
./release.sh 1.02

This creates firmware files in the release/ directory:

Flashing

# With device in BOOTSEL mode:
picotool load build/frank-386.uf2

# Or use the flash script:
./flash.sh

Troubleshooting

"0 bytes of memory" during Windows 95 setup

Use setup /im to bypass memory check.

"Protection error" during Windows 95 startup

Use patcher9x.

Enable mapdrive.com support (redirector) to map SD-card to network-attached-drive H

Set redirector = 1 in config.ini.

No keyboard input

SD card not detected

License

MIT License. See LICENSE for details.

Authors & Contributors

Mikhail Matveev & DnCraptor

Acknowledgments

This project is based on the following open-source projects:

Tiny386

Pico-286

QuakeGeneric

QEMU

MAME FM Sound Generator

inih

SeaBIOS

FatFs

FatFs Utilities

Raspberry Pi Pico SDK

frank-386 (rh1tech/frank-386)

Searching Database…

这是什么?FRANK 386 是一个 i386 PC 模拟器,以固件形式运行在 Raspberry Pi Pico 2(RP2350)上,把这块开发板变成一台迷你复古 PC,带有 VGA/HDMI 视频、SD 卡存储、键盘鼠标输入和声音。它是 Chunhui He 的 Tiny386 的移植版。
所以它不是装在我电脑上的程序——而是 Pico 开发板本身变成那台电脑?没错。你把它作为固件刷写到 RP2350 开发板上,仅靠这块微控制器就能模拟整台机器——CPU、显卡、声卡和磁盘驱动器。运行时完全不需要电脑主机。
我怎么把它跑起来?把为你的开发板编译好的 .uf2 固件刷写到 RP2350 上,然后准备一张 FAT32 格式的 SD 卡,里面放一个 386/ 目录,包含 SeaBIOS 和 VGA BIOS 文件、你的磁盘镜像,以及一个指向这些文件的 config.ini。
除了开发板,我还需要什么硬件?扩展内存需要 8MB 的 PSRAM,另外还要一个 VGA 或 HDMI 接口、一个以 SPI 模式接线的 SD 卡模块,以及一个 PS/2 或 USB 键盘。通过 I2S DAC 或 PWM 输出声音是可选的。
它的性能大概相当于什么样的电脑,实际能运行什么?可以想象成 90 年代初的硬件:完整模拟 i386、部分模拟 i486/i586,可选 x87 浮点协处理器,内存最多 8MB,图形最高支持 640x480。在这个范围内,它可以启动 DOS、Windows 3.x、Windows 95 和 Linux。
我可以把它刷写到哪些开发板上?支持四种 GPIO 布局:FRANK、Murmulator(M1 和 M2 两种版本)、Olimex PICO-PC 以及 Waveshare RP2350-PiZero。Release 构建会为每种开发板生成单独的 .uf2 文件。
它模拟哪些声卡硬件?AdLib OPL2、Sound Blaster 16、PC Speaker、Tandy、Covox、Disney Sound Source 和 MPU-401——全部都可以在设置菜单(Win+F11)中开关。
能不能不重启就换磁盘?可以——Win+F12 会打开一个运行时的磁盘管理器,用于插入和弹出软盘(A:、B:)、硬盘(C:、D:)和 CD-ROM(E:)镜像,更改会自动保存回 config.ini。
Windows 95 不用特殊技巧就能运行吗?基本可以——有两个已知的坑:安装时加上 setup /im 参数跳过内存检测;如果启动时停在保护错误上,就打 patcher9x 补丁。
Creator
rh1tech
Size
21.8 MB
Stars
210
Age
8mo
Commits · 90 Days