Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a helper module to parse /shared2/sys/SYSCONF #23

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

linkmauve
Copy link
Collaborator

This parsing is quite brittle, but should work as long as the Wii hasn’t been tempered with.

See https://wiibrew.org/wiki//shared2/sys/SYSCONF

This is based on #21 and #22, and thus doesn’t work on the real hardware yet.

libstd’s runtime changed the prototype of lang = "start" in
ddee45e1d7fd34563c13513d974f792fae41a2f7 to support changing the SIGPIPE
behaviour on Linux, so this function now takes a third argument on every
platform.

Additionally, it now supports user_main() returning any Termination, so
we don’t need a transmute() any longer. :)
@linkmauve linkmauve force-pushed the sysconf branch 2 times, most recently from 412dcfb to a49503f Compare April 23, 2023 09:28
This fixes the build on current nightly (since 2023-04-22).
This lets us open file descriptors and perform actions on them.

MINI uses a different protocol, so this can’t currently be used to talk
with this Starlet firmware, see https://wiibrew.org/wiki/MINI

TODO: Figure out why it only works on Dolphin and not on a real Wii.
This is done using the /dev/stm/immediate device, see
https://wiibrew.org/wiki//dev/stm/immediate
This parsing is quite brittle, but should work as long as the Wii hasn’t
been tempered with.

See https://wiibrew.org/wiki//shared2/sys/SYSCONF
Comment on lines +13 to +14
BigArray(Vec<u8>),
SmallArray(Vec<u8>),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think allocations are needed here, maybe use 'a [u8] for both instead.

}

/// Parsed structure containing the system settings.
pub struct Sysconf(BTreeMap<String, Item>);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need something like this. We can make something similar without relying on allocations,

@ProfElements
Copy link
Collaborator

Maybe something like this to reduce allocations gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants