Skip to content

Document dmod_link_modules installation, configuration file mechanism, and device numbering#13

Merged
JohnAmadis merged 4 commits intomainfrom
copilot/update-readme-installation-methods
Feb 5, 2026
Merged

Document dmod_link_modules installation, configuration file mechanism, and device numbering#13
JohnAmadis merged 4 commits intomainfrom
copilot/update-readme-installation-methods

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

The README incorrectly showed mounting with NULL config parameter and didn't document the dmod_link_modules CMake macro or the configuration file mechanism.

Changes

  • Installation methods reorganized - Added dmod_link_modules as Method 1 (recommended), explicitly documenting that it handles module downloading, dependency resolution, and linking
  • Usage example corrected - Changed mount call from dmvfs_mount_fs("dmdevfs", "/mnt", NULL) to dmvfs_mount_fs("dmdevfs", "/mnt", "/etc/dmdevfs") with explicit note that config path is required
  • Configuration files section added - Documents INI format, directory structure (flat/hierarchical), interpretation flow (discovery → parsing → loading → initialization → mapping), and troubleshooting
  • Driver name resolution documented - Explains the 3-priority mechanism: (1) INI file content driver_name field, (2) configuration filename, (3) directory name
  • Device numbering mechanism documented - Complete documentation of dev_num structure with major/minor/flags, path generation rules for all combinations, and examples showing how device numbers affect resulting filesystem paths

Example Configuration

[main]
driver_name = dmspiflash
spi_bus = 0
chip_select = 1
speed_hz = 1000000
mode = 0

Configuration files are discovered recursively, parsed via dmini, and passed to the driver's dmdrvi_create() function at mount time.

Path Generation Examples

The device number returned by the driver determines the filesystem path:

  • Major + Minor → dmspiflash0/1
  • Minor only → dmi2ceepromx/0
  • Major only → dmuartstorage2
  • Neither → dmgenericdriver
Original prompt

This section details on the original issue you should resolve

<issue_title>Zaktualizować README.md o możliwe metody instalacji dmdevfs</issue_title>
<issue_description>Najwygodniejszym sposobem na dodanie dmdevfs do swojego projektu opartego na DMOD (w trybie modułu) jest wykorzystanie makra w CMake dmod_link_modules - warto by było zaktualizować README aby to uwzględniał.

Co więcej - przykład pokazuje, że parametr konfiguracyjny może być pusty, a tymczasem z tego co wiem podczas montowania musimy podać ścieżkę zawierającą konfiguracje dla drivera - jest to bardzo ważny mechanizm, który zasługuje na osobny rozdział w readme ze szczegółowym opisem w jaki sposób wykorzystywać pliki konfiguracyjne, w jaki sposób są interpretowane i jakie są możliwości </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…nsive configuration documentation

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Update README.md with installation methods for dmdevfs Document dmod_link_modules installation and configuration file mechanism Feb 5, 2026
Copilot AI requested a review from JohnAmadis February 5, 2026 16:51
@JohnAmadis
Copy link
Contributor

@copilot przyjrzyj się dokładnie implementacji - nazwa drivera może pochodzić:

  1. Z zawartości pliku *.ini - w sekcji main jako pole driver_name
  2. Z basename nazwy pliku konfiguracyjnego
  3. Z nazwy katalogu z konfiguracjami (czyli np można trzymać wszystkie pliki konfiguracyjne SPI w jednym katalogu)

Opowiedz też o node->dev_num -> o tym jaki wpływ na pliki konfiguracyjne i wynikowe ma. O tym, że może być minor albo major podany, jaka będzie nazwa pliku wynikowego itd

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot przyjrzyj się dokładnie implementacji - nazwa drivera może pochodzić:

  1. Z zawartości pliku *.ini - w sekcji main jako pole driver_name
    ...

Done in c622b0c.

Added comprehensive documentation covering:

Driver Name Resolution (3 priority levels):

  1. INI file content (driver_name field) - highest priority
  2. Configuration filename (basename without .ini)
  3. Directory name (for hierarchical organization)

Device Numbering (dev_num) with full path generation table:

  • Major + Minor → <driver_name><major>/<minor> (e.g., spiflash0/1)
  • Minor only → <driver_name>x/<minor> (e.g., spiflashx/0)
  • Major only → <driver_name><major> (e.g., spiflash0)
  • Neither → <driver_name> (e.g., spiflash)

Includes examples for all combinations with configuration files and resulting filesystem paths.

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title Document dmod_link_modules installation and configuration file mechanism Document dmod_link_modules installation, configuration file mechanism, and device numbering Feb 5, 2026
@JohnAmadis JohnAmadis marked this pull request as ready for review February 5, 2026 17:17
@JohnAmadis JohnAmadis merged commit 0398656 into main Feb 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zaktualizować README.md o możliwe metody instalacji dmdevfs

2 participants