#Astral

1 messages · Page 34 of 1

formal patio
#

depending on what the tradeoff parameters are, it might be worth it for the hardware that has EHCI controllers still

#

UHCI and OHCI are quite the meme tho

robust geyser
#

oh yeah, don't bother with that

formal patio
#

with EHCI you can support eSATA, and with OHCI you can support FireWire meme

#

I actually have machines (plural) with that

opal lotus
#

same

marsh sparrow
#

ehci has way fewer failure modes than xhci

#

ehci is a comparatively simple device with a very simple state machine that is iterated through and it only supports one bus protocol (usb2)

#

xhci has its own firmware and RAM (or rather, RAM stolen from system memory) and it does allocation of various things (data structures, bus schedule) on its own

#

And it supports 3 bus protocols on the hardware level that have subtle and not so subtle differences

grand shadow
#

xhci core mostly done

#

(missing one TODO related to post-unplug cleanup. oh well I'll do it at some point)

#

working on hid rn

#

I'll skip boot protocol straight to full report

quartz granite
grand shadow
#

first signs of life out of full report hid on userland:

#

its still missing actually keeping track of keys and control keys though

#

as well as I still havent hooked up a mouse abstraction here

#

I also want to do ABS touchpad

grand shadow
#

today was a productive day

#

I started not knowing how to parse an hid report descriptor and ended with hid fully working

#

forgot to post here etc

#

cc @robust geyser

grand shadow
#

Im pretry surprised I actually managed to pull this off while running on 3 hours of sleep and sick

#

💀

grand shadow
#

@opal lotus since u want to look at it soon the xhci and usb stuff is merged into master now

fleet osprey
#

disabling console logs once Xorg is running when trl

grand shadow
#

@formal patio how bad was it to get usb phone network passthrough to work btw

#

Kinda wanna try my hand at that at some point

#

@analog berry gg

#

Tho as you can see it is kinda messy

#

I have like 27 /dec/ibput events

#

☠️

#

Probably because I do not do ubplug properly abd my keyboard fucking has like 6 applications

#

Like wtf

#

My mouse does not like existing tho

#

It says Im failing to get the descriptor there

#

I forgot to disable my mostly unsted ahci driver before booting, surely nothing bad has happened to my data

#

Power button and openrc work too

#

Yippe

fleet osprey
#

And then forget you ever did that

#

For maximum data insecurity going into the future

grand shadow
#

Funny thing, the total size occupied by all my packages when in xbps format is very low

#

470M

#

Excluding wine and openjk which are like 300M each

#

So I can just keep it on my usb stick for almost no cost

#

Though I want proper msd soon

#

tomorrow I will try out the arcade and I have a usb full of packages including evtest so I can try out the fucking joysticks to see if my hid parser is up to par

robust geyser
formal patio
#

aka it's piss easy

#

the spec for it is also pretty nice to work with

#

most modern Android devices expose NCM, some older ones expose RNDIS, iPhones do some custom shit tho where you'd need libimobiledevice

#

NCM is also the generic interface that modern USB ethernet dongles expose

formal patio
#

if you have some HID touchscreen, I can only recommend implementing multitouch support, it's really nice btw

#

I have a thinkpad with touch, the digitizer is a wacom USB device

analog berry
grand shadow
#

Though I have to do hubs cuz the fucking device is behind a hub

#

💀

grand shadow
#

Worth looking into probably

robust geyser
#

i mean yeah, i think i already said it's super easy, similar to MSD

#

you just yeet shit at a bulk endpoint

#

and it just works™

grand shadow
#

Ive had to look into a using a lorawan modem and it was just sending text over usb

#

I might lowkirkenuely do this

#

After hibs

#

Though that means I need to make my networking stuff hotplugganle

#

OOOOOOR

#

// TODO hotplug

#

:^)

grand shadow
#

Its just sending packets over a bulk endpoint

carmine swallow
#

its basically the same for rndis too, you just yeet ethernet packets + a header to an endpoint

grand shadow
#

working on hubs

#

I've got the xhci bullshit out of the way and I have the init stuff almost done

#

just gotta do the initial chain of power ons and get status

grand shadow
#

I should test it on real hw

#

huh

#

nevermind then

#

I thought the front panels usb ports on my desktop were a hub but according to windows there is none?

#

all this usb work has made the kernel fatter

#

holy fuck yeah its like

#

I'm gonna do another clanker ctf before going to sleep

grand shadow
prime mulch
#

i think the most difficult it ever is for me not to be annoying is when someone brings up their loc counts

prime mulch
#

flex my own loc counts

#

which would be annoying

grand shadow
#

The "keep all your packages in an initrd directory and install them when needed" trick works on my desktop and I have a nice xfishtank view

#

Also good to see that killing and restarting the X server doesnt explode the entire thing

#

I had to do that like 10 times

#

Hopefully tomorrow I can finally get it to boot on the arcade machine

#

My mouse isnt working but I can actually play quake lmfao if I start the X server and run tyrquake directly

#

Perfectly playable fps too

#

Year of the astral desktop

#

Pretty crazy how far Ive come

#

I remember being excited by playing quake on astral for the first time

#

At like 7 fps

analog berry
#

Hopefully I can reach quake some day nooo

hearty fulcrum
#

same

cyan junco
analog berry
#

who knows

grand shadow
#

This stupid fucking controller doesnt return any connected ports for some reason?

#

Like I loop over the connected ports and that shi doesnt do antthing

fleet osprey
grand shadow
#

Since that motherboard has both a ehci and xhci controller

fleet osprey
#

now go all the way and do full EHCI support trl

#

I'll help test on both of my machines that only have EHCI

analog berry
#

Nah in this case I just disable ehci

#

Its for compat with old osses

grand shadow
#

Currently installing astral to the arcade

#

The joysticks and stuff seem to work too

grand shadow
#

Deed is done

#

(memory usage is from dirty pages, its slowly syncing it)

formal patio
#

it's nasty, I love it

viscid flame
grand shadow
#

Nor openjdk

marsh sparrow
grand shadow
#

I do think Ill need to recompile sdl2 to support joysticks

grand shadow
#

Worst case I hack together doomgeneric to use joysticks

#

(astral will run on the arcade in an event saturday)

