#Astral
1 messages · Page 34 of 1
oh yeah, don't bother with that
with EHCI you can support eSATA, and with OHCI you can support FireWire 
I actually have machines (plural) with that
same
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
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
did you find the smoking gun
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
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
Im pretry surprised I actually managed to pull this off while running on 3 hours of sleep and sick
💀
@opal lotus since u want to look at it soon the xhci and usb stuff is merged into master now
usb tablet also works now
disabling console logs once Xorg is running when 
@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
Make sure to add a script that dd's random data over any SATA disk if one is detected
And then forget you ever did that
For maximum data insecurity going into the future
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
make sure to also grab linux along with you so you can dump the descriptors and parse them at home ;)
based based based
you just need to implement USB CDC NCM
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
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
Damn
Smart
Though I have to do hubs cuz the fucking device is behind a hub
💀
Oh thats tiny
Worth looking into probably
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™
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
:^)
Ok yeah its piss easy
Its just sending packets over a bulk endpoint
its basically the same for rndis too, you just yeet ethernet packets + a header to an endpoint
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
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
😭
i think the most difficult it ever is for me not to be annoying is when someone brings up their loc counts
what were u gonna say
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

Yeah thats true
Hopefully I can reach quake some day 
same
Is it that hard to port ?
who knows
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
local osdev discovers device quirks for the first time:

As it turns out, I needed to do ehci port routing bullshit
Since that motherboard has both a ehci and xhci controller
now go all the way and do full EHCI support 
I'll help test on both of my machines that only have EHCI
Currently installing astral to the arcade
The joysticks and stuff seem to work too
it's nasty, I love it
when deltarune astral arcade
that's very cool
I do think Ill need to recompile sdl2 to support joysticks
Worst case I hack together doomgeneric to use joysticks
(astral will run on the arcade in an event saturday)
Holy
I have gotten news that it shut down properly so it should have synced to disk
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
lol what
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
(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
make download is now a thing lol
how that work
its been there for a while iirc
you just pass an xbps repostiroy and jinx will download packages
zamn
no more having to build five trillion gccs to fix one kernel bug and pr it in
now its just one gcc
xd
though mednafen still doesn't really seem to do anything with it
I think its a matter of just configuring mednafen now
since it works on the sdl2 side
usb keyboard, presumably
Yeah theres a hub on the front
I think I might stwrt working towards audio soon
Is this aura
Crazy stuff
uhda
I think I figured out what you need to set to enable ifunc in gcc, testing as we speak
thx
Epic
I wanna do that next tbf
But I am likely going to not do any astral work this next week
Or minimal work only
Cuz I got exams
Famous last words
And also, after that stupid crash that made the arcade machine disk corrupt, I really really want to do journaling :D
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
U mean journaling?
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
Yeah
funny how I have basically aced this list at this point https://wiki.osdev.org/Creating_an_Operating_System
the only two things I am missing is audio and fully self hosting
which soon™
"Procesessor"
I miss user interface, networking, sound, USB and self hosting
I'm missing block storage, a real filesystem, gui, networking, sound, usb, self-hosting
missing networking, sound, usb and self hosting 😭
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
implement dxgi instead then
or macos's uapi
Well you'd need a gpu driver as well then, not just the DRM APIs
Otherwise all u get is slightly better dev fb
virtio gpu and nvidia open is all I need 
(I have no idea how any of that works)
For virtio gpu u just need to wire Userspace ioctls correctly and do basic virtio stuff
For Nvidia u need a lot of sysdeps
But shouldn't be a problem for astral kernel since its relatively complete
you should also support drivers for apple gpus
they are awesome
(it involves rust in kernelmode)
you're saying it like there's a portable driver
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
That's underselling the complexity by quite a bit
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
Hm?
It's not "just" wiring up a few ioctls correctly
Its a tiny driver even on linux
Its hard for you because managarm microkernel memes
No?
But for a mono it should be trivial
Just pipe user buffer as part of a command
Not even validation needed there
I'm sorry but you're just talking out of your ass here
Lol ok
Did you ever look at the userspace side?
uhh
Why would I care about the Userspace side at all
You do need to understand the mesa shader pipeline to some extent to debug it
Its handled by mesa
Because it sends mesa IR over the ring
just write bug free code lmao its not thta hard
exactly lol
Yes, why is that a problem
And if you need to debug just change random shit until it works
If it's that easy, just do it
Why would I need to debug mesa
no just rewrite it from scratch but with no bugs
if you cant write perfectly bug free code you really arent a good kernel developer ngl
@claude rewrite this project in nim please
If it's trivial, then every second hobby OS should have it
just implement drm/adp instead
Well compared to any serious gpu driver lol
adp is like 900loc (because its only display out for the touchbar)
Plus all the ABI that you need to get correct on the userspace side
Are u just seething that you couldn't get it to work on managarm
Admit it 
Leo had an in progress driver but it was pain to debug
We already figured out it was probably because of an mlibc bug
The actual driver side was tiny
It got to the point where everything worked on the ioctl / vq side but display didn't work
Yep
Presumably because of some mismatch in host/guest abi
anyway you should write your own full gpu driver anyway because thats cooler
It would've probably just worked if it was glibc
I dont have a kernel
maybe or maybe not
Ah, but that's not a problem, you just gotta wire up a few syscalls and do some generic MM and tasking
Ok you're 100% seething lol
I just think it's stupid to claim that something is trivial when it isn't
Since you're just saying non objective bs now and you know it
I literally just paraphrased your own msg in case you didn't notice
Because I hurt your ego by saying that virtio gpu is easy
But you started coming up with stories of how its insanely hard
^
How can you hurt my ego?
Did I have to say given you have the kernel infrastructure and mesa?
I never worked on virtio-gpu
I guess indirectly
Hm?
Only you know the answer, but you clearly got hurt
I think the fact that nobody has done it is some indicator
How many hobby kernels with DRM do you know
Probably dozens?
I don't think there are that many
Anyway lets see what it takes me once I get there, or Mathew
its probably not trivial but it's probably considerably easier than any other gpu
Does it even work on BSDs?
E.g. on Intel GPUs admin commands are in the same stream as normal 3d commands so there's a ton of validation to do etc, also barriers and stuff that are super fragile
Nvidia might be easier
Here userspace commands are just wrapped into a special command
porting an existing driver does not count 
Nah I think if you can implement a ton of sysdeps it needs its a big achievement
Some are pretty complex
It does NOT
But sure, it's trivial to wire up, so just do it
What are BSDs? Linux is the only OS there is
Are you implying they didn't do it because its impossibly hard?
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
And it's requires more effort than just wiring up a few ioctls
What else does it require, maybe highlight some of the difficult parts
It requires debugging on the userspace side which requires digging into Mesa
That's the main difficulty
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
Go for it 
Mesa does not send gpu commands over the VQ
It sends mesa ir that is interpreted by host mesa
maybe if my kernel werent a hello world i would
Thats for shaders
Your guest mesa needs to send IR that is compatible with what host mesa expects
And its the same general principle no? A buffer u send
If there is a mismatch somewhere you need to debug it
And you can't debug it by looking at the kernel side only
Well for Linux compat id just copy stuff from my host 
We were talking about shaders, no?
Doesn't change much I think
Do u agree that if you know your mesa is the same and has no libc related bugs its not that much work?
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
Anyway what I said was with the assumption that the mesa part is figured out and is known to work perfectly
I think that assumption doesn't hold
If you recompile it with a custom libc that you dont know the state of then it might be super hard
yeah and really everything is just moving protobufs around
Wdym
yeah and sometimes transcoding one to the other
(you can do everything this way, thats the joke)
Well ok 
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
I mentioned some stuff here
and some sync which is also true for drm
but this isnt even universal
On Intel gpu there's also a very limited aperture so you need to have very careful relocation etc for host buffers
i think on amd admin commands arent on the same stream? not sure
Not sure
Also context switching for gpu page tables if they're supported, handling hangs, erros, reg switching etc
You need to know the proprietary layout for some cases
handling hangs, lol
if (hang) just reset the device and tell the user shit went wrong
^^ amdgpu code
even the assumption "you just need drm" is kinda weird because DRM on linux is larger than many other kernels 
Lol kinda
Yeah but a shitos impl can be minimal fake atomic helpers with hardcoded res etc
drm/asahi is only ~4x bigger
For proper 3d ud need at least fences etc ig
And proper buffer allocation
Yes
and syncobjs
even on virtio-gpu
and like all of the common logic around that
yeah
Yes
which is also very much not easy
But that's outside the scope of virtio gpu driver, I think thats kinda fair
Well, if you restrict the scope to just the execbuf ioctl, that's ofc easy but that doesn't match reality 
yeah lol
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
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
Intel has a shit ton more I think
its from strace
Which program is that
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
and theres some that arent recognized by strace too
probably _IOC(_IOC_READ|_IOC_WRITE, 0x64, 0x48, 0x40)
the etnaviv and vc4 ones etc are strace decoding mistakes
Obviously, amd gpu has no overlap with vc4
yes see the second list
There was some environment variable for mesa u could set to get a command trace
At least for crocus dri
i think its DRM_RADEON_GEM_WAIT_IDLE
wait or maybe DRM_RADEON_CLEAR
wait no not clear
idk
anyway its one of them
just enable this trace https://elixir.bootlin.com/linux/v7.0.8/source/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c#L1015 
lol
would be easier to patch mesa lol
echo 1 > /sys/kernel/tracing/events/amdgpu/amdgpu_cs/enable like that I think?
but yeah mesa probably has tons of options
they like env variable stuff
not really
damn
at least for when i did igpu stuff it wasnt that hard to dump shit
but idr if i had to recompile it
https://paste.sr.ht/~pitust/1fcd9d856c3a3324072066c466956dee6694cba9 its basically just this
huh lol
so i might just be stracing wrong lol
maybe it forks itself or something
i did use -ff
strange
I wonder how it bypasses strace
no idea
@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
The last point is the most important 
interesting
undertale on astral

tbf its also probably possible to just
wine
but would it be playable?
wdym?
like, the performance. would the performance be playable
i mean the YoYoian runner uses DirectX 9, which presumably requires emulation via OpenGL, and thus Mesa/llvmpipe, and stuff like that
Deltarune seemed playable and that was before I did some optimizations
i see
speaking of, I think that switching over to use the backend that deals with Vulkan would make this a non-issue, as there is some standardized Khronos format for serializing vulkan stuff which gets used there
i don't see why it wouldn't be, i saw it on Astral as well, on video, and it seemed perfectly playable
Yeah i think for vulkan it sends spirv
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
And tgsi tokens are binary
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
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
astral will be the most aesthetic OS here of all time
as for audio, I think the stack will be sndio backed by oss
bsd 🗣️
Together with uHDA?
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
I can do a driver for the GameCube/Wii DSP 
(I have no idea how any x86 audio shit works)
idk I never got past doing basic memory management on x86
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 
That’s basically what PCI is except it takes a bit more work to find it iirc
i mean pci is just for discovery
ah cool
after you discover where the BAR is located, its basically just MMIO as anywhere else
I guess that's useful if I ever do try x86 osdev again
PCI itself is also IO, not memory mapped but IO :^)
or, if you do ECAM then it’s MMIO aswell
(and you should do ecam on pcie)
solution: force zink mode
@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
isnt it should check is there even function like this in configure
I did some bullshit
I think you have to manually add the check in configure and I guess they either didn't or configure only checks for the symbol and not the define
sadly ksh could not be built
patch it
Unironically talk is cheap send patches
This is a perl level bullshit build system
i mean patch src to not use it
it's got one of those legacy build systems that was never equipped for cross compilation as far as i know
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.
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
I wonder how viable it would be to do something a la perl-cross
I should think it would be quite straightforward but tedious to do
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
I can see if codex can take that task later
Unfortunately nscde has a hard dep on ksh93 so I do need to deal with this sooner or later
Do u pay for codex
Yeah
text rendering challenge (literally impossible wtf)
Btw whats missing for KDE on astral
Idk, probably like 50 ports
Kernelwise? Probably /proc
Which I dont want to do
So KDE never? 
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
Lol
Like architecturally dont want to do or atm
Playing minecraft on nscde with audio and chatting on irc 🤤
Kinda both, I think proc is a bit bad
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
Unironically daily driveable if stable 
Yeah that would be nice
what is wrong with the DateTime and Main windows
cause i've never had them work properly i have the same behavior
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
tomorrow is calc exam, then weekend with bf and then we ball on audio (if the other person isn't working on it already)
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
more bullshit
@winged basin I assume this will be of interest to you
Based how'd you get this going?
got a clanker to do an autotools wrapper around the bin/package script, and then got the clanker to fix many of the cross compiling issues in there
there are still quite a lot of rough edges though
its very messy altogether
I had a feeling it would manage alright at it
Not too bad
I might steal it
It's not as big of a diff as I worried there might be
https://github.com/ksh2020/ksh this incidentally was the ksh93 fork that went to meson (I said one went to autotools but I was wrong)
With ksh out of the way, I have a feeling nscde is pretty close
With just a few more ports left
I think I've got most of the basic dependencies for nscde
to use the theme
first signs of life out of nscde
has to compile qemu again award
I did not build pulseaudio support into it and wslg exposes a pulseaudio server, oops
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
and it was broken for some parts 
able to run kde but not fvwm
Yeah but the sidebar is broken
Ah
time to port glibc
if i ported glibc to Astral would you upstream it? :3
please do
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
im sure mathew will accept it if u make it optional
making it optional is a lot of work though
and you'd need conditional patches
which jinx doesn't support yet
damn
or i guess you'd need to make your patches portable, which is probably a better fix lol
wdym by that?
nothing, something stupid that you'd ideally not need
basically patches that you only apply based on some setting
teach us how to port glibc
hope and dreams
I still want to use mlibc though
-# i'll take a free glibc port (i don't even have userspace setup yet :P)
You will scrap your kernel the moment you get anything done for the 17th time tho 
asrijgijkhwshjkebkjshed
shush
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
holy
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
ooo I won't mind borrowing some patches 
its literally a 2 line fix in mlibc
theres already a pr open for it
ah
(don't mind the CI fails, linux servers seem to be bad for some reason)
Average guthib moment:
Of course it's a printf/scanf related issue lmao
I remember mlibc had some issues with those a while back too
yay
I think today I will do some more nscde work before doing hda stuff
It really wants renameat2 lol
billions must larp as linux
I need to figure out why the icons do not load
tf is nscde
Will this be the official DE for astral?
I hope so
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
Based
should of taken the free glibc port when you had the chance :p
i agree
I'll just debug it later
gonna work more on hda now probably
that bug is only really needed for minecraft
what are the most commonly found quirks in hda?
the manual (its bad) 
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
no idea, probably gotta look at linux code for that
(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
well that's still something
I don't really know about most common but the ones that I can remember on top of my head are the preference to use port irq over msi on nvidia gpus and the position reporting being broken either in the dma pos buffer or the stream's pos register
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)
well there was a recent regression with the so promotion code in mlibc after all
anyways talk was cheap and patches were sent
I already have a widget graph built, time to do a bfs now
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
this probaly gonna look even cooler with higher resolution
get iconified idiot
I love this so much
when you will port gtk
Talk is cheap
pend satches
Cheap is talk
:dingus:
Calk is theap
patches is talk
Patches are cheap
send talk
tend salk
They also say it gets 170 FPS in Fortnite
That’s what really sells it
fr
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
uhda, the destroyer of sound cards 
oh wait fuck I misread
s/uhda/astral hda/
I love getting 2h of sleep
qwinci just wanted to brick your soundcard
#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
Astral secretly run by Microsoft
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 
I do wana ask, how bad is HDA actually to implement verses how bad the manual is to read
its not that bad, its mostly just annoying to have to create paths through the codecs etc etc
How does that work exactly? Is it like input/output shit and you have to tell it to wire the things up properly?
yeah, you find a path from a pin to a dac/adc and set up the inputs alongside the path to route the signal
Makes sense makes sense. Basically make a graph of all the nodes then traverse them to find the proper path
Thank you
yeah
I just do a simple breadth first search
You gotta use Claude search and go @claude what’s the best way to route this 
TRUE
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:
I am listening to the sound of the kernel file
no idea
it'll be a while before I test it
I want to have this mostly working on a vm (full audio stack) first

Lmk if you want me to test it later
I have the good network card and iirc I have an HDA complaint audio card
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
probably when this is less buggy
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
cross compilation incapable build system award
ok that was annoying but it compiled
time to implement enough ioctls for it
maybe I start with trying to get aucat to work
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
@grand shadow how do you usually profile your kernel
configure hardware profiler to send NMI every X tsc ticks, have that shove a backtrace into a per core ringubffer, then every core has a thread that reads it every now and then and puts it into a global ringbuffer which backs /dev/prof. that can then be read, alongside some other useful info
I usually just take that info, feed it into the serial port and then generate a flamegraph with a python script
I ask because I'm trying to extract linux tar.xz and it's still not finished after a few minutes
it extracted 94M 
☠️
well that just sounds like some i/o slowness :p
^
funnily enough I could ctrl+c
extracting with -v showed that it stopped after a few seconds
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
sounds like a very fun deadlock
linux larp
is it necessary to send an NMI? could you not rely on the timer interrupt and just have the timer interrupt have the highest priority of the system?
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
it is nice to be able to profile the interrupts at well
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
lmfao
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
do you use uhda
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
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
the latency is pretty bad
as one last sideproject today I can see if I can get openal to build with sndio support
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
As part of the cde larp I should also revive the xscreensaver port
Also damn this rewrite of astral is 3 years old already
And this time actually mirror it myself because the dev likes to delete old source tarballs
Seems like theres a github mirror someone made
Nvm it completelt breaks nscde because I am missing pgrep damn
using protocol 666
thats gotta be intentional
(and not just going through 665 other protocol versions)
I might as well look into implementing sysctl now that I need pgrep
/proc is for losers
me when sysctl in proc
how quickly did you get xorg running?
I forgot
But it wasnt a speedrun to xorg
Since I got networking before xorg
I think I could run it now if I wasn't doing linux compat
wtf even cat /boot/astral > /dev/dsp0 seems to take 1-1.5s to make sound
I added sleep(1250) to your code
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
Are you trying it on native Linux?
Or do you want me to download an image and test it
I don't have a linux install
💀
I'll probably just work on getting openal to work for now
wsl?
does that not have an emulated audio device
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
i mean send me an image and i can verify if thats the issue or not
I guess I can rq
if its the issue you can install linux 
cat /boot/astral > /dev/dsp0
(or some other big audio file)
this is what I use, switch it to whatever your system uses:
-audiodev pa,id=snd0,server=unix:/mnt/wslg/PulseServer
-device intel-hda,debug=0
-device hda-duplex,audiodev=snd0 \
also make sure ur volume is slow if you value ur ears
💀
its instant
gonna try a few boots
But uhhh
It seems like a WSL issue
😭
same timing
near instant from enter to ears beeding
ist it over fur mich
It’s over for windows WSL
lol
Lesgo install nixos
Is this playing your kernel binary as audio
yeah
XD
not really if you assume what format it is
does this happen with a linux guest as well?
if not it's a driver issue triggered by wsl
or there's a wsl quirk that fixes it
According to evalyn it didnt happen on her end which is linux
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
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
I wonder if prism launcher is a viable port
It’s atleast able to run on the major 3
I think its a wsl issue but I need to double check against linux
I'd be surprised if real hardware worked ngl
the driver is running on hopes and dreams
oh yeah I have console logs disabled
it probably died somewhere in hda init probably
Does this build have XHCI?
If so I can test two other laptops
If not I have one other
yeah
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
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
here you go
included is sndio and piano2.wav, u can
cat piano2.wav > /dev/dsp0 or aucat -i piano2.wav -f rsnd/0
erm awkard!!!!!!!
ooops
I think thats a race condition with smp scheduling
uhhh
edit the entry to have nosmp :p
XHCI is a bit fucked
And I can’t type the username right
Because enter is glitching
💀
interesting
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
well thats interesting
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
send ^D instead? that's EOF
wdym
that delay seems to happen on a linux vm under wsl too
I think it’s WSLg atp
I'm downloading quake on the debian livecd just to quadruple check
wtf torvalds fix ur os
this is just some qemu in wslg bullshit
fuuuck me
Anyhow, I have pushed the audio work so far
Still a long way to go but it worksish now
Why dont you run it in native qemu
Or, like, vbox/vmware
Or with whpx if you can
Or with real linux
whpx worked pretty good for me back when i used windows
I can try whpx
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
average
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))

