适用于 RP2350 的 386 PC
A 386 PC for Your RP2350

原始链接: https://github.com/rh1tech/frank-386

**FRANK** (frank.rh1.tech) 是一款专为树莓派 Pico 2 (RP2350) 设计的高性能 i386 PC 模拟器。它基于何春晖(Chunhui He)的 *Tiny386* 开发,使 RP2350 开发板能够运行 DOS、Windows 3.x、Windows 95 以及 Linux 系统。 **主要功能:** * **硬件模拟:** 完整的 i386/i486/i586 CPU 模拟,可选 x87 FPU,支持最高 8MB PSRAM。 * **外设支持:** 支持 VGA/HDMI 输出、用于磁盘镜像(软盘/硬盘/ISO)的 SD 卡存储、PS/2 或 USB 键盘/鼠标,以及 NES 手柄支持。 * **音频:** 包含模拟的 AdLib (OPL2)、Sound Blaster 16、PC Speaker、Tandy、Covox 和 Disney Sound Source。 * **用户界面:** 提供运行时磁盘管理器(Win+F12)用于热插拔镜像,以及设置菜单(Win+F11)以便即时调整硬件配置。 **技术要求:** 该固件支持多种 RP2350 开发板(M1、M2、Olimex PC、Waveshare Z2),并要求 SD 卡中配置 `bios.bin`、`vgabios.bin` 和 `config.ini` 文件。构建选项允许对 CPU(最高 504MHz)和 PSRAM 进行超频,并针对 USB-HID 和视频输出提供了特定的标记。该项目基于 MIT 许可证开源,集成了包括 SeaBIOS 和 FatFs 在内的多个成熟模拟库。

```Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 为您的 RP2350 制作一台 386 PC (github.com/rh1tech) 12 分,由 SamuraiLion 发布于 1 小时前 | 隐藏 | 过往 | 收藏 | 讨论 | 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:```
相关文章

原文

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.

  • Full i386 (and partially i486/i586) CPU emulation with optional x87 FPU
  • Up to 8MB RAM (using 8MB PSRAM)
  • VGA and HDMI graphics output (text modes and graphics up to 640x480)
  • Sound: AdLib OPL2, Sound Blaster 16, PC Speaker, Tandy, Covox, Disney Sound Source
  • SD card support for floppy, hard disk, and CD-ROM images
  • Runtime disk manager (Win+F12) for hot-swapping disk images
  • Settings menu (Win+F11) for changing emulator configuration
  • PS/2 keyboard and mouse input
  • USB keyboard and mouse input (via native USB Host)
  • NES gamepad support with mouse emulation mode
  • Boots DOS, Windows 3.x, Windows 95, Linux, and more

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5

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

  • Raspberry Pi Pico 2 (RP2350) or compatible board
  • 8MB PSRAM (required for extended memory)
  • VGA or HDMI connector
  • SD card module (SPI mode)
  • PS/2 keyboard (directly connected) - OR - USB keyboard (via native USB port)
  • Audio output (optional): I2S DAC or PWM

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.

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

Signal M1 GPIO M2 GPIO
Base 6 12
Range 6-13 12-19
Signal M1 GPIO M2 GPIO
CLK 2 6
CMD 3 7
DAT0 4 4
DAT3/CS 5 5
Signal M1 GPIO M2 GPIO
CLK 0 2
DATA 1 3
Signal M1 GPIO M2 GPIO
CLK 14 0
DATA 15 1
Signal M1 GPIO M2 GPIO
CLK 14 20
DATA 16 26
LATCH 15 21
Signal M1 GPIO M2 GPIO
DATA 26 9
BCLK 27 10
LRCLK 28 11

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

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

Floppy Images (.img):

  • Standard 1.44MB floppy images (1474560 bytes)
  • Create with: dd if=/dev/zero of=floppy.img bs=512 count=2880
  • Format with DOS or use pre-made DOS boot disks