worthy mica
grand shadow
#

I have gotten news that it shut down properly so it should have synced to disk

grand shadow
#

now I wonder how fucked up it would be to get hid sensor data out of the quest 2

grand shadow
#

oh shii mednafen always segfaults

#

wtf is this regression

#

oh come on not this shit again

Line 29 of "../../../base_dir/sources/mlibc/options/posix/generic/pthread.cpp" starts at address 0x3cbf5 <_ZN10ScopeTraceC2EPKciS1_+53>
   and ends at 0x3cc0b <_ZN10ScopeTraceC2EPKciS1_+75>.```
#

this is some issue I have to do a world rebuild to fix but I do not want to do world rebuilds

#

oh nice I don't need to do that

#

the stuff at my vps is already updated

#

sure thing bro

fleet osprey
#

lol what

grand shadow
#

I really need to update the readme to talk about the ../jinx/jinx download thing

#

probably just a make download-all-packages or some bullshi

grand shadow
#

(this is with some evil hacks applied in my hid parser to treat the usb-tablet in qemu as a joystick)

#

I'm probably gonna leave some street fighter game running in the arcade

grand shadow
opal lotus
#

how that work

grand shadow
#

ezpz

opal lotus
#

no like

#

is that a new feature

grand shadow
#

its been there for a while iirc

#

you just pass an xbps repostiroy and jinx will download packages

opal lotus
#

zamn

grand shadow
#

no more having to build five trillion gccs to fix one kernel bug and pr it in

#

now its just one gcc

#

though mednafen still doesn't really seem to do anything with it

grand shadow
#

I think its a matter of just configuring mednafen now

#

since it works on the sdl2 side

analog berry
#

How did u type stuff in it

robust geyser
#

usb keyboard, presumably

grand shadow
#

Yeah theres a hub on the front

grand shadow
#

I think I might stwrt working towards audio soon

grand shadow
robust geyser
#

holy fuck

#

that's so based

analog berry
#

Crazy stuff

grand shadow
fleet osprey
#

audio when

#

(based tho)

hearty fulcrum
#

uhda

formal patio
#

I think I figured out what you need to set to enable ifunc in gcc, testing as we speak

formal patio
#

this is the necessary change

#

confirmed to work

#

cc @opal lotus

opal lotus
#

thx

grand shadow
#

Epic

grand shadow
#

But I am likely going to not do any astral work this next week

#

Or minimal work only

#

Cuz I got exams

fierce forge
grand shadow
#

And also, after that stupid crash that made the arcade machine disk corrupt, I really really want to do journaling :D

grand shadow
#

maybe I can add like ext3 as part of my "1.0 must have" list

#

for larping I will make astral 1.0 probably as soon as I have audio, an installer and I can bootstrap a system inside itself

analog berry
grand shadow
#

yeah

#

I feel like nowadays for a usable system that is kind of a must have

#

especially for a crash prone one such as a hobby os

#
  • its going to be interesting to learn about it tbh
#

Ive always wondered how its been done but I never sat down to read about it

analog berry
#

Yeah

grand shadow
#

the only two things I am missing is audio and fully self hosting

#

which soon™

prime mulch
#

"Procesessor"

proper meteor
hearty fulcrum
#

I'm missing block storage, a real filesystem, gui, networking, sound, usb, self-hosting

opal lotus
#

i have that minus sound usb and self hosting

willow rapids
#

missing networking, sound, usb and self hosting 😭

grand shadow
#

Another thing I am gonna look into doing at some point is drm

#

As much as I dont want to implement drm, I want 3d accel

#

3d accel minecraft in astral with sound would go hard

errant zephyr
#

or macos's uapi

analog berry
#

Otherwise all u get is slightly better dev fb

errant zephyr
#

ye

#

drm rendering and accel is mostly completely separate

grand shadow
#

(I have no idea how any of that works)

analog berry
#

For Nvidia u need a lot of sysdeps

#

But shouldn't be a problem for astral kernel since its relatively complete

errant zephyr
#

you should also support drivers for apple gpus

#

they are awesome

#

(it involves rust in kernelmode)

analog berry
#

you're saying it like there's a portable driver

errant zephyr
#

most of the logic is portable

#

because most of it is in mesa

#

well except for amd

#

for amdgpu there is like 200 megabytes of kernel headers

#

which i guess is also portable

marsh sparrow
errant zephyr
#

yeah lol

#

for apple you just need to implement the kernel driver, and also implement the command buffer formatting, sync formatting, and some shader lowering code

#

not even a full shader compiler so basically its trivial

marsh sparrow
#

It's not "just" wiring up a few ioctls correctly

analog berry
#

Its a tiny driver even on linux

marsh sparrow
#

Not to mention that it's very hard to debug

#

If it's that easy, then do it meme

analog berry
#

Its hard for you because managarm microkernel memes

marsh sparrow
#

No?

analog berry
#

But for a mono it should be trivial

#

Just pipe user buffer as part of a command

#

Not even validation needed there

marsh sparrow
#

I'm sorry but you're just talking out of your ass here

analog berry
#

Lol ok

marsh sparrow
#

Did you ever look at the userspace side?

errant zephyr
analog berry
#

Why would I care about the Userspace side at all

marsh sparrow
#

You do need to understand the mesa shader pipeline to some extent to debug it

analog berry
#

Its handled by mesa

marsh sparrow
#

Because it sends mesa IR over the ring

errant zephyr
marsh sparrow
analog berry
mild sentinel
marsh sparrow
#

If it's that easy, just do it

analog berry
#

Why would I need to debug mesa

errant zephyr
#

if you cant write perfectly bug free code you really arent a good kernel developer ngl

mild sentinel
marsh sparrow
#

If it's trivial, then every second hobby OS should have it

analog berry
#

If it has a working mesa port and DRM sure

#

Barely any has that

errant zephyr
#

its also not that tiny lol

#

its 5kloc

marsh sparrow
#

There are probably 50 hobby OSes with a mesa port

#

And zero with virtio hwaccel

errant zephyr
#

just implement drm/adp instead

analog berry
errant zephyr
#

adp is like 900loc (because its only display out for the touchbar)

marsh sparrow
#

Plus all the ABI that you need to get correct on the userspace side

analog berry
#

Admit it KEKW

marsh sparrow
#

Leo had an in progress driver but it was pain to debug

analog berry
#

We already figured out it was probably because of an mlibc bug

#

The actual driver side was tiny

marsh sparrow
#

It got to the point where everything worked on the ioctl / vq side but display didn't work

analog berry
#

Yep

marsh sparrow
#

Presumably because of some mismatch in host/guest abi

errant zephyr
#

anyway you should write your own full gpu driver anyway because thats cooler

marsh sparrow
#

It's definitely not trivial

#

And you've also not done it, infy

analog berry
#

It would've probably just worked if it was glibc

analog berry
errant zephyr
marsh sparrow
analog berry
#

Ok you're 100% seething lol

marsh sparrow
#

I just think it's stupid to claim that something is trivial when it isn't

analog berry
marsh sparrow
#

I literally just paraphrased your own msg in case you didn't notice

analog berry
#

Because I hurt your ego by saying that virtio gpu is easy

#

But you started coming up with stories of how its insanely hard

analog berry
#

Did I have to say given you have the kernel infrastructure and mesa?

marsh sparrow
#

I never worked on virtio-gpu

analog berry
#

I guess indirectly

marsh sparrow
#

Hm?

analog berry
#

Only you know the answer, but you clearly got hurt

marsh sparrow
analog berry
#

How many hobby kernels with DRM do you know

marsh sparrow
#

Probably dozens?

analog berry
#

Id say thousands

#

Maybe millions

marsh sparrow
#

I don't think there are that many

analog berry
#

Anyway lets see what it takes me once I get there, or Mathew

gritty shore
#

its probably not trivial but it's probably considerably easier than any other gpu

marsh sparrow
#

Does it even work on BSDs?

analog berry
analog berry
#

Here userspace commands are just wrapped into a special command

gritty shore
analog berry
#

Nah I think if you can implement a ton of sysdeps it needs its a big achievement

#

Some are pretty complex

marsh sparrow
#

But sure, it's trivial to wire up, so just do it

fierce forge
#

What are BSDs? Linux is the only OS there is

gritty shore
#

wtf is linux

#

is that the woke os from the swedish guy or something

analog berry
marsh sparrow
#

No, I'm don't think that it's impossibly hard

#

I think it's non-trivial

analog berry
#

Iirc it was implemented in linux by the same people that implemented it in QEMU

#

So they just didn't bother

#

Its not even documented properly still

marsh sparrow
#

And it's requires more effort than just wiring up a few ioctls

analog berry
#

What else does it require, maybe highlight some of the difficult parts

marsh sparrow
#

It requires debugging on the userspace side which requires digging into Mesa

#

That's the main difficulty

analog berry
#

Im still not sure why that sort of debugging would be required if your task is to take a buffer and push it into the gpu. That would only be needed if you suspect a problem in mesa itself

gritty shore
#

I'll do it first... just watch me...

#

(I dont have any drivers)

analog berry
#

Go for it chad

gritty shore
#

infy will you implement it for me

#

in return i will give you my gratitude

analog berry
#

Well if u implement drm

#

I might try

marsh sparrow
#

It sends mesa ir that is interpreted by host mesa

gritty shore
#

maybe if my kernel werent a hello world i would

analog berry
marsh sparrow
#

Your guest mesa needs to send IR that is compatible with what host mesa expects

analog berry
#

And its the same general principle no? A buffer u send

marsh sparrow
#

If there is a mismatch somewhere you need to debug it

#

And you can't debug it by looking at the kernel side only

analog berry
#

Well for Linux compat id just copy stuff from my host trl

marsh sparrow
analog berry
#

Do u agree that if you know your mesa is the same and has no libc related bugs its not that much work?

marsh sparrow
#

I don't know

#

I don't claim anything that i cannot form an educated opinion on

#

And i don't know mesa internals well enough to know what it looks at etc

analog berry
#

Anyway what I said was with the assumption that the mesa part is figured out and is known to work perfectly

marsh sparrow
#

I think that assumption doesn't hold

analog berry
#

If you recompile it with a custom libc that you dont know the state of then it might be super hard

errant zephyr
analog berry
errant zephyr
#

and moving protobufs around is trivial

#

so everything is trivial

#

eqed

analog berry
#

If your software is just the mover, sure

#

You're not a producer nor a consumer

errant zephyr
#

yeah and sometimes transcoding one to the other

#

(you can do everything this way, thats the joke)

analog berry
#

Well ok KEKW

errant zephyr
#

anyway normal gpu drivers also work like this

#

you have gpu firmware

#

you tell the gpu firmware to do x

#

and it does x

#

you do some page table shit too

errant zephyr
#

and some sync which is also true for drm

errant zephyr
analog berry
#

On Intel gpu there's also a very limited aperture so you need to have very careful relocation etc for host buffers

errant zephyr
#

i think on amd admin commands arent on the same stream? not sure

analog berry
#

Not sure

analog berry
#

You need to know the proprietary layout for some cases

errant zephyr
#

if (hang) just reset the device and tell the user shit went wrong

#

^^ amdgpu code

marsh sparrow
#

even the assumption "you just need drm" is kinda weird because DRM on linux is larger than many other kernels halfmemeleft

errant zephyr
#

on nvidia you can actually debug it

#

on amd not so much afaik

analog berry
marsh sparrow
#

But not for 3d accel

#

That works for mode set, but not for accel

errant zephyr
#

drm/asahi is only ~4x bigger

analog berry
#

For proper 3d ud need at least fences etc ig

marsh sparrow
#

And proper buffer allocation

analog berry
#

Yes

errant zephyr
marsh sparrow
#

even on virtio-gpu

errant zephyr
#

and like all of the common logic around that

marsh sparrow
#

yeah

analog berry
#

Yes

errant zephyr
#

which is also very much not easy

analog berry
#

But that's outside the scope of virtio gpu driver, I think thats kinda fair

marsh sparrow
#

Well, if you restrict the scope to just the execbuf ioctl, that's ofc easy but that doesn't match reality KEKW

errant zephyr
#

yeah lol

analog berry
#

Well its not just execbuf, there's a lot of auxiliary commands but yes its also just wiring ioctls

#

Thats why I mentioned having a DRM impl lol

#

It needs to be at least minimally working

errant zephyr
#

there is only a few ioctls for amdgpu too: ```
DRM_IOCTL_AMDGPU_CTX
DRM_IOCTL_AMDGPU_GEM_CREATE
DRM_IOCTL_AMDGPU_GEM_METADATA
DRM_IOCTL_AMDGPU_GEM_MMAP
DRM_IOCTL_AMDGPU_INFO
DRM_IOCTL_ETNAVIV_GEM_NEW
DRM_IOCTL_GET_CAP
DRM_IOCTL_IVPU_SUBMIT
DRM_IOCTL_LIMA_GEM_INFO
DRM_IOCTL_MSM_GEM_NEW
DRM_IOCTL_PRIME_HANDLE_TO_FD
DRM_IOCTL_PVR_GET_BO_MMAP_OFFSET
DRM_IOCTL_QAIC_MMAP_BO
DRM_IOCTL_SYNCOBJ_CREATE
DRM_IOCTL_SYNCOBJ_DESTROY
DRM_IOCTL_V3D_CREATE_BO
DRM_IOCTL_VC4_WAIT_BO
DRM_IOCTL_VERSION

