Norman,
Understood. Thank you for your reply. I will take care to avoid pasting any AI generated content in the future.
If I understand your answer correctly, then using AI to research and investigate is acceptable, but any proposed changes, bug reports, or fixes should solely consist of code and content I create, and which I assume all responsibility for?
Thanks,
Ryan Davidovics
-------- Original Message --------
On Monday, 06/08/26 at 05:01 users-request(a)lists.genode.org wrote:
Send users mailing list submissions to
users(a)lists.genode.org
To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
users-request(a)lists.genode.org
You can reach the person managing the list at
users-owner(a)lists.genode.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of users digest..."
Today's Topics:
1. MSM8226 Port part_block GPT Partition Parsing Error
(Ryan Davidovics)
2. AI-generated code (was Re: MSM8226 Port part_block GPT Partition Parsing Error)
(Norman Feske)
----------------------------------------------------------------------
Message: 1
Date: Mon, 08 Jun 2026 01:47:42 +0000
From: Ryan Davidovics <davidovicsryanp(a)protonmail.com>
Subject: MSM8226 Port part_block GPT Partition Parsing Error
To: "users(a)lists.genode.org" <users(a)lists.genode.org>
Message-ID: <In2Lv_iy0CX68v2IED625TkHDmkg4Y9wg3LDs9Uxd-e9jdHz83zmO_EQx
1WzCLmUOALjtEA0CrQvwLfewHJrrcLbQ_bghhvAN7EsmLMB5-c=(a)protonmail.com>
Content-Type: multipart/alternative;
boundary="b1=_PHFoLFLjnJOmFBdCeBKKc0YQJv7ZBM03H1EDpxyU"
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