<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on losgobbi</title><link>https://losgobbi.github.io/posts/</link><description>Recent content in Posts on losgobbi</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>personal blog :)</copyright><lastBuildDate>Sun, 08 Feb 2026 17:52:00 -0300</lastBuildDate><atom:link href="https://losgobbi.github.io/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>My contributions at 2025</title><link>https://losgobbi.github.io/posts/contributions-2025/</link><pubDate>Sun, 08 Feb 2026 17:52:00 -0300</pubDate><guid>https://losgobbi.github.io/posts/contributions-2025/</guid><description>&lt;h4 id="my-contributions-at-2025">My contributions at 2025&lt;/h4>
&lt;p>Number of patches: 14&lt;/p>
&lt;p>&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=54cec13d5726a88919b5bf3f47491b6c3fe67598">dt-bindings: trivial-devices: Add Maxim max30208&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=294d4a1c79c1e83adf283cb164488cf7d9e2a257">dt-bindings: trivial-devices: Add VZ89TE to trivial&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b0d226a60856a1b765bb9a3848c7b2322fd08c47">wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc0756de69dc398faa4472eafb72563672cc5981">dt-bindings: iio: adc: st,spear600-adc: txt to yaml format conversion.&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a238572b90876c9030655b7fb062b79b5972034f">dt-bindings: iio: gyroscope: invensense,itg3200: add binding&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=06f77ff9d852c9f2764659ea81489364d8a69a9c">soundwire: debugfs: move debug statement outside of error handling&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fd8e6f8729629407d2d932116d83b9cd71c17d80">dt-bindings: iio: gyro: invensense,mpu3050: change irq maxItems&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d75c7021c08e8ae3f311ef2464dca0eaf75fab9f">iio: adc: spear_adc: mask SPEAR_ADC_STATUS channel and avg&amp;hellip;&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=73c8b83b4aedae07b3c45379fe14be5a2734cbca">dt-bindings: iio: pressure: add invensense,icp10100&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b3c253cda6eefcf317cb81afadb2f49d8a2620d5">staging: rtl8723bs: Remove commented ifdef CONFIG_WAPI_SUPPORT&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5cfa43ae133856c8afb4f0177dde782b68005d2c">staging: rtl8723bs: Remove unsupported PALTFORM_OS_WINCE ifdef&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=de4cbbdf2d98a6f94dfc116247798d6600936335">staging: rtl8723bs: remove todo/note and duplicated EFUSE_CTRL macro&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=02f86101e430cce9a99a044b483c4ed5b91bb3b8">iio: imu: bmi270: fix dev_err_probe error msg&lt;/a>&lt;br/>&lt;/p></description></item><item><title>My contributions at 2024</title><link>https://losgobbi.github.io/posts/contributions-2024/</link><pubDate>Mon, 26 May 2025 21:00:00 -0300</pubDate><guid>https://losgobbi.github.io/posts/contributions-2024/</guid><description>&lt;h4 id="my-contributions-at-2024">My contributions at 2024&lt;/h4>
&lt;p>TL;DR; patches over staging area&lt;br>
Number of patches: 5&lt;/p>
&lt;p>&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=00ea2b0dc6ff47e3d3d976fd788aa22373d042b8">staging: gdm724x: fix returning -1 with return equivalent errors&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ea5e911e14cebfc9832728c27f05e43b086fec0c">staging: rtl8723bs: remove unused debug statements&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e139445ccbe4d902fce1dce517cd3b63f5b68eb8">staging: rtl8723bs: change remaining printk to proper api&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2bc2c3640039520d7cc0ea1e4c91fb0a8126fdda">staging: rtl8723bs: delete DBG_RX_SIGNAL_DISPLAY_RAW_DATA ifdef code&lt;/a>&lt;br/>
&lt;a href="https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=716eefc88c2f784ef16395d6a3eea8670847bba4">staging: rtl8723bs: delete HAL_DEF_DBG_RX_INFO_DUMP enum and caller&lt;/a>&lt;br/>&lt;/p></description></item><item><title>Tracking Android 14 Wifi problem at RPI4</title><link>https://losgobbi.github.io/posts/wifi-pi4/</link><pubDate>Fri, 24 Jan 2025 19:17:33 -0300</pubDate><guid>https://losgobbi.github.io/posts/wifi-pi4/</guid><description>&lt;h4 id="android">Android&lt;/h4>
&lt;p>I was doing some experiments with my Raspberry Pi 4 + “the portable display 7 IPS raspberry pi” over the last months like building, installing and testing Android OS (Android 14) from the following repository: &lt;a href="https://github.com/android-rpi/">android-rpi&lt;/a> . Besides that repository, there is also the &lt;a href="https://github.com/raspberry-vanilla">raspberry-vanilla&lt;/a>, and in both cases, they “support” Android for rpi (not just the for pi4). The first one, is not considered a vanilla repository (as we can see in the name), meaning, that is not a pure AOSP fork, it may have some or a set of changes customized to rpi hardware.&lt;/p>
&lt;p>On the other hand, at vanilla repo, it’s considered a pure fork, with just opensource stuff, like using at graphics stack the &lt;a href="https://www.mesa3d.org/">Mesa3d&lt;/a> project as a implementation of OpenGL.&lt;/p>
&lt;p>Well, at my tests I noticed two issues from “unrelated areas”, Wifi and BT, that kept me very intrigued:&lt;/p>
&lt;ul>
&lt;li>Wifi was not connecting to either Wifi 2.4GHz and 5Ghz, and the following error was identified (there are other strange messages within wifi services and wpa_supplicant process):&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-jsx" data-lang="jsx">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">11&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">28&lt;/span> &lt;span style="color:#ae81ff">23&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">14&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">22.228&lt;/span> &lt;span style="color:#ae81ff">2666&lt;/span> &lt;span style="color:#ae81ff">2666&lt;/span> &lt;span style="color:#a6e22e">I&lt;/span> &lt;span style="color:#a6e22e">wpa_supplicant&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">wlan0&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">CTRL&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#a6e22e">EVENT&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#a6e22e">SSID&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#a6e22e">TEMP&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#a6e22e">DISABLED&lt;/span> &lt;span style="color:#a6e22e">id&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">0&lt;/span> &lt;span style="color:#a6e22e">ssid&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;&amp;lt;ssid&amp;gt;&amp;#34;&lt;/span> &lt;span style="color:#a6e22e">auth_failures&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> &lt;span style="color:#a6e22e">duration&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">10&lt;/span> &lt;span style="color:#a6e22e">reason&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#a6e22e">WRONG_KEY&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>And when I’ve tried to use bluetooth, pairing and connecting with a headset, a disconnection happened during the “connection handshake”:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-jsx" data-lang="jsx">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">11&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">29&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">03&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">34.149&lt;/span> &lt;span style="color:#ae81ff">3541&lt;/span> &lt;span style="color:#ae81ff">3568&lt;/span> &lt;span style="color:#a6e22e">I&lt;/span> &lt;span style="color:#a6e22e">btm_acl&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">packages&lt;/span>&lt;span style="color:#f92672">/&lt;/span>&lt;span style="color:#a6e22e">modules&lt;/span>&lt;span style="color:#f92672">/&lt;/span>&lt;span style="color:#a6e22e">Bluetooth&lt;/span>&lt;span style="color:#f92672">/&lt;/span>&lt;span style="color:#a6e22e">system&lt;/span>&lt;span style="color:#f92672">/&lt;/span>&lt;span style="color:#a6e22e">stack&lt;/span>&lt;span style="color:#f92672">/&lt;/span>&lt;span style="color:#a6e22e">acl&lt;/span>&lt;span style="color:#f92672">/&lt;/span>&lt;span style="color:#a6e22e">btm_acl&lt;/span>.&lt;span style="color:#a6e22e">cc&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">205&lt;/span> &lt;span style="color:#a6e22e">hci_btsnd_hcic_disconnect&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Disconnecting&lt;/span> &lt;span style="color:#a6e22e">peer&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#a6e22e">xx&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#a6e22e">xx&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#a6e22e">xx&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#a6e22e">xx&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">65&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>&lt;span style="color:#a6e22e">f&lt;/span> &lt;span style="color:#a6e22e">reason&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#a6e22e">HCI_ERR_PEER_USER&lt;/span> &lt;span style="color:#a6e22e">comment&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#a6e22e">stack&lt;/span>&lt;span style="color:#f92672">::&lt;/span>&lt;span style="color:#a6e22e">l2cap&lt;/span>&lt;span style="color:#f92672">::&lt;/span>&lt;span style="color:#a6e22e">l2c_link&lt;/span>&lt;span style="color:#f92672">::&lt;/span>&lt;span style="color:#a6e22e">l2c_link_timeout&lt;/span> &lt;span style="color:#a6e22e">All&lt;/span> &lt;span style="color:#a6e22e">channels&lt;/span> &lt;span style="color:#a6e22e">closed&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>There were other strange errors and not necessary the two logs that I’ve quoted are the culprit of Wifi/BT to not be working. Later, I’ve identified a very similar report at this &lt;a href="https://github.com/android-rpi/device_arpi_rpi4/issues/128">issue&lt;/a>, for BT case, in which I was trying to help. The android-rpi is less active than vanilla one, at least for now, so in that time I was wondering, in order to pursuit those problems and compare the behavior: &lt;em>“Maybe I can test this using the vanilla repo?”&lt;/em>. And that, is what I did!!!&lt;/p>
&lt;h4 id="tracking">Tracking&lt;/h4>
&lt;p>….after spending some time to change my workspace from android-rpi to vanilla one, I was capable of repeating the same tests and compare the logs, in order to see if both “state machines” were equivalent, since they were in a kind of similar Android version, but not exactly using the same infrastructure of wpa, wpa configuration and so on.&lt;/p>
&lt;p>At that point, I was driven to discover why android-rpi was in that state? In which scope the issue was? AOSP, “device folder/product configuration”, firmware, Linux Kernel? Well, I did some experiments in order to isolate those cases mixing different things:&lt;/p>
&lt;ul>
&lt;li>creating the android-rpi device folder inside the vanilla tree;&lt;/li>
&lt;/ul>
&lt;p>The idea was to identify if the problem was:&lt;/p>
&lt;ul>
&lt;li>lack of configurations inside the device structure;&lt;/li>
&lt;li>something wrong with the specific AOSP tag;&lt;/li>
&lt;li>or at another scope;&lt;/li>
&lt;/ul>
&lt;p>In this particular mixed case, blobs for Linux Kernel and firmware were copied from vanilla repo.&lt;/p>
&lt;h4 id="results">Results:&lt;/h4>
&lt;p>After some building issues, I’ve faced a loop of different problems over pi4. Some of them were created by me during the lack of attention when mixing these repositories. One of them was a crash at SurfaceFlinger, one process responsible for managing things related to the graphics stack:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-jsx" data-lang="jsx">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">23.959&lt;/span> &lt;span style="color:#ae81ff">17253&lt;/span> &lt;span style="color:#ae81ff">17273&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">libc&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Fatal&lt;/span> &lt;span style="color:#a6e22e">signal&lt;/span> &lt;span style="color:#ae81ff">6&lt;/span> (&lt;span style="color:#a6e22e">SIGABRT&lt;/span>), &lt;span style="color:#a6e22e">code&lt;/span> &lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> (&lt;span style="color:#a6e22e">SI_QUEUE&lt;/span>) &lt;span style="color:#66d9ef">in&lt;/span> &lt;span style="color:#a6e22e">tid&lt;/span> &lt;span style="color:#ae81ff">17273&lt;/span> (&lt;span style="color:#a6e22e">surfaceflinger&lt;/span>), &lt;span style="color:#a6e22e">pid&lt;/span> &lt;span style="color:#ae81ff">17253&lt;/span> (&lt;span style="color:#a6e22e">surfaceflinger&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span> &lt;span style="color:#f92672">***&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Build&lt;/span> &lt;span style="color:#a6e22e">fingerprint&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#e6db74">&amp;#39;arpi/rpi4/rpi4:14/AP2A.240905.003/eng.gobbi.20250103.104810:eng/test-keys&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Revision&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#e6db74">&amp;#39;0&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">ABI&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#e6db74">&amp;#39;arm64&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Timestamp&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#ae81ff">1970&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">23.997155267&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#ae81ff">0000&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Process&lt;/span> &lt;span style="color:#a6e22e">uptime&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>&lt;span style="color:#a6e22e">s&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Cmdline&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">/system/bin/surfaceflinger&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">pid&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#ae81ff">17253&lt;/span>, &lt;span style="color:#a6e22e">tid&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#ae81ff">17273&lt;/span>, &lt;span style="color:#a6e22e">name&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">surfaceflinger&lt;/span> &lt;span style="color:#f92672">&amp;gt;&amp;gt;&amp;gt;&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">/system/bin/surfaceflinger &amp;lt;&amp;lt;&amp;lt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">uid&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#ae81ff">1000&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">tagged_addr_ctrl&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#ae81ff">0000000000000001&lt;/span> (&lt;span style="color:#a6e22e">PR_TAGGED_ADDR_ENABLE&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">signal&lt;/span> &lt;span style="color:#ae81ff">6&lt;/span> (&lt;span style="color:#a6e22e">SIGABRT&lt;/span>), &lt;span style="color:#a6e22e">code&lt;/span> &lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> (&lt;span style="color:#a6e22e">SI_QUEUE&lt;/span>), &lt;span style="color:#a6e22e">fault&lt;/span> &lt;span style="color:#a6e22e">addr&lt;/span> &lt;span style="color:#f92672">--------&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">01&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">01&lt;/span> &lt;span style="color:#ae81ff">00&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">18&lt;/span>&lt;span style="color:#f92672">:&lt;/span>&lt;span style="color:#ae81ff">24.111&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#ae81ff">17276&lt;/span> &lt;span style="color:#a6e22e">F&lt;/span> &lt;span style="color:#a6e22e">DEBUG&lt;/span> &lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#a6e22e">Abort&lt;/span> &lt;span style="color:#a6e22e">message&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#e6db74">&amp;#39;no suitable EGLConfig found, giving up (format: 1, vendor: Android, version: 1.4 Android META-EGL, extensions: EGL_ANDROID_front_buffer_auto_refresh EGL_ANDROID_get_native_client_buffer EGL_ANDROID_presentation_ti
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74">me EGL_EXT_surface_CTA861_3_metadata EGL_EXT_surface_SMPTE2086_metadata EGL_KHR_get_all_proc_addresses EGL_KHR_swap_buffers_with_damage EGL_ANDROID_get_frame_timestamps , Client API: OpenGL_ES)&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>...
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The “no suitable EGLConfig found” was a indication that something related to the graphics/OpenGL structure was not right after mixing those repositories. After some time I’ve realized that I’ve missed a .dtb overlay file from Linux Kernel when I copied the device folder that was preventing some DRI cards to be populated at /dev, like the original vanilla image, triggering a wrong execution of Mesa3d initialization, crashing the SurfaceFlinger:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// there were no devices entries like the original vanilla tests
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>console:&lt;span style="color:#f92672">/&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> ls &lt;span style="color:#f92672">-&lt;/span>l &lt;span style="color:#f92672">/&lt;/span>dev&lt;span style="color:#f92672">/&lt;/span>dri&lt;span style="color:#75715e">/*
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">crw-rw-rw- 1 root graphics 226, 0 1970-01-01 00:00 /dev/dri/card0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">crw-rw-rw- 1 root graphics 226, 1 1970-01-01 00:00 /dev/dri/card1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">crw-rw-rw- 1 root graphics 226, 128 1970-01-01 00:00 /dev/dri/renderD128
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This was only one of the issues, after fixing that a lot of other instabilities were detected during the “mixing test”. In the end of all of this, I couldn’t stabilize that test and reach the root cause of why both problems were occurring at android-rpi repo.&lt;/p>
&lt;p>Anyway, mixing different devices folders from “different” versions can be tricky and create a lot of instabilities. Considering that the history of changes, in this case, for android-rpi, is not “public known”, it’s hard to point if from the first A14 support Wifi/BT was working or not.
Android for RPI4 doesn’t officially supports LK bootloader/fastboot mode since it uses the sdcard, making every test very expensive.&lt;/p></description></item><item><title>Using QEMU to run Kernel Selftests (x86)</title><link>https://losgobbi.github.io/posts/self-test-x86/</link><pubDate>Tue, 05 Mar 2024 17:53:15 -0300</pubDate><guid>https://losgobbi.github.io/posts/self-test-x86/</guid><description>&lt;img style="display: block; margin: auto;" src="https://losgobbi.github.io/qemu_logo.webp"/>
&lt;p>Last month I read something about Kernel Selftests, a subject I had never heard of. Those tests were created to exercise some code paths inside the Kernel and they can also be used to detect regression during future versions. I was curious about it and initially I was intending to run that at my personal machine but tests could generate instabilities or side effects during the system usage, so I’ve changed my mind and I was looking for a VM for that purpose.&lt;/p>
&lt;p>Instead using the VirtualBox, I remember about QEMU, a versatile emulator and virtual machine for many architectures and since I’ve never played with that before directly, I’ve decided to use it.&lt;/p>
&lt;h4 id="environment">Environment:&lt;/h4>
&lt;p>The selftests are located at the Kernel source tree, at &lt;em>tools/testing/selftests/&lt;/em> folder. You need to clone that and ideally, be running the same kernel version in your system. I’ve used a release candidate version (kernel_source/Makefile):&lt;/p>
&lt;p>&lt;img style="display: block; margin: auto;" src="https://losgobbi.github.io/kernel_version.webp"/>&lt;br/>&lt;/p>
&lt;p>After building the Kernel, we could use the bzImage (Kernel compressed image binary) through QEMU CLI but we don’t have a file system available to interact with the system (actually, Kernel won’t boot without it…). So, I’ve used the &lt;a href="https://buildroot.org/">Buildroot&lt;/a> platform to create a FS with utilities and dependencies plus the Kernel image. In that way, we could interact with the system and achieve our goal, run the Kernel Selftests. I’ve used some pieces of a nice instructions file at &lt;a href="https://gist.github.com/chrisdone/02e165a0004be33734ac2334f215380e">here&lt;/a> (very straightforward if you are not used to Buildroot).&lt;/p>
&lt;p>After making everything, we’ll have the artifacts at &lt;em>images/&lt;/em> path of Buildroot, just need to use them:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># mount the rootfs created by buildroot, we&amp;#39;ll install the selftests there
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>sudo mount &lt;span style="color:#f92672">-&lt;/span>o loop &lt;span style="color:#f92672">/&lt;/span>opt&lt;span style="color:#f92672">/&lt;/span>buildroot_topdir&lt;span style="color:#f92672">/&lt;/span>build_cfg_files&lt;span style="color:#f92672">/&lt;/span>buildroot&lt;span style="color:#f92672">/&lt;/span>images&lt;span style="color:#f92672">/&lt;/span>rootfs.ext2 &lt;span style="color:#f92672">/&lt;/span>opt&lt;span style="color:#f92672">/&lt;/span>buildroot_topdir&lt;span style="color:#f92672">/&lt;/span>build_cfg_files&lt;span style="color:#f92672">/&lt;/span>buildroot&lt;span style="color:#f92672">/&lt;/span>root_loop
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install selftests but a disclaimer: this is not very correct because
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># I didn&amp;#39;t use the kernel folder at buildroot for building the test binaries.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Also, the tools to build them (gcc, etc) would not be the same.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>cd &lt;span style="color:#f92672">&amp;lt;&lt;/span>linux_repo_outside_of_buildroot&lt;span style="color:#f92672">&amp;gt;/&lt;/span>tools&lt;span style="color:#f92672">/&lt;/span>testing&lt;span style="color:#f92672">/&lt;/span>selftests
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo mkdir &lt;span style="color:#f92672">-&lt;/span>p &lt;span style="color:#f92672">/&lt;/span>opt&lt;span style="color:#f92672">/&lt;/span>buildroot_topdir&lt;span style="color:#f92672">/&lt;/span>build_cfg_files&lt;span style="color:#f92672">/&lt;/span>buildroot&lt;span style="color:#f92672">/&lt;/span>root_loop&lt;span style="color:#f92672">/&lt;/span>tests
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo .&lt;span style="color:#f92672">/&lt;/span>kselftest_install.sh &lt;span style="color:#f92672">/&lt;/span>opt&lt;span style="color:#f92672">/&lt;/span>buildroot_topdir&lt;span style="color:#f92672">/&lt;/span>build_cfg_files&lt;span style="color:#f92672">/&lt;/span>buildroot&lt;span style="color:#f92672">/&lt;/span>root_loop&lt;span style="color:#f92672">/&lt;/span>tests
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>sudo umount &lt;span style="color:#f92672">/&lt;/span>opt&lt;span style="color:#f92672">/&lt;/span>buildroot_topdir&lt;span style="color:#f92672">/&lt;/span>build_cfg_files&lt;span style="color:#f92672">/&lt;/span>buildroot&lt;span style="color:#f92672">/&lt;/span>root_loop
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="running">Running:&lt;/h4>
&lt;p>Now we need to use the artifacts generated by Buildroot. QEMU has a CLI very powerful, we could append lines to the Kernel cmdline, use ramdisk rather a pure FS, etc. In order to boot that system, we should do something like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># a few notes:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># 1) nographic option gives a feeling like minicom/picocom, very nice.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># 2) both -hda and -drive seems to work, not sure the underlying differences regarding the disk image
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># but for this test, that is not very important
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>qemu&lt;span style="color:#f92672">-&lt;/span>system&lt;span style="color:#f92672">-&lt;/span>x86_64 &lt;span style="color:#f92672">-&lt;/span>kernel &lt;span style="color:#f92672">/&lt;/span>opt&lt;span style="color:#f92672">/&lt;/span>buildroot_topdir&lt;span style="color:#f92672">/&lt;/span>build_cfg_files&lt;span style="color:#f92672">/&lt;/span>buildroot&lt;span style="color:#f92672">/&lt;/span>images&lt;span style="color:#f92672">/&lt;/span>bzImage &lt;span style="color:#f92672">-&lt;/span>nographic &lt;span style="color:#f92672">-&lt;/span>append &lt;span style="color:#e6db74">&amp;#34;root=/dev/sda console=ttyS0&amp;#34;&lt;/span> &lt;span style="color:#f92672">-&lt;/span>hda &lt;span style="color:#f92672">/&lt;/span>opt&lt;span style="color:#f92672">/&lt;/span>buildroot_topdir&lt;span style="color:#f92672">/&lt;/span>build_cfg_files&lt;span style="color:#f92672">/&lt;/span>buildroot&lt;span style="color:#f92672">/&lt;/span>images&lt;span style="color:#f92672">/&lt;/span>rootfs.ext2 &lt;span style="color:#f92672">-&lt;/span>m &lt;span style="color:#ae81ff">12&lt;/span>G
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The system will looks like this:&lt;/p>
&lt;img style="display: block; margin: auto;" src="https://losgobbi.github.io/qemu.webp"/>
&lt;p>Running tests:&lt;/p>
&lt;img style="display: block; margin: auto;" src="https://losgobbi.github.io/qemu_fs.webp"/>
&lt;p>I’ve played around using the full suite of tests, generating the following results:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># run the entire suite
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>.&lt;span style="color:#f92672">/&lt;/span>run_kselftest.sh &lt;span style="color:#f92672">-&lt;/span>s
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// failed and skipped tests:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#75715e"># # Totals: pass:108 fail:2 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:50 fail:1 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:2 xfail:0 xpass:0 skip:1 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:56 faii:4 xfail:0 xpass:0 skip:70 error:5
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:21 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:8 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:4 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:1 fail:6 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// passed and skipped tests:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#75715e"># # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:2 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:91 fail:0 xfail:0 xpass:0 skip:5 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:6 fail:0 xfail:0 xpass:0 skip:3 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:11 fail:0 xfail:0 xpass:0 skip:1 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Some tests were failing because some options for this Kernel were not enabled (menuconfig), others were failing because there are missing tools that weren’t enabled at Buildroot. Didn’t check all of the other failures, maybe I’ll do that in the future or maybe I will use a LTS version of the Kernel to compare the results.&lt;/p>
&lt;p>Yet, the purpose was to use QEMU, and he proved to be a very powerful alternative to VirtualBox.&lt;/p>
&lt;p>&lt;em>edit&lt;/em>: I’ve reduced a large amount of errors, but there are still tests failing. The configs are &lt;a href="https://github.com/losgobbi/lowlevel_misc/tree/main/Kernel_SelfTests/x86_configs">here&lt;/a>.&lt;/p></description></item><item><title>Adding an arm64 syscall entry</title><link>https://losgobbi.github.io/posts/x86-syscall/</link><pubDate>Thu, 27 Jul 2023 17:53:17 -0300</pubDate><guid>https://losgobbi.github.io/posts/x86-syscall/</guid><description>&lt;img style="display: block; margin: auto;" src="https://losgobbi.github.io/tux.webp"/>
&lt;p>For some architectures, kernel has changed the generation of some inner headers for syscall tables. Now at kernel 6.1.y (Pi fork) there are some utility scripts like &lt;em>syscallnr.sh&lt;/em> which acts over a table file called &lt;em>syscall.tbl&lt;/em>. Apparently, for arm64, this is not the case since we still have to add the entries manually like the old days.&lt;/p>
&lt;p>At linux-rpi-6.1.y folder, change the following headers:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// include/linux/syscalls.h
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>asmlinkage &lt;span style="color:#66d9ef">long&lt;/span> &lt;span style="color:#a6e22e">sys_my_pi_syscall&lt;/span>(&lt;span style="color:#66d9ef">void&lt;/span>);
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// include/uapi/asm-generic/unistd.h
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#75715e">#define __NR_my_pi_syscall 451
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#a6e22e">__SYSCALL&lt;/span>(__NR_my_pi_syscall, sys_my_pi_syscall)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// add a &amp;#39;plus one&amp;#39; at total number...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#75715e">#define __NR_syscalls 452
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// usr/include/asm-generic/unistd.h
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#75715e">#define __NR_my_pi_syscall 451
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#a6e22e">__SYSCALL&lt;/span>(__NR_my_pi_syscall, sys_my_pi_syscall)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// add a &amp;#39;plus one&amp;#39; at total number...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#75715e">#define __NR_syscalls 452
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// arch/arm64/include/asm/unistd32.h
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#75715e">#define __NR_my_pi_syscall 451
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#a6e22e">__SYSCALL&lt;/span>(__NR_my_pi_syscall, sys_my_pi_syscall)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// for syscall implementation: use an existing file or create a new one.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// i&amp;#39;ve used the kernel/sys.c...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#a6e22e">SYSCALL_DEFINE0&lt;/span>(my_pi_syscall)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">printk&lt;/span>(KERN_ERR &lt;span style="color:#e6db74">&amp;#34;my pi syscall called for arm64!!!&amp;#34;&lt;/span>);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>There is a document about this called &lt;em>adding-syscalls.rst&lt;/em> inside the tree, this info is also there. After updating the kernel image and installing the new headers:&lt;/p>
&lt;pre tabindex="0">&lt;code>sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_HDR_PATH=/mnt/rootfs_sdcard/usr/ headers_install
&lt;/code>&lt;/pre>&lt;p>You can call the &lt;em>my_pi_syscall&lt;/em> with syscall function from libc.&lt;/p></description></item><item><title>The neverending app</title><link>https://losgobbi.github.io/posts/never-app/</link><pubDate>Thu, 22 Sep 2022 17:38:33 -0300</pubDate><guid>https://losgobbi.github.io/posts/never-app/</guid><description>&lt;img style="display: block; margin: auto;" src="https://losgobbi.github.io/app.webp"/>
&lt;h4 id="the-starting-point">The starting point:&lt;/h4>
&lt;p>The beginning of this story started in the year of 2014 when, with a couple of friends, I’ve decided to buy a Macbook Air in order to build mobile apps. Back on that day, we started a couple of things using native iOS but we moved from it to hybrid technologies, in particular, the Ionic Framework (old Apache Cordova but version one which was using AngularJS).&lt;/p>
&lt;p>We did a couple of nice things and we have learned a LOT (from cloud services, payment gateway integration and more). It was very nice and we had some funny moments.&lt;/p>
&lt;p>In the year of 2019, I’ve decided to quit this group in order to study by myself and focus on my own ideas. After digging around, thinking and searching, I’ve decided to create a mobile app for a specific segment that at the time was interesting to me.&lt;/p>
&lt;p>Since I’ve already worked using Ionic in the past, I’ve decided to keep on this same track because some of my previous knowledge could help me to bring this idea out of the paper. Also, I intended to update some technologies/stacks in order to learn a set of new things.&lt;/p>
&lt;p>This new project used a new version of Ionic in order to take advantage of new features, resources and new styles from both operating systems (Android and iOS). Additionally, this version would be using Typescript rather than Javascript, so a learning curve would be necessary in order to write that app. In the past, I’ve used AWS services and they are too complicated in the end (too many services, different terms, etc). In this project I decided to move to Google Services aiming simplicity (Firebase cloud).&lt;/p>
&lt;h4 id="fast-forwarding-through-time">Fast-forwarding through time:&lt;/h4>
&lt;p>Let’s move in time so we can focus on the history behind this. I’ve been following some trends for some time now about how to build ideas out of the paper, MVP, focus on major things and so on. I enjoy reading blogs, news, and watching reality shows about people who start their own tech businesses; listening to their pitches; how they work; difficulties; and all of the major challenges that come with this type of project.&lt;/p>
&lt;p>The rule of the thumb is to be fast enough in the development cycle focusing on simple things in order to validate the whole idea during earlier stages. Getting feedback from the market is crucial in order to check if the idea makes sense and if you are really solving a pain point.&lt;/p>
&lt;p>Either knowing all of that theory, I’ve been spending a lot of time doing NONE of that (LoL). From learning, studying, testing this project outside of the market, trying to build a business model that was feasible, finding partners to join in this journey there were a lot of things to do on my own. It’s too hard to do all of that and keep the project moving forward.&lt;/p>
&lt;p>This year I’ve noticed the following according to a picture from my Bitbucket repository (which I was using to keep track of this side project):&lt;/p>
&lt;p>&lt;img style="display: block; margin: auto;" src="https://losgobbi.github.io/commit.webp"/>&lt;br/>&lt;/p>
&lt;p>Yeah, that’s right!!! I’ve been doing this, at least, since 2020, but in reality this started in 2019. I spent around four years of my free time on this mission to create this side project. The bad thing about all of this is that I could not follow the recommendations previously mentioned to keep things simple so the idea could be validated. From the code perspective, I have tried to develop a lot of features from day one, because firstly, it was fun. Secondly, there were a lot of features that would be necessary for the app to make sense in my mind so they couldn’t stay for later development.&lt;/p>
&lt;p>It was a long run, with a lot of doubts over myself and interesting questions over those four years on this road:&lt;/p>
&lt;ul>
&lt;li>“Is it all worth it?”&lt;/li>
&lt;li>“Did I spent four years on this for nothing?”&lt;/li>
&lt;/ul>
&lt;h4 id="project-on-hold">Project on hold:&lt;/h4>
&lt;p>Last month I finally finished what I set out to do in “roadmap” terms. I have a working app version for both operating systems. The integration with Firebase is functional too and in particular, for Android, I was able to use the in-app purchases for subscription cases and they are working too over the Google sandbox environment (test environment).&lt;/p>
&lt;p>At this moment I’ve decided to put this project “on hold”, and for now, it will not be published to the market because, among other things, Brazil is too bureaucratic for certain things and the marketing area for mobile apps is heavy and expensive.&lt;/p>
&lt;h4 id="final-thoughts">Final thoughts:&lt;/h4>
&lt;p>It’s hard to develop a full side project of this size without a proper team. If you put it down it was really big: the app aimed at both OS’s versions, Android and iOS. There was a cloud infrastructure behind the app for authorization, registration and storing information. Also, there was an integration with IAP (in-app purchases) for both stores. I’ve tried to use inside the app the AdSense version for mobile too.&lt;/p>
&lt;p>With a team on your side you can divide and conquer all of those areas, and maybe, focus on the part you like the most since there are a lot of options. With a team, the rule of thumb could be accomplished in an easier way and in short time.&lt;/p>
&lt;p>The previously mentioned doubts are still valid until this current day but I’ve been looking on the bright side of this. I think it was possible to prove to myself that, indeed, I can have discipline and focus on trying to accomplish my goals. Looking back it is remarkable that anyone could accomplish anything with focus and consistency. There is an old phrase, something like this: “Having an idea is easy, the hard part is to bring the idea out of the paper”. I think this is a good point because you always have another thing to do in your free time, other commitments, your own life, and so on. It’s hard you know BUT you can always focus on your priorities and if a side project is a priority for you, you can do it.&lt;/p>
&lt;p>I’ll end up saying that having this kind of side project is great because you learn a lot of additional things that complement your professional life. I don’t regret all this time spent and I would do it all over again.&lt;/p>
&lt;p>See you!!!&lt;/p></description></item></channel></rss>