#

i think some of those are garbage

analog berry
#

Intel has a shit ton more I think

errant zephyr
#

its from strace

analog berry
errant zephyr
#

glxgears

#
DRM_IOCTL_AMDGPU_CTX
DRM_IOCTL_AMDGPU_GEM_CREATE
DRM_IOCTL_AMDGPU_GEM_METADATA
DRM_IOCTL_AMDGPU_GEM_MMAP
DRM_IOCTL_AMDGPU_INFO
DRM_IOCTL_GET_CAP
DRM_IOCTL_PRIME_HANDLE_TO_FD
DRM_IOCTL_SYNCOBJ_CREATE
DRM_IOCTL_SYNCOBJ_DESTROY
DRM_IOCTL_VERSION
``` actually
analog berry
#

U need like a 3d triangle to make it fair

#

Yeah but where execbuf etc 🤔

errant zephyr
#

and theres some that arent recognized by strace too

#

probably _IOC(_IOC_READ|_IOC_WRITE, 0x64, 0x48, 0x40)

marsh sparrow
#

Obviously, amd gpu has no overlap with vc4

errant zephyr
analog berry
#

There was some environment variable for mesa u could set to get a command trace

#

At least for crocus dri

errant zephyr
#

wait or maybe DRM_RADEON_CLEAR

#

wait no not clear

#

idk

#

anyway its one of them

analog berry
#

this is the work horse i think

#

There should be a DRM_IOCTL_AMDGPU_CS

errant zephyr
#

thats 0x66

#

idk

fleet osprey
#

wtf amdgpu stuff

#

is Astral getting AMD GPU accel ultrameme

analog berry
#

lol

errant zephyr
analog berry
#

but yeah mesa probably has tons of options

#

they like env variable stuff

errant zephyr
analog berry
#

damn

#

at least for when i did igpu stuff it wasnt that hard to dump shit

#

but idr if i had to recompile it

analog berry
#

oh cool

#

so it is getting called at least

#

strace doesnt show it?

errant zephyr
#

it doesnt seem to

#

it hits amdgpu_cs_ioctl too

analog berry
#

huh lol

errant zephyr
#

so i might just be stracing wrong lol

analog berry
#

maybe it forks itself or something

errant zephyr
#

i did use -ff

analog berry
#

strange

errant zephyr
#

vkcube does show it

#

so maybe its glx jank

#

it has ioctls 0xc1 and 0xc2

analog berry
#

I wonder how it bypasses strace

errant zephyr
#

no idea

neon crane
#

@grand shadow you should try to port butterscotch (https://github.com/MrPowerGamerBR/Butterscotch), it's pretty easy since it's just sdl 1.2, and on my fork you even get a software renderer so no need to futz around with mesa/llvmpipe

#

also the project is made by a fellow brazilian

analog berry
#

The last point is the most important chad

grand shadow
#

undertale on astral

#

tbf its also probably possible to just

#

wine

sage locust
#

it's actually kind of more impressive (and accurate) to just use wine lol

#

imo

grand shadow
#

True

#

Deltarune works I dont see why undertale wojldnt

neon crane
sage locust
#

wdym?

opal lotus
#

It's Not an Emulator chad

neon crane
#

i mean the YoYoian runner uses DirectX 9, which presumably requires emulation via OpenGL, and thus Mesa/llvmpipe, and stuff like that

grand shadow
#

Deltarune seemed playable and that was before I did some optimizations

neon crane
#

i see

formal patio
sage locust
marsh sparrow
#

While for opengl it sends mesa's internal tgsi tokens

#

There is also a cursed direct buffer pt mode where it sends gpu assembly

#

But that's only supported by some drivers

marsh sparrow
#

I suspect it didn't work on managarm when you tried it out because of host-guest ABI mismatch

#

Maybe somebody should try it on linux-mlibc to see if that works

grand shadow
#

Also I feel like plain fvwm is getting stale at this point

#

I need to go even further beyond and get nscde

#

So I can finally complete the unix workstation larp

winged basin
grand shadow
#

as for audio, I think the stack will be sndio backed by oss

opal lotus
#

bsd 🗣️

marsh sparrow
#

Together with uHDA?

grand shadow
#

Still unsure if going to roll my own or uhda. Someone also wants to roll the audio stack for astral so if they do so its up to them

fleet osprey
#

I can do a driver for the GameCube/Wii DSP trl

#

(I have no idea how any x86 audio shit works)

opal lotus
#

it's just a pci device

fleet osprey
#

never even begun to figure out PCI

#

I'm used to just knowing where shit is in memory, a device is just a region of memory that I can write to and read from and shit will happen trl

mild sentinel
analog berry
#

i mean pci is just for discovery

analog berry
fleet osprey
#

I guess that's useful if I ever do try x86 osdev again

robust geyser
#

PCI itself is also IO, not memory mapped but IO :^)

#

or, if you do ECAM then it’s MMIO aswell

wraith surge
#

(and you should do ecam on pcie)

errant zephyr
grand shadow
#

@winged basin did you ever manage to get ksh93 to build for keyronex? this build system seems pretty damn hostile to cross compilation

#

like, perl levels of hostile

#

atp I think something like perl-cross is the only way forward for something like this

#

well thats fun

#

TIL there is a function called j1() in posix

#

huhh why are these functions not exposed in mlibc

#

TODO: fix that in mlibc

viscid flame
# grand shadow

isnt it should check is there even function like this in configure

grand shadow
#

I did some bullshit

grand shadow
#

sadly ksh could not be built

viscid flame
grand shadow
#

This is a perl level bullshit build system

viscid flame
#

i mean patch src to not use it

winged basin
#

some guy from red hat tried to pick up development of it and he did autotoolise the build system but he also added loads of his own personal changes and caused severe regression so it died

#

the current maintainers report the following:

No, because the build depends on various feature tests that have to be run on the architecture and OS that the binary is going to be run on. For example, a test is done not just if posix_spawn(2) exists, but also to determine if it's functional enough to be worth using instead of fork(2). There are many other such tests, some written as C programs and some as shell scripts, all embedded in the iffe test scripts.

AT&T originally tried to make cross-compilation possible by providing a crossexec script, invoked by iffe, that remotely runs architecture-dependent feature tests on a host of the target architecture via rsh or ssh. But, in my view, that's a bit pointless. if you have to run feature tests on a remote machine, you might as well run the build on that remote machine to begin with, and avoid the hassle of setting up automated command execution via ssh.

The crossexec script is still part of the 93u+m distro. I've actually never tried this out, so I don't know how well it works (if at all). It's just never reached the top of my priority list.

wild marsh
#

does it have a way to just provide answers for all the checks instead?

#

like with autoconf you can export env vars to set answers to configure checks

grand shadow
winged basin
#

I'd probably ask a clanker to add autotools support

#

Or path of least resistance see what the build system generates in terms of config headers and just manually edit one

grand shadow
#

Unfortunately nscde has a hard dep on ksh93 so I do need to deal with this sooner or later

gritty shore
#

Do u pay for codex

grand shadow
grand shadow
#

text rendering challenge (literally impossible wtf)

analog berry
#

Btw whats missing for KDE on astral

grand shadow
#

Kernelwise? Probably /proc

#

Which I dont want to do

analog berry
#

So KDE never? nooo

grand shadow
#

Talk is cheap etc

#

If you can get it to work Id merge it :^)

#

But my goal rn is unix workstation larp so Im slowly porting shit for nscde

#

The biggest blocker being fucking ksh93 and its retarded build system

analog berry
grand shadow
grand shadow
#

And I would much rather sysctl() it

#

But I also dont have sysctl

#

So its kind of whatever right now,.maybe I have a change of heart

grand shadow
analog berry
#

Yeah that would be nice

grand shadow
willow rapids
#

what is wrong with the DateTime and Main windows

#

cause i've never had them work properly i have the same behavior

grand shadow
#

no idea, they are part of the sidebar

#

they seemed to work on qwinci's libc, which means this seems a mlibc issue

#

I've never looked into it

grand shadow
#

tomorrow is calc exam, then weekend with bf and then we ball on audio (if the other person isn't working on it already)

grand shadow
#

I think another port I am gonna bring back is xscreensaver

#

but I'm gonna mirror the source code for that one myself

#

the developer really really really likes to delete old versions

grand shadow
#

more bullshit

grand shadow
#

@winged basin I assume this will be of interest to you

winged basin
grand shadow
#

there are still quite a lot of rough edges though

#

its very messy altogether

winged basin
#

I had a feeling it would manage alright at it

grand shadow
#

that recipe should just work for any mlibc target

winged basin
#

Not too bad

#

I might steal it

#

It's not as big of a diff as I worried there might be

grand shadow
#

Interesting

#

I thought of asking clanker to use meson but opted for autotools

grand shadow
#

With ksh out of the way, I have a feeling nscde is pretty close

#

With just a few more ports left

grand shadow
#

I think I've got most of the basic dependencies for nscde

grand shadow
#

what is bro yapping about

#

I ran astral without any of that

gritty shore
grand shadow
#

oops

#

1k context llm brain moment

grand shadow
#

first signs of life out of nscde

grand shadow
#

has to compile qemu again award

#

I did not build pulseaudio support into it and wslg exposes a pulseaudio server, oops

opal lotus
#

laugh at the windows user

grand shadow
#

Fuck ME I think nscde is broken because fvwm is broken

#

Ans everything points towards it being a mlibc issue

#

Since it worked under hzlibc

marsh sparrow
#

you could test on linux-mlibc meme

#

aren't you using fvwm the entire time though?

opal lotus
#

and it was broken for some parts meme

viscid flame
#

able to run kde but not fvwm

grand shadow
marsh sparrow
#

Ah

sage locust
#

if i ported glibc to Astral would you upstream it? :3

analog berry
#

please do

sage locust
#

not porting it if he won't upstream it

#

it would just be nice to see more projects port glibc, it's actually not too bad once you know how it works

analog berry
#

im sure mathew will accept it if u make it optional

sage locust
#

making it optional is a lot of work though

#

and you'd need conditional patches

#

which jinx doesn't support yet

analog berry
#

damn

sage locust
#

or i guess you'd need to make your patches portable, which is probably a better fix lol

fierce forge
sage locust
#

nothing, something stupid that you'd ideally not need

#

basically patches that you only apply based on some setting

viscid flame
wraith surge
grand shadow
bright knoll
#

-# i'll take a free glibc port (i don't even have userspace setup yet :P)

mild sentinel
grand shadow
#

In the meantime I have also began reading and working on hda

#

I have decided not to go with uhda becase it doesnt support buffer mmapping and because I want to actually learn how hda works

#

Since Ive never really written a driver for a sound card before

#

Ill use sndio as the audio server

#

Hopefully I get verb submission and awaiting working today, but Im not in a rush

#

I already have a design in mind for how thats gonna be done

grand shadow
#

the larp approaches

#

yoo I was able to change colours

#

there are a LOT of errors lmfao

#

thsi is quite promising

#

none of the icons are loading

#

I wonder if thats me missing shmget?

#

cc @willow rapids

#

coming soon to a mlibc near you

#

now I do wonder whether I keep going with hda or I do nscde stuff

#

I'll finish some basic hda verb submission stuff

willow rapids
grand shadow
#

theres already a pr open for it

willow rapids
#

ah

grand shadow
#

(don't mind the CI fails, linux servers seem to be bad for some reason)

mild sentinel
willow rapids
#

I remember mlibc had some issues with those a while back too

grand shadow
grand shadow
#

I think today I will do some more nscde work before doing hda stuff

#

It really wants renameat2 lol

hearty fulcrum
#

billions must larp as linux

grand shadow
#

I need to figure out why the icons do not load

grand shadow
#

fuuck something wants RENAME_EXCHANGE

#

💀

marsh sparrow
#

lol

#

nice

viscid flame
grand shadow
#

using fvwm isntead of ancient cde code

mild sentinel
grand shadow
#

its still pretty buggy but I love cde

#

if I can get nscde working properly I will leave it as the default de

#

since the goal is to unix workstation larp

mild sentinel
#

Based

grand shadow
#

ughh this is so cool

#

NOT THIS BUG AGAIN

#

DID MLIBC REGRESS

bright knoll
#

should of taken the free glibc port when you had the chance :p

earnest willow
grand shadow
#

I'll just debug it later

#

gonna work more on hda now probably

#

that bug is only really needed for minecraft

earnest willow
#

what are the most commonly found quirks in hda?

mild sentinel
earnest willow
#

i also kinda want to write a driver for it in the future

#

the only quirk i have seen in my system is that linux prefers the pirq rather than the msi

grand shadow
#

(or ask a clanker to look at the linux code for you

#

I barely got verb sending working so I am still pretty far off from caring about quirks

earnest willow
#

well that's still something

carmine swallow
#

but in general there are like a huge ton of quirks if you would want to support all the quirky cards/machines that linux supports (though some of them only affect additional features that don't matter if all you want is basic playback)

grand shadow
#

well there was a recent regression with the so promotion code in mlibc after all

#

anyways talk was cheap and patches were sent

grand shadow
#

I already have a widget graph built, time to do a bfs now

grand shadow
#

thats quite a boring path, qemu

#

#define HDA_WIDGET_TYPE_AUDIO_OUTPUT 0
#define HDA_WIDGET_TYPE_PIN_COMPLEX 4

#

though I suppose now I just gotta do the initialization in the path

grand shadow
#

this probaly gonna look even cooler with higher resolution

#

get iconified idiot

#

I love this so much

viscid flame
grand shadow
hearty fulcrum
#

pend satches

fast gorge
#

Cheap is talk

spare prairie
neon crane
fierce forge
#

patches is talk

analog berry
#

Patches are cheap

hearty fulcrum
#

send talk

obsidian pivot
#

tend salk

analog berry
#

new cpu drop

willow rapids
#

typical thing resellers say

#

Gaming PC:
CPU: Intel Core
Ram: 8 Gb
GPU: Nvidia

mild sentinel
#

That’s what really sells it

willow rapids
#

fr

grand shadow
#

throwback to that one time qwinci was working on astral hda and his driver made my soundcard lock up for the next boot

#

wonder if I'll run into the same issue

fleet osprey
#

uhda, the destroyer of sound cards ultrameme

#

oh wait fuck I misread

#

s/uhda/astral hda/

#

I love getting 2h of sleep

viscid flame
grand shadow
#
#define DEV_MAJOR_NULL 1
#define DEV_MAJOR_FULL 2
#define DEV_MAJOR_ZERO 3
#define DEV_MAJOR_TTY 4
#define DEV_MAJOR_FB 5
#define DEV_MAJOR_KEYBOARD 6 // unused, kept as to not reuse numbers
#define DEV_MAJOR_BLOCK 7
#define DEV_MAJOR_E9 8
#define DEV_MAJOR_URANDOM 9
#define DEV_MAJOR_NET 10
#define DEV_MAJOR_MOUSE 11 // unused, kept as to not reuse numbers
#define DEV_MAJOR_PTY 12
#define DEV_MAJOR_ACPI 13
#define DEV_MAJOR_PROF 14
#define DEV_MAJOR_INPUT 15```
#

