#Managarm and related projects

1 messages · Page 9 of 1

brittle mauve
#

I actually wanted to fix it and I already began doing that in the morning, Ill have to actually test it after I figure out why I can't boot into kmscon/weston at all anymore (it just times out and systemd kills it) KEKW it was broken because mlibc started checking symbol versions, the new solution I came up with for now is that you use a script that does a bunch of patchelf --clear-symbol-version on all symbols with glibc versions and set the osabi field of the executable/library to solaris (so I can still determine whether the caller is a glibc binary or not as the old logic relied on the versioning info)

#

the whole thing is a huge hack but it would be funny to get it to work again

vestal sapphire
#

going forward it might be nice to tag binaries with an xattr or similar for this purpose

#

or something less cursed than marking them Solaris meme

#

(we don't have xattrs yet btw)

brittle mauve
#

yeah, it was just the first solution I came up with lol

#

the versioning solution was good but I couldn't figure out a good way to make it work with the mlibc changes (without changing mlibc that is, if that would be an option then ig there could be some env variable or whatever that'd disable version checks for the binaries/libraries listed in there or something like that)

#

you'd literally need a library full of stubs forwarding to mlibc functions for every single function (though idk if it would be that bad except for the performance overhead it'd cause, it could probably be autogenerated with a python script similar to the rust bindgen one and would avoid the need to patch away all the version info + osabi hack)

vestal sapphire
#

PSA: if you want to help managarm (and linux devs as well), you can submit DRM info dumps as explained here: https://drmdb.emersion.fr/

#

it takes about 5 sec to do

native prairie
#

how does it help?

#

holy shit so many properties

vestal sapphire
#

and it's a nice reminder of what I need to implement

#

drm_info is ported to managarm ofc meme

brittle mauve
#

I got nvidia-smi to start properly now, ig Ill have to redo the annoying proper gpu setup to be able to go further

vestal sapphire
#

holy shit lol

#

if you pull my current nvo branches you should get the nvidiactl device

#

hopefully that's enough

#

I pushed them literal seconds ago tho

#

also remember to repatch nvidia-open meme

brittle mauve
#

nice, Ill try

vestal sapphire
#

I also updated the udev rule so you shouldn't need to change that any more

#

it will autodetect any nvidia GPU

brittle mauve
#

