Hacking d2xl-cIOS - a fork of davebaol's d2x-cIOS

leseratte

Wiimmfi Team
OP
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
d2xl-cIOS

What is d2xl?

The d2xl-cIOS ("l" for "Leseratte") is a fork of davebaol's d2x-cIOS.
I began the development of the d2xl-cIOS in September 2019, when the Bluebomb exploit for the Wii Mini was released. The Wii Mini uses different IOS than the Wii, that means, the cIOS needed to be modified.
Because the old versions of devkitARM needed to compile the d2x(l)-cIOS were not available at that time, I made the necessary changes with a hex editor - which resulted in a cIOS that somewhat worked on a Wii Mini (but not 100%), and no longer worked on Wii and vWii.

In February 2020, I was finally able to compile the d2xl-cIOS using Docker containers with an old Debian version, and a couple modifications to the devkitARM build scripts. If you need a working devkitARM r32 for another project, check out this Github repository. If you want to compile my d2xl-cIOS, there are Dockerfiles in the d2xl-cIOS repository.

Changes

Currently, the most recent version of my fork is a beta version - d2xl-v1-beta2 - and can be downloaded from here. Right now, it only works on the Wii Mini.

The last couple days I've been working on getting my fork to run on Wii and vWii, too, with the intention of adding more features to the cIOS in the future. This means that right now this d2xl fork doesn't give you any advantage over just using d2x-v10-beta52, but I'm hoping that that'll change soon.

The next part that I'm currently working on is A) preparing one cIOS that works on Wii, vWii and Wii Mini (instead of having three different ones like now), and B) writing patches for certain homebrew tools that require changes to support my d2xl-cIOS. This includes:

  • the d2x cIOS installer, so that it knows if it's running on Wii / vWii / or Wii Mini and can install the cIOS properly on all of them,
  • the "Syscheck Hacksden Edition" so that a syscheck can also properly display the base IOS revision (necessary for vWii and Wii Mini versions of the d2xl-cIOS)
  • the USB-Loader GX and WiiFlow Lite, because these loaders get confused by my new cIOS and don't enable the d2x features
  • When the d2xl-cIOS is released, XFlak will update ModMii so that that can create d2xl cIOS WAD files.

More information

The source code of the d2xl-cIOS fork can be found in my Github repository.
Right now this repository doesn't contain any release for the new d2xl-cIOS because I'm still busy modifying it to work properly, but I wanted to already create this thread, for further discussions about my fork when I release the first public test version.

If you are interested in compiling the cIOS yourself, there are detailed instructions in the repository wiki which should run on any Linux computer with Docker (no Windows support right now, sorry).
 
Last edited by leseratte,

fjmolano

New Member
Newbie
Joined
Mar 6, 2020
Messages
2
Trophies
0
Age
43
XP
47
Country
Spain
Hi, you are the BEST. Good job.
I have a question for you?
What are the parameter for use the cios?
Select cios = d2xl - beta
Cios base = ??
Cios spot = 249
Cios revision = ??

I'm use your last version d2xl (2019/09/29 20:03)
Thank you
 
  • Like
Reactions: banjo2

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,648
Country
France
hello :)

Nice to see someone are working on cIOS again !
I know you'll achieve a lot based on your last works on the loaders and network.

Maybe you could find a way to fix the ehci module to properly initialize all usb devices ? new ones and flashdrives?
that would remove the need to boot into IOS58 to init some devices, as some users have issues with 58, and some have issue with d2x. there are currently no proper setup. I forced IOS58 by default on USBGX1272 based on all the user's report, and now there are many reports that IOS58 is not working for a lot of users.

Having a single cIOS for all devices and console type would be a real savior to finally get an easy setup for everyone.

I wish you good luck on achieving all your ideas.


IOS EXPLANATION AND INSTALL TIPS
I have a question for you?
What are the parameter for use the cios?
Select cios = d2xl - beta
Cios base = ??
Cios spot = 249
Cios revision = ??