I already have obsolete stuff lmao

fleet osprey
#

Astral secretly run by Microsoft

grand shadow
#

slowly getting there, I feel like I'll be able to do a cat preformattedfile.wav > /dev/dsp0 soon

#

I have some oss glue already (excluding ioctls) as well as most of the playback mechanisms done

#

just gotta finish the stream ops

#

and likely debug meme

mild sentinel
#

I do wana ask, how bad is HDA actually to implement verses how bad the manual is to read

grand shadow
#

its not that bad, its mostly just annoying to have to create paths through the codecs etc etc

mild sentinel
#

How does that work exactly? Is it like input/output shit and you have to tell it to wire the things up properly?

grand shadow
mild sentinel
#

Makes sense makes sense. Basically make a graph of all the nodes then traverse them to find the proper path

#

Thank you

grand shadow
#

I just do a simple breadth first search

mild sentinel
#

You gotta use Claude search and go @claude what’s the best way to route this bigbrain

grand shadow
#

TRUE

grand shadow
#

good news: the playback mechanism seems to work in theory (writing stuff starts playback, on close() it waits for stopping unless its been signalled etc)
bad news:

grand shadow
#

I DID IT

#

I GOT AUDIO

mild sentinel
#

🗣️ 🔥

#

Let’s goooooo