it still gives the error, idk which ones of the files it accesses it wants but from an strace on the host it tries ```
/sys/module/nvidia/initstate
/sys/bus/pci/devices/<addr>/config
/dev/nvidiactl
/proc/devices
/proc/driver/nvidia/capabilities/mig/config
/proc/driver/nvidia/capabilities/mig/monitor

vestal sapphire
#

the first one and the last two don't exist

#

the last two were introduced with r570 for blackwell so they're probably optional

#

it's probably the first one I'd guess

brittle mauve
#

yeah maybe, ig the log could help but it has some weird format lol

#

maybe I can figure it out using ghidra

vestal sapphire
#

dafuq

#

is it readable on linux?

brittle mauve
#

no

vestal sapphire
#

we should probably set up a package with utilities for nvidia stuff, I have some utils locally as well

upbeat smelt
#

government-grade encryption on the logs

vestal sapphire
#

yeah they don't give out the decoder for GSP logs either

native prairie
#

What the fuck why do they encrypt logs

brittle mauve
#
NVML LOG

Build branch : r575_92
Build date   : Thu-Apr-10-15:34:31-UTC-2025
Build CL     : 35813551
Build Type   : Local build
NVML Log 5/20/2025 16:37:46.019
DEBUG:    [tid 77]    [0.005513s - nvml.c:207]    Entering initWithFlags_Underlock(void) ()
INFO:    [tid 77]    [0.006452s - nvml.c:295]    -1
INFO:    [tid 77]    [0.006662s - nvml.c:304]    
DEBUG:    [tid 77]    [0.006852s - nvml_checkpoint.c:605]    
ERROR:    [tid 77]    [0.007086s - nvml.c:310]    3
CRITICAL:    [tid 77]    [0.007706s - dmal/common/common_nvml.c:171]    26
CRITICAL:    [tid 77]    [0.007993s - unix.c:38]    /dev/nvidiactl No such device or address (ENXIO) 6
DEBUG:    [tid 77]    [0.008335s - dmal/common/common_mig.c:2614]    1b
DEBUG:    [tid 77]    [0.008685s - dmal/common/common_mig.c:2640]    1b
WARNING:    [tid 77]    [0.008873s - dmal/dmal_init.c:56]    rmDMALLayer.init
ERROR:    [tid 77]    [0.009072s - nvml.c:327]    Driver Not Loaded 9
DEBUG:    [tid 77]    [0.009225s - nvml.c:346]    Returning 9 (Driver Not Loaded)
vestal sapphire
#

wait no

#

why does it not find nvidiactl

#

do you see it in /dev?

#

ok only 4 CUs left

#

idk where it should get the header from tho

#

ah I might have to just patch it out

#

I think that what haiku does but it's hidden behind layers of macro defs

brittle mauve
#

I didn't realize that the plainfb force ENV line was added lol

vestal sapphire
#

ah yeah

#

I boot with plainfb.force=0 and gfx.vm=0

#

ah more compilation errors

#

brb after dinner

brittle mauve
#

now it wants some ioctl at least

vestal sapphire
#

ooooh

#

I need to give you the mlibc patch

#

I forgor

#

but this is looking good

brittle mauve
#

yeah and the display works fine too (as in kmscon is displayed in there though its a little slow when typing)

vestal sapphire
vestal sapphire
#

I just used weston for the time being

#

idk how flip completion should work ngl

brittle mauve
# brittle mauve now it wants some ioctl at least

it wanted NV_ESC_CHECK_VERSION_STR and NV_ESC_CARD_INFO (which is supposed to return a list of card infos), with that returning a zeroed list it died in nv_get_ctl_state as that's stubbed (and its supposed to return a properly filled nv_state_t, ig that's not too hard as its pci info + bars + other stuff like that along with rm_init_private_state to fill some other fields)

vestal sapphire
#

ah we need to implement those ioctls ourselves iirc

brittle mauve
#

for the version one there was a helper but it needed a special case as its not handled by the generic rm ioctl yeah

vestal sapphire
#

we currently unconditionally defer to rm_ioctl, whereas linux handles them in nvidia.ko

brittle mauve
#

I just changed it to a switch and added the other ones there

vestal sapphire
#

based

brittle mauve
#

though the card info one should also be properly implemented

dusk crystal
nocturne tide
#

no, kernel-gcc is used for building the kernel and system-gcc is used for building the system (ports and servers)

#

i'm not sure what bootstrap-system-gcc is used for though

vestal sapphire
#

I'm not sure how LFS gccs work, but we have a separation between kernel and userspace

#

for building userspace, we first build a bootstrap-system-gcc which is a simple cross-gcc + libgcc

#

that is used to build mlibc, which then is used to build the final cross system-gcc that's used for cross-compiling programs

#

also iirc bootstrap-system-gcc builds freestanding libstdc++ too

nocturne tide
#

in that case bootstrap-system-gcc is kind of like a stage 1 gcc and system-gcc is a stage 2 gcc

#

stage 3 gcc is not applicable here since cross compilation but managarm does also have a gcc package

dusk crystal
#

Thanks!

native prairie
#

crazy stuff

#

i should really get my shit together

vestal sapphire
#

local man creates uACPI basically single-handedly

vestal sapphire
native prairie
#

last time i checked it couldnt modeset nvidia trl

vestal sapphire
#

I've been able to modeset it for a few days already

native prairie
#

i mean uacpi lol

vestal sapphire
#

but yeah porting it took like 2 or 3 weeks, half of that time was spent dealing with stupid skill issues

native prairie
#

is porting 3d accel next?

vestal sapphire
#

yes but the NVK shit is borked af

#

I'll try to actually get it to work on linux first

#

that's at least pretty simple to test

native prairie
#

makes sense

blissful bluff
#

Does this mean that if I switch to mlibc, the Nvidia drivers would probably magically just work?

carmine current
#

The Managarm port assumes the existence of a lot of existing DRM infrastructure

bold knot
#

trying to managram on physical hardware (a HP ProBook 440 G9, my old school computer) gone wrong

fair oracleBOT
#

Tag managram not found!

bold knot
#

(keyboard input doesn't work)

cedar cosmos
#

.!t managarm

fair oracleBOT
#
managarm

It's Managarm, not Managram

native prairie
#

hey at least EC works lol

trim eagle
#

this might be non fatal if you just let it sit for a bit?

bold knot
# fair oracle

btw my discord is bugged and I don't see what the bot writes lol

cedar cosmos
#

It's Managarm, not Managram

bold knot
#

yeah, I know

#

I wrote managram for lols

vestal sapphire
bold knot
#

physical hardware kmscon but I removed serial

vestal sapphire
#

idk if they work lol

#

just use the systemd kmscon option

trim eagle
#

they might work

#

but won't boot kmscon

#

(we kinda forgot to update those entries)

#

just use the default kmscon entry?

bold knot
#

should I remove the bochs?

vestal sapphire
#

yeah

#

that just enables e9 logging

bold knot
#

still I get the following:

thor: No sink for IRQ io-apic.2:1
thor: IRQ io-apic.2:1 was nacked (synchronously)!
thor: Unstalling IRQ io-apic.2:1 after 100ms
carmine current
#

Maybe we should add a msi only boot option

vestal sapphire
#

ok nvidia modeset is upstream now, we ball

dusk crystal
#

incredible

native prairie
upbeat smelt
vestal sapphire
#

peak osdev

serene portal
vestal sapphire
serene portal
#

xd

vestal sapphire
#

there you go

vestal sapphire
native prairie
#

snakemake

spring oak
#

wtf is it

vestal sapphire
#

no idea

golden maple
#

wtf is alex

vestal sapphire
#

dmidecode works

vestal sapphire
#

Hmm I wonder how difficult it would be to extract register definitions from the PRMs, kinda like the x86 instruction reference at felixcoultier

#

There is only a single supplement that has an overview table, and that is only for a part of the register space and for sandy bridge

#

It would be very useful as the register layout seems to have changed between sandy bridge and haswell a lot, mostly because of more hw support for things

native prairie
#

does it even list all registers?

#

Last time i checked it didnt for half of them

vestal sapphire
#

Most

native prairie
#

none of the chicken ones for example

vestal sapphire
#

They are listed in the workarounds volume

native prairie
#

ah ok

vestal sapphire
#

Not a register spec but "set this bit in the register at that offset"

#

There are some powerup things that are undocumented but I don't think you need to care about them

#

Worst case is that you do need to set them, but you can basically treat that like a quirk

#

And I'd prob discover them with vfio tracing or re'ing GOP

worn rampart
#

Sometimes Intel provides the xml that they built the PDF from

vestal sapphire
#

never seen that

vestal sapphire
#

ok I have utmpx stuff working enough for systemd to not complain

#

however

#

I get no keyboard input at login????

vestal sapphire
#

yeah whenever I enable logind for kmscon I get no kbd input

trim eagle
#

Cringe

vestal sapphire
#

ah okay the keyboard input thing is probably some sysfs or udev meme

#

I patched around it for now by removing a part of qookie's original kmscon patch (0001)

#

still not quite there tho

#

btw dennis the fix to the --no-pager thing is easy

trim eagle
#

PR it in I’d say

vestal sapphire
#

export SYSTEMD_PAGER=cat

trim eagle
#

Oh lol

#

Add it to /etc/profile

vestal sapphire
#

lmfao

#

ah the no keyboard meme is due to your missing inputX eventX sysfs representation

#

god I hate that shit tho

#

I already tried to implement it 3 times

carmine current
#

Doesn't it make sense to focus on the syscall cancellation PR before starting another project? :^)

vestal sapphire
#

I got fed up from being stuck yesterday so I looked at logind

carmine current
#

Ah

vestal sapphire
#

I think we need PAM

#

and proper shadow

#

I don't think we can get around that

#

sounds like we want that

vestal sapphire
#

last commit

#

that's the best that I could come up with

#

that doesn't include IRQ await cancellation stuff tho

#

oops wrong remote, fixed it now

carmine current
#

I'll check in the evening

#

IRQ await cancellation is not necessary anyway, I don't mind if that doesn't work

vestal sapphire
#

@trim eagle do you happen to have a PAM recipe I can yoink

trim eagle
#

Hahahaha you need Pam? Legit?

vestal sapphire
#

Yes for logind

trim eagle
#

I have it, but it’ll take an hour at least to access it

trim eagle
vestal sapphire
#

I'm not home anyways

trim eagle
#

I come with patches tho

#

But yeah can give

#

Will do whenever I boot my laptop

vestal sapphire
#

GitHub is also fine idc

trim eagle
#

Including patches for whatever needed

#

Free reminder, needs config files (I’ll provide them too) and a rebuild of at least shadow outside of systemd

vestal sapphire
#

ez

trim eagle
#

Oh yeah been there done that

vestal sapphire
#

I think I'm close to logind working btw

trim eagle
#

Lemme see if I can push that shit to GH tomorrow

#

That works for you?

vestal sapphire
#

So far everything that I tested outside of PAM worked

#

But PAM is needed for sessions

#

I mean we kinda need it for greeters anyways

trim eagle
#

Figured

#

That’s why I ported it in the first case

vestal sapphire
#

Also fingerprint login ultrameme

#

libfprint shouldn't be too hard

trim eagle
#

Agreed

vestal sapphire
#

God I love threatening myself with a good time

trim eagle
#

I have more stuff that can use or wants pam

#

Id love to help with this damn it why is this week so fucking busy and why am I going on vacation after this week fuckkkkk

vestal sapphire
#

Bruh

trim eagle
#

Yeah yeah

#

I’ll do my best to assist from vacation

vestal sapphire
#

dw

trim eagle
#

Yes I’ll worry

#

I’ve been working on this shit for a while off and on and just passing it off feels wrong

vestal sapphire
#

We've both made shit that's 10x worse than this work

#

This still be fine

serene portal
vestal sapphire
trim eagle
#

Right

#

Currently other jobs have taken priority I’ll attempt to get to it later today

vestal sapphire
#

@trim eagle happy?

trim eagle
#

I see you don’t need PAM anymore

#

Yes very happy

#

Please submit PR then I can take a look at it hopefully today otherwise Friday or Sunday (mind you that after Friday my availability is severely limited and VC is out for 3 weeks due to vacation)

vestal sapphire
trim eagle
#

Yeah I noticed

#

It’s not too bad

vestal sapphire
#

we ball with PAM and logind

#

logoff is borked tho

trim eagle
#

Nice work

#

Looking forward to the PR

vestal sapphire
#

it needs some mlibc work tho

#

utmp and utmpx

trim eagle
#

Yeah figured

#

Any other major changes?

vestal sapphire
#

I wrote some PAM configuration and put it in extrafiles

#

I install it as a step in the PAM package

trim eagle
#

I’ll probably find a thing or two about that

#

But works for now

vestal sapphire
#

ah I also have a degraded systemctl status

trim eagle
#

I don’t like that

trim eagle
#

Kinda need that probably

#

Any specifics it complains about?

vestal sapphire
#

I'll fix that, I commented out some OOM and cgroups stuff

trim eagle
#

Yeah

#

That’s a thing

vestal sapphire
#

current issue is setresgid

#

ig I'll implement that?

#

idk

trim eagle
#

We don’t implement that do we

vestal sapphire
#

we're close tho

#

the PAM side of things looks smooth so far

#

it's just some systemd memes

trim eagle
#

Expected

vestal sapphire
#
systemd[83]: Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.
systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
systemd[1]: [email protected]: Failed with result 'exit-code'.
#

this is quite annoying tho

trim eagle
#

Why is that not set

vestal sapphire
#

it shows up in env

trim eagle
#

Shouldn’t systemd set that (specifically logind?)

vestal sapphire
#

yes

trim eagle
vestal sapphire
#

I'm as confused as you

trim eagle
#

Time to trace systemd code then I guess

vestal sapphire
#

I have no idea what is wrong with that

trim eagle
#

Neither do I without looking. There is a small chance I can look on Friday in an afternoon VC? But no guarantees as it fully depends on how quickly I can pack my shit and clean my room

#

And how early I’m back on Friday

#

After that VC is a big unknown for 3 weeks

vestal sapphire
#

yeah

#

what I can do is to clean up the mlibc side so far

#

and push the new packages and patches somewhere

#

given that user@<UID>.service is degraded I don't think we should upstream it as-is

trim eagle
#

Fully agree

#

Can you make a draft bootstrap PR so I can take a first look at that and maybe take bits and pieces for upstream and then PR the mlibc side in so that is already merged and updated

vestal sapphire
#

the mlibc side will take some effort

trim eagle
#

Yeah makes sense

#

No hurry

vestal sapphire
#

it's ugly parsing code so tests are obligatory

trim eagle
#

Yep

vestal sapphire
#

but overall, the changes so far are very tame if you can look past the utmp(x) stuff

#

I'm happy about this so far, ngl

trim eagle
#

So am I

vestal sapphire
trim eagle
#

Feels like I have my vacation project

#

Engaging secret project 6

vestal sapphire
#

yeah I'm happy to pass this XDG_RUNTIME_DIR shit off to you meme

trim eagle
#

Yeah that’s a small hurdle hopefully for secret project 6

native prairie
vestal sapphire
#

god I wish I did half as much as I get credit for

native prairie
#

Lol

trim eagle
#

The only thing missing was utmp here right?

vestal sapphire
#

and some configs and some light patching

native prairie
#

Idk man u do crazy amounts of work

trim eagle
trim eagle
#

You’re on your own as it stands for the next 3.5 weeks

#

Wanna know why?

#

Cuz my FUCKING LAPTOP DECIDED TO NO LONGER LIVE OF COURSE IT DOES

vestal sapphire
#

bruh

trim eagle
#

LITERAL 2 DAYS BEFORE I GO ON VACATION. THIS BITCH DIES

vestal sapphire
#

feelsbadman.jpg

trim eagle
#

BRB GRABBING EMOTIONAL SUPPORT ITEM

#

YES I FUCKING BROUGHT IT FROM UNI

#

CUZ FUCK THIS SHIT

vestal sapphire
trim eagle
#

And people wonder why I’m so fucking unstable. Wonder why

vestal sapphire
#

just bring the box + monitor meme

carmine current
#

grab the cheapest laptop that you can find and ssh into a remote machine halfmemeleft

trim eagle
trim eagle
carmine current
#

if you have some machine on the same LAN you could use wol

median wharf
#

just develop from your vps

trim eagle
#

Can’t WOL if there’s no power to the network

vestal sapphire
#

ok so I tried to enable util-linux's login instead of shadow's

#

it's completely borked

trim eagle
#

Bad

#

Shadow login or go home

vestal sapphire
#

Ideally we should use util-linux login tho?

trim eagle
#

No?

vestal sapphire
#

why

trim eagle
#

Isn’t login provided by shadow on almost all Linux distros?

#

As it should

#

Yes

vestal sapphire
#

I thought util-linux

trim eagle
#

LFS pulls it out of shadow

vestal sapphire
#

ok then

trim eagle
#

What’s the problem you’re running into atm?

vestal sapphire
#

one sec

#

XDG_RUNTIME_DIR is set by pam_systemd.so

trim eagle
#

Makes sense

vestal sapphire
#

idk why

#

pam_systemd.so is the only place that sets it

trim eagle
#

I thought you handed that off to me for debugging in the vacation (laptop is currently away for diagnosis, here’s to hoping it’s fixed in time)

#

Else i can tackle it after vacation

vestal sapphire
#

sure

#

I was just hoping to make it work quicker meme

trim eagle
#

Real

vestal sapphire
#

is it maybe that we need some more config?

trim eagle
#

But no hurry on logind as it’s not required by anything atm

trim eagle
vestal sapphire
#

so that the user service inherits its env from login?

trim eagle
#

Wouldn’t be surprised

trim eagle
#

Question

vestal sapphire
#

I mean looking at the kmscon upstream service

trim eagle
#

We use kmscon upstream no?

vestal sapphire
#

we might want to use some of that

#

agetty for instance looks like a thing that might do funni stuff

trim eagle
#

Im a big fan of agetty but it brokey

trim eagle
vestal sapphire
#

yes

#

using the upstream service file while adding the wait-for-devices thing gets me a new funni

trim eagle
#

Do we do anything with user-runtime-dir.service? Or is that newer systemd

vestal sapphire
#

I fear it's getopt memes

trim eagle
vestal sapphire
vestal sapphire
trim eagle
#

Ah

vestal sapphire
trim eagle
#

Of course I did

#

Noted

#

But yeah if you want that then agetty needs to work

#

And it does not

#

Util-Linux provides it

vestal sapphire
#

I think we need that ngl

trim eagle
#

Then util-linux is your best friend

#

(Or worst nightmare)

vestal sapphire
#

it's a getopt_long meme

trim eagle
#

Of course it is

vestal sapphire
#

oh god

vestal sapphire
#
mlibc: pututxline() failed to seek in 3: Unknown error code (?)
agetty[83]: -: not open for read/write
#

getopt_long was an easy fix tho

trim eagle
#

Nice

carmine current
#
$ login --version
login from util-linux 2.41
trim eagle
#

Interesting

vestal sapphire
#

same here

trim eagle
#

LFS en Gentoo don’t agree

#

Very interesting

#

I would recommend to use the one from shadow. Apparently the util-Linux version is usually a fallback? (Okay basing on ChatGPT but w/e)

#

Honestly surprised Debian defaults to this

mild jetty
#

on arch it's util-linux as well

trim eagle
#

Very interesting

#

Lemme do more research

#

I see I see. Util-Linux requires PAM for this stuff. It’s also not clear if u-l can replace the entire shadow stack. If not, we need to hand remove conflicting files from shadow as shadow does not support configure switches to disable installing them

vestal sapphire
#

bruh

trim eagle
#

So for now, I propose keeping the shadow versions

#

And we can look at this later

vestal sapphire
#

okay I'm getting further, now it wants some ioctl

#

okay I have kmscon with agetty

#

also spicy

trim eagle
#

Interesting

vestal sapphire
#

okay the mlibc side of syscall cancellation should be good I think

#

I'll clean up the managarm side next

trim eagle
#

Mlibc utmp after that meme?

vestal sapphire
#

I'll do some smaller fixes first

#

utmp needs some work + tests

#

it would also be real nice to get #924 reviewed + merged

#

half of that is just yehuda's tests

trim eagle
#

Understandable

#

I’ll be out for most of the day, considering I just had the graduation of the GF and we’re going out for dinner now

vestal sapphire
#

ah have fun then

trim eagle
#

Will do

#

Also

#

#1344765127383322659 message @vestal sapphire

#

Check that

#

And laugh with me

vestal sapphire
#

I pushed some cleanup to the managarm side of the cancellation stuff too

#

there's still a few open comments but I don't really know what to do about them

carmine current
#

anybody in VC today?

vestal sapphire
#

me

carmine current
#

👍 i'll also join, but probably only at 9pm or so

vestal sapphire
#

just ping if I'm not here as always

trim eagle
#

Okay laptop update: apparently it starts again?

#

I expect to be able to grab it this evening and then it can go along on vacation

#

We ball

carmine current
#

nice

vestal sapphire
#

re the syscall cancellation signal changes

#

it seems to mostly work

#

except for the small detail that if I run cat, press Ctrl+C, cat does get killed, but bash's wait never succeeds

#

I don't really understand why

carmine current
#

do we make it to Process::terminate()?

vestal sapphire
#

yes

#

but it's being weird about it

#

the code block with the split signal handling is a bit too verbose rn but should work

#
            if (!delayedSignal) {
                async::cancellation_event ev;
                ev.cancel();
                auto active =
                    co_await self->signalContext()->fetchSignal(~self->signalMask(), {ev});

                if (active) {
                    auto handling = self->signalContext()->determineHandling(active, self.get());

                    if (handling.killed) {
                        co_await self->signalContext()->raiseContext(active, self.get(), handling);
                        break;
                    } else if (handling.ignored) {
                        co_await self->signalContext()->raiseContext(active, self.get(), handling);
                    } else {
                        if (self->checkOrRequestSignalRaise()) {
                            co_await self->signalContext()->raiseContext(active, self.get(), handling);
                        } else {
                            self->cancelEvent();
                            delayedSignal = active;
                            delayedSignalHandling = handling;
                        }
                    }
                }
            }
carmine current
vestal sapphire
#

so did I but I don't see the problem

#

the terminated process gets added to the parent's notifyQueue

carmine current
#

it can basically only means that either the process is not terminated correctly in posix (= we don't make it to the end of terminate() where we enqueue the notification for the parent)

#

or the wait() in bash doesn't return

vestal sapphire
#

but for some reason Process::wait never returns

carmine current
#

are there any changes in wait()?

#

iirc there was some change to make wait() cancelable, maybe that should be reverted for testing?

vestal sapphire
#

it's not the awaits that wait for signal and request handlers to exit btw, those return

carmine current
#

maybe bash has a the SIGCHLD handler (not unlikely) and that messes up the wait?

vestal sapphire
#

no idea

#

how would that mess with the wait

carmine current
#

i guess the should cause wait() to return with EINTR

#

upon receiving SIGCHLD

#

but i'm not entirely sure how the interaction works

#

I think the easiest option is to not make wait() cancelable for now

vestal sapphire
#

hmm ig in the race_and_cancel the awaitEvent never returns

#

guess I'll trace this a bit better tomorrow, gtg now

carmine current
#

I'd just make wait() non-cancelable for now

#

and extract that into a separate PR

vestal sapphire
#

might try that tomorrow

#

ok what's happening is that in the race_and_cancel, Process::wait returns

#

but the other lambda doesn't get cancelled?

#

so the race_and_cancel ends up hanging

#

so basically I get the log Process::wait done but I don't get AwaitEvent done, or WAIT pid={} done

carmine current
#

sounds like a bug in the kernel awaitEvent cancellation

vestal sapphire
#

Yeah I suspected that to but I didn't see anything wrong

#

I should try stashing the changes to that code tho

#

I didn't do that yet

carmine current
#

You could push the current state to a branch though

vestal sapphire
#

ok what's super weird is that even when I comment out the race_and_cancel for the wait() call, the userspace's wait request never returns

#

oh wait it does, it just doesn't show up in wireshark

#

wtf

#

ok I see the problem now?

#

the returned bragi message reports a PID of zero?????????????

#

what

#

ah no

#

ok so the wait returns

#

but userspace is stuck on this apparently

#

this is some shared library, I assume libc

carmine current
#

in the currently pushed mlibc changes, waitpid() has no SignalGuard anymore

#

that looks like a problem

vestal sapphire
#

I have one locally

carmine current
#

the lock cmpxchg may be the one in _waitProgressFutex

#

but that loop should terminate

#

and then go into helFutexWait

#

unless that futex wait is repeatedly interrupted

#

which would be weird though

vestal sapphire
#

I just came back after lunch

#

and now it works

#

I am getting royally trolled

#

okay only kind of

#

but at least bash now gives me a prompt after cancellation

#

the read doesn't terminate entirely correctly now tho

trim eagle
#

Progress tho

vestal sapphire
#

ok I have had a few instances where I want to wait for any one of a set of cancellation_tokens to be cancelled

#

could we have a helper for that?

#

I don't know if that's correct but something like this

template<std::convertible_to<async::cancellation_token>... CancelToken>
async::result<void> race_cancel_tokens(CancelToken... tokens) {
    async::cancellation_event ce;
    auto cb = std::forward_as_tuple(async::cancellation_callback{tokens, [&ce]{ ce.cancel(); }}...);

    co_await async::suspend_indefinitely({ce});
}
carmine current
#

Does that always involve race_and_cancel?

vestal sapphire
#

yeah

#

ig it makes sense in the observeThread stuff where we get a generation->cancelServe

#

otherwise the Process lives on (indefinitely?)

carmine current
#

We need to make race_and_cancel cancelable

#

By letting it take a cancellation_token and then adding a cancellation_observer to its implementation

vestal sapphire
#

bruh

carmine current
#

That shouldn't be very difficult

vestal sapphire
#

it's libasync code

#

so that's a lie

trim eagle
vestal sapphire
#

ig what happened is that I didn't cancel outstanding stuff for signals that kill the process

#

however if I do that I get hangs

#

I'm confused ngl

vestal sapphire
#

I have implemented the wait_if changes in libasync that should make the recurring_event::async_wait() return more useful ig

trim eagle
#

Work update, I might be able to start looking at secret project 6 later today

vestal sapphire
#

based

serene portal
#

based

wind hamlet
#

i wonder what secret project 6 is

short gazelle
#

it seems like it’s secret project 6

trim eagle
#

Indeed it is secret project 6

vestal sapphire
#

I figured it out meme

#

it's not impossible to guess

wind hamlet
#

managarm RiiR

#

jk

vestal sapphire
#

you can write servers in rust

#

soon™

#

speaking of, I should prob rebase our rust upstreaming work

trim eagle
vestal sapphire
#

eir RiiR

trim eagle
#

Be right back grabbing the emergency 12 gauge

vestal sapphire
#

hmm ig what I could do that doesn't touch other code is making everything use the note passing mechanism for passing data from eir to thor

trim eagle
#

That’s a good thing. Yeah

vestal sapphire
#

btw why do we have a split /usr/(s)bin

trim eagle
#

Why not

vestal sapphire
#

it's annoying meme

trim eagle
#

Why is it annoying?

vestal sapphire
#

when you have to figure out if something is in sbin or bin

trim eagle
carmine current
#

At least all fixed size data could easily be converted

trim eagle
vestal sapphire
#

apparently we have kcalc

trim eagle
#

We have

#

For a while

#

Lmao

#

@vestal sapphire see here

native prairie
#

Lol

#

Only Kate left

golden maple
native prairie
#

after chrome

vestal sapphire
#

we did run chromium

#

once

#

would be funni to get that going again but effort

#

managarm, the dedicated ___ OS

#

would be especially funny when paired with qwinci's audio work

native prairie
#

ngl a vscode port would probably blow up osdev reddit

vestal sapphire
#

nah r/osdev is lost

#

GDT init ... OK OS is what blows that subreddit up

native prairie
#

lmao

nocturne tide
#

managarm the goon os

golden maple
#

i even cant post some my post gets immediately removed by reddit filters 🙏

carmine current
#

cross post from Managarm server: some basic hardware CI infrastructure

#

this turns a rpi4 on/off programmatically and captures serial

native prairie
#

Failed assertion for that native assertos feel meme

carmine current
#

if you ask me, failing with a missing initrd is better than executing garbage instructions ;D

trim eagle
vestal sapphire
#

SYSCALL CANCELLATION IS MERGED

golden maple
vestal sapphire
#

assume you have a blocking read like with cat

#

and you get a signal like SIGINT

#

the read should then return EINTR (if nothing was read) or a partial read

#

if you don't cancel the syscall, the read wouldn't get interrupted

lament grove
carmine current
#

leo made a test that works but only under strace ultrameme

trim eagle
vestal sapphire
#

my classic managarm dev experience really

serene portal
#

the general computer experience

trim eagle
shrewd grove
mossy swallow
trim eagle
#

my systemd booted Managarm into a wayland compositor running KDE apps and Discord (in the browser) begs to differ ultrameme

mossy swallow
#

on what architecture?

carmine current
#

Managarm is closer to being a functional OS than almost all hobby OSes

native prairie
#

its not daily drivable but definitely not a concept lol

mossy swallow
#

what I said was a joke (bad I admit) in response to this meme

trim eagle
trim eagle
native prairie
#

which browser

mossy swallow
#

I have never been able to test a good version of managarm because I do not master the compilation toolchain, is the policy still not to offer a release for those who want to test?

trim eagle
#

We make nightly images

trim eagle
native prairie
#

ditch webkit embrace chromium

trim eagle
mossy swallow
#

I'm going to test it on VirtualBox, because I can't configure the network cards properly on QEMU.

trim eagle
vestal sapphire
#

ok I think I implemented the logic for SIG_IGN-ing SIGCHLD

#

also SA_NOCLDWAIT

#

doesn't even need mlibc changes meme

upbeat smelt
#

nice

#

does this fix exiting out of bash in weston-terminal not closing the terminal window?

#

or is that something else entirely being broken

vestal sapphire
#

I didn't test that

#

let's see

upbeat smelt
#

that's like one of the longest standing bugs

#

i recall it being there when i was first poking at managarm in 2018/19

vestal sapphire
upbeat smelt
#

ah damn

#

i do wonder what that's about

vestal sapphire
#

Ctrl+D on that is still borked

#

ig it would be nice to figure that out, maybe with wireshark?

nocturne tide
#

i need to look at ptrace at some point

#

or at least the bare minimum for implementing some simple strace-like tool

#

it would also be kinda based to be able to debug with gdb

vestal sapphire
#

coredumps meme

#

I didn't upstream that yet tho

nocturne tide
#

running and being able to live debug something would be way more fun tho

#

but coredumps are based too

upbeat smelt
#

for testing the weston-terminal thing it might be easier to test weston-terminal --shell=/usr/bin/true

#

so you don't get any bash stuff in the logs

#

and only get a blank terminal that's supposed to close immediately

vestal sapphire
#

I'm looking at the wireshark dumps for bash withing weston-terminal, it's looking fine tho

upbeat smelt
#

btw i think next best request to implement cancellation for would be poll :^)

#

so you can ^C x/wayland apps

#

or well, you can do that now, but you need to do something that causes an event to be sent over the socket for it to wake up from the poll and try reading instead

vestal sapphire
upbeat smelt
#

maybe it's stuck in a poll with the master fd?

#

and is waiting for it to end with POLLHUP?

vestal sapphire
#

hmm sounds plausible

upbeat smelt
#
static void
io_handler(struct task *task, uint32_t events)
{
    struct terminal *terminal =
        container_of(task, struct terminal, io_task);
    char buffer[256];
    int len;

    if (events & EPOLLHUP) {
        terminal_destroy(terminal);
        return;
    }

    len = read(terminal->master, buffer, sizeof buffer);
    if (len < 0) {
        terminal_destroy(terminal);
        return;
    }

    terminal_data(terminal, buffer, len);
}
#

:^)

vestal sapphire
#

ok

#

I have to leave in 5 min so ig I'll implement that tomorrow

#

pls review #975 in the meantime tho halfmemeleft

upbeat smelt
vestal sapphire
#

hmm weird, naively making the master end of the pty just return POLLHUP when the last slave closed leads to weston-terminal instantly closing

#

weird

#

if I understand the logic correctly, handleClose should be called when the last fd refering to the file closes?

vestal sapphire
vestal sapphire
#

we ball

trim eagle
#

Nice

vestal sapphire
#

coredumps work letsgo

native prairie
#

Damn

#

Leo solo carrying managarm again

native prairie
vestal sapphire
#

you just write out a funni ELF file

#

with a few note sections

native prairie
#

How complex is it?

vestal sapphire
#

and then you just dump memory

vestal sapphire
native prairie
#

Do u dump it from the kernel?

vestal sapphire
#

nah the posix server

native prairie
#

Damn

mild jetty
#

in a classic monolithic system it'd be the kernel though right

vestal sapphire
#

yes

mild jetty
#

just for future reference if I ever get to implementing it

native prairie
vestal sapphire
#

no, you just iterate the VMAs and dump some of them

native prairie
#

Interesting

#

Some?

vestal sapphire
#

you list all VMAs as PHDRs

#

and the ones with a fileSz != 0 are appended at the end of the file basically

native prairie
#

Ill definitely do that as well

vestal sapphire
#

yeah it's pretty easy

#

there are a few note sections that are annoying to compile the data for

#

and dumping them is super annoying

native prairie
#

Why is that?

vestal sapphire
#

readelf treats them as binary data meme

#

you need to use eu-readelf -n

#

it took me a while to figure that part out ngl

native prairie
#

Lol

#

What does EU stand for

vestal sapphire
#

elfutils

native prairie
#

Ah

upbeat smelt
#

now let's see paul allen's elfutils

carmine current
#

launching on the raspberry pi is now basically as fast as starting qemu

#

this is over an internet connection, not local LAN

#

4 seconds from launching the command to first line of raspi firmware

trim eagle
#

Nice work!

zinc remnant
#

Does this contain the intel iGpu driver collection thingy in this thread?

trim eagle
#

@vestal sapphire LIL questions asked

zinc remnant
#

Yeah so are there any plans to eventually add support for amd integrated graphics? Or is the plan to be intel only?

vestal sapphire
#

if someone contributes amd drivers, sure

#

I'm not doing it tho

#

amdgpu driver looks like significantly more effort than both intel and nvidia

nocturne tide
#

mlibc#1398 and managarm#995 gets us to desktop on riscv64 :^) hopefully after doing some more signal memes we can get a working terminal

lament grove
#

I don't have it handy the next couple weeks but lmk if you want to test on my HiFive Unmatched

nocturne tide
#

that would be cool, but i'm absolutely unsure about hardware support but if it can run limine (needs uefi) then maybe it's worth a try?

lament grove
#

It definitely does

#

I do that for running BadgerOS on it already

#

Last time it didn't boot because of some bug in thor IIRC but that's a while ago now

#

There are 31 GPRs, not 30. 32 including PC.

nocturne tide
#

isn't it x0-x31?

#

so excluding x0 (constant 0) it's 30

#

wait x0-x31 is 32 ☠️

#
-                for(int i = 0; i < 30; i++)
-                        regs[i + 1] = thread->_executor.general()->x(i + 1);
+                for(int i = 1; i < 32; i++)
+                        regs[i] = thread->_executor.general()->x(i);

does that look correct too? seems more correct to loop over all gprs skipping x0

lament grove
#

Yes

#

I use the spot where x0 would be for the PC but you're probably already doing that.

nocturne tide
#

yup exactly

serene portal
carmine current
#

well, there are 32 grps (one of which is zero) and PC

lament grove
nocturne tide
#

with signals fixed we can run a shell :^)

native prairie
#

damn and u say u cant do anything

nocturne tide
#

i was just filling in holes

#

the only original piece of code i kinda wrote is the msi allocation and routing for riscv

#

but i am happy with this result ;) getting something to work with not much effort is nice

vestal sapphire
#

getting sway in took 2.5 years

#

I did take breaks tho

#

it gets better

median wharf
#

sick

carmine current
#

this means that Managarm can now boot and run desktop environments on all three supported architectures

#

now we just need some more riscv drivers for real hw to be able to claim that we can also do it on all three archs on real hardware

trim eagle
#

Wellllll. Which real AArch64 hardware do we run on now then?

carmine current
#

raspi4

trim eagle
#

Oh I thought we were still missing stuff there

#

I guess USB boot cuz we don’t have a SD card driver yet right

carmine current
#

we're missing some patches by qookie that already exist though

#

and xhci is not fully functional

trim eagle
#

Yeah ok that makes sense

serene portal
#

iirc eir-uefi is also broken on aarch64

#

that's my fault i guess?

carmine current
#

¯_(ツ)_/¯

#

what's happens if you run it?

vestal sapphire
#

good news, I got webkitgtk to compile again

trim eagle
#

Yeah

brittle mauve
#

also there are the socket leaks in the netserver

serene portal
#

idr which one

#

i think it said synchronous exception

carmine current
brittle mauve
#

there was some kind of misuse of a weak ptr where its promoted to a normal shared ptr and stored creating a reference cycle

#

or actually it wasn't a reference cycle, its just that a shared_ptr<Tcp4Socket> is stored inside a vector in Tcp4 and only removed from there inside Tcp4Socket destructor (that never gets called because the Tcp4 keeps ref to it)

carmine current
#

ah

#

i guess the fix is removing it on close, not when it's destructed

#

close = the file lane (not the passthrough lane) is closed

brittle mauve
#

what I did for that when I tried to make the tcp server stuff work was to just change Tcp4 to instead store a vector of normal pointers

nocturne tide
#

what's Tcp4 anyway? what is that object supposed to represent?

#

the entire machinery behind handling any incoming ipv4 tcp connections?

brittle mauve
#
struct Tcp4 {
    void feedDatagram(smarter::shared_ptr<const Ip4Packet>);
    bool tryBind(smarter::shared_ptr<Tcp4Socket> socket, TcpEndpoint ipAddress);
    bool unbind(TcpEndpoint remote);
    void serveSocket(int flags, helix::UniqueLane lane);

private:
    std::map<TcpEndpoint, smarter::shared_ptr<Tcp4Socket>> binds;
};
nocturne tide
#

so yeah, it's the state used to manage tcp connections i guess

brittle mauve
#

yeah

carmine current
#

basically the set of all bound sockets

#

the IP header tells us if a packet is tcp or udp but not what port it's addressed at

#

so Tcp4's job is figuring that out

vestal sapphire
#

coming to a mlibc build near you soon™

#

ngl that was easier than I thought

#

btw I was able to just copy/paste the CFI annotations from the linux sysdep into managarm meme

#

so if 1401 gets merged the managarm sysdep will be ezpz

trim eagle
#

decided to try and see if the Vulkan based version of glxgears works. It does, after enabling a vulkan driver in mesa, without patching

vestal sapphire
carmine current
#

very cool

#

Btw does /usr/managarm/bin/gen-initrd.py work? :^)

native prairie
#

damn

#

now try cloning linux

carmine current
#

from Managarm?

#

that'll probably run out of disk unless leo has a very large image lol

trim eagle
#

we fixed GNOME Calculator!

lament grove
#

What does managarm do for USB?

trim eagle
#

How do you mean exactly? What kind of information are you looking for?

lament grove
#

Do you use existing libraries? How do you handle HID? How about USB MSC devices?

#

How about devices that use vendor-specific interfaces? Is there any sort of support for that (at least in the sense you could make a driver if you wanted to)?

#

I'm basically looking into what the USB because I want to be able to use USB HID and USB MSC myself.

brittle mauve
lament grove
#

From what I see there, it looks like Managarm has its own USB drivers

brittle mauve
#

yeah

lament grove
#

I guess I'll be doing something similar myself at some point

#

But I don't think I'll support older USB controllers

vestal sapphire
#

we just have our own HID driver, and that should support the basics of mouse/keyboard/touch input

#

for the rest, we have some class drivers like ECM, NCM, MBIM etc

#

you could just write drivers for vendor-specific interfaces, but we haven't upstreamed any such driver yet

#

I do have toyed around with a driver for the vendor interface of an ASIX AX88772B and a RTL8153, but that's not ready yet

mossy swallow
# lament grove I'm basically looking into what the USB because I want to be able to use USB HID...

Here is a book about USB driver development: https://www.amazon.fr/USB-Universal-Benjamin-David-Lunt-dp-1717425364/dp/1717425364/ref=dp_ob_title_bk This is a very good source of information and the author answers questions on the osdev forum.

#

Honestly, since I got the book, I haven't needed to ask him any questions. 🤣

vestal sapphire
#

@trim eagle

#

fluke pass of gapplication test

#

it's inconsistent tho

short gazelle
#

managram ded

upbeat smelt
carmine current
#

Managarm is doing great in the last few weeks

#

We got a driver for the bpi-f3's NIC

#

which we can now boot using NVMe over TCP

#

Also, we (or rather, qookie) upstreamed a bit of work for the raspberry pi including proper DMA barriers for non coherent memory

#

and @nocturne tide made Managarm boot to userspace on Apple M1 real hardware

#

with a driver for Apple's AIC interrupt controller

#

and running the kernel in EL2

#

also, Leo fixed a lot of bugs and he almost has thread groups and non-trivial Linux clone() flags working

trim eagle
#

If we’re talking past few weeks, we also got gtk4 to work properly, tested that with gnome-calculator and made the ports collection grow to 400 recently

#

(And now I don’t have to think about the failure that is Secret Project 6)

upbeat smelt
#

btw @trim eagle did you upstream libqalculate?

trim eagle
#

I did not

#

But I can cherry-pick it for upstream next time I remember

nocturne tide
#

sadly you can’t really see it’s a mac so i’ll get a proper pic later

native prairie
#

But insane work

nocturne tide
native prairie
#

Wait what the hell

nocturne tide
#

i don’t have nvme yet, all that we did recently is a few kernel/eir changes so it boots and passes a framebuffer, also some changes for correctness because a lot of existing arm code did not anticipate such a dumb interrupt controller

native prairie
#

Why did they have to complicate it so much

nocturne tide
#

it would be amazing to get nvme to work but im sure its not trivial

nocturne tide
native prairie
#

Real

nocturne tide
#

rtkit has had a few cves in the past lmao

#

so it’s a great example that complexity only introduces vulnerabilities

#

excessive complexity* i guess

#

it could have been a simple nvme hooked up over pci but that wouldn’t be complicated enough lmao

#

but maybe thats how they can achieve 40+gbit transfer rates for their nvmes without much effort

#

actually i might be lying, idk how fast they go but i think they can do 10GB/s RW

#

or maybe 10Gb/s, which doesn’t sound so impressive anymore

#

they can apparently do between 3-5GB/s depending on the size and model

#

in some cases up to 7GB/s

#

30-40Gbit/s is pretty fast

native prairie
carmine current
#

tbh the apple aic is not that bad

#

It's actually pretty simple

#

Aside from the fact that it uses FIQs instead of IRQs for the timer

vestal sapphire
#

the apple NVMe situation is objectively just dumb

#

they get slow ass NVMes that are just special for no reason

#

with an insane controller that they had to spend time and money on

#

just for every comercially available SSD to run circles around that

#

they just shot themselves in the foot ngl

#

but ig they can charge dumb amounts of $$$ to people for storage upgrades

native prairie
#

Was it done purely so people cant put a custom nvme there they didn't buy for 9999999 dollars?

vestal sapphire
#

the only other explanation I can come up with is saving on PCIe lanes

#

sooooo

#

sounds like the beancounters had a little too much sway there

vestal sapphire
#

esp given that you need a second mac meme

upbeat smelt
#

i wonder how dumb the pcie controller is in the m1

nocturne tide
#

it’s ECAM compatible apparently

#

idk if that means much or if a controller can be not ECAM compatible but it seems pretty doable :^)

native prairie
#

There's a select reg or something

carmine current
#

Yeah, the are many controllers that are not ecam compatible

#

Almost no arm pcie controllers are ecam compatible

#

Just to get a feeling of how ecam and hence acpi compatible the arm world is: there are 401 device trees with pcie hosts in the linux source and 10 that support ecam KEKW

#

I think ecam implies dma-coherent ah, actually that's probably not true

#

Does the dt of the m1 have dma-coherent on the pcie controller?

nocturne tide
#
pcie@690000000 {
    compatible = "apple,t8103-pcie", "apple,pcie";
    device_type = "pci";
    reg = <0x06 0x90000000 0x00 0x1000000 0x06 0x80000000 0x00 0x100000 0x06 0x81000000 0x00 0x4000 0x06 0x82000000 0x00 0x4000 0x06 0x83000000 0x00 0x4000>;
    reg-names = "config", "rc", "port0", "port1", "port2";
    interrupt-parent = <0x0f>;
    interrupts = <0x00 0x2b7 0x04 0x00 0x2ba 0x04 0x00 0x2bd 0x04>;
    msi-controller;
    msi-parent = <0xbd>;
    msi-ranges = <0x0f 0x00 0x2c0 0x01 0x20>;
    iommu-map = <0x100 0xbe 0x01 0x01 0x200 0xbf 0x01 0x01 0x300 0xc0 0x01 0x01>;
    iommu-map-mask = <0xff00>;
    bus-range = <0x00 0x03>;
    #address-cells = <0x03>;
    #size-cells = <0x02>;
    ranges = <0x43000000 0x06 0xa0000000 0x06 0xa0000000 0x00 0x20000000 0x2000000 0x00 0xc0000000 0x06 0xc0000000 0x00 0x40000000>;
    power-domains = <0xbc>;
    pinctrl-0 = <0xc1>;
    pinctrl-names = "default";
    phandle = <0xbd>;
#

i cut off the rest as it contains some hardcoded pci devices

carmine current
#

Ah

#

I think it's not a big deal whether it's dma coherent or not since we need to insert cache flushes into the drivers anyway to support the pi etc

#

But still a bit surprising that it's not coherent

nocturne tide
#

i think that with a simple-framebuffer, once we write an applespi driver, xhci and nvme we can get to weston :^)

carmine current
nocturne tide
#

nvme is optional since we can boot off usb

#

keyboard is done over spi and touchpad is usb

carmine current
#

Ah

#

Is the xhci attached directly to the system bus or to pcie?

nocturne tide
#

it's separate

#

or, well, attached directly to the system bus :^)

upbeat smelt
#

but idk how the default is determined

upbeat smelt
nocturne tide
#

yeah but it doesn't look so bad

#

for each root port you enable the clock, you reset the root port, 100ms and set up the irqs

upbeat smelt
#

makes sense

nocturne tide
#

i think what he meant is that if you want more storage you pay way more than you should for the hardware lol

carmine current
#

Just attach an nvme enclosure over thunderbolt galaxybrain

nocturne tide
#

yeah sure, just write me a thunderbolt driver meme

carmine current
#

I have no idea how thunderbolt controllers work

#

Is the spec even open?

vestal sapphire
#

I don't even want to think about how tb works meme

fresh hornet
#

Don't you know, would this work. Namely, in uboot's cli, you set bootargs, using setenv bootargs 'blablabla'. The question is would the blablabla reported to the UEFI loader via EFI_LOADED_PROTOCOL's LoadOptions field? uboot's documentation implies it would. Didn't you try to pass parameters for the loader this way? Unfortunately neither fatload nor load not bootefi can pass anything useful in this spirit. Can't check by myself and asking people to do it for my case would be too bold - they would need to figure partition GUID or MBR Signature and offset, then type all that. 😁 but maybe managarm makes use this way for the uboot case. I use it as an alternative way of passing the Boot Volume Descriptor. Works via UEFI shell, not tested on uboot commands.

vestal sapphire
#

The LoadOptions field is defined to be binary data (no joke), so ig that could work

#

For U-Boot tho you can probably also just pass args via dtb

nocturne tide
#

that's basically what you're supposed to do

#

the standard is a /chosen/bootargs node in the dtb

fresh hornet
# vestal sapphire The LoadOptions field is defined to be binary data (no joke), so ig that could w...

Yes, when booting from the BootN variable, that field points to the OptionalData part of the load option variable and it can be anything you need (and I use this). When loaded via the UEFI shell, that fields get the command line (as per the EFI Shell specification). I just wanted to know if someone experimented with uboot this way. Well, how it's written in the uboot documentation, looks like it would pass the contents of bootargs.

fresh hornet
nocturne tide
#

idk, uboot uefi is a meme anyway

#

why would you want uboot to pass bootargs to uefi

#

that also requires bootloader support

#

just pass them yourself if you load a bootloader anyway

#

and if you boot linux directly with efistub the bootargs are baked into the executable anyway iirc

#

i think uboot can pass args if you do booti/bootm

carmine current
#

how else do you want to discover devices on the system bus?

carmine current
#

UEFI supports DTBs

fresh hornet
# carmine current you still need a dtb with uefi

Currently yes. In future, hopefully, no. But it doesn't matter, since messing with dt still would be left to the kernel. The loader should be free of this. My loader looks into LIP->LoadOptions and if it's not NULL, inspects the contents. If it's Boot Volume Descriptor, defined by the boot protocol, it means we are getting loaded via our BootN variable - the installed, main scenario. We get needed info from that descriptor (partition, system root directory, file system type). Alternatively, if the BootN got deleted, but the installation is valid, the user can pass the text form of the BVD. As I said, with firmwares, implementing EFI Shell and its protocols, you can pass the text form of BVD during the loader start in the CLI. Or, via implementation's Boot Manager if the latter allows one to create a boot option manually including with allowing to set Optional Data as text. For uboot it was unclear. Now I see it allows via the mentioned setenv bootargs, just need to ensure. As of why not from dt. Even if I have to use it, that would happen in the kernel, the aforementioned logic is in the beginning of the loader. The latter is purely UEFI OS loader. Its code is almost 100% architecture agnostic, no way to screw it up by such an abomination as dt.

vestal sapphire
#

update on the rust situation

lament grove
#

Damn

#

That's so cool

vestal sapphire
#

I can't wait to upstream managarm support to all the crates

trim eagle
#

You and me both

carmine current
#

Managarm rust target is in the current bors rollup

vestal sapphire
#

I saw that live as it happened

vestal sapphire
#

We need

#

Shit auto correct

#

We merged

#

We'll be in stable on Oct 30th

trim eagle
#

Based

carmine current
#

Nice

vestal sapphire
#

And the next nightly ofc

carmine current
#

Managarm is now in upstream Rust nightly

nocturne tide
#
$ rustc +nightly --print target-list | grep managarm
aarch64-unknown-managarm-mlibc
riscv64gc-unknown-managarm-mlibc
x86_64-unknown-managarm-mlibc```
:^)
nocturne tide
#

