Skip to content

Commit f8727a2

Browse files
committed
Merge branch 'filesystem': FAT filesystem on flash with require support
2 parents f26795e + f9bc98b commit f8727a2

15 files changed

Lines changed: 1317 additions & 224 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ Design documents and implementation notes are in `doc/`:
2424
- [doc/psram.md](doc/psram.md) — PSRAM driver (APS6404L, QMI CS1 initialization, XIP mapping)
2525
- [doc/dvi.md](doc/dvi.md) — DVI output (HSTX, DMA, text/pixel modes, stability analysis)
2626
- [doc/dvi/batch-rendering.md](doc/dvi/batch-rendering.md) — Batch scanline rendering (N=4, line buffers, descriptor layout)
27+
- [doc/dvi/text-mode-rendering.md](doc/dvi/text-mode-rendering.md) — Text mode rendering (VRAM, font cache, scanline renderer)
28+
- [doc/dvi/stability.md](doc/dvi/stability.md) — DVI stability analysis (bus contention, flash write safety, diagnostics)
2729
- [doc/usb-host-keyboard.md](doc/usb-host-keyboard.md) — USB host keyboard (PIO-USB, HID, Ruby/C API)
30+
- [doc/filesystem.md](doc/filesystem.md) — FAT filesystem on flash (FatFs, VFS, flash write safety)
2831

2932
## Documentation style
3033

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ add_executable(harucom_os
118118
src/main.c
119119
src/hal.c
120120
src/psram.c
121+
src/flash_disk.c
122+
src/platform.c
123+
src/env.c
121124
${PICORUBY_ROOT}/mrbgems/picoruby-gpio/ports/rp2040/gpio.c
122125
mrbgems/picoruby-usb-host/ports/rp2350/usb_host.c
123126
)
@@ -144,6 +147,7 @@ target_compile_definitions(harucom_os PRIVATE
144147
MRB_TIMESLICE_TICK_COUNT=10
145148
MRB_USE_TASK_SCHEDULER=1
146149
NO_CLOCK_GETTIME=1
150+
USE_FAT_FLASH_DISK=1
147151
NDEBUG=1
148152
BOARD_TUH_RHPORT=1
149153
)
@@ -152,6 +156,7 @@ target_compile_options(harucom_os PRIVATE -fshort-enums)
152156

153157
target_include_directories(harucom_os PRIVATE
154158
${CMAKE_CURRENT_LIST_DIR}/src
159+
${CMAKE_CURRENT_LIST_DIR}/include
155160
${PICORUBY_ROOT}/include
156161
${PICORUBY_ROOT}/build/${PICORUBY_BUILD_CONFIG}/include
157162
${PICORUBY_ROOT}/mrbgems/picoruby-mruby/lib/mruby/include
@@ -161,6 +166,12 @@ target_include_directories(harucom_os PRIVATE
161166
${PICORUBY_ROOT}/mrbgems/picoruby-gpio/include
162167
${PICORUBY_ROOT}/mrbgems/picoruby-mruby/lib/mruby/mrbgems/mruby-task/include
163168
${PICORUBY_ROOT}/mrbgems/picoruby-machine/include
169+
${PICORUBY_ROOT}/mrbgems/picoruby-require/include
170+
${PICORUBY_ROOT}/mrbgems/picoruby-env/include
171+
${PICORUBY_ROOT}/mrbgems/picoruby-time/include
172+
${PICORUBY_ROOT}/mrbgems/picoruby-filesystem-fat/include
173+
${PICORUBY_ROOT}/mrbgems/picoruby-filesystem-fat/lib/ff14b/source
174+
${PICORUBY_ROOT}/mrbgems/picoruby-filesystem-fat/src/hal
164175
${PICORUBY_ROOT}/build/${PICORUBY_BUILD_CONFIG}/mrbgems
165176
${CMAKE_CURRENT_LIST_DIR}/mrbgems/picoruby-usb-host/include
166177
)

build_config/harucom-os-pico2.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
conf.cc.defines << "MRB_USE_CUSTOM_RO_DATA_P"
1313
conf.cc.defines << "MRB_LINK_TIME_RO_DATA_P"
1414
conf.cc.defines << "NO_CLOCK_GETTIME=1"
15+
conf.cc.defines << "USE_FAT_FLASH_DISK"
1516

1617
conf.cc.command = "arm-none-eabi-gcc"
1718
conf.linker.command = "arm-none-eabi-ld"
@@ -39,7 +40,11 @@
3940
conf.microruby
4041

4142
conf.gembox "minimum"
43+
conf.gem gemdir: "#{MRUBY_ROOT}/mrbgems/picoruby-mruby/lib/mruby/mrbgems/mruby-string-ext"
4244
conf.gem core: 'picoruby-gpio'
45+
conf.gem core: 'picoruby-require'
46+
conf.gem core: 'picoruby-vfs'
47+
conf.gem core: 'picoruby-filesystem-fat'
4348
conf.gem File.expand_path('../../mrbgems/picoruby-dvi', __FILE__)
4449
conf.gem File.expand_path('../../mrbgems/picoruby-usb-host', __FILE__)
4550
end

0 commit comments

Comments
 (0)