#

Does it work on real hardware?

grand shadow
#

I am listening to the sound of the kernel file

grand shadow
#

it'll be a while before I test it

#

I want to have this mostly working on a vm (full audio stack) first

mild sentinel
#

Lmk if you want me to test it later

#

I have the good network card and iirc I have an HDA complaint audio card

grand shadow
#

I can cat many files into /dev/dsp0 and it just works every time

#

still a bit rough but I can fix these small issues

grand shadow
#

think thats enough for today, tomorrow I can work more on this

#

probably going to work on some polishing relating to feeding the dma buffers

#

and on sndio

grand shadow
grand shadow
#

ok that was annoying but it compiled

#

time to implement enough ioctls for it

#

maybe I start with trying to get aucat to work

grand shadow
#

file build-x86_64/sysroot/root/piano2.wav
build-x86_64/sysroot/root/piano2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz

#

what is this thing smoking

hearty fulcrum
#

@grand shadow how do you usually profile your kernel

grand shadow
#

I usually just take that info, feed it into the serial port and then generate a flamegraph with a python script

hearty fulcrum
#

I ask because I'm trying to extract linux tar.xz and it's still not finished after a few minutes

#

it extracted 94M skully

analog berry
#

☠️

hearty fulcrum
#

don't worry it was just stuck :P