sorry for shitty crop i cant take a photo without my face in the reflection lol, but here’s managarm booted into systemd on an m1 macbook air :^) i wrote an aic (apple interrupt controller), sart (sort of an iommu but for dma filtering), rtkit (apple coprocessor driver, used by the ans2 nvme) and of course an ans2 nvme driver, still got some bugs to iron out + i need to write an spi driver so i can get keyboard + touchpad and boot into weston!

dense umbra
#

Holy shit damn

fierce mist
#

Is there any documentation on these apple specific chips/devices?

carmine current
nocturne tide
carmine current
#

Progress: Managarm can now boot into its kernel on Radxa Orion O6 which is an ARM SystemReady board with UEFI + ACPI

#

However, we don't have proper ACPI support on aarch64 yet, so that will be the next step

#

And also, we can do this over HTTP boot (another new feature)

native prairie
#

Cool

carmine current
#

it's probably a bit less than $500

#

but yeah it's not cheap

#

it's quite capable though

civic vortex
trim eagle
#

WebKit revival in progress

carmine current
#

nice

dusk solstice
#

are there any plans for a new post on the managarm website?

carmine current
#

yeah we have some content to share

#

progress on that is slow though, seems that none of us are eager blog post writers lol

dusk solstice
carmine current
#

some progress by @vestal sapphire : we can compile + run sortix's os-test testsuite on Managarm and we get more passing tests than Minix and Redox