I'm use your last version d2xl (2019/09/29 20:03)
There is NO definitive answer to your question.
You first need to understand what a IOS is, an IOS Slot, an IOS base and how applications are using them.

I explained hundred times what it was, how it works, but nobody read previous tutorials and explanations, so here it is again (very quick) :

IOS and IOS Slot:

The Wii console uses the "IOS" system to communicate with the hardware, it's like a driver (compared to Windows). It contains information and communication tools (like how to access the Disc drive, how to access USB, read the savegames data stored on internal memory, etc.)

Each game uses and requires a specific version of that "IOS".
As games can't be updated on Wii (this is no PS4, or wiiu!), they are made to work on a specific version of IOS to ensure they ALWAYS use that version to prevent unexpected bugs due to updated functions.
Nintendo decided to install new released IOS in a different folder on the system (called a slot) instead of updating one single IOS for all the library (like the wiiU).

Therefore the Wii contains multiple IOS versions:
IOS9, IOS..., IOS30, IOS...., IOS53, IOS56, IOS57, IOS58, etc.

Any application running on the console (system menu, homebrew, games, etc.) uses ONE SINGLE IOS Slot at a time, and doesn't care what are installed on other slots. This is the "requested IOS", expecting to use a specific version of IOS containing the specific functions version it requires for the application or game to work properly.
Zelda twilight princess requests IOS9 (first IOS used by the oldest game), while Dragon Quest MMORPG requests IOS59 (last released version, which contains external encrypted HDD support).


As you can imagine, nintendo would release each new IOS by installing them in higher slots (folders), so IOS located in slot 57 contains more functions and features than the IOS located in slot 9.
So you can think that higher the better, but it's not necessarily the case. Nintendo didn't always release new version in higher slots, they sometime released IOS and installed it in random or lower slots.
Don't see the slot number as the IOS version, but as just another version containing different drivers and functions that a games can use.

Some IOS contains specific functions (IOS58 contains USB2 support for accessories like WiiSpeak, microphones, etc.), while some games will work only on specific slot number (Spyro NFC portal accessory works only with IOS56) and Animal city folk Keyboard support works only with IOS38!

Generally speaking, 99% of games will work fine with IOS57 which contains almost all required functions and drivers :)
So, your best bet is to use that IOS for general setup and be almost sure all your games will work.
Only a very few exception will require specific IOS version (located in specific numbered slots) like I said above : Spyro (56), Animal crossing (38), sponge bob (53/58), DQ (59).

IOS Slot:

If you noticed, I said all new IOS versions are installed in a different folder to keep previous versions available to old games.
This is what a slot is, just a folder containing an IOS version.

IOS58 is one IOS version located in slot 58.
IOS57 is another IOS version located in slot 57. not older, just a DIFFERENT version.


The Wii has 256 available slots for IOS to be installed into, but Nintendo only ever used IOS slots up to 59.
As a common rule, hackers decided to use empty slots to install their own patched versions of the IOS (custom IOS, or cIOS) in higher slots to prevent conflicting with Nintendo official releases and keep the official IOS "clean", untouched and working properly for disc based playing.
You can freely install cIOS anywhere between slot 200 and slot 255, but please do NOT fill all your slots with random data, 1) your console has limited storage space, and 2) it's useless! only install or replace slots using common sense and your own requirement!
Common usage for USBLoaders are slot249, 250 and 251, but only one is ever required ! don't ever install all 3 slots if you don't know why and only follow random and bad tutorials.
by default, ONLY slot249 will be used by USBLoaders, but can be changed in USBLoader's settings anytime to use a different slot containing specific "drivers" (features and functions) for specific games!


IOS base:


The IOS base is the IOS to use as "base" for the added hacked features and patches, such as signature check patch, redirecting Disc access to USB (for USB Loaders to load games from USB), EmuNAND features, etc.
The resulted patched IOS has to be installed somewhere on the console to be used on request by an application, and NOT overwrite the existing IOS from nintendo, so anything above slot 200.