#

it's not that slow

grand shadow
hearty fulcrum
#

funnily enough I could ctrl+c
extracting with -v showed that it stopped after a few seconds

grand shadow
#

thats pretty interesting

#

sounds like its spawning another process or whatever to handle the decompression and that got stuck while the main process didn't get stuck

#

and so you could ^C it and it'd return just fine because it was just waiting on pipe data

hearty fulcrum
#

on a few runs it completely froze trl

#

I don't have the energy to debug this though

earnest willow
#

sounds like a very fun deadlock

opal lotus
neon crane
#

i feel like it'd be obvious if you're stalling for too long in a cli/sti region or a spinlock and also that you wouldn't be stalling for too long in the aforementioned regions

grand shadow
#

it is nice to be able to profile the interrupts at well

marsh sparrow
#

there is no reason not to use an NMI

#

at least on x86

grand shadow
#

lol wtf

#

yes please give me poll of 0 fds with no timeout

#

I think its a missing SNDCTL_DSP_SETTRIGGER anyways

#

?????????????????????????????????????

#

???????

#

THEY TOOK MY AUDIO DEVICE

earnest willow
#

lmfao

grand shadow
#

aucat worked

#

hell yeah

#

lets see if does conversion properly

#

I WORKS LMAO

#

I just put some random ass meme into a .wav converter with random configurations and it worked

