{"id":50679228,"url":"https://github.com/gerph/riscos-nvramhw","last_synced_at":"2026-06-08T17:32:13.854Z","repository":{"id":355327522,"uuid":"1194424403","full_name":"gerph/riscos-nvramhw","owner":"gerph","description":"RISC OS NVRAMHW module","archived":false,"fork":false,"pushed_at":"2026-05-03T02:01:29.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-03T04:06:13.490Z","etag":null,"topics":["riscos"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-28T10:40:20.000Z","updated_at":"2026-05-03T02:00:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gerph/riscos-nvramhw","commit_stats":null,"previous_names":["gerph/riscos-nvramhw"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/gerph/riscos-nvramhw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-nvramhw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-nvramhw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-nvramhw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-nvramhw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerph","download_url":"https://codeload.github.com/gerph/riscos-nvramhw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-nvramhw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34073778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["riscos"],"created_at":"2026-06-08T17:32:13.538Z","updated_at":"2026-06-08T17:32:13.849Z","avatar_url":"https://github.com/gerph.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NVRAMHW - NVRAM Vector Hardware Module\n\nA RISC OS module that implements the NVRAMV software vector for non-volatile RAM operations.\n\n## Overview\n\nThis module provides a prototype implementation of the NVRAMV vector (vector 0x3E), which is used by RISC OS Kernel 9.48 and later to delegate NVRAM handling to hardware support modules. The module intercepts NVRAM operations and provides stub implementations that simulate NVRAM hardware.\n\n## Features\n\n- **NVRAMV Vector Implementation**: Claims and handles the NVRAMV vector\n- **Three Operations Supported**:\n  - **FillCache** (reason 0): Populates a cache buffer with NVRAM data (up to 240 bytes)\n  - **ReadByte** (reason 1): Reads a single byte from NVRAM\n  - **WriteByte** (reason 2): Writes a single byte to NVRAM\n- **Stub Hardware Implementation**: Simulates NVRAM with in-memory storage\n- **Debug Output**: Comprehensive debug logging of all operations\n- **PCF8583 Example**: Comments describing how to interface with a real PCF8583 RTC/NVRAM chip via IIC\n\n## Requirements\n\n- RISC OS 3.1 or later\n- AMU (RISC OS Make Utility) build environment\n- CMHG (C Module Header Generator)\n\n## Building\n\n### Build the Module\n\n```bash\nriscos-amu\n```\n\nThis produces `rm32/NVRAMHW` (32-bit RAM module).\n\n### Build All Variants\n\n```bash\n# 32-bit RAM module\nriscos-amu ram\n\n# 26-bit RAM module\nriscos-amu ram BUILD26=1 BUILD32=\n\n# 32-bit ROM module\nriscos-amu rom\n\n# 26-bit ROM module\nriscos-amu rom BUILD26=1 BUILD32=\n\n# Export headers\nriscos-amu export\n```\n\n### Clean Build\n\n```bash\nriscos-amu clean\nriscos-amu\n```\n\n## Usage\n\n### Loading the Module\n\n```basic\n*RMLoad rm32.NVRAMHW\n```\n\n### Unloading the Module\n\n```basic\n*RMKill NVRAMHW\n```\n\n### Testing\n\nRun the included test program:\n\n```basic\n*RMLoad rm32.NVRAMHW\n*Run TestNVRAM,fd1\n```\n\nThe test program performs 10 tests:\n1. Module loaded verification\n2. ReadByte at address 0\n3. ReadByte at address 1\n4. ReadByte at addresses 2-5\n5. ReadByte out of range (address 255)\n6. WriteByte and ReadByte verification\n7. WriteByte value preservation\n8. FillCache operation\n9. Multiple reads consistency\n10. WriteByte out of range handling\n\n## Technical Details\n\n### Vector Interface\n\nThe NVRAMV vector is called by the Kernel with the following register interface:\n\n| Reason | Name      | Entry (R0-R2)              | Exit (R0-R2)                    |\n|--------|-----------|----------------------------|---------------------------------|\n| 0      | FillCache | R1=cache ptr, R2=count     | R0=-1, R2=bytes populated       |\n| 1      | ReadByte  | R1=address                 | R0=-1, R1=value read            |\n| 2      | WriteByte | R1=address, R2=value       | R0=-1, R1=value written         |\n\n### NVRAM Layout\n\nThe stub implementation provides 240 bytes of usable NVRAM (addresses 0-239). The initial contents are:\n\n| Address | Value | Description      |\n|---------|-------|------------------|\n| 0       | \u00265A   | Test pattern     |\n| 1       | \u0026A5   | Test pattern     |\n| 2       | \u0026DE   | Test pattern     |\n| 3       | \u0026AD   | Test pattern     |\n| 4       | \u0026BE   | Test pattern     |\n| 5       | \u0026EF   | Test pattern     |\n| 6-239   | \u002600   | Zero initialised |\n\n### Integration with Kernel\n\nThe Kernel calls NVRAMV through OS_Byte calls:\n- **OS_Byte 160**: FillCache\n- **OS_Byte 161**: ReadByte\n- **OS_Byte 162**: WriteByte\n\nThe module must be loaded early in the boot sequence to intercept these calls before the Kernel initialises its NVRAM cache.\n\n## Hardware Implementation Notes\n\nThe stub implementation in `c/nvram` includes comments describing how to interface with a PCF8583 RTC/NVRAM chip:\n\n- **IIC Address**: 0xA0 (write), 0xA1 (read)\n- **RAM Location**: Addresses 0x0A-0xFF (240 bytes)\n- **Write Cycle Time**: ~5ms\n\nTo implement real hardware support:\n1. Initialise the IIC bus\n2. Detect PCF8583 presence\n3. Implement read/write operations via IIC protocol\n4. Handle write cycle delays\n\n## Project Structure\n\n```\nNVRAMHW/\n├── c/\n│   ├── module      # Module interface (init, final, vector handler)\n│   ├── nvram       # NVRAM hardware stub implementation\n│   └── os          # OS interface (vector claim/release)\n├── cmhg/\n│   └── modhead     # CMHG module definition\n├── h/\n│   ├── nvram       # NVRAM hardware interface header\n│   └── os          # OS interface header\n├── rm32/\n│   └── NVRAMHW     # Built 32-bit RAM module\n├── oz32/\n│   └── *.o         # Object files\n├── .robuild.yaml   # RISC OS build configuration\n├── Makefile,fe1    # AMU makefile\n├── TestNVRAM,fd1   # BBC BASIC test program\n├── VersionNum      # Version information\n└── LICENSE         # MIT license\n```\n\n## CI/CD\n\nThe project includes automated build configuration:\n\n- **`.robuild.yaml`**: RISC OS build script for build.riscos.online\n- **`.github/workflows/ci.yml`**: GitHub Actions workflow\n- **`.gitlab-ci.yml`**: GitLab CI configuration\n\nBuilds produce:\n- 32-bit and 26-bit RAM modules\n- 32-bit and 26-bit ROM modules\n- Exported headers\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\nCopyright (c) 2026 Charles Ferguson\n\n## Author\n\n**Charles Ferguson**\n\n## Related Documentation\n\n- [NVRAMV Vector Specification](nvramv.xml)\n- [RISC OS PRM - Software Vectors](http://www.riscos.com/support/developers/prm/softvecs.html)\n- [RISC OS PRM - OS_Byte](http://www.riscos.com/support/developers/prm/osbyte.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Friscos-nvramhw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerph%2Friscos-nvramhw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Friscos-nvramhw/lists"}