There are exceptions:
Slot <230 are usually reserved for hermes cIOSes (202, 220-225)
Slot236 is a patched IOS36 installed in slot 236 usable by any very old homebrew who wants it. just forget about it.
Slot254 is Bootmii launcher! NEVER REPLACE OR INSTALL ANYTHING IN THAT SLOT!

Only ever use slot 240-251 for your needs.


To make debugging and helping users more easily, the Wii scene started using a written format to be easier to understand what were installed in each slots.
So if you run a syscheck (tool and tutorial linked in my signature) you'll see something like this :

IOS249[57] d2x v8 final revision 21008
It means that the slot 249 contains a modified IOS, based on the IOS located on slot57. it has been patched with hacked feature using the "d2x v8 final" cIOS version.


Another example:

IOS248[53] d2x v10-alt r53 revision 65535
Resume: A patched IOS53 is located in slot248.
detailed: Slot 248 is not empty! It contains a patched IOS, based on the the official IOS from nintendo located in slot53 (base53). It has been patched with additional hacked features using the cIOS version "d2x v10-alt, revision 53", and installed on the console in slot 248 with file's revision number 65535.

Attention: Do not mix cIOS version (d2x v10), cIOS revision (d2x r53), cIOS base (base53), cIOS slot (248), and file's revision (65535).



IOS revision:

You can see that as the "file's revision".
When Nintendo released an updated version of a specific IOS (to fix a bug for example), it increased its revision (not its slot number!).
For example, there are different revisions of IOS57, which can be newer than IOS58. remember, the slot number doesn't define its version!

If the console detects a new higher revision of a specific file or IOS is available (from nintendo update server, or from inserted game disc's update partition) then the console would prompt you to update your console.
revisions go from v0 to v65535.

cIOS are usually released with a revision number reflecting the "cIOS patcher version", for example "cIOS r21 d2x v8" had revision 21008.
But nintendo started to release new IOS 249 and 250 with higher revision in order to counteract piracy. They released they own IOS249/250 with revision 65280.

Imagine you have a cIOS d2x v8 installed in slot249, with revision 21008.
If you insert a game disc, and it contains IOS249 r65280, the console will tell you there's a new update (for your slot249)! it'll replace your cIOS located in slot 249 which is revision v21008 with the higher version found on the disc (v65280) and your slot will become "stub". it's a dummy IOS with no function, it just does nothing, no function, no drivers, no application will work if it tries to use that IOS slot.

To prevent nintendo from updating (and replacing) a cIOS into a stub IOS (useless, empty, doing nothing IOS), and to prevent the console to prompt you to update when you insert a disc containing that fake 249, you can set the revision of your installed cIOS to something even higher than 65280.
cIOS installer lets you choose whether you want the "real" revision (21008) or a maxed out revision (65535) to prevent any further replacement from automatic update checks.

Another option to prevent updates of the IOS with low revision numbers is Priiloader's hacks "prevent updates from disc/network".


cIOS version:


In order to fix bugs and add new features to cIOS (usb redirection, emuNAND, vWii support, Wii mini support, etc.) the cIOS patch needs to be updated.
This is the "d2x" version as you know it.
When a new cIOS version is released (v8, v10, etc.), it's common usage to also increment the "IOS revision". v21008 (d2x v8) -> v21010 (d2x v10)




The cIOS version is the version of the patches applied to an original (base) IOS.
for example cIOS revision 17, or cIOS d2x v10 r52, or cIOS d2x v10-alt r53, etc.

To get an idea of which version exists and which one you are currently using, here are the last used ones, declined in two different "main branches" from the two initial developers who created them:

1) Hermes cIOS:
• cIOS v4 : has USB Port 0 and Port 1 support. IOS base selection, multiple base in one slot! (37+38)
• cIOS v5
• cIOS v5.1
• cIOS v6 (hermesrodries mod)