viscid flame
grand shadow
#

I guess now I wonder on getting sndiod to work

grand shadow
#

aucat is using a lot of cpu for some reason, I need to figure out why

#

because that just completely destroys any quality coming out of sndiod

#

it happens both on the rsnd/0 (direct /dev/dsp0 open) and snd/0 (sndiod) case

grand shadow
#

now I get sound on quake through sndiod but its like a second delayed

#

☠️

#

ok I think I need to change how I fill the dma buffer

#

as one last sideproject today I can see if I can get openal to build with sndio support

grand shadow
#

did I find a bug in openal sndio backend or something?

#

like there is NO WAY this works?

#
void SndioPlayback::start()
{
    if(!sio_start(mSndHandle))
        throw al::backend_exception{ALC_INVALID_DEVICE, "Error starting playback"};

    try {
        mKillNow.store(false, std::memory_order_release);
        mThread = std::thread{std::mem_fn(&SndioPlayback::mixerProc), this};
    }
    catch(std::exception& e) {
        sio_stop(mSndHandle);
        throw al::backend_exception{ALC_INVALID_DEVICE, "Failed to start mixing thread: %s",
            e.what()};
    }
}```
#
int SndioPlayback::mixerProc()
{
    fprintf(stderr, "sndio mixerProc: entered\n");

    sio_par par;
    sio_initpar(&par);
    if(!sio_getpar(mSndHandle, &par)) // <---- this fails with "already started" because of the earlier sio_start
    {
        fprintf(stderr, "sndio mixerProc: sio_getpar failed\n");
        mDevice->handleDisconnect("Failed to get device parameters");
        return 1;
    }

    fprintf(stderr, "sndio mixerProc: par pchan=%u bps=%u rate=%u\n",
        par.pchan, par.bps, par.rate);

    const size_t frameStep{par.pchan};
    const size_t frameSize{frameStep * par.bps};

    // SetRTPriority();
    // althrd_setname(MIXER_THREAD_NAME);

    while(!mKillNow.load(std::memory_order_acquire)
        && mDevice->Connected.load(std::memory_order_acquire))
    {
        fprintf(stderr, "sndio mixerProc: loop\n");

        al::byte *WritePtr{mBuffer.data()};
        size_t len{mBuffer.size()};

        fprintf(stderr, "sndio mixerProc: rendering %zu bytes\n", len);

        mDevice->renderSamples(WritePtr, static_cast<ALuint>(len)/frameSize, frameStep);

        fprintf(stderr, "sndio mixerProc: writing %zu bytes\n", len);

        while(len > 0 && !mKillNow.load(std::memory_order_acquire))
        {
            size_t wrote{sio_write(mSndHandle, WritePtr, len)};
            fprintf(stderr, "sndio mixerProc: sio_write returned %zu\n", wrote);

            if(wrote == 0)
            {
                ERR("sio_write failed\n");
                mDevice->handleDisconnect("Failed to write playback samples");
                break;
            }

            len -= wrote;
            WritePtr += wrote;
        }
    }

    fprintf(stderr, "sndio mixerProc: exiting\n");
    return 0;
}
#

??????????????????????????????????????????

#

am I retarded?

#

seems like a bug in that version of openal

#

latest upstream does not have that sio_getpar call

grand shadow
#

As part of the cde larp I should also revive the xscreensaver port

#

Also damn this rewrite of astral is 3 years old already

grand shadow
#

Seems like theres a github mirror someone made

#

Nvm it completelt breaks nscde because I am missing pgrep damn

neon crane
#

thats gotta be intentional

#

(and not just going through 665 other protocol versions)

grand shadow
#

I might as well look into implementing sysctl now that I need pgrep

#

/proc is for losers

hearty fulcrum
#

me when sysctl in proc

hearty fulcrum
grand shadow
#

But it wasnt a speedrun to xorg

#

Since I got networking before xorg

hearty fulcrum
#

I think I could run it now if I wasn't doing linux compat

grand shadow
#

wtf even cat /boot/astral > /dev/dsp0 seems to take 1-1.5s to make sound

hearty fulcrum
#

I added sleep(1250) to your code

grand shadow
#

lowk I think the issue is wslg here

#

💀

#

that delay changes with every boot and often it goes pretty low

#

how it feels to do osdev on wsl

#

kanker

mild sentinel
#

Are you trying it on native Linux?

#

Or do you want me to download an image and test it

grand shadow
#

I don't have a linux install

#

💀

#

I'll probably just work on getting openal to work for now

analog berry
#

does that not have an emulated audio device

grand shadow
#

it does but it seems to randomly add some crazy delays every qemu reboot

#

like some boots its 1.5 seconds of delay some its 200 ms some its almost no delay

mild sentinel
grand shadow
#

I guess I can rq

mild sentinel
#

if its the issue you can install linux PSP1G_pspTrollar

grand shadow
#

also make sure ur volume is slow if you value ur ears

#

💀

mild sentinel
#

its instant

mild sentinel
#

gonna try a few boots

#

But uhhh

#

It seems like a WSL issue

#

😭

#

same timing

#

near instant from enter to ears beeding

grand shadow
#

ist it over fur mich

mild sentinel
#

It’s over for windows WSL

wraith surge
#

lol

mild sentinel
#

3 times

#

Perfect audio

#

@grand shadow time to install nixOS

somber wraith
#

Lesgo install nixos

analog berry
grand shadow
wraith surge
#

XD

analog berry
#

Lol

#

I thought audio was supposed to have some metadata

willow rapids
#

not really if you assume what format it is

sharp carbon
#

if not it's a driver issue triggered by wsl

#

or there's a wsl quirk that fixes it

grand shadow
sharp carbon
#

no like that's linux host astral guest

#

I'm saying test linux on linux on windows

#

that way if it's a wsl issue that linux has no workaround for it'll still occur

#

and if it isn't a wsl issue or has a workaround you'll know

grand shadow
#

I can test it at some point

#

though it seems to have gone away on its own?

grand shadow
#

wondering why minecraft audio does not work
apparently alpha minecraft downloads audio files autoamtically
the old cnd mojang used does not exist anymore

#

mfw

#

a simple openal test program confirmed openal itself is working

#

I'm just gonna take the resources/ from my main install but thats annoying

#

I guess a launcher is a must

mild sentinel
#

It’s atleast able to run on the major 3

grand shadow
#

I think qwinci got that on managarm?

mild sentinel
#

Yo based

#

Yeah port that one it’s a great launcher

grand shadow
#

nevermind the stupid delay

#

and usb-tablet sucking for games

prime mulch
#

any idea what causes the latency

#

or lag spikes

grand shadow
#

I think its a wsl issue but I need to double check against linux

mild sentinel
#

Or full send real hardware PSP1G_pspTrollar

#

I’m trying that rn

grand shadow
#

I'd be surprised if real hardware worked ngl

#

the driver is running on hopes and dreams

mild sentinel
#

It got suck on a cursor with no printing

grand shadow
#

oh yeah I have console logs disabled

#

it probably died somewhere in hda init probably

mild sentinel
#

Does this build have XHCI?

#

If so I can test two other laptops

#

If not I have one other

grand shadow
#

I can re-enable the console logs one sec

#

I often disable them because I work on astral over ssh to my laptop most of the time

#

so that way I can see the logs easily

mild sentinel
#

This machine seems to get stuck before ever getting to astral?

#

The USB light turns off

#

And the thing says loading module

#

Yeah both AMD and Intel laptops seem to be dying

#

The more modern AMD did the same as the Intel one

grand shadow
grand shadow
mild sentinel
#

The old AMD one just died

#

Erm

#

What the sigma

grand shadow
#

ooops

#

I think thats a race condition with smp scheduling

#

uhhh

#

edit the entry to have nosmp :p

mild sentinel
#

XHCI is a bit fucked

#

And I can’t type the username right

#

Because enter is glitching

#

💀

grand shadow
#

interesting

mild sentinel
#

External keyboard seems fine tho

#

Or not ig

#

Other laptop is also cucked

#

Il try my desktop tomorrow or later tonight

#

Depending on when I sleep

grand shadow
#

well thats interesting

grand shadow
#

another thing that makes me think this is just wsl latency is like

#

if I ^C cat into /dev/dsp0, it takes a second for it to stop playing after the process exists... but the process does not exit until all audio data has been played (I haven't implemented the insta-stop path yet)

#

and like I have a 40ms dma buffer this shit is much bigger than the dma b uffer

grand shadow
grand shadow
#

that delay seems to happen on a linux vm under wsl too

mild sentinel
grand shadow
#

I'm downloading quake on the debian livecd just to quadruple check

#

this is just some qemu in wslg bullshit

#

fuuuck me

fleet osprey
#

average Windows experience

grand shadow
#

Anyhow, I have pushed the audio work so far

#

Still a long way to go but it worksish now

neon crane
#

Or, like, vbox/vmware

#

Or with whpx if you can

#

Or with real linux

willow rapids
#

whpx worked pretty good for me back when i used windows

grand shadow
#

I can try whpx

grand shadow
#

I also added a startnscde command. Im probably gonna use nscde for testing now and Once I feel like nscde is good enough Ill make that the default

#

I also maaaybe should yknow make startx not explode the kernel too

#

Because idfk what that one is about

#

startx literally triple faults the kernel
Its the only user app that manages that somehow

willow rapids
#

average

grand shadow
#

qemu-system-x86_64.exe -M q35,i8042=off -m 8g -smp cpus=1 -netdev user,id=net0 -device virtio-net,netdev=net0 -device qemu-xhci,id=input-xhci -device usb-hub,bus=input-xhci.0,port=1 -device usb-kbd,bus=input-xhci.0,port=1.1 -device usb-hub,bus=input-xhci.0,port=2 -device usb-tablet,bus=input-xhci.0,port=2.1 -audiodev dsound,id=snd0 -device intel-hda,debug=0 -device hda-duplex,audiodev=snd0 -object filter-dump,id=f1,netdev=net0,file=netdump.dat -drive file=/home/mathewnd/blehh/astral/build-x86_64/hdd.img,if=none,id=disk -device nvme,drive=disk,serial=0xdeadbeef -boot dc -machine accel=whpx
**
ERROR:../../../block.c:1709:bdrv_open_driver: assertion failed: (is_power_of_2(bs->bl.request_alignment))
Bail out! ERROR:../../../block.c:1709:bdrv_open_driver: assertion failed: (is_power_of_2(bs->bl.request_alignment))