#

this is a testsuite that tests posix compliance

vestal sapphire
dusk solstice
#

5% more and freebsd will be behind 😔

#

on the overall score

carmine current
#

getting UDP tests to work would get us another 1.5%+ of conformance

dusk solstice
#

would pty be stuff like ansi support or smth?

carmine current
#

@vestal sapphire it'd be nice to generate the report for Managarm on CI

#

i wonder if we have any good way to do that

#

we should probably expand virtual boot

#

maybe have a python script running on the Managarm side that sends the output base64 encoded over serial

carmine current
#

I think improving virtual boot is something i might do next

serene portal
#

os of the future

vestal sapphire
#

don't worry

trim eagle
vestal sapphire
#

you don't need pty support or ppoll if it's blazing fast 🚀🚀🚀

trim eagle
#

Balzing fast lmao

vestal sapphire
#

let a man typo

trim eagle
#

Funny typo

vestal sapphire
#

now run os-test on menix trl

serene portal
#

💀 i would need waitpid for that

trim eagle
serene portal
#

yeah

dense umbra
vestal sapphire
#

soon

serene portal
#

soon

#

menix on managarm

carmine current
#

No need to shit on redox, they also have a few cool things that we don't have

lament grove
#

Would be pretty funny if Managarm eventually surpassed Linux in these tests

