#Astral
1 messages · Page 6 of 1
hm nevermind this is something I will have to sit down and think about and probably rewrite a function or two in the vmm for
and I am not in the mood today to think that much
well hopefully I think of something that doesnt suck soon
because smp is pretty much unusable from how much my shootdowns suck 💀
i wonder if what i experienced was due to tlb shootdowns
i tried running with 8 cores
the black screen was related to tlb shootdowns but wasnt because it was slow
i could move the mouse around but fvwm did not launch
it was actually a bug in one of the timer abstractions
ohh
it kept trying to schedule into a specific cpu to access its apic timer
but that cpu was waiting for the cpu that thread was running on to do the shootdown
why dont you just pin threads to CPUs
aka skill issue
interesting interaction
then do thread migration if needed
yeah it got to fvwm
idrk
I can update the bootdisk, the nice thing about separating the root and kernel images is that I dont have to copy a 4 gb file every kernel update
that would be nice
i kinda want to try running glxgears with 16 cores or some shit lol
I tried glxgears and even then its sloooooooow and the system locked up after a bit
but I will upload the new image
hopefully once I fix the HORRIBLE shootdowns I can go after the rest of the smp bugs
-j8 gcc build 🥹
scp finished running it should be there
same link
just need to update the bootdisk.iso
sending an ipi for every page unmapped does that
being lazy early on is hitting me hard now lmao
yeah that makes sense lol
I want to hopefully make it go from one shootdown per page unmapped to one shootdown per vmm_unmap or vmm_changemmuflags
idk how feasible that'd be with my current design but it'd be a hell of a speedup
I mean I managed to fit a page cache into my shitty vmm design I can probably get at least something faster going
something that wouldn't require too much change is probably one page per shootdown -> one address range per shootdown
yeah I was thinking of that
since I do have specific functions to destroy or change the mmu flags of a specific range
how hard was llvmpipe to port btw?
yeah that's perfect, but keep in mind that the functions to unmap/remap single page still need to shootdown, and if your functions to unmap/remap a range call out to the single page variant dont forget to have some sort of flag to omit shootdown 😅
with some help from vinix (I wouldnt even know where to being to patch it) the biggest things I ran into were a bug(?) in gcc's build system, mesa not installing some .pc file and having to implement mprotect which I didnt have implemented
the hardest part was waiting for llvm to compile
and having to do it several times because I did oopsies
yeah I think this weekend I might look into that further
having smp be faster than single core would be a cool start even if unstable as shit
what alternative is there any way
the non llvm renderer
softpipe I guess
i might try and implement an xhci driver (again)
for astral
that would be cool too
oh and zlib not setting SONAME by default unless you patch the configure script
true that'd be cool
it'd probably work better on real hardware than ps2 if you write a HID thing lmao
i only ever implemented the hid boot protocol
and my keyboard doesnt even implement that properly 
if you havent looked into usb hid, boot protocol is basically a standard that is the bare minimum for input devices used during boot
lets see how long glxgears lasts with 8 cores
mainly for the firmware setup and stuff like that
really easy to implement if you dont need all the bells and whistles
15 seconds, pretty cool
thats 15 seconds more than 0
damn that was fast
for me it lasted at least 30
i just ctrl-c because it was slow as balls
I dont even implement a lot for keyboard/mouse anyways
40 fps or so
What happens, does it crash or something?
deadlock
well the kernel still works its just that someone is waiting on some mutex and that deadlocks 
like all cpus are on the idle thread
shootdowns my behated
what do you do for shootdowns?
They are one of the highest priority irqs
and ensure all threads of the same process run on the same cpu
bam
no shootdowns
I have solved osdev
What about idle threads
what about them
you have a kernel pagetable per core
wait no that wouldnt work
yeah youd need kernel threads all on a single core
which sucks
just keep the cr3 of each core in its cpu_local struct
then loop over each one and for each cr3 that matches the one in which you modified the page table
send an IPI to it
yeah that's what I thought of, but you'd still need shootdowns because if a kernel thread remaps memory you need to propagate it
otherwise go onto the next cpu
yeah so you still need shootdowns atleast for kernel threads
and having all threads of a task on the same core could cause issue with load-balancing
ah
I have solved load balancing (any thread can run on any cpus at any time
)
yeah I suppose you could avoid many tlb flushes if you dont share the same pagemap
are you guys saying that each time you do a TLB shootdown, you mindlessly reload cr3 to flush the tlb
or smth
or is this just a terrible misunderstanding on my end
I really gotta refactor this file
contains all mmu stuff
I do the invlpg on all other cores
its just that mine sucks cuz I do that for EVERY unmapped page
nah I just do invlpg
I do it each time a page's prot is modified
whether that be the page is unmapped, or the prot bits change
but it's one page at a time
which truely sucks
obvious solution is to stub munmap and mprot so that you never have to do a TLB shootdown
REAL
I needed it for my driver interface
in the driver loader
in the elf laoder
*loader
I think thats a TODO in my elf loader lmao
or I just manually remap calling the arch_mmu_remap directly
I forgor
my elf loader just uses mmap anyways
demand page in ftw
my todo for the elf loader is mmap the file direclty
because the ubsan messages annoy me (I write at address 0, which is mapped)
my driver loader's elf loader just takes a buffer with the file directly
so you can mmap the file if you'd like
did you enable mlibc to mmap the shared libraries?
I did yeah
- internal_conf.set10('MLIBC_MAP_DSO_SEGMENTS', true)
- internal_conf.set10('MLIBC_MAP_FILE_WINDOWS', true)
what do you need for that anywyay
idk if I'm missing any
vfs too hard
mmap file?
yeah
bonus points if page cache
if you dont set those options, basically, mlibc just mmaps anon memory then reads the file in
in astral tmpfs IS the page cache lmao
all tmpfs data stays in the page cache
yeah I noticed that poking at the meson.build
there seems to be another one in managarm's config
internal_conf.set10('MLIBC_MAP_DSO_SEGMENTS', true)
internal_conf.set10('MLIBC_MMAP_ALLOCATE_DSO', true)
internal_conf.set10('MLIBC_MAP_FILE_WINDOWS', true)
wonder what that one does
this project progresses so fast
I think for the shootdown I wont have to change too much code and would be able to make it work once per unmap if I do it something like this:
Make mappings inacessible but keep the PTEs with the pages, and have the change function return a list of pages of sorts that has either the pages to shootdown or says to shootdown the whole tlb if its too big of a range
Do the tlb shootdown
Go through the PTEs again and release the pages like I would normally, knowing that if any other core tried to access it they would have to go through the page fault handler first and get a segfault instead of doing a use after free
It could still be optimised further (requires going through the range twice) but for an initial thing that wont require that much change its good enough
Also ty
A mesa port was long overdue anyways
MAP_DSO_SEGMENTS means file mmap is used to map in shared library phdrs (instead of anon mmap + memcpy), MMAP_ALLOCATE_DSO means mmap is used to allocate the address space that shared libraries use (instead of a fixed counter), MAP_FILE_WINDOWS means mmap is used to map files internally (currently only for /etc/localtime iirc)
what if a page gets mproted from RW to RO
then it won't pf on other cores
Wdym
Does MMAP_ALLOCATE_DSO still have a library base or so I have to pass that too
I might turn it on later, I already have the other two on
MMAP_ALLOCATE_DSO does: ```
max_addr = 0
for each phdr with p_type == PT_LOAD:
max_addr = max(max_addr, p_vaddr + p_memsz)
max_addr = round_up(max_addr, page_size)
library_base = mmap(NULL, max_addr, PROT_NONE, MAP_ANONYMOUS, -1, 0)
it's only for figuring out where to place the library (and reserving the address space)
you most likely want MMAP_ALLOCATE_DSO in conjunction with MAP_DSO_SEGMENTS, but it should work on it's own as well
the main benefits are aslr and that libraries won't collide with anything that might just happen to be in the way
Yeah you need to do a TLB shootdown everytime you constrict the permissions of a page
If I'm lucky I might test out that build today
and so it begins
and it does work for files owned by the euid
now I just need to draw the rest of the owl
Nice!
su - doesn't run cuz of this hm
after I finish implementing all those different permission checks in astral I'll implement {set,get,end}usershell in mlibc
implemented checks for a bunch of stuff but still got a while to go
lmao oops I had forgotten about the permissions for /dev /tmp /dev/shm
so my /etc/rc created them with the wrong ones and the user couldnt write to /tmp for example
now they have the right ones (755, 1777, 1777)
you can have ptys now as an user too
very cool
porting startx would be nice eventually, so you wouldnt have to be root to start an X server
I actually got it to run X.org and xeyes but it complained about euid not being 0
and twm didnt work idk why
can you type fg to make cat foreground again?
yeah
damn thats cool
job control works well enough
best benefit of implementing signals
I have some 6 system calls left to look into, then I will implement some checks for a few ioctls, then I will implement the mlibc stuff that stops su - from working
doing login -p mathewnd on an xterm allows for me to run stuff like tyrquake just fine
these are the only remaining ones for me to look at
-rw-r--r-- 1 mathewnd mathewnd 917 Aug 21 19:49 mprotect.c
-rw-r--r-- 1 mathewnd mathewnd 2196 Jul 17 21:05 renameat.c
-rw-r--r-- 1 mathewnd mathewnd 1235 Jul 17 21:05 unlinkat.c
and theyre the more complicated ones
after I'm done with credentials and the mlibc thing its gonna be fat filesystem and then an installer
actually idk too much about the installer yet
cuz either it gets from the internet or from the initrd
does mesa work now?
ya
speaking of mesa, I should compile xscreensaver with glx support now
niice
pfft
assertos strikes again
__ensure(!"Not implemented") is the ultimate punishment
I think mlibc missing the %f on scanf is fucking me over
your os is cool but does it have SCREEN SAVERS??
is that dynamically rendered?
cause holy shit
that’s awesome
Nice work
wowzers
‼️
soon™️
redoing the vfs locking scheme so the locking is done at the vnode layer instead of the filesystem layer (I will have to spend 10 days debugging deadlocks)
nice
maybe I can add procfs one day....
also holy shit I just noticed
GPU: llvmpipe (LLVM 18.1.7, 128 bits)
thats news
Lol
Got it to run configure but it deadlocked on make -j8 (no smp just trying to see how many processes at the same time goes)
Tmr Ill deal with that
gotta love the Low Level Virtual Machine pipe.........
beats having a soft( )pipe
I think you can get blue pills for that
Btw, just tried to do a build of Astral to try to implement cpuinfo and memonfo just for the hell of it, and the latest code on GH doesn't seem to actually build
Will post the error (and try to investigate in a sec)
In file included from arch/x86-64/main.c:22:
/build_dir/builds/astral/include/x86-64/arch/ps2.h:17: note: this is the location of the previous definition
17 | #define ECHO 0xee
|
[CC] arch/x86-64/smp.o
[CC] arch/x86-64/syscalllog.o
[CC] flanterm/backends/fb.o
[CC] flanterm/flanterm.o
[CC] fs/devfs.o
[CC] fs/ext2.o
[CC] fs/file.o
[CC] fs/initrd.o
[CC] fs/pipefs.o
[CC] fs/sockfs.o
[CC] fs/tmpfs.o
[CC] fs/vfs.o
[CC] io/audio/hda.o
io/audio/hda.c:3:10: fatal error: kernel/hda.h: No such file or directory
3 | #include <kernel/hda.h>
| ^~~~~~~~~~~~~~
compilation terminated.
[CC] io/block/block.o
make[1]: *** [Makefile:33: io/audio/hda.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/build_dir/builds/astral'
make: *** [Makefile:25: all] Error 2
make[1]: *** [Makefile:40: kernel] Error 2
make[1]: Leaving directory '/home/techflash/src/astral'
make: *** [Makefile:12: all] Error 2
fully stock clone from https://github.com/mathewnd/astral
wait
OOPS
Did I accidentally fucking upstream my nonexistant hda driver 😭
You can just remove the include
👍 alright lol
I figured something had to be up
I think at one point I just did git add kernel-src/io and that got added
Might as well just up the hda.h later lmao
and now it craps out trying to build some userspace (I think?)
Making all in lib
make[1]: Entering directory '/build_dir/builds/ace-of-penguins/lib'
gcc -O2 -march=x86-64 -pipe -mtune=generic /base_dir/sources/ace-of-penguins/lib/make-imglib.c -o make-imglib -lpng -lz
gcc -O2 -march=x86-64 -pipe -mtune=generic /base_dir/sources/ace-of-penguins/lib/text2c.c -o text2c -lpng -lz
/base_dir/sources/ace-of-penguins/lib/make-imglib.c: In function ‘tokenize’:
/base_dir/sources/ace-of-penguins/lib/make-imglib.c:205:5: error: ‘return’ with no value, in function returning non-void [-Wreturn-mismatch]
205 | return;
| ^~~~~~
/base_dir/sources/ace-of-penguins/lib/make-imglib.c:199:1: note: declared here
199 | tokenize(char *string)
| ^~~~~~~~
/base_dir/sources/ace-of-penguins/lib/make-imglib.c:207:20: error: implicit declaration of function ‘isgraph’ [-Wimplicit-function-declaration]
207 | while (*next && !isgraph(*next)) next++;
| ^~~~~~~
/base_dir/sources/ace-of-penguins/lib/make-imglib.c:10:1: note: include ‘<ctype.h>’ or provide a declaration of ‘isgraph’
9 | #include <png.h>
+++ |+#include <ctype.h>
10 |
make[1]: *** [Makefile:694: make-imglib] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/build_dir/builds/ace-of-penguins/lib'
make: *** [Makefile:385: all-recursive] Error 1
make: *** [Makefile:13: all] Error 2
astral audio stack before managarmis actually crazy
Wait why is it using the host compiler wtf
Seeing as that is a non nescessary package you can just rm recipes/ace-of-penguins or whagever the name os
If you consider audio stack to be just initialising some pci stuff for the controller 
I should do a clean build soon so I can fix these
Astral is a star and this os deserves a huge star!
oh boy
now it's gonna build LLVM 💀
at least this is one-time, once this is done I can keep recompiling semi-quickly until cpuinfo and meminfo work
If you feel like boot times are too high due to the initrd you can change DISTROTYPE to minimal in the makefile and thatll only build some things
Well
Itll build everything
But only some times will be in the initrd
i just manually invoked jinx to build the minimal distro
and then make astral.iso run or whatever
or actually make DISTROTYPE=minimal sysroot astral.iso run
i think that was it
That works too
I really should
its a good project, just a bit rough around the edges
i need some time to get used to the code then i can take a look at xhci
If you have any questions lmk
the code is too densely packed for me to be able to read it comfortably
so i take extra time
Or you can just make an ext2 image with the sysroot and tell qemu to use it as nvme or virtio :')
i believe its not with -M q35
I thought I had passed -M q35
you can do some fancy shit to do virtio cd, and EFI / seabios will boot from it at the speed of light
at least, that's my experience from it
Maybe its just in my local machine lemme check
oh nah I see q35
does that change that -cdrom emulates? I haven't used it very often
Yeah its much faster
If you really want it to be as fast as it can do this and change the limine.cfg
I have a handy script at home
well I still don't even know if it's gonna be slow or not yet, I thought from your comment that you were implying it's going to be painfully slow to boot
probably just misread then, sorry for the confusion
Not really. No one is tackling that over at Managarm because everyone has something else they want to do
The initrd would still take a tiny bit to load and it just annoyed me when I wanted to make small changes
ah
@grand shadow do you use a language server when working on astral?
I just use whatever vim version came with the distro and nothing more
damn kinda based
Idk what a language server is
yes
if you don't use q35 then by default it'll use IDE hard drives & cd-rom drives
Ive mostly only been writing code with vim at home for the past few years
At uni I try to use vim when I can too
i wish i could write code without a language server
But at work we have to use windows and use online platforms so I cant really
What is that
Ohhhhh
That sounds helpful but Ive just trained myself to quickly look at the header files
When I used codeblocks a whiiile back that helped me a bit
And now with the convenience of doing everything from the terminal idk if I can go back to a gui application for osdev
This reminds me
I should write a serial driver soon and hook it to the tty subsystem
that would be neat
DOOM serial match over 2 computers running Astral
?
hmm, dead link, or is my internet being weird? I get NXDOMAIN here if I try to manually resolve it with dig, so unless cloudflare's DNS is having a heart attack, I would imagine the former
make[1]: Leaving directory '/home/techflash/src/astral'
./jinx build-all
* building package: pixman
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0curl: (6) Could not resolve host: www.cairographics.org
make: *** [Makefile:13: all] Error 6
and it just went away? weird, nvm them ¯_(ツ)_/¯
This site can’t be reachedwww.cairographics.org’s server IP address could not be found.
Try:
Checking the connection
Checking the proxy, firewall, and Secure DNS configuration
Running Windows Network Diagnostics
ERR_NAME_NOT_RESOLVED
also using 1.1.1.1
Works on my end
Not using 1.1.1.1
yeah try clearing your DNS cache and try again
I just tried again and it started working
guess Cloudflare just had a stroke for a minute or 2 there
If I get a source port with multiplayer you can probably play it over the internet
I tried to make tyr-quake multiplayer but it needs more interface memes
oh does doomgeneric strip it out? rip
ooh I'm getting deep into Xorg stuff
if I had to guess, it should be done building soon, and I can finally try to poke at procfs to try to add cpuinfo and meminfo
I dont have a procfs lmao
Yeah
/dev/mouseX and /dev/keyboardX
Mouse.c keyboard.c in io
You can look at ps2kbd.c and ps2mouse.c for an example
so i just call newmouse and i can push packets using mouse_packet
Yeah
No support for stuff like unplugging yet but I have support for that in the devfs (becahse of ptys) so implementing it shouldnt be too hard if needed
ah, might try make a tiny stub implementation off tmpfs then that has a partially complete cpuinfo and meminfo
I don't have the time to implement the entire thing
Yeah, but I think thatd just end up being a call to like mouse_unregister to remove it from the tree and wait for a mouse_inactive function to call when all references to the devfs node are done
Like ctrl c ctrl v the tmpfs?
¯_(ツ)_/¯
I don't really have a plan yet
kinda making this up as i go along
first I need to actually have a working stock build lol
Ah
alright, so I now have a working stock build, and am looking at the fs code
I feel like duplicating the tmpfs code isn't really the best idea, probably would be better to try to let it sit on top of the existing tmpfs codebase, since most of the actual fs would be the same
only differences (that I can think of) from tmpfs are that it needs to create some nodes on mount (and then in the final implementation also create nodes for PIDs, but I'm too lazy to go implement that right now), and forbid deleting anything, return EPERM if attempted, and forbid userspace from making new nodes
I feel like making an entire duplicate of the tmpfs codebase just for that is a bit extreme
although actually, now that I think about it
does any of this really need to be "stored"
would probably be cleaner to implement it as a minimal thing on it's own with some nodes that aren't actually stored in RAM, but generated on the fly when read
which would actually be more ideal for meminfo and cpuinfo especially since they have the opportunity to change
polished a bit more the new vfs locking, configuring and making gnu hello with -j8 doesnt deadlock anymore and e2fsck doesnt scream at me
<----- spent 1h going after a bug that was literally nothing it was just mkfs.ext2 making the filesystem with dir_index without me actually supporting it so it complained
going to finish adding the last few checks to the vfs_unlink and vfs_rename functions as these are more annoying because they need to also check the ownership of whatever they are working with
then I will add an /etc/shells to astral, add the *loginshell functions in mlibc and add an /etc/mke2fs.conf
almost forgot, after adding the mke2fs file I will also add the check for mprotect and signal
and rename too
setuid programs now work too
though I do run into the issue that uh
the sysroot jinx puts out is under my host uid and gid 
lmao i was gonna ask you what you did about that
@craggy tide is there any good fix for that or do I just chown -R root:root sysroot and pray
I chowned it from astral
that some packages might want to install files under different uid:gid
or some web servers
so yeah idk how to solve that
i wonder if there is some hack to set the uid of installed files to some sentinel value
i think there might be no way to solve this without root access at least when installing packages to a sysroot
fakeroot is pretty nice
but the problem is that what's root inside the container is the user uid outside
and THAT is the problem
that uid preserves into the initrd and into astral
and there is no way to fix that without root
yeah, so create, and pack the initrd all inside of fakeroot
then the faked root-owned files persist in the final initrd image
they're never actually owned by root on the real fs, but whatever makes the initrd is fooled into believing that they are, and thus, in the image, they are owned by root
the only problem now is that you have no way to package stuff which wants a specific gid:uid
and idk how that can be solved
yes you do
you just install it with the regular uid:gid
but that pack initrd inside container thing is a good idea
ok, then what?
fakeroot won't touch them
it fakes that you are uid 0, any files you create are owned by uid 0, and when read back, are still owned by uid 0 as long as you're in the container
no but like... you cant change from 0:0 to anything else inside the container
yes you can, you just run chown on them
no, you cant
and then it becomes non-0
yeah, but fakeroot fakes that
but the filesystem you are running this on does not know that
it hooks libc to essentially fake all operations that require root
correct
for all it cares you are still 1000:1000
nothing is ever saved to disk
if you do everything in fakeroot, you can
there is this thing currently in jinx
apt tried to chown files
but it fails
exactly because of that
and prints a warning
W: chown to root:adm of file /var/log/apt/term.log failed - OpenLog (22: Invalid argument)
exactly that
oh? interesting
you can't chown the file from 1000:1000 to anything else
it appears as being owned as 0:0 inside the container
because fakeroot is specifically designed for debian packaging iirc
so it's weird that apt would blow up on it
maybe they have some funky shit going on
it doesnt, its just a warning
but yeah
thats how fakeroot works
nothing you can do about it iirc
maybe debian pckages have metadata that tells the pckage manager how to properly install the pckage
which includes fixing uid:gid
idk
hmm
techflash in ~ at Michael-ArchT14 ➜ fakeroot
root in ~ at Michael-ArchT14 ➜ mkdir a
root in ~ at Michael-ArchT14 ➜ cd a
root in ~/a at Michael-ArchT14 ➜ touch balls
root in ~/a at Michael-ArchT14 ➜ chown root:adm balls
root in ~/a at Michael-ArchT14 ➜ ls -la
total 0
drwxr-xr-x 1 root root 10 Aug 27 18:52 .
drwxr-xr-x 1 root root 1942 Aug 27 18:52 ..
-rw-r--r-- 1 root adm 0 Aug 27 18:52 balls
root in ~/a at Michael-ArchT14 ➜
techflash in ~ at Michael-ArchT14 ➜ ls -l a
total 0
-rw-r--r-- 1 techflash techflash 0 Aug 27 18:52 balls
interesting
works on my machine
maybe fakeroot works a bit differently
plain unshare calls dont seem to allow for that
there's this piece of software that i wrote
that's used for containerization in jinx
maybe it would be a good idea to replace it with bwrap/fakeroot
its essentially homemade bwrap lol
yeah
fakeroot hooks into libc's file related functions and keeps track of all of the spoofed data in RAM until it exits
not sure how unshare does it, never used it
ah, so that's the difference then
yup
that uid:gid mapping to root is also a linux thing
there's /proc/self/uid_map and /proc/self/gid_map
yeah, fakeroot just lets you perform actions as if you were root without actually touching the underlying filesystem
this wouldn't work with jinx where packages are installed into a per-package destination directory
it would require a rewrite of jinx where each package is actually packaged and installed into a temporary sysroot as needed
packaging it inside of fakeroot would work well, and then when building you could install it in fakeroot again which would presumably preserve permissions it was packaged with
the way to do this is to have post install hooks
this = have non-root owned files and whatever
the post install hooks would change the owner/perms of files
the hooks should run on the OS itself
thats exactly what managarm does, i think
they use xbps
and i believe packages are reconfigured or some shit during boot
rare xbstrap W
yes
that's how it has to be done
i still don't know how i wanna do packaging in Jinx
eh jinx is too big of a shell script for me to even attempt to look at
i'll pass sorry lol
eh, xbps package templates are kinda pain imo
but when using working packages, it works great
what xbps package templates
are you talking about void packages?
like this thing?
yea, with xbps-src
that's like, the main way that you build xbps packages, no?
main way to build void packages for sure
this is very void specific
at least i think so
the script is literally in their package repository
it does not come with xbps itself
I'm well aware, I have to maintain custom packages for it, for an architecture that's no longer officially supported
but, in case you weren't aware, xbps is a Void project lmfao
https://github.com/void-linux/xbps
yeah i know that as well
of course it's gonna be void-specific
xbps itself is not very void specific
but the xbps-src script seems to be
especially the way its lodged in their repository containing all the packages
the only real way to get it is to fetch the raw file out of the repo
which sucks
yes, that's what I'm talking about
I'm not aware of any way other way to make xbps packages though without doing it fully manually
its not that hard
except if you want all the soname/dependency tracking things
but ive done it
its like 20 lines of bash
idk, if you have an alternative way to make packages for it then sure
but xbps-src templates are honestly kinda depressing to work with
especially if your package has a non-standard build method
:3
gonna open a pr for *usershell in mlibc now
I want to do that soon
or doas, might be easier
true
anything bsd is usually easier lol
that will be uh, after I rebuild the world
kinda fucked up an rm command while trying to clear the mlibc source
yikes
is astral using the great new debian based jinx version?
still on the old arch version
might want to look into that then, while you're at it :p
if you do, make sure to back up your mlibc patches so you dont accidentaly nuke them!
thats on git lmao I would explode if I nuked it and didn't have a fallback
I'll leave it building while I go to sleep and deal with it tomorrow, uni break starts soon so I will have more time

I'll leave the world rebuiling overnight and tomorrow I will finish the last few checks for mprotect and signal
then uh, I think thats it?
add a login option to init and add an astral user too I guess
and see if I can port sudo/doas
oh and add the appropriate chowns to my gendisk.sh script
Nice nice
oh my gosh
oh my gilly gosh omg
real?
compile ur own os on astral?
almost enough to build Limine on astral
you probably only need to port mtools and nasm if you don't have those
I do have nasm since I can build the kernel on astral, its just mtools then
guys I will use astral on my main machine for a week if you port neovim 
If you have the drivers xd
For disk theres only nvme
And theres no installer etc etc
Thats coming after fat
who uses anything other then nvme these days
the AHCI is very popular
I do wish do write an ahci driver soon, my main computer has an unused ssd connected via sata
And dual booting astral would be very very cool me thinks
OBOS
obos supremacy
@grand shadow it's just stuck like that after i pulled and rebuilt the kernel, any idea? lol
i also rebuilt mlibc, bash and init
nuked the mlibc sources of course
why would it not
boo
hoo
:^)
void sched_runinit();
it makes perfect sense to me actually
yaaay sourceware.org is down!
No idea
How did you revuild the kernel
Theres a syscall logger you can enable too in kernel-src/Makefile
Oh you have to make clean-kernel
I dont have header dependencies
I really need to revisit the build system lmao
Like switch to submodules from the jinx regenerate for the kernel stuff and other QoL things
Np :3
proper kernel build system too, i suppose?
so i dont have to clean-kernel to make sure it doesnt break lmao
Yeah lmao
thank god
It annoys me sometimes too, I change a header file and forget to clean and wonder why its breaking and then remember a second later
But yeah, for today after I rebuild the world (left it building when I left for work, hopefully it didnt crash and burn), I will look into the remaining functions I have to implement the access stuff for and port sudo
does astral work on any real hw?
it'd be interesting seeing it compile itself while running itself on real hw
too bad it cannot do so with SMP
Worked on my main computer and laptop
interesting
I have a bootdisk that has a minimal initrd in my server
It was meant to be used with an nvme image in qemu but it should boot in real hw if you pick the initrd option in limine
The main thing stopping me from going after the smp bugs is how slow my tlb shootdown is
But once thats done I can look into it further
8 core gcc compilation 🥺
And once I have sysconf() llvmpipe could also use the other cores
this reminds me i promised uacpi support for astral
also if it doesnt die before uGPU maybe a drm subsystem as well
since it has mesa ported over now
anyways soon ™️
Yeah
I fixed that bug so it should be perfectly fine now
Dont think itll die anytime soon I am still pretty hyped about it actually not sucking that much
thats great
im confident I could get mesa to execute stuff on igpus
since ive done it freestanding before
id just need to implement drm for your kernel
that would be giga based
at least like a dirty POC thing that could run a game
without any isolation or security
Hw accel glquake
yeah as an example
If you want to try it, managarm has DRM ready to go (and soon™️ modesetting on some iGPU)
Does it have mesa ported tho
Bro we’re in upstream Mesa
We’ve had Mesa for at least 5 years
Oh lol
I think I want to support both full on drm drop in subsystem as well as an extension to an already existing DRM systems so I need both
Ye
tack on -MMD to gcc and itll generate *.d files alongside your *.o files
then
DEPS = $(patsubst $(OBJS),*.o,*.d)
-include $(DEPS)
and like clockwork
Seems easy enough
I hope it's as easy as I portrayed it 😛
Managarm doesn’t do that either? Unless meson does it for me
I'd rather do userspace developement for windows than use make tbh
I just don't wanna learn it
sorry if i come off as rude lol my bad
nothing personal against make
i half dont mean it
Ofc it does, thats the entire point lol
I mean it makes sense
But I never gave it more than 1 second of thought. So thanks for answering that, TIL that those options are already done if you use meson
No offence taken, thanks for the answer
Yeah I mean make is like assembly and meson is like idk, python
In terms of things you need to do yourself? Yeah that’s accurate
honestly just yoink it from the limine-c-template
^
meson does some other stuff
because it uses ninja aka the superior build system
does ninja itself do dependency tracking? i didnt know that
i thought meson generates a bunch of rules
Nah I think meson generates it that way
why tf did I not
allow for jobctl_setctty to return an error
(it should fail with EPERM if there is already a controlling tty and its not stealing)
Assert better, prove me wrong 
welp, went ahead and implemented ctty stealing
since login likes using that
I will probably have to do startwm as a setuid program
since xorg doesnt like it if you run it with euid != 0
also pretty much rewriting init from scratch and doing some improvements
well not from scratch but most of it
I will want to run most things as an user when I have this working fully
just finishing having startwm work as an user
very nice
I think I am going to add those tests to mlibc now to get the usershell stuff upstream and then try to port sudo or something
i wonder how much work it would be to bump all of your packages to sync them with vinix/gloire and use jinx 0.3
122 files in recipes/, 126 files in source-recipes/, 15 files in host-recipes/
hm on that topic, i wonder whether comments in /etc/shells have to be handled by the user of the function?
the /etc/shells on my system opens with ```
/etc/shells: valid login shells
/bin/bash
...
the manpage doesn't mention anything about that
i guess the first line would not be a valid field value in passwd anyway?
because of the : in the middle
interesting
but in another file it only does an strcmp
glibc seems to parse all the shells when opening the file for the first time, and seems to specifically ignore comments
i think the impl in mlibc should be fine though? musl does not do that for example
I love functions that aren't standardized!
the musl impl is basically the mlibc impl but more code golfed :^)
probably not, that'd be bad
if someone can write a bad entry they can just create a malicious user anyway
yeah
so i think the impl in the pr is fine
damn you still have separate sources
this sounds like a lot of effort
yeah its like, gonna take an entire day of full time effort to do that
nop
meson just tells ninja that the depfile will land at <path>
and thats the end of ther involvement
basically you do this https://git.sr.ht/~pitust/wwce/tree/8426d162165fa1834a3ef3e7c69ee831b6d04f71/item/x#L152
I think today I will port sudo/doas and also implement putgrent and fgetgrent in mlibc
Because useradd dies if you dont pass -N without those
And without them you have to manually create the groups for each user anyways
I do wonder how difficult itd be to port something in the likes of wine
Didnt managarm already run it
@carmine swallow is there anything super weird or specific needed for wine? I might try my hand at that some time in the future
at least I didn't run into anything weird when porting it to managarm other than needing to add a new os in signals_x86_64.c (or whatever file it is, I don't remember the name of it) which likely just consists of copying the linux code and adding your own call to a syscall that sets the gsbase
well there were funny mlibc signal memes but they are fixed by now
also its a good stress test for your filesystem drivers because it writes a decent amount of stuff
that's very likely the reason why it takes ages to start on managarm (and sometimes even times out)
Could be an interesting way to test my new vfs locking stuff then
Configuring and compiling gcc already weeded out some disk and ext2 bugs
Gonna look into it after finishing the stuff I have planned, ty
@grand shadow what IDE do u use and how do u set it up
vim and I dont
f
I literally just use whatever camr with wsl
lol ur on wsl too
i thought of booting into linux so i could use a proper ide at least
with astral
but idk maybe over wsl is possible too
wdym visual studio very normal ide
nvm
@grand shadow is there like a build lightweight or whatever
so i dont have to build 10 copies of gcc etc
Uhhh @robust geyser had some commands he used
make DISTROTYPE=minimal clean-kernel kernel initrd astral.iso run-kvm
lol
❯ make DISTROTYPE=minimal clean-kernel kernel initrd astral.iso run-kvm
find builds/astral/ -name *.o -delete
find: ‘builds/astral/’: No such file or directory
make: *** [Makefile:43: clean-kernel] Error 1
Dont need clean kernel
you need to ./jinx build minimalsysroot mlibc bash coreutils init distro-files vim nano mount netd
In thr first run
Yeaj
where did u get jinx
make jinx
make jinx
jinx
also @grand shadow what is the stance on timeouts in driver init code
thnaks
xhci controller halt should happen within 16ms but i dont want to a) spin b) block the main thread
omg is infy starting uGPU now on astral
no im not
im just porting uacpi to astral
BASED
lmao
why dont you want to block the main thread
idk it sounds stupid
are u writing something for astral as well
Meh it rly doesnt matter
so sleep in main thread?
create a new thread for that I guess?
lets goooo
/home/infy/Astral/jinx: 865: .: cannot open /home/infy/Astral/recipes/minimalsysroot: No such file
🤔
Theres no minimalsysroot recipe
Its distro-files
did you change that recently?
an xhci driver?
i had a brain fart
damn
xhci will be very useful (my ps2 code sucks)
so i replace that with distrofiles?
look at sched.h
Yeah
its already in the command so
Should also add astral there
i just copied one elements to the left accidentally
ah ok
Iyeah
perfect thank u
are there mutexes/events/work queues whatever?
i guess i can emulate it with events
and a separate thread
can u pin threads to a core?
Yeah
nice
sched_targetcpu then sched_yield
damn bro astral goated
To untarget run targetcpu with null
i just wish the code was a little bit cleaner
and u can make kernel threads right?
based
that then sched_queue it seems
if (shouldntstart == false)
sched_queue(thread);```
crazy code
i find lack of capitalization or underscores a bit hard to read but whatever
same
I never thought itd reach the point where other people would contribute lmao
that is fair honestly
Trust me it is better now than old astral
In old astral everything was much more disorganised
Working on lyre for like a month helped fix me
I hope I can get to a similar point to your OS at some point
there's a lot I still need to do to reach that point
Its trying to get nvme
use the 2nd boot option
Is there no initrd option for a console
Nit nvme virtio block 💀
It seems like youre focusing more on kernel design so when you do reach itll be more robust
I too, wishO OBOS could get to the point of astral
stupid slowfat driver is slowing me down 
its doing a thing
depending on how good resharper is with this project you might need to use clangd + this
compile_flags.txt
resharper? im using clion
provides auto complete, errors and whatever
nothing, it just works as it for me in vscode
though i should try clion
i see
I am focusing more on kernel design
i got a license so i shouldnt let it go to waste :^)
can I have it
Well my plan is roughly like this: first, the kernel, then my own userspace ecosystem, then getting mlibc and the "unix-like" world running in a protected subsystem / compatibility layer / whatever
if it wasnt in my name
I think it'd be pretty cool
@grand shadow no way to allocate a dma buffer?
what kind of buffer do you want
xhci wants a bunch of small things, didnt want to have to waste whole pages for it
i guess i could calculate how much physicala memory i need for all buffers and allocate all pages at once, then bump
or throw a bunch of pages at it and call it a day
@robust geyser so what exactly did you do for vscode configuration?
just that one file
like i opened the project dir, now what
along with the clangd extension
i placed the file at project root (next to Makefile)
its not proper language support but it gets the job done
oh yeah that works i think
most notably jump to implementation doesn't really work unless you have the corresponding .c file open
i just takes you to definition instead
its because there is no compile db
its usually generated by cmake/meson
the compile_commands.json file
make astral use meson 
I found some tool that can convert a makefile to a compile_commands.json
bear yeah
but astral is built inside jinx
and i dont want to know, or even try
i have a feeling this would fail terribly
strange because go to definition does work
czapek@raptor-wsl:~/new-sources/Astral$ bear -- make DISTROTYPE=minimal clean-kernel kernel initrd astral.iso run-kvm
find builds/astral/ -name *.o -delete
find builds/astral/ -name *.asmo -delete
rm -f builds/astral.packaged
rm -f builds/astral.built
./jinx build astral
* building package: astral
/home/czapek/new-sources/Astral/.jinx-cache/rbrt: execvp() failure at line 351: No such file or directory
make: *** [Makefile:40: kernel] Error 1```
lmao
yep, beacuse they are in headers which it can index (it has the include paths)
but it doesnt know about all the source files, except the ones that are open
ah ok
so jump to implementation will only work with those
yeah thanks
@grand shadow soo your acpi stuff currently lives under arch/x86_64 for some reason, mind if i move it out of there?
or at least most things releated to acpi
I do that in the virtio net driver
Multiple page allocations are to be avoided BUT during system init Id say its ok
Yeah sure idk why I put it there either
also like
would a drivers/ directory be ok?
maybe iretq can put their stuff there as well
put it in io/acpi/
intreresting
im just going to allocate single pages for now, simplifies init a lot
My pmm is a linked list of struct pages
But I can iterate through them to find ones that are adjacent in physical memory
maybe ill come up with a small dma allocator that can be generalized for the rest of the system
Could be helpful
i need to allocate a bunch of small structures in physical memory, like pointer arrays
so yeah it would cut down memory usage a bit
but its not the end of the world
ill look into that maybe too, i like going and improving random things and this could be improved :D
one thing at a time tho
i want to do everything but if i do then i end up not doing much
I already do that
Its just not recommended outside of driver init code as I dont really support taking pages from the page cache while doing it
seems like sudo wants some mlibc stuff stubbed
@grand shadow is there no way to sleep from a kernel thread?
There is?
What r you trying to do
i only found this
You prepare the sleep then yield to actually sleep
so i have to call 4 functions to sleep?
prepare, target, insert, yield
insert?
Thats for a timeout but yeah
i just called sched_sleepus
otherwise its just infinite sleep?
oh
Target is for the timeout too
thats a thing?
Yeah
nvm
I should prooobably write some docs sooner or later lmao
did u also forget it existed?
I didnt know what you were trying to do
I thiught you wanted to wait on an event with a timeout or something
i mean idk how u can explain it better lol
sched_preparesleep prepares the thread to sleep
And sched_yield() blocks it
Anything else is just support for stuff like timeouts
yeah i get that
i really like the way it works
Useful if you need to release locks and stuff before sleeping but these locks also protect the object youre sleeping on (like a semaphore/mutex)
that makes sense
@grand shadow whats the reason that you currently map tables using vmm_map and not MAKE_HHDM?
I don't map them when mapping the hhdm
since IIRC their entries aren't guaranteed to be page aligned
so can cause issues
in real hw
cant u just round down to nearest page
I mean multiple entries could be on the same page and I assert the vmm_map that maps the hhdm
vmm_map with VMM_FLAGS_PHYSICAL shouldn't even take that much space anyways
does vmm_map support non-page-aligned physical offset?
kind of

