<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WiiU Linux</title>
	<atom:link href="https://www.wiiulinux.net/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wiiulinux.net</link>
	<description>The home of Linux on the Wii U</description>
	<lastBuildDate>Sat, 06 Dec 2025 15:07:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.wiiulinux.net/wp-content/uploads/2024/12/new-wiiulinux-site-icon-small-1-150x150.png</url>
	<title>WiiU Linux</title>
	<link>https://www.wiiulinux.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SMP on the Wii U!</title>
		<link>https://www.wiiulinux.net/wii-u-news/smp-on-the-wii-u/</link>
					<comments>https://www.wiiulinux.net/wii-u-news/smp-on-the-wii-u/#respond</comments>
		
		<dc:creator><![CDATA[loganius]]></dc:creator>
		<pubDate>Thu, 02 Jan 2025 05:02:52 +0000</pubDate>
				<category><![CDATA[Wii U News]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Kernel Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SMP]]></category>
		<guid isPermaLink="false">https://www.wiiulinux.net/?p=128</guid>

					<description><![CDATA[After years of work, SMP is finally working on the Wii U! If you run Wii U Linux and would like to take advantage of all 3 CPU cores, you&#8217;ll need to build a kernel using the rewrite-6.6-smp branch of the linux-wiiu kernel source found here. Unfortunately, as of me writing this, there are no [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="has-text-align-left">After years of work, SMP is finally working on the Wii U! If you run Wii U Linux and would like to take advantage of all 3 CPU cores, you&#8217;ll need to build a kernel using the <code>rewrite-6.6-smp</code> branch of the <code>linux-wiiu</code> kernel source found <a href="https://gitlab.com/linux-wiiu/linux-wiiu/-/tree/rewrite-6.6-smp?ref_type=heads">here</a>. Unfortunately, as of me writing this, there are no pre-built kernels with SMP support available for the Wii U, but fortunately the <a href="https://gitlab.com/linux-wiiu/linux-wiiu/-/blob/rewrite-4.19/README.md?ref_type=heads">readme for the default branch</a> contains a very easy to follow set of instructions on how to build the kernel, although they do require Docker. You will, however, do <code>git clone -b rewrite-6.6-smp https://gitlab.com/linux-wiiu/linux-wiiu</code> instead of <code>git clone https://gitlab.com/linux-wiiu/linux-wiiu</code>, and <code>make wiiu_smp_defconfig $LINUXMK</code> instead of <code>make wiiu_defconfig $LINUXMK</code> (otherwise SMP won&#8217;t get enabled!)</p>



<p>(FYI: I&#8217;m working on a pre-built SMP kernel and patched Gentoo tarball for the Wii U, so stay tuned for that.)</p>



<p>I was originally going to write a long post about how we got here, but then I decided that I don&#8217;t actually want to write that, so instead, I&#8217;m just going to list some of the things we (me and Quarky) learned while working on this.</p>



<h2 class="wp-block-heading">1: The EXI Bootstub is Not Used in Wii U Mode.</h2>



<p><strong>The</strong> primary source for all of our knowledge on the Wii U’s CPU comes from <a href="http://The primary source for all of our knowledge on how to start up the secondary cores of the Wii U comes from one article">one article</a> written by Marcan of fail0verflow. It is the reason we know how to start up and take control of the primary CPU core, <a href="https://wiiubrew.org/wiki/Boot_process">despite all of Nintendo&#8217;s safeguards</a>, how to initialize several important CPU registers, and how to start up the secondary CPU cores. Because Marcan is a veteran console hacker, and because he was right about everything else, everyone (including us) took the information in this article as gospel; we assumed <em>everything</em> in it was true.</p>



<p>In order to start up the secondary CPU cores correctly, we need to know where they start executing code from, and according to Marcan, this location was a piece of hardware leftover from the Wii called the <a href="https://wiibrew.org/wiki/Hardware/External_Interface#EXI_boot_vector">EXI bootstub</a>.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Cores 1 and 2 boot with <code>MSR[IP]=1</code>, thus at the high vectors. The old Wii PPC EXI bootstub hardware is still present and controls the instructions read from there, so just perform the normal EXI bootstub configuration sequence from the Starbuck.</p>



<p>-Marcan, fail0verflow.</p>
</blockquote>



<p>So, as per Marcan&#8217;s instructions, we wrote our initialization code to the EXI bootstub and started up the secondary cores, but they never did what we expected. Then, one day, as I was staring at a dump of the decrypted kernel <a href="https://wiiubrew.org/wiki/Ancast_image">ancast</a> image in <a href="https://ghidra-sre.org/">Ghidra</a>, I realized that, when mapped to the <a href="https://wiiubrew.org/wiki/Cafe_OS#Virtual_Memory_Map">known location of the ancast image in Cafe OS</a> (<a href="https://wiiubrew.org/wiki/Cafe_OS">the Wii U&#8217;s built-in OS</a>), my dump extended <em>past</em> the high boot vector, where the EXI bootstub was supposed to be, so I scrolled down and lo and behold: there was a bootstub there! After discovering this, I tried writing our bootstub overtop that part of the ancast image and it <em>worked!</em> The secondary cores were finally behaving as expected!</p>



<p><strong>Conclusion: In Wii U mode at least, the high boot vector (the one used by cores 1 &amp; 2) is not mapped to the EXI bootstub: it&#8217;s mapped to MEM0 as part of the ancast image at address <code>0x08100100</code></strong></p>



<p>PS: it turns out that developers behind emulators like <a href="https://github.com/cemu-project/Cemu">Cemu</a> and <a href="https://github.com/kinnay/Wii-U-Firmware-Emulator">WUFE</a> already knew that <a href="https://github.com/cemu-project/Cemu/blob/1e30d72658151a5304f5625a8acdf6aae31b6c58/src/Cafe/HW/MMU/MMU.cpp#L41-L44">0xFFE00000 (the location of the kernel ancast image) is mapped to MEM0.</a> Marcan must have known this too, as the Cafe OS kernel immediately jumps to a location above 0xFFE00000 (using an absolute jump), and then starts up the secondary cores soon afterwards, and there is clearly no code present to initialize the EXI bootstub. I assume, therefore, his statement quoted above was either a mistake, or in reference to vWii mode (which in fairness was the focus of his article.)</p>



<h2 class="wp-block-heading">2: CAR and/or BCR Control Cache Coherency</h2>



<p>With the ability to run whatever code I wanted on the secondary cores, I was now able to send them into the Linux CPU initialization code. However, there was a problem: despite having proof that they were running, my debugging code was saying the secondary cores were not coming up <em>at all!</em> Specifically, I had a variable in RAM which the cores would write their ID* number to upon starting up. I also wrote some code to print out the value of that variable after starting each core. My code told me that the value of the variable wasn&#8217;t changing, but when I looked in <code>/dev/mem</code> afterwards, I saw that its value was exactly what I expected it to be if the cores <em>were</em> starting up. I eventually figured out this was due to cache coherency problems; cores 1 and 2 were coming online and writing to that value exactly as they were supposed to, but core 0 wasn&#8217;t seeing the change, either because the new value was stuck in the write cache of the secondary core, or because the read cache of the primary core wasn&#8217;t being flushed. Adding some <code>dcbst</code> instructions to the CPU init code and a cache flush to the debugging code seemed to fix the issue, but similar problems just kept cropping up.</p>



<p>Out of ideas and desperate for a solution, I once again turned to the fail0verflow article written by Marcan, and I noticed something: there were 2 unknown CPU registers mentioned we weren&#8217;t using: &#8220;CAR&#8221; and &#8220;BCR&#8221;. The article gave no indication of what they did, but I decided it couldn&#8217;t hurt to try initializing them, and so I wrote some code to do so using the same values Cafe OS did, as per the article. Once again, it <em>worked!</em> Magically, all of my cache coherency problems disappeared, and, after dealing** with some driver bugs, I was able to get the cores fully started and (somewhat)** working in Linux.</p>



<p><strong>Conclusion: CAR and BCR, in some way, control the new cross-core cache coherency mechanisms in the Wii U CPU.</strong></p>



<p>*By ID number I mean the core number, so core 1 would write &#8220;1&#8221; and core 2 would write &#8220;2&#8221;. I also had another debugging variable that told me how far into the process of starting up each core was getting, and this variable told me that the secondary cores were getting quite far in despite the kernel claiming they&#8217;d never started.</p>



<p>**What I&#8217;m referring to here was a bug in our <a href="https://en.wikipedia.org/wiki/Inter-processor_interrupt">IPI</a> driver that caused the wrong interrupt to be triggered. Fixing that allowed the cores to come up successfully, but the IPIs still weren&#8217;t working and <a href="https://www.wiiulinux.net/friends-of-wiiulinux-net/" data-type="page" data-id="49">Quarky</a> ended up having to completely redo the IPI implementation in order to make the system usable.</p>



<h2 class="wp-block-heading">3: The Bit Order of the ICI Bits of SCR is Backwards.</h2>



<p><strong>This one was discovered by Quarky.</strong> As I said above, in order to get the system stable enough to use, she ended up having to completely redo the IPI implementation. While doing so, she learned about a much easier method to implement IPIs than the one we were previously been using: <em><a href="https://wiiubrew.org/wiki/Hardware/Espresso#SCR">SCR already contained bits for sending interrupts between cores!</a></em></p>



<figure class="wp-block-image size-full"><img decoding="async" width="359" height="117" src="https://www.wiiulinux.net/wp-content/uploads/2024/12/image.png" alt="" class="wp-image-200" srcset="https://www.wiiulinux.net/wp-content/uploads/2024/12/image.png 359w, https://www.wiiulinux.net/wp-content/uploads/2024/12/image-300x98.png 300w" sizes="(max-width: 359px) 100vw, 359px" /></figure>



<p><em><strong><span style="text-decoration: underline;">pain</span></strong></em></p>



<p><a href="https://wiiubrew.org">WiiUBrew</a> calls these &#8220;I<em>C</em>Is&#8221; instead of &#8220;I<em>P</em>Is&#8221;, but they&#8217;re the same thing*. By flipping one of these bits from off to on, you could send an interrupt to the corresponding core, which was exactly what we needed. However, while picking through Cafe OS to figure out <em>exactly</em> how these IPI bits worked, she discovered that the order of the bits listed on WiiUBrew was backwards. Bit 18 controls the IPI to core 2, not core 0, and bit 20 controls the IPI to core 0, not core 2.</p>



<p><strong>Conclusion: The order of the ICI bits of SCR (bits 18-20) is backwards.</strong></p>



<p>*ICI = Inter-core Interrupt. IPI = Inter-processor Interrupt. Linux always calls them IPIs.</p>



<p>Hopefully you found this information useful or interesting. </p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wiiulinux.net/wii-u-news/smp-on-the-wii-u/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The WordPress Migration</title>
		<link>https://www.wiiulinux.net/site-news/the-wordpress-migration/</link>
					<comments>https://www.wiiulinux.net/site-news/the-wordpress-migration/#comments</comments>
		
		<dc:creator><![CDATA[loganius]]></dc:creator>
		<pubDate>Tue, 05 Mar 2024 22:16:39 +0000</pubDate>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[NGINX]]></category>
		<category><![CDATA[web hosting]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.wiiulinux.net/?p=72</guid>

					<description><![CDATA[It&#8217;s been rough! Up until recently, wiiulinux.net has been a collection of manually written HTML &#38; CSS files, good old Web 1.0 style. What the site used to look like. CC0. However, a few weeks ago (at time of writing), I decided it would be a good idea to get with the times and migrate [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>It&#8217;s been rough!</p>



<p>Up until recently, <code>wiiulinux.net</code> has been a collection of manually written HTML &amp; CSS files, good old Web 1.0 style. </p>



<div class="wp-block-group is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-ce155fab wp-block-group-is-layout-flex">
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="518" src="https://www.wiiulinux.net/wp-content/uploads/2024/03/Old-wiiulinux.net-screenshot-1024x518.png" alt="" class="wp-image-93" srcset="https://www.wiiulinux.net/wp-content/uploads/2024/03/Old-wiiulinux.net-screenshot-1024x518.png 1024w, https://www.wiiulinux.net/wp-content/uploads/2024/03/Old-wiiulinux.net-screenshot-300x152.png 300w, https://www.wiiulinux.net/wp-content/uploads/2024/03/Old-wiiulinux.net-screenshot-768x388.png 768w, https://www.wiiulinux.net/wp-content/uploads/2024/03/Old-wiiulinux.net-screenshot-1536x776.png 1536w, https://www.wiiulinux.net/wp-content/uploads/2024/03/Old-wiiulinux.net-screenshot-2048x1035.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><em>What the site used to look like. CC0.</em></p>
</div>



<p>However, a few weeks ago (at time of writing), I decided it would be a good idea to get with the times and migrate to WordPress, so it would be easier to update the site, add new information, and actually allow this site live up to its tagline. <em>The Home of Linux on the Wii U.</em> A few days ago, I finally committed to actually making it happen.</p>



<p>Problem number 1: I didn&#8217;t have MariaDB or PHP installed. But that&#8217;s an easy enough problem to fix; just install them, right? No. That&#8217;s because I&#8217;m running Gentoo. Unlike, say, Debian or Arch, which distribute ready to use binary packages, on Gentoo every package is compiled locally. In my case, that means compiling them on the Wii U&#8217;s 1.24 GHz G3-derived CPU. Making matters worse, Linux on the Wii U [at time of writing] is limited to using one core! Needless to say, compiling MariaDB and PHP on a single core 1.24 GHz G3 takes a while.</p>



<p>Problem number 2: NGINX. Because the Wii U is so comically under-powered, I settled on NGINX as my web server, because it has a reputation of being faster than Apache. The problem here is that running WordPress on NGINX is harder than doing so on Apache, though it is possible. One of the things you&#8217;ll need to make this work is to build of PHP with FPM support. However, Gentoo does not build PHP with FPM by default, and I had no idea I needed to change that because I didn&#8217;t read any &#8220;Setting up WordPress using NGINX&#8221; tutorials until <em>after</em> I installed PHP! So I had to tell Gentoo &#8220;Please enable FPM support,&#8221; and wait another 2 hours for PHP to build again.</p>



<p>By this point, a day and a half in, I was only just now ready to install WordPress. Well, almost ready. I first had to set up MariaDB and tweak my NGINX config, but that was all pretty straightforward. So, I downloaded WordPress, unzipped it into my new NGINX web root, and was just about to start setting it up when suddenly, I remembered, in the access log, I had seen people trying to access <code>/wp-admin/setup-config.php?step=1</code> and I realized &#8220;Hey, maybe I oughta take the server off the internet while doing this.&#8221; After avoiding my Wii U becoming compromised, I proceeded to finish the WordPress setup uneventfully. And within 3 minutes of installing WordPress, I had broken it so badly I could no longer log in. Here&#8217;s what happened.</p>



<p>Problem number 3: SSL. I noticed all the links on the site pointed to the local IP address of the Wii U, which is a problem for a public website, so I poked around in the WordPress settings, and changed the page URL to <code>http<em>s</em>://www.wiiulinux.net</code>. Upon doing so, I became unable to log in.</p>



<p> So, a bit of context: <code>wiiulinux.net</code> does not handle requests from the internet directly, but instead runs behind a reverse proxy. Because of this, I had never bothered to set up SSL on the Wii U side, as the reverse proxy handled it. This meant requests the Wii U always received HTTP requests. But I just told WordPress to expect HTTPS. What was happening was, WordPress saw my HTTP request, and redirected me to <code>https://www.wiiulinux.net</code>. The reverse proxy forwarded my request as HTTP, resulting in an endless loop that prevented me from logging in. However, even once my Dad figured out what was going on, it took us another hour to actually get SSL working on NGINX and get the problem solved. Unfortunately, this was not the end of our problems.</p>



<p>Problem number 4: NGINX again. Now that I had WordPress working again, I wanted to get to work making the site look nice. However, the page editor refused to load. I discovered upon closer inspection that this was caused by the server failing to find a bunch of important files! So, my Dad and I and set spent the next 3 hours trying to figure out why this was happening and what how to fix it. He was methodically thinking through the problem, I just threw ideas at the wall to see if that would fix it. Eventually, my Dad figured out that all we had to do was slightly rewrite 1 rule in the NGINX config.</p>



<pre class="wp-block-code"><code>#try_files $uri $uri/ /index.php?$args =404;

location / {
    try_files $uri $uri/ /index.php?$args;
}</code></pre>



<p>Yep. That&#8217;s it.  After making that change, the editor worked perfectly. By this point, it was near midnight, so I decided to go to bed and work on designing the site tomorrow. But WordPress had one last, headache inducing surprise in store for me.</p>



<p>Problem number 6: Designing a page with WordPress. For the header, I wanted to have 2 inwards facing Tux penguins, like I did before. That requires flipping one of the images, but I couldn&#8217;t just add <code>transform: scaleX(-1);</code> to the CSS one of the images because, as far as I can tell, there is no way to add custom CSS to a specific instance of a block in WordPress. You can only add it to every occurrence of that block on the whole site. Luckily, my Dad saved the day once again when he had the idea to just make a flipped version of Tux and have two separate, independent image blocks. Although this is not the last time WordPress&#8217;s design has caused me pain, for the sake of brevity I&#8217;ll spare you the details. Suffice to say, it&#8217;s been frustrating.</p>



<p>For all it&#8217;s many, many faults though, I do still believe the migration to WordPress is a positive step for <code>wiiulinux.net</code>. WordPress can provide a really nice experience, if you&#8217;re using it as intended; ie: for writing blog posts. Writing this post using WordPress has been way easier than it would have been had I written it manually. Thank you so much to my Dad, who was absolutely essential in helping me through this transition. Thank you for all your hard work and your kind, patient support while helping me. Here&#8217;s to a more active future for <code>wiiulinux.net</code>. Maybe it&#8217;ll finally live up to it&#8217;s hyperbolic tagline.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wiiulinux.net/site-news/the-wordpress-migration/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Hello World!</title>
		<link>https://www.wiiulinux.net/uncategorized/hello-world/</link>
					<comments>https://www.wiiulinux.net/uncategorized/hello-world/#respond</comments>
		
		<dc:creator><![CDATA[loganius]]></dc:creator>
		<pubDate>Tue, 05 Mar 2024 08:51:21 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.wiiulinux.net/?p=84</guid>

					<description><![CDATA[My first ever blog post using WordPress! This is just a quick test to see how blog posts work in WordPress and so that I have a post I can use for setting up the blog post UI. That&#8217;s all for now. Bye!]]></description>
										<content:encoded><![CDATA[
<p>My first ever blog post using WordPress! This is just a quick test to see how blog posts work in WordPress and so that I have a post I can use for setting up the blog post UI.</p>



<p>That&#8217;s all for now. Bye!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wiiulinux.net/uncategorized/hello-world/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