2) Waninkoko cIOS
...
• cIOS rev17 : last revision with mandatory WBFS for games, adds emuNAND supports but limited to 1st FAT32 partition of a 512 bytes/sector HDD, NandEmuPath must be on root, Full EmuNAND only. base IOS38 only. clone the installed IOS in both 249 and 250 only.
• cIOS rev18 : adds Partial EmuNAND mode. Adds support for different base IOS and different destination slots!
• cIOS rev19 :
• cIOS rev20 : don't use, it has wiimote freeze issue!
• cIOS rev21 : adds EmuNAND paths, latest release from Waninkoko.

branch from cIOS rev21, maintained/developed by Davebaol
• cIOS rev21 d2x beta : adds partition selection for emuNAND.
• cIOS rev21 d2x v2
• cIOS rev21 d2x v3 : officially supports partition selection
• cIOS rev21 d2x v4 : adds 4096 bytes/sector support
• cIOS rev21 d2x v5 :
• cIOS rev21 d2x v6 :
• cIOS rev21 d2x v7 : Adds support for "block ios reload", and fixes Wiimote+ games (Zelda skyward sword, redsteel2, etc.), but also games with menus (Metroid Prime, Sam&max, etc.)
cIOS rev21 d2x v8 final : Latest stable and best version for Wii. THIS IS THE ONE YOU WANT ON WII !
• cIOS rev21 d2x v9 beta r49 : Fix a HDD init bug. adds support for Port1, plug&play, but breaks some games and other features such as emuNAND, games from SD and some hardware support.
• cIOS rev21 d2x v10 r52 : Fallback to d2x v8 with HDD init bug fix only. this is v8 ! don't be fooled by version number ! it was re-released as v10 only to prevent users installing the real v10 vWii on Wii because of incremented version.... (higher IS NOT better! but people don't understand or never read install instructions)
• cIOS rev21 d2x v10-alt r53: This is d2x v9 beta ! with all its bugs. don't use it please.
cIOS rev21 d2x v10 vWii : This is d2x v8, for vwii. THIS IS THE ONE YOU WANT ON vWII !
• cIOS rev21 d2x v10-alt vWii : This is d2x v9 beta with all its bugs, for vWii. still don't use it please!

Branch from cIOS rev21 d2x v10 (r52/r53), maintained/developed by Leseratte
cIOS rev21 d2xl-IOS beta : You are here ! This is the cIOS for Wii mini. It's an updated branch from latest d2x v10.





What you want to install:



So, here we are :
in the cIOS installer you have to choose what to install, and where.

most common setup will be this one :
IOS 57 patched with d2xl-cIOS, installed in slot 249.
Select cios = d2xl - beta
Cios base = 57
Cios spot = 249
Cios revision = leave it as default, or set 65535


And if you ever want to play spyro, you'll ALSO need an IOS based on the one located in slot 56 :
IOS 56 patched with d2xl-cIOS, installed in slot 250.
Select cios = d2xl - beta
Cios base = 56
Cios spot = 250
Cios revision = leave it as default, or set 65535

:!: Adapt the "cIOS base" based on the game requirement, spyro, animal crossing, wiiware, etc.
:!: Adapt the "IOS Slot" (spot, or destination), based on your current internal content already installed on your console ! keep track of what you install. if you ever forget, run syscheck homebrew again :)


Using a specific IOS slot:

IMPORTANT!
If you properly read what I said several times until now, an application or a game running on the Wii uses ONE and only one IOS slot at a time.
you need to specify which one to use for the game at any given time to work properly.

By default, all usbLoaders are using slot249 and DO NOT CARE WHAT YOU INSTALLED IN OTHER SLOTS! installing 20 cIOS at the same time has no effect and won't magically fix your compatibility issues!
Following random (and bad) youtube tutorial which make you install 3 cIOS in 3 random slots will be of no use if you don't actually USE the correct slot!
All your USBLoader's interface and its features will depends on the currently used and loaded in memory IOS, and if you followed the recommendation you'll have access to functions provided by the IOS57 (which is patched and installed in the default slot249).
That's the same for all your games, the slot249 will be used and will provide needed communication with the hardware (wiimote, usb access, savegame, network, NAND, etc.)

If you want to play a game which requires a specific IOS (for example Spyro), then you'll have to tell Spyro to use the slot where you installed the patched IOS, based on official IOS it expects to use, located on slot 250 (base56).
In your loader, go to Spyro game individual settings, change the IOS Slot to use from 249 to 250 (if you installed cIOS base 56 in 250! if you installed based 56 in 251 then set 251!).


Like you see, you can install any base in any slot, it's UP TO YOU to decide and choose what you need, where you install it and properly setup your USBLoader to use the specific slot for specific games !
If you are unsure, go with slot249 base57, that's all you'll need for 99% of your library. if a game doesn't work, ask or search if someone else used another base !


I hope it was detailed enough, sorry I wanted to make it shorter but I couldn't.
I also thought better explanation would be useful on the first page of this thread for future users asking the same questions :)
I'll probably update it to explain what the "revision" is and its purpose. Done!
I did it again, I wrote a full guide instead of leaving the answer to others or just post 3 lines of config without explanations.
 
Last edited by Cyan,

fjmolano

New Member
Newbie
Joined
Mar 6, 2020
Messages
2
Trophies
0
Age
43
XP
47
Country
Spain
thank you. I will read all.
I will read everything and try to understand how it works, for me it is the first time I have seen it, I am sorry I did not find it in the rest of the post. Thank you very much again.
 

JuanMena

90's Kid, Old Skull Gamer & Artist
Member
Joined
Dec 17, 2019
Messages
4,875
Trophies
2
Age
30
Location
the 90's 💙
XP
10,018
Country
Mexico
Why wouldn't you call it:

d2XL-cIOS?

XL standing for Xtra Large... which is kind of a joke as this is for the Wii Mini

"Oh I want to put my cIOS on my useless Wii Mini"
"You better use the Xtra Large version of d2x-cIOS"
"Thank you daddy"
"You're welcome my son"
 
  • Haha
Reactions: impeeza

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,648
Country
France
I stickied your thread.

could you add this patch on future revision please?
https://gbatemp.net/posts/5092147

it's the FATFS update to support Ustealth drives with emuNAND.
it's just adding 0x55AB as valid partition table signature too.
thank you :)
 
Last edited by Cyan,

GHAM2000

Member
Newcomer
Joined
Apr 9, 2020
Messages
9
Trophies
0
Age
39
XP
71
Country
United Kingdom
Cyan, do you still recommend using cIOS rev21 d2x v8 final for the majority of users, rather than cIOS rev21 d2x v10 r52? Is the HDD innit bug not a big deal, or is the "v10" not as stable as the v8 final?
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,648
Country
France
The "hdd init fix" is supposedly not really important. at least for what I noticed based on user reports.
both v8 and v10 are identical, and I might even wonder if the change in v10 is not worse.
It's best in fact to test both v8 or v10 if the user has any issues.
but if one of them are working, no need to switch to the other.

also because v8 was initially the "final" and the others were always marked as "beta", we (few users, justinOnline for example did that too) initially suggest users to keep or install v8 final which was know working fine, while random guide told users to go wrong (mixing r52/r53 with different bases without real purpose or thinking. Hopefully it changed!!). having v8 would ensure that version weren't mixed.

I usually suggest v8 because I know the user won't mistakenly install v10 r53
but if we properly tell them to not do that, I'm sure they can follow our direction and install r52.
I might suggest them randomly now, no real reason why. sometime it's easier to tell to install v10 (it works on both Wii and vWii) so I don't risk users following Wii instruction with v8 on vWii. but that's all.

Lot of people still have the "init bug" with v10 r52, so the difference from v8 didn't really help for that problem.
maybe it helps a little, I really don't know or have enough reports to base any recommendations on it.