Hard Disk Images (.img):

  • Raw disk images up to 2GB
  • Create with: dd if=/dev/zero of=hdd.img bs=1M count=512
  • Use FDISK and FORMAT from DOS to partition and format

CD-ROM Images (.iso):

  • Standard ISO 9660 images
  • Use CD burning software to create ISOs from CDs

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.

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

Configure emulator settings at runtime:

  • Memory size (1-8 MB)
  • CPU generation (386/486/586)
  • FPU emulation on/off
  • Sound devices (AdLib, SB16, PC Speaker, Tandy, Covox, MPU-401, DSS)
  • PS/2 or USB Mouse on/off
  • NES Mouse on/off (emulate mouse with NES gamepad D-pad, B=left click, A=right click)
  • RP2350 CPU frequency and voltage
  • PSRAM / Flash frequency

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

Manage disk images without restarting:

  • Insert/eject floppy images (A:, B:)
  • Insert/eject hard disk images (C:, D:)
  • Insert/eject CD-ROM images (E:)
  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
# 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
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
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

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:

  • frank-386_m1_<version>.uf2 - M1 board (Murmulator)
  • frank-386_m2_<version>.uf2 - M2 board (Murmulator)
  • frank-386_pc_<version>.uf2 - Olimex PICO-PC
  • frank-386_z2_<version>.uf2 - Waveshare RP2350-PiZero
# With device in BOOTSEL mode:
picotool load build/frank-386.uf2

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

"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.

  • For PS/2: Check keyboard connection and GPIO pins
  • For USB: Ensure firmware was built with --usb-hid option
  • Ensure SD card is formatted as FAT32
  • Check SD card module connections
  • Verify 386/ directory exists on SD card

MIT License. See LICENSE for details.

Mikhail Matveev & DnCraptor

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

  • Project: Tiny386 - x86 PC Emulator
  • Author: Chunhui He
  • License: BSD 3-Clause
  • Description: The core i386 CPU emulator and PC peripheral emulation (8259 PIC, 8254 PIT, 8042 keyboard controller, VGA, sound devices).
  • Project: Pico-286
  • Author: xrip
  • License: MIT
  • Description: RP2350 platform integration, disk management, VGA driver concepts.
  • Project: QuakeGeneric
  • Author: DnCraptor
  • License: GPL v2
  • Description: RP2350 hardware integration patterns, Murmulator platform support, and PS/2 mouse driver implementation.
  • Project: QEMU
  • Authors: Fabrice Bellard (2003-2017), Vassili Karpov "malc" (2003-2005), Joachim Henke (2006)
  • License: MIT
  • Description: PC peripheral emulation code including 8259 PIC, 8254 PIT, 8257 DMA, 8042 keyboard controller, PCI bus, PC speaker, VGA, and AdLib OPL2 proxy.
  • Project: MAME
  • Author: Tatsuyuki Satoh (1999-2000)
  • License: LGPL 2.1+
  • Description: FM OPL sound generator (fmopl) for AdLib emulation, forked from MAME and relicensed under LGPL.
  • Project: inih
  • Author: Ben Hoyt (2009-2020)
  • License: BSD 3-Clause
  • Description: Simple INI file parser for configuration file handling.
  • Project: SeaBIOS
  • Authors: Kevin O'Connor and contributors
  • License: GNU LGPL v3
  • Description: x86 BIOS and VGA BIOS firmware.
  • Project: FatFs
  • Author: ChaN (2014, 2021)
  • License: FatFs License (BSD-style)
  • Description: Generic FAT filesystem module for SD card access.
  • Author: Carl John Kugler III (2021)
  • License: Apache 2.0
  • Description: FatFs utility functions for error handling and result string conversion.
  • Project: Pico SDK
  • Author: Raspberry Pi (Trading) Ltd. (2020)
  • License: BSD 3-Clause
  • Description: PIO SPI driver for SD card communication.
联系我们 contact @ memedata.com