dense umbra
#

get managarm certified meme

#

managarm unix™

upbeat smelt
#

just pay a shit ton of money to be granted exceptions for failing tests :^)

dusk solstice
#

functionality doesn't matter if it's memory safe 😔

carmine current
#

We also have that

#

Or do you mean in upstream rust?

serene portal
#

upstream

carmine current
#

that's true but it doesn't really give a huge benefit unless you're building rust programs outside of xbstrap

trim eagle
#

Oh wait

dense umbra
#

Simply dont have a rust target and use a better language smh

serene portal
#

C3

wind hamlet
#

and the interrupt controller is dumb because it comes from the iPhone

#

i think it's originally a samsung design? probably got revamped a lot but it should be related to the A1 (first iPhone's SoC) which is a samsung design

carmine current
#

the apple interrupt controller is actually quite nice

#

except that for some reason they decided to route the timer interrupt to FIQ

carmine current
#

some progress from my side: I improved the CI such that we now

  • test whether all boot protocols work on x86 (uefi, limine, mb2), both on bios (where applicable) and on uefi
  • run posix-tests and kernel-tests on each github actions run
    these test run after booting with systemd to check that both kernel + userspace work
lament grove
#

Help, Marvin and I have been nerdsniped by microkernels KEKW

trim eagle
#

Skill issue keke

lament grove
#

But yeah I want to learn about them. Probably not this instant because of the time of day, but still.

carmine current
#

source lines of code is a useless metric, but mlibc has surpassed musl in SLOC

trim eagle
#

Image viewer based on the GNOME stack. Now with SVG support (GTK SVG support is nasty stuff, Qt does this a lot nicer)

native prairie
trim eagle
#

One day

dense umbra
#

Gnomagarm

carmine current
#

we also have a bunch of KDE stuff though lol