I hope we won't have that problem anymore on d2xL release, one single version for all consoles with same features instead of 4. (unsure whether it'll be titled v11 or not, but that might be helpful for end users to know it's a "new version they can update to")
 
Last edited by Cyan,

jeannotte

Well-Known Member
Member
Joined
Jun 15, 2016
Messages
4,517
Trophies
1
Age
53
XP
4,894
Country
France
The "hdd init fix" is supposedly not really important. at least for what I noticed based on user reports.
both v8 and v10 are identical, and I might even wonder if the change in v10 is not worse.
It's best in fact to test both v8 or v10 if the user has any issues.
but if one of them are working, no need to switch to the other.

also because v8 was initially the "final" and the others were always marked as "beta", we (few users, justinOnline for example did that too) initially suggest users to keep or install v8 final which was know working fine, while random guide told users to go wrong (mixing r52/r53 with different bases without real purpose or thinking. Hopefully it changed!!). having v8 would ensure that version weren't mixed.

I usually suggest v8 because I know the user won't mistakenly install v10 r53
but if we properly tell them to not do that, I'm sure they can follow our direction and install r52.
I might suggest them randomly now, no real reason why. sometime it's easier to tell to install v10 (it works on both Wii and vWii) so I don't risk users following Wii instruction with v8 on vWii. but that's all.

Lot of people still have the "init bug" with v10 r52, so the difference from v8 didn't really help for that problem.
maybe it helps a little, I really don't know or have enough reports to base any recommendations on it.

I hope we won't have that problem anymore on d2xL release, one single version for all consoles with same features instead of 4. (unsure whether it'll be titled v11 or not, but that might be helpful for end users to know it's a "new version they can update to")
Hello,

@Cyan :

I noticed on several forums, that many people had more problems with version 10 than version 8 final (same opinion as you).:huh:

Don't ask me why !!:D:unsure:

But as you quote, we can test either version to see which one works better.:nds:
 

Aeredren

Well-Known Member
Newcomer
Joined
Nov 12, 2019
Messages
75
Trophies
0
Age
25
Website
txti.es
XP
291
Country
France
Hi ! I notice the latest post on this thread is from April and the latest commit on the git mater's branch is from March 7th... Have you givin' up ? :'(
What is the current state of 2dxl and what in the roadmap has been accomplish ?
 

cyberstudio

Member
Newcomer
Joined
Dec 2, 2020
Messages
17
Trophies
0
Age
53
XP
108
Country
Canada
I am doing some work on 2-bay HDD enclosure support. Well, the hardest part is just getting cIOS to build, and for that, leseratte has done the most impressive work, with great directions on how to use docker to run the old r32 devkitARM toolchain, and... the whole thing is on CI!!!. I've forked his repository.

While my mod is intended for vWii, due to leseratte's work the most well-known for Mini, I wanted to test if my mod breaks anything. (Hope not!) But I have a couple of basic questions...

In ciosmaps.xml, I noticed that there are some console= tags, with values like Wii, mini and vWii. Tried it in d2x cios installer, they don't seem to be honored. (I see all Wii and vWii cIOS's on my Mini.) Is there a newer d2x cios installer which detects what hardware it is running on and filter down the selection so that you will never install vWii stuff on Wii? Or on Mini? Or is this still on your todo list?

If not, would it help if the build process creates 3 separate packages, one for vWii, one for Mini and one for Wii?

I also wonder how you get the 31775 base 57 for the Mini. I was about to download it with NUS Downloader but wait... it's never put online of course, because Mini has no online support!
 
Last edited by cyberstudio,

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,803
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,786
Country
Cyprus
Vwii and wii mini cios's can only be constructed if the base ios is installed to the system. So this is where it sources it from, and presumably it would fail to construct a wii mini cios on vWii for example since it can't get the right base, I haven't tested it though
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Sicklyboy @ Sicklyboy: Can't wait for season 2