#Astral
1 messages Β· Page 8 of 1
yaaay i can use irq->priv now :D
thanks, lemme know if something breaks
I should change the other drivers to use that π
ngl biggest achievemnt of that pr
unironically i was surprised it was missing
i wanted to ask if i can somehow store a context variable per irq
but then i looked at nvme driver
and i saw it uses a fucking hashtable
lol
lost my mind for a second but i just adopted it
@grand shadow btw is it expected that reset fucks up the console?
how fucked are we talking
lemme see if reset fucks up xterm
[submodule "kernel-src/io/acpi/uacpi"]
path = kernel-src/io/acpi/uacpi
url = https://github.com/UltraOS/uACPI
bruh
yes
y no keep things consistent
I plan on moving kernel stuff to submodules soon
^
thank god
from the jinx regenerate thing
because then I can git clone and compile the kernel
reset works on xterm
maybe flanterm meme?
reset should work on flanterm
yeah ur right
thats weird
iirc reset works just fine on flanterm so..
maybe astral console/tty driver does something weird
btw why does exiting vim not restore the initial console state?
i dont think flanterm implements alternate buffer stuff
oh
i see
there is some weird escape sequence that lets you switch to a different buffer
so when you start vim/nano/less
which is weird that it works on xterm, /dev/console and /dev/pts/* go through the same driver
it doesnt mess everything up
flanterm bug?
its the one with "Abandon all hope, ye who enter here" on the readme

Btw why not port whatever managarm is running?
just like my fat driver
I Am Not Porting Wayland
yeah I like it
why not?
needs way too many linuxy apis than I'd like to implement
unfortunate
drm and evdev and some others
then yeah ugpu will definitely come in handy
reset works on my flanterm terminal emulator
huh weird
astral bug 
are u on latest master
hmm
which is the commit from 3 months ago or smth
inb4 it needs callbacks or something
did the callback stuff even make it out of the limine tty stuff
callbacks for what?
@craggy tide why not?
probably didnt think it was needed
also idk waht the proper name for that is
so sorry if im wrong
just ^L
its also broken here, so its not an astral meme :^)
that works yeah but i lose whatever i had in the history which i often use
or like not in history
just above on my screen
the buffer yeah
i get that
kinda annoying
it would be cool if flanterm implemented that tho
might look into it myself
ye
i have no idea how any of that works as well
just understanding the idea of tty/pty/etc was hard enough
you can apparently use \e[?1049h and \e[?1049l to switch to and from the "alternate screen"
for me the hard part about a proper tty subsystem wasn't the tty part but rather the process group and session stuff
that was so annoying to get right and I don't even know if my refcounting works 100%
oh yeah
https://ratatui.rs/concepts/backends/alternate-screen/ found some docs from a random rust thing
also apparently its xterm specific :^)
but everything supports it right
I am pretty sure yeah
the crate you sent uses just that```rs
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct EnterAlternateScreen;
impl Command for EnterAlternateScreen {
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result {
f.write_str(csi!("?1049h"))
}
#[cfg(windows)]
fn execute_winapi(&self) -> io::Result<()> {
let alternate_screen = ScreenBuffer::create()?;
alternate_screen.show()?;
Ok(())
}
}```
so i think its safe to assume most things implement that
probably this stuff
yeah but the escape sequence
linux console doesn't either
but linux console sucks
okay
anyway whats the actual reason
literally that
why limit yourself 
it's meant to run with TERM=linux with ncurses
idk what that means but thats alright
u mean the terminal hanging or the lack of alternate screen?
it tells ncurses to act as if it were running on the linux console
alternate screen
ah
if you ever ran nano on the linux console you'd see it behaves identically
i got that much
i just tested it
can confirm
but still, i think it would be nice if flanterm was a more proper terminal emulator
ye
i will accept a pr that implements it
as long as it doesn't break other stuff, directly or indirectly
might look into it then, soon
i mean it probably shouldnt?
u would just store a new char array somewhere
or like the entire state ig
i meant break other things when running TERM=linux ncurses
as maybe stuff relies on that escape code doing something else or not doing anything
its just two new sequences
the new windows terminal probably does support it
the old one i doubt it
yea conhost is absolute dogshit
yup
damn
maybe nano just calls that win32 api?
probably
u could test it by killing it from task manager
then it does probably...
because the win32 api is manual
u cant arm it to switch back on exit
or maybe u can? idk
no idea, but i killed it from task manager and it did switch back
thats what i meant, not sure if that was clear enough
maybe conhost is smart enough
maybe it has some tricks up its sleeve
definitely, its windows after all lmao
@analog berry @robust geyser
le cool
that'll be a task for init
init will do the echo r > /dev/acpi
but it will receive an event from acpi too
so like poll -> read -> check event -> kill(-1, SIGTERM) -> sleep(5) -> kill(-1, SIGKILL) -> waitpid() until ECHILD -> write(acpifd, "p", 1)
actually instead of a sleep(5) it'd be better to do a waitpid with an alarm
probably not even init tbh, I might just leave init only handling commands from a FIFO and have some other process in the background handling listening to acpi
but the shutdown command to init will be like that
aaaand there we go
that p was returned by the device
that should be all
for now
really simple poweroff
and you can see what init does
(thats why I downloaded gnu hello)
still missing the kill(-1, SIGTERM) etc but thats because I literally dont have that
yet
I'm gonna add a reboot command, the acpi listener and then call it a day
TODOβ’οΈ
there we go
I'll just look for some weird tty issue that happens on login when you backspace and call it a day
well, that is all for today
tomorrow I will finally do the auth checks for signals I swear
Nice work
@grand shadow u sure this pageoff thing is needed in map and unmap? Since we round the address down and round the length up anyway
yeah i dont think its worth to take up an entire shitos5 for marca if hes going to abandon it after a week π
hmm am i supposed to rebuild somehow to get this to work?
i dont have a poweroff command
O_O
Eyy that's not what happens ok :>
I at least work for about a month
And then life gets to me and I have to do other things
And then life gets to me and I have to do other things
...
./jinx rebuild init
I think
Imagine like, you want to map 10 bytes starting at the last 5 bytes of the page
Wait now that I have a fresh mind I think I did it wrong too π nvm
But yeah you have to account for it
i think my logic still works?
But yeah youd be mapping only one page and get a page fault (best case) or access wrong memory (worst case)
i cant think of a case where it doesnt
10 bytes would be rounded up to 4096
last 5 byttes would be rounded down to byte 0
i dont see a problem tbh
oh ok i see it i think
e.g.
map 4096 at 2048
Yeah
so u have to like
uhhh
idk
add wahtever u rounded down
then round up that
size += addr - ROUND_DOWN(addr)
size = ROUND_UP(size)
or no wait lmao
there
fixed it
Did jinx rebuild init work
yup
Epic
Lmao thats fine I think it was in my old acpi table mapping code too
lol
@grand shadow btw why is your memcpy src non const
that produces lots of warnings
also found a header bug in uacpi, its not a big deal but also produces a warning
I forgor
I think I also should get around to implementing the unmounting of filesystems sometime in the future, would be a step in the direction of cleanly powering off
have u tested real hw yet?
Not yet, will do when Im home
nice
no
I thought it was some setitimer meme but it wasnt that
(whoops slipped into native dutch)
I'm pretty sure it used to work once upon a time
but last I checked, the clock does not tick
hell, xclock straight says 00:00 iirc
Wtf
I remember having.an issue like that and it turning out to be some weird rounding issue
I honestly haven't looked into it at all, but I'm 99.99% sure that it used to work
- unsigned long update = (int) (_update * 1000.0 + 0.5);
+ unsigned long update = roundf(_update * 1000.0 + 0.5);
Thats what I have in my patches
let's see if we can test that in class
booting vm
ah I get a divide by zero in xclock
time to gdb that bitch
0x0000000000405041 in round_time (tv=0x7ffffffff320, tm=0x7ffffffff330, _update=0) at /var/lib/managarm-buildenv/src/ports/xclock/Clock.c:1306
1306 unsigned long new_millis = intervals * update;
(gdb)
interesting
/*
* Round the current time to the nearest update interval using
* milliseconds since midnight
*/
static void
round_time(float _update, struct tm *tm, struct timeval *tv)
{
/* interval in milliseconds */
unsigned long update = (int) (_update * 1000.0 + 0.5);
/* compute milliseconds since midnight */
unsigned long old_secs = time_seconds(tm);
unsigned long old_millis = time_millis(tm, tv);
/* Nearest number of intervals since midnight */
unsigned long intervals = time_intervals(old_millis, update);
/* The number of milliseconds for that number of intervals */
unsigned long new_millis = intervals * update;
Very interesting division happening there
yes
but t = tv->tv_sec - old_secs + new_millis / 1000; and update is null
so new_millis is something times 0
and therefore 0
and something plus 0 / 1000 is UB 
?
let's try your patch
zero divided by anything (!=0) is just 0
i guess _update = 0.0?
yes
gdb says it's 0
just 0 cuz int
oh no _update is float
hmm
still 0 tho
testing again
@grand shadow update on xclock, your patch unfucks the divide thing, but no ticking
yeah
I'm pretty sure that used to work
but idk
almost like the time update function isn't called
no weird shit in e9 log either
Guess its out of battery or something

if you figure it out please let me know
I might take a stab at it later this week if all other items are blocked (something something multi user / cooked mode / systemd)
I guess one would have to dig into the xclock source to figure it out
Hm I do have nothing to do at work atm
yeah that's gonna be source digging
Seems like it adds the timeout in the clock_tic function
if (w->clock.update && (id || !w->clock.interval_id))
XtAppAddTimeOut(XtWidgetToApplicationContext((Widget) w), waittime(w->clock.update, &tv, &tm), clock_tic, (XtPointer) w);
In SetValues too it seems
Redisplay is exposed as the expose function which I assume is what Xorg wants when redisplaying it and it calls the clock_tic function
So Id have to check the timeout stuff there
probably
I wonder if building another version of gcc makes the mlibc meme go away.....
@analog berry my main pc (got it 2021)
It says it has 16 processors but its 6 core, does that mean the cpu originally had more and theyre just defective?
maybe hyper threading?
Nah it doesnt have that
Its a i5-9400f
Gonna get a full distro and try it on my laptop cuz ik there the ps2 kbd and mouse work
maybe the madt table is schizophrenic
this is how cpu manufacturing works
they make a 16 core part
and if a lot of cores dont turn out right they sell a 6 core part
or rather
its an 8 core part
with 16 hyperthreads
and two cores went bad
I imagined
or alternatively it's just that the controllers are the same and dont change
even though the cores dont really exist
Thatd explain why the default lapic ids are how they are
it was like 0 2 4 ...
yeah these were just random numbers
point is they looked random
i mean this is just the number of devices in the AML namespace of type Processor
which are deprecated btw
u would match them against MADT to know which one is which and which one is online
there can be 0 or tehre can be 99999
its not indicative of anything in particular
nice that it shuts down
does the power button work?
yeah I pressed the power button
niice
which put some data in /dev/acpi which was read by acpid which passed an event to init which synced the disks and wrote into /dev/acpi to shut down

π
"""synced the disks"""
real chads just throw that in the kernel
(it was an initrd)
you gotta put the running processes in their place first smh
(I dont even do that I don't have kill(-1, *) yet)
testing on my laptop now
it has a key power button idk if that will matter a lot
@analog berry seems like it worked on my laptop too
Gonna first try out some things in xorg
that doesnt really matter, what matters is how they routed it
it could be the "simple way"
aka fixed event u have right now
or the "complex way" via the EC
the numbers are unique but some numbers are missing
well, 12 due to hyperthreading?
Neat glxgears work and is a bit faster too
I mean it doens't matter
damn thats pretty cool
le very cool
cpu doesnt have hyperthreading
so I really just assume it had defective cores
same thing for my laptop, its a 4 core 8 threads cpu iirc
thats weird
now i want to test on my laptops as well
maybe it will boot into gui at least unlike managarm

never seen that before
probably cuz initrd
if it doesnt hang at ps2 init
I hate ps2! I hate ps2!
managarm was failing mostly because drm bugs
why is it that the only two damn fucking computers that it works are the only ones that I can test
sometimes bad xhci, sometimes bad ahci, sometimes ps2 as well
its always a different thing
lol ikr
uacpi has been tested on probably like 50ish computers at this point
Oh quake is fucking SMOOTH in real hw
daamn
nice
wait until u see it running on an igpu
astral is definitely one of the cooler oses on this server (idk about the kernel quality, but the user space is very cool)
you sure it wasnt before the uacpi stuff?
yeah
does astral support swap of some kind
It ran a bit slower but uh its more due to me unshittifying my ringbuffer and memcpy
or no
Only page cache but I assume itd not be too hard since I have most of the facilities in place
it has page cache
And Id say the page cache is battle tested at this point since it compiled like half of gcc
well definitely read the denning working set paper
when (and if) you implement swap
it's pinned in #virtual-memory
I was planning on doing that at one point in the future
Right now if a page is paged in it stays there forever
Until the process unmaps or quits
maybe I could do that sometime soon
but since school for me starts tomorrow I won't have enough time to work on my own kernel
Gonna try some xscreensaver demos now
Im in uni break now even tho I still have a job
I will try to do as much as I can until late september
Note to self: mount tmpfs root as 755 instead of 000 π
Ah shit xscreensaver is stuck I think I ran the wrong command π
Oh well time to test the power button
@analog berry yeah here it didnt work
yeye for laptops its usually the "hard" way
u mean poweroff
did it power off?
yeah thats p cool
nah its rebooting I had turned it off from holding the key too much
ah
yeah holding the key too long bypasses acpi
it does send the emergency shutdown event tho
I need to read a bit on what acpi than do for when I delve deeper into that
wait uhh
poweroff does work tho
how
how did u follow yourself? idk
it sends the event and everything and then powers off
nice!
yeah if u want the power button to work there thats gonna take a bit of work (not too much)
this basically
hmmm 400 lines of phd code
if u dump the tables from that laptop it probably has a PNP0C0C device
which is the power button
its similar to ioapic
write one reg read the other
or write both
etc
it'll be a TODOβ’οΈ for now
how do you hook it to uacpi though
i sent an example above
from managarm
uacpi_install_address_space_handler(
ecDevice->node, UACPI_ADDRESS_SPACE_EMBEDDED_CONTROLLER,
handleEcRegion, ecDevice.get()
);
and for ec events theres uacpi_install_gpe_handler
DRM bugs?
wrong reply
lol
@analog berry
Yeah fuck
yeah drm bugs
Fat fingers
@formal patio DRM issues?
either ps/2 code dies or the resoultion it tries to modeset is bogus
no idea after that
i think qookie had some ideas
Sounds like something might not be starting properly / application crashing / driver crashing
context?
Boot to weston and keeps black screen
managarm no work
I hate to tell you but glxgears really isn't a good (graphics) benchmark, it spend relatively little time drawing
well his quake is pretty good as well sooo
I think the point matthew was trying to make is that running glxgears is fucking cool and it runs faster
yeah I'm not saying it isn't, just pointing out that glxgears fps are to be taken with some caution
digital rights management
dog ritual manager
yeah
for what oberrow said
plus if quake is smooth then astral is good enough I dont need to develop it further smh
if it can run:
while(1)
fork();
i wanna play gta sa on astral
then it's good
will Astral get a DRM subsystem?
for that we need wine and for me to implement igpu
I plan on supporting this in obos
via uGPU 
this uGPU, what will it need?
probably same complexity
run astral
then get qemu on astral qemu on host qemu
like from the kernel?
yeah
(I dont have rlimit)
then run astral
then get qemu
I probably have everything for a qemu port just not the recipes
1 year per frame
so like me running mc with shaders?
it will work as a drop-in drm subsystem or work with an already existing one. very similar api to uacpi with probably a few extras on top as it needs more kernel integration to work, also stuff like registering an on-disk file/directory etc to make it work
well and something in the userspace to submit commands, e.g. Mesa
might port that to obos in a million years
or I could speedrun it and become the first adopter+tester on real hw
one thing I wanna do is try to passthrough my laptop's ethernet card and see if I can write a driver for it
i am thinking about e.g. with DRM-PRIME then it will need some sort of VMM integration
yeah definitely
ill need to think of how to design that api well
this stuff is very very far off
by ugpu my kernel will hopefully not suck as muchβ’οΈ
ill probably use your kernel as a test bed
so two million years?
i want to get the very basic proof of concept running
e.g. glquake with actual acceleration
glquake would be very neat
mamogram
and if it has mesa
mamogram
wonder what mc needs to run...
web browser for launcher
without launcher
i will need u to port/implement whatever is needed besides DRM for Weston 
or well as long as i can get mesa to work i guess
whatever
:(
I mean I think drm is the worst thing?
I have no idea what all the linux specfic apis weston uses are
maybe when ugpu gets closer to being real I can look into that
i can run mesa in astral right now right?
then ig I could also move xorg to use xf86-input-libinput instead of keyboard/mouse
yeah
it runs with llvmpipe rn
glquake works with it rn?
epoll you can do a shite implementation of relatively easily if you don't care about the case of thread A waits on an epollfd, thread B adds some new epollfd to the set, new fd has an event
yeah but has some graphical bugs
why is that?
I have no idea
with llvmpipe?
and you have to be careful with epoll to not do the sensible thing too much as linux certianly doesn't
lol
yeah
bad fpu state?
tyr-quake (fully software) works but tyr-glquake has some glitches
well if it works on linux with llvmpipe
then..
either mlibc bug or astral fpu init bug
I could see if I can adapt my current poll system to do that
my current polldesc_t only accepts one thread on the sleeping list but it could maybe be bigger?
I'd have to think about that one
i have been thinking about epoll literally right now before coming into this conversation and i haven't decided yet how it should best be done
my fpu init happens in two places, per processor and on context init
i'm looking at what solaris does right now (don't worry, i don't understand it either)
im betting on the former in that or btw
its easy to get some float thing wrong
/dev/poll wtf
tbh there was some weird rounding issue in xclock
one of the prior arts epoll didn't copy
but with a little work it was made to almost emulate epoll
it doesn't emulate the thing where files that you've closed still give epoll notifications with the wrong FD number
wtf
it requires you to do certain things when you fork() to trigger the wild behaviour
I should see what it disassembles to
btw @grand shadow are you planning on doing a hda driver yourself at some point? because if not (and you are open for contributions) I could try making one for astral (and also maybe look into somehow making the nitpicky lib (aka alsa) work with it)
yeees pleasse do that
I mean it was on my radar to do but I never began writing it too much (I was mostly just reading the spec and trying to understand how it works) but if you want to I won't complain
that would be very neat
then we could have the full stack on astral
usb+graphics+sound
plus you probably know better how it works than me 
@grand shadow can u reboot via poweroff somehow?
reboot
yeah
nice
almost the same code except it sends 'r' to the init pipe rather than 'p'
big api
well I have written one driver for my own kernel that I ported to vinix :p I do know in general how it works but the alsa stuff I have no idea about (as it has some weird parameter refining stuff and then if you don't get that right alsalib refuses to work)
yes qwinci do htat pls
that'd be neat
ig I can take a look then, first have to compile astral tho 
I also dont complain about people wanting to write drivers cuz it helps me unshittify the kernel and make the apis a bit better (thanks infy)
lol thanks
u can make a lightweight build
that takes a little less than 10 years to compile
you only have to compile gcc once, thats one time less than twice and you dont need to compile llvm
we should make a script like ./just-build-the-goddamn-thing.sh
that would do all the steps
or that 
I'll first make it so that DISTROTYPE=minimal doesn't build everything and push that
to build a minimal build I just need to do make jinx + update submodules + make kernel + make minimal?
(and then the run the iso rule after that to create the iso)
make jinx
./jinx build mlibc bash coreutils init distro-files vim nano mount netd
make DISTROTYPE=minimal kernel initrd astral.iso run-kvm
iirc something like this
huh
I sure do wonder how I followed myself
thats why i thought maybe u had an alt
anyways I pushed a change to the makefile that should hopefully make it that DISTROTYPE=minimal only builds the MINIMALPACKAGES
brb
should cd minimalsysroot be cd mlibc? because no files ever get put to minimalsysroot even if I do ./jinx install minimalsysroot
in any case the shell is very snappy when compared to eg. managarm lol
wait
ohhhhhh
ohhhhhhhhhhhhhhhhhhhhh
I forgot to add minimalsysroot to the ./jinx install
I have dumb
I tried running that manually but it didn't put anything to there
@grand shadow thereβs a non zero chance that youβll need to expose some shit that udev usually does / dependencies on udev and friends
If, and thatβs a massive if, thatβs the case
@carmine swallow pull again
Enjoy netlink (not all of it tho)
what even is netlink
Linux specific API to broadcast events. But used for all kinds of shit
if I recall correctly it was made for SELINUX originally
But now a metric shitload of shit goes over it
aghhh they need better names I thought it was network related
Including some network route BS
Oh itβs used for it
But not originally if I recall correctly
Itβs a Linux kernel interface for IPC if I trust Wikipedia
linux picking non ambiguous names challenge
This document describes Linux Netlink, which is used in Linux both as an intra-kernel messaging system as well as between kernel and user space. The focus of this document is to describe Netlink's functionality as a protocol between a Forwarding Engine Component (FEC) and a Control Plane Component (CPC), the two components that define an IP serv...
if I told you "I'm implementing netlink" and you never heard of it before whatd you think
now it works, thanks
epic
udev needs NETLINK_KOBJECT_UEVENT
You can ignore all other families if you need to implement this
(Afaics)
theres a stub driver in io/audio/hda.c that you can start out of
but theres no msi in pci, only msix
I should get around to implementing it I got completely derailed
yeah while you work on that I will implement msi
@carmine swallow do you plan on using multiple msi interrupts
I am pretty sure that there is only one interrupt on the hda
then multiple msi interrupt support will be assertosβ’οΈ
I guess most devices that use multiple interrupts should support msix anyway
oops all children of init were running with a full signal mask because I forgot to unset it when spawning a child
well I pushed msi
untested but SHOULD work
I'm going to deal with dinner then play around seeing if I can see what caused the xclock rounding issue (and if that can be fixed without patching)
nice, I got the register structs made and controller stopping if its already running done (that mostly just happens when you use pci passthrough to pass a controller from the host to qemu, then if you don't properly stop it it can became completely unusable until the next host reboot). I think Ill go sleep now and continue with it tomorrow (and also see if the msi's work)
alrighty nice work
@grand shadow when does summer break end for you?
i should stop looking at your thread, it makes me want to work on my thing but I have so much homework 
uni break started last week so until like 20th of september I'll not have to deal with it
still have to go to work though
hm
i will have to play catch up but i am still sitting in limbo here figuring out what to do with my life lol
wdym
good job though, you've made a lot of progress
like
who when how or if i am going to be paid for Vinix work
Unironically jealous of the progress
it's fine i'll just steal get inspired by the progress once time comes :^)
lyre 3.0 soonβ’οΈ
I mean if you eventually get paid for vinix I think the first thing you should do is weed out the remaining instabilities and then flesh out the tty stuff and implement ptys to have terminals in xorg
you can run webkit smh
actually it was that alongside looking into starting an aarch64 port perhaps, but not simultaneously
also cvttsd2si seems to be the instruction that it uses to round without the roundf
(I have no idea about sse programming)
also figure out what's missing that doesn't make gtk work on Vinix (it works on Lyre)
it'd really be nice to see some progress on vinix eventually, it was one of the big inspirations for me
i think i will work on personal projects on fridays
I chose a schedule that doesnt have classes on fridays
hmmm
wonder if 0.5 is treated this way
hm actually seems like this is the expected behaviour of the function
not funciton
instruction
Yes and it took a lot of time Iβm aware. But I see progress threads where big progress is made quickly and I guess I just wish that Managarm had that too. And yes webkit is based, but I canβt run fucking configure scripts without 20 different autoconf cache variables and what the fuck is a user, I only do that with a shitload of hacks and then it still isnβt done properly
i guess that's what happens when the main focus is put on impressive ports
or when thereβs like 2 people working on it, one of which does magic with drivers but get stuck in review hell and the other one is me
that too
well tbf you're constantly pushing the boundaries of mlibc and adding code to it so OSes like astral dont have to do the work
I've been having to implement some stuff in mlibc
nothing too deep (I barely know c++) but it is some things
yeah I think the biggest issue with managarm is just how slow it is to develop sometimes
yeah ofc but managarm has the issue of having not many contributors and also having to maintain mlibc which is huge
Yep. Honestly focussing more on stability and bugfixes would be good too but every time we suggest that, we agree, and then fail to keep focus lol
same with me going back to osdev
i just write some code
realize how shit it is
and drop the project lol
honestly I'm pretty happy with my current iteration
just gotta finish a sidequest first so I can develop it on my mac
Anyway, off to sleep and crying about systemd porting. Thereβs a printf issue in printing help and I suspect thereβs a linker bug related to rpath. If that works, I need to debug udev and cry
Then debug systemd as init actual
Which would involve a lot of shit
All in the name of stability right? (Better init)
hopefully lol
did you try porting openrc
gn and good luck
or runit
Yet a lot of people use it
I tried porting openrc and it needed quite a few missing(?) linux stuff
But itβs already compiled, now it just needs to work
I donβt think I have mlibc patches for the compilation part
the good thing about systemd is its UX
Which is based
runit fucking sucks in that sense kinda
but the problem with it is it tries to do everything all at once
so its fucking huge
bruh so
_update is 0, update is 0
_update * 1000 is 0, + 0.5 is 0.5
the (int) does a truncation which turns it into 0
which then is a div by 0 in time_intervals
is it really wanting (int) to round it??
ooor
maybe _update is being passed wrong
w->clock.update is 0
could it possibly be that the missing scanf %f is at fault here?
it seems like w->clock.update is initialized by X and it seems to have some default
passing -update doesn't seem to change it
I AM SO FUCKING SMART HOLY SHIT
@prime juniper IT LIVES
basically the problem seems to be: w->clock.update needs to be initialized by whatever the fuck in the X11 stack it needs to be, but it isnt (again, I am betting on the missing scanf %f), so adding a
w->clock.update = 0.5;
on the Initialize() function fixed it
funnily enough, theres a check for an invalid update being passed but it was commented out for some reason?
/* make invalid update's use a default */
/*if (w->clock.update <= 0) w->clock.update = 60; */
awesome
bleh no idea then
but yeah that is why xclock doesnt tick or work normally: its missing update for some reason
well digging into xorg is something I dont want to do
this is where the default is defined
I lied
the fuck is this sscanf magic
actually
yeah thats equal to %f
I was right
thats why mlibc needs %f in scanf, so xclock can tick 
so yeah, w->clock.update isn't initialized because %f inst implemented for scanf and it does some sscanf magic to convert it in libXt
maybe this (missing %f) is also whats causing the tyr-glquake glitches?
I wish u could explain literally every bug with this
Oooh nice debugging job! Love seeing deep dives into obscure issues like this
Nice work
msis appear to work fine except that there was a typo in pci_msisetbase inside the if (is64bit), address > 32 should be address >> 32
Omg howd I miss that
Ill let you push the fix with hda nothing else is really gonna use msi for now
now time to figure out the cursed stuff ig
(though not that I even implemented anything other than created those device files with empty logging ioctl impls, the hda side is also missing things like queuing audio because I want to first know how exactly it should work, I am pretty sure that there is a signal along with a write ioctl)
Damn
Has it played any audio?
no because I didn't yet implement the queueing stuff but I did implement all the stuff needed to eg. set the format and start the playback
choosing a supported sample rate is kinda cursed though, its like billion ifs because there are two base rates (44100 and 48000) and then you can multiply that by 1/2/3/4x and divide by 1/2/3/4/5/6/7/8x (so you have to find the closest match that it supports)
realloc accepting null would be nice, though I already implemented that locally (well its literally just a if (!ptr) return alloc(size)) but other than that I haven't yet needed anything new
You can push it witj the hda driver too then, thatd be how Id implement it anyways
wait u implemented hda in like a day?
Qwinci probably has got it down to an art atp I think he wrote one for vinix and for his oses
well I already knew how a lot of the basic stuff is done because I did it before two times (and its still missing some things ofc, its like the minimum for playback eg. no hdmi support or anything)
nice, thats p cool
Can I push Managarm into the queue for a HDA driver? 
I am pretty sure Leo wanted to do that tho 
Leo is really busy tho 
I mean maybe, then there would need to be a new server tho and idk how do they work (though ig I could come up with something based on the existing ones)
yeah I won't touch sound for a while
iGPU stuff is torchering me enough already lol
what are u working on atm and how is the progress
i see
i swear to god
everything that qwinci touches
has to play audio
(not a bad thing)
Quake with audio soon???
I think tyrquake has audio
And can use sdl for it
I think I disabled it cuz it was segfaulting or something lmao
now I ran into something that would be nice to get fixed, apparently mmap doesn't check if the underlying file supports mmaping + succeeds even if it doesn't and then fails in an assert in vmm pagefault handler when the mmap'd memory is accessed
at least if I understood whats happening correctly
Ill fix that when Im home
yeah you can just make DISTROTYPE=minimal and it wont build llvm and gcc twice (only gcc once)
and you can add the packages you want to the makefile
I'm considering unshittifying the astral vmm
by adding swap
- working set things
it won't be the best, but it will help ease out oom conditions
since I don't want to work on ttys rn, I'll start
I'll try to abstract it away as much as I can
as to not interfere with drivers
and stuff
I mean hey if you want to go ahead
just tell me exactly how you are gonna do it/did it so I can know when I eventually need to change something
(just note, this might include some slight obos curse in astral)
((depends on how skill issued I am))
the mm stack is pretty stable so anything I will blame on you 
it's probably just gonna be some extra linked lists to vmm ctx (both global and per-process) + some way to interface with swap
from the vmm
as long as kernel memory doesnt get swapped out it should be fine
I have a specific requirement that all kernel memory needs to be allocated at map time
to simplify things
no I'm forcing you to support that
i.e., ways to allocate/free swap file space, and doing io on said allocated swap regions
dam your vmm looks really simple
this is gonna be fun
I haven't look inside yet tho
a lot of the magic is just thanks to struct page
no optimized ways to fetch struct page?
wdym
not rly no
.
but you just get the physical and then the struct page from that
and does struct page represent a virt. page or phys. page
physical
so how do you get info for a virtual page
I'm going to quite a bit of metadata for this
also this was specifically with a file in the devfs where I think it gets proxied through the devfs generic ops? that might make it harder, though ig there could be some kind of flag or something like that
I think I might just have the map address being some magic value like -1 being a "check if mapping is actually possible"
so VOP_MMAP(vnode, -1, ...) would return ENODEV if mapping isnt possible
cya
I need to actually write docs if people are gonna start contributing now
the good thing is that the code alone is pretty easy to understand
lol thanks
well I pushed the fix
soon I will get around to making vmm_map be able to return an errno
I think for that I will just have a macro VMM_MAP_OK() and a VMM_MAP_ERRNO() and have any return values < PAGE_SIZE be an errno
actually I wouldn't even need to have a VMM_MAP_OK
just VMM_MAP_ERRNO == 0 when its ok like literally everywhere else
thanks
I already have that in obos for one
two
I don't wanna implement ttys
this is a procrastination strategy
makes sense
ttys are fun until you have to session and process group
that took me a while to figure out how I would do it and I still don't think I do it 100%
but hey it works well enough for bash job control so worth
flip you I'm doing that anyway (if your vmm isn't too shit)
idk how useful that is tho, swap in general is pretty useless on modern machines
lol
I would've said hyenasky, but he ain't here no more
i used to think this
but this is a skill issue
(to think it is)
make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
hmm
to think that its useless?
I have just disabled swap completely on my pc as I am not ever running out of 48gb ram (and I don't want to use ssd as a swap anyway)
At least two reasons:
- if u do it well and have a fast swap backing u can really make it feel like u have lots more memory (see MacOS/XNU)
- Less resident pages -> less fragmentation -> more contiguous memory (do i need to explain why this is good?)
ability to do more advanced things like compress on swap etc
linux swap is just dogshit so everyone disables it
you spent too much time writing this, the valid answer is "swap is fucking cool" /hj
Not to mention just more free memory == more memory to use for caching stuff
that sounds cursed
not rly
paged out back to the file it came from? lol
idr how this worked exactly
page cache is not paged out, thats the entire point
its just written back to file if dirty
its desigend so it can be reclaimed easily
#1141057599584878645 message
that's what I meant
its shit in the way that by design faults in the kernel are instantly an error and the locking is shit for handling faults like that in the kernel (say youre loading memory from swap and want to vmm_map some meory to use, you cant because of locking unless you make a recursive mutex or something)
btw when you make the kernel pageable, not everything becomes pageable
fair, ig there are some good things about it but eh I still don't see much use for it personally
"page cache" is view of memory on disk
vmm stays out of it
^
yeyeyyeyeyeyeyye eyyeyeyyeye
scheduler too
in astral pages stay in the page cache until all pages in the free list are gone and you have to start taking from the standby list
in a hobby kernel only if ur really interested in vmm design and stuff
other than that i wouldnt bother
yeah on linux kswapd thread wakes up then reclaims the page cache
then wakes up kcompactd to compact the pages
I also dont have the concept of a paged and nonpaged pool so you'd probably have to add that to my slabs
ext2.c is 1.9k thats nothing
inb4 oberrow introduces the curse into astral
fnuy typo
lmao I forgot to fix that
ah well doesnt matter flanterm supports it
its an easter egg now 
how should I write commit messages
kerenC
git commit -m "thing: change"
look at the history
too much work
i do -v so i can see the code im writing the message about
wait really
also if you want a compile commands json I have a cmakelists I can borrow
(just use it with host gcc and run cmake but don't actually build it)
also git add -p if u didnt already know
git add -p is useful
I just didn know about -v
also it doesnt highlight the diff, cringe
I'll just use bear or whatever the tool was called
depends on your editor
it uses the variable from the config file