Hello,
My sincerest apologies if this question is malformed, misplaced, or mistaken in some way.
I am inexperienced with Genode, but have been exploring it for a number of personal projects. The one I am currently working on is creating a minimal sculpt-like OS to replace the default Android 4.2 operating system on a rugged 4G Sonim XP5700 phone to serve as a platform for further Genode exploration and IoT projects.
To test the viability of this, I have been using Claude Opus 4.7/4.8 to accelerate working through creating a port for the msm8226/msm8926 SoC and phone platform. It has been largely successful so far, but hit a snag when implementing the file system service. This was its report:
``` part_block has a real bug for this device's GPT: the parse loop (gpt.h:373) runs to a hardcoded MAX_PARTITIONS=128, but this Qualcomm GPT declares fewer entry slots, so the entry-array buffer (sized to the header's actual entries(), gpt.h:363) overruns once i passes the real count. (_calculate_used at gpt.h:342 already correctly bounds by entries() — only the parse loop doesn't.) The one-line fix is to bound the parse loop by min(entries(), MAX_PARTITIONS). ```
And its recommended fix, which successfully resolved the issue:
``` diff --git a/repos/os/src/server/part_block/gpt.h b/repos/os/src/server/part_block/gpt.h index dbe9128e01..3539024cfb 100644 --- a/repos/os/src/server/part_block/gpt.h +++ b/repos/os/src/server/part_block/gpt.h @@ -370,7 +370,17 @@ class Block::Gpt : public Block::Partition_table _gpt_total = (gpt.part_lba_end() - gpt.part_lba_start()) + 1; _gpt_used = _calculate_used(gpt, entries, gpt.entries());
- for (int i = 0; i < MAX_PARTITIONS; i++) { + /* + * Iterate only over the entries the header actually declares -- + * a GPT may advertise fewer slots than MAX_PARTITIONS (e.g. the + * Qualcomm MSM8226 eMMC declares < 128), and the entry-array + * buffer above is sized to gpt.entries(); walking to MAX_PARTITIONS + * unconditionally overruns it (Mmio Range_violation). This matches + * the bound already used by _calculate_used(). + */ + unsigned const num_entries = min(gpt.entries(), + (uint32_t)MAX_PARTITIONS); + for (unsigned i = 0; i < num_entries; i++) {
Gpt_entry e(entries.range_at(i * gpt.entry_size())); ```
I am not sure of what the stance is on AI generated code or how well-documented pull requests need to be before creation, and I do not yet have the ability to test this change in a comprehensive way. I would love to contribute in any way I can, but am not yet certain of whether I have the tools or knowledge to do so correctly yet.
I would greatly appreciate any feedback or advice, and thank you for your time and consideration regardless. This has been a remarkable project to learn about so far.
Thanks, Ryan Davidovics
Hello Ryan,
thank you for your interest in Genode.
I am not sure of what the stance is on AI generated code [...]
This question was recently raised in the context of a pull request [1].
[1] https://codeberg.org/genodelabs/genode/pulls/5853
Citing my own comment from this issue:
---
Genode is not open for AI-generated code contributions due to the legal uncertainties of such code. In order to incorporate code into genuine Genode components (those that are marked by the license headers as being part of Genode) we must ensure that such code does not violate rights of third parties. On this account, the Genode contributor's agreement [2] states "You certify and warrant that your Contributions to Genode Labs’s Products do not violate the intellectual property rights of third parties [...]". This cannot be assumed for code generated by AI models without legal records of their training material. As far as I know, AI service providers do not provide such evidence.
[2] https://genode.org/community/gca.pdf
I'm not a lawyer. But I consider learning from any source (book, teacher, experience, internet search engine, AI model) as fine as long as the information source is legal (think of trade secrets).
Code generation is different matter. Legally, regardless of whether running the model locally or as a service, unless you created the model yourself, you cannot know from which data the model parameters had been derived. So one should assume the worst. Common sense. The obvious way to stay safe is to craft code by hand, driven by human intent.
At the end of the day, someone has to assert responsibility, for both technical and legal risks. A maintainer becomes responsible for the code whenever accepting a contribution. Accepting the risks of AI-generated artifacts would be irresponsible for Genode Labs. Hence, we have to keep our code untainted.
---
On a further personal note, as a matter of conduct, please keep in mind that the copy-pasting of text generated by an AI agent may be perceived as impolite.
Best regards Norman