#Astral

1 messages · Page 20 of 1

bronze nexus
#

rivtard world rain

regal stone
#

i hate wacatac

wild marsh
#

i wonder what the detection heuristics are for wacatac because i've seen it be detected as a false positive a bunch of times

grand shadow
#

if (download.is_kernel && download.kernel_is_good) detect("wacatac");

analog berry
bronze nexus
#

Wacatac is apparently a class of malwares and not a specific thing

#

That'd also explain why there are so many false positives of it.

grand shadow
#

got it to do a full build with the patches gcc, now it is time to update mlibc and do another clean build

#

my laptop probably wants to cry

grand shadow
#

almosst done, compiling wine

grand shadow
#

oh no

#

xterm stopped working

#

and so did me launching serial

#

did login stop working as well

#

ok I dont think its that

#

oh no it is that

#

creating /var/run makes it work

#

why would it not display an error though?

#

yeah creating that makes xterm also work

#

so weird though, that it makes both hang

bronze nexus
#

Smells like something is missing error handling

grand shadow
#

time to go through the ports and see what works still works

grand shadow
#

as ^C still kills the process

#

sudo is broken, doesnt seem to have setuid bit

bronze nexus
#

I don't like the concept of suid

#

I'm literally not gonna add it to my kernel

grand shadow
#

seems like dns is also borked

bronze nexus
#

Damn, what changed to break all this shit?

grand shadow
#

I updated mlibc and patched gcc 💀

#

its probably the mlibc update, I was like a good year behind I think?

bronze nexus
#

Mlibc regressions 💀

grand shadow
#

it does seem that just dns is down

#

gotta figure out if its my udp or something else

#

it used to work

#

seems like it is just the dns issues

#

tested the other ports

#

su also does not work

#

I think this doenst work more cuz of the jinx update

#

hm

#

yup

#

lets see how gloire handles this

#

oh they dont

grand shadow
#

had to port xbps and will do post install hooks for this

grand shadow
#

in a side quest to implement advisory locking now

#

so that xbps can run so that I can do post install hooks so that I can fix sudo et cetera

fleet osprey
#

next side quest: fixing PS/2 troll

cyan junco
bronze nexus
#

Getting superuser will be done by talking with init to get it to spawn a privileged process.

bronze nexus
grand shadow
#

My todo list rn is finish advisory locks, get xbps working, add post install hooks to a bunch of packages which need it, figure out why dns stopped working and then continue whatever I was doing

#

Small derailing

#

Worth

fleet osprey
#

small derailing from the end goal of fixing PS2 trl

grand shadow
#

one day a deity will descend from the heavens and deliver a pr for a perfectly working ps2

fleet osprey
#

also please excuse the godawful code style

#

I don't write code like that anymore

#

this is old code

#

also since I was a fucking dumbass and decided that writing code under a custom license was somehow OK - you can use that code under whatever license for whatever you want

#

(if you do decide to use it or parts of it, for whatever horrific reason)

grand shadow
#

alright, I think I got advisory locks implemented

#

time to see if everything explodes

#

ewww stop doing permission checks I am your creator you must respect me

#

oh woops, forgot to add flock to the mlibc sysdep

#

nope, borked

#

me when I forget to intiialize variable

#

it ran but gpf'd while closing a file, likely due to the advlock

grand shadow
#

I need to get this to run on the first boot now

#

xdddddd

#

there we go

#

I might want to just pipe that into a logfile, though

#

and if I run it again it does not run

#

perfect

#

there we go

#

and the xbps-reconfigure logs will be in /var/log

#

now I just gotta write the post install hooks

#

I'll do that tmr

#

and then I gotta see what broke dns

prime juniper
#

Nice work

grand shadow
#

@prime juniper mr port man I have a mlibc related question, does mlibc support vdsos

#

I looked into rtld and it seems like it only prints the value of the auxval

sharp carbon
#

upstream does not but depending on your style of vdso (is it required to make syscalls (hard) or only an optimization (easy)) it's relatively easy to add

grand shadow
sharp carbon
grand shadow
#

Oh seems simple enough

#

Thank you monkuous

sharp carbon
#

unlike linux's, hydrogen's vdso is listed in DT_NEEDED and uses unique symbol names not provided by any other objects, and for that usage style it works correctly

#

but idk how that code interacts with vdsos that aren't listed in DT_NEEDED (does it get inserted into the symbol resolution order at all? if so, where?)

sharp carbon
grand shadow
#

It would be interesting to have upstream mlibc vdso support with jinix being a thing now and other hobby kernels looking into it

opal lotus
#

@sharp carbon KEKW

sharp carbon
#

yeah yeah i know

grand shadow
#

If I get the hooks done today depends on that the bf wants to do

grand shadow
#

that is done

#

gotta figure out what broke dns now

#

ok so mlibc expects an /etc/services now

#

and if that is not present it just does not do dns

#

ugh

#

I mean its in posix so I gotta

carmine swallow
#

even windows has etc/services (and etc/protocol + etc/hosts) in C:/Windows/System32/drivers/etc/

grand shadow
#

there we go that works now

analog berry
#

Damn

#

Will astral be the only hobby os with a working chromium port at this pace

#

I wonder what you're even missing for that

#

Well DRM I guess

bronze nexus
#

It's really in outer space compared to the other OSes trl

analog berry
#

Real

grand shadow
#

theres kernel work to do but I will take a small detour on a lil project

grand shadow
#

nvm this too cancer

#

will do another day

fleet osprey
grand shadow
#

So true

#

I will do some mlibc sysdep work now, make some scheduling and smp syscalls etc

grand shadow
#

for getcpu I will just probably use rdtscp

#

actully taht could be intel specific hm

#

lemme check the amd manual

#

wait no I'm dumb I think its on both

#

vdso looking mad fine rn

#

might just query cpuid for it in __mlibc_entry and if it is present go through the fast path

grand shadow
#

nah just gonna keep it simple and slow

grand shadow
#

or nah I'll do that another time, just implementing getcpu

grand shadow
#

noooo updating mlbic seems to have broken links

#

@prime juniper what does sys_inet_configured search for exactly?

#

just if its running with ipv4 or ipv6?

prime juniper
#

I’d need to check

#

One sec

#

Seems like it

#

Tho it does some rtnetlink stuff in our sysdep

#

@formal patio might know more

grand shadow
#

I guess I can just hardcode it ipv4 = true

#

I dont support nor do I plan on supporting ipv6 for quite a while

#

otherwise I would have to implement a way to iterate through interfaces and check if those interfaces have an ip assigned to them from netd

#

and I refuse to implement netlink

#

yeah it really doesnt matter if theres no interface configured it'll just get a routing error in its face cuz of no route in the ip tables

formal patio
#

So if you have no link up or should return false

formal patio
#

rtnetlink is good tho

#

Better than any other of the cursed interfaces for that that I have seen so far

grand shadow
#

oh well

#

if it breaks something in the future I do that otherwise wawawawa

#

added it to the mlibc pr as well so I do not have to keep it in the local patch

grand shadow
#

I should finish setting up xbps and see if I can download and install a package

grand shadow
#

its all dns

#

non recoverable resolver failuyre

grand shadow
#

syscall return: pid 41 tid 42: 18446744073709551615 EAFNOSUPPORT (956 cached pages, 501055 free pages)

#

proably uz of this

#

oh right, I dont think I have special stuff in the type field

#

like cloexec

#

BROTHER I AM RUNNING AS ROOT

#

lmao

#

astral too secure

robust geyser
#

x86_64-repodata btw :^)

grand shadow
#

oh woops ty

#

this is so weird, no syscall in that process fails with EPERM

#

oh seems like xbps does return EPERM itself for some functions

#

oh right I'm blind

#

certificate veritfication failed

#

wait I dont think I install the certificates in the minimal distro

#

5head moment

robust geyser
#

can't wait to be able to install astral from a live usb

#

you should port dosfstools and e2fsprogs :^)

#

also something you can use to partition the drive

#

then you could do a full astral install from within astral

#

which would be very cool

grand shadow
#

I got e2fsprogs and I plan on porting parted

#

though I still need a fat driver for the efi boot partition and some real nic driver

grand shadow
#

astralbros we are so back

analog berry
#

Damn

neon crane
cyan junco
grand shadow
#

wtf windows supports /proc real

cyan junco
neon crane
cyan junco
#

and it alaways fallback to the commands stuff

grand shadow
#

maybe I could start adding some stuff to proc

analog berry
#
$ cat /proc/gdt
$ ... OK
grand shadow
#

REAL

grand shadow
#

I do wonder, how does procfs handle say, a process doingle multiple reads of the same file

#

@analog berry linux man do you know

#

like reading half of it and then the other half

sharp carbon
#

iirc it prints the content into a kernel buffer on first read and then returns from that buffer

analog berry
#

havent looked into the vfs and that stuff at all yet

pine ledge
sage locust
#

real

pine ledge
sage locust
#

that's a decent pick

grand shadow
#

fixed a bug in vionet that randomly broke networking

#

the bug?

#

a typo.

#

I typed tx instead of rx

#

fml

#

spent like 3 hours looking for the bug

#

but now! networking seems perfectly stable

#

I wanna see what error jinx makes

#

awwwww

#

it doesnt explode it just says fuck off

fleet osprey
#

absolutely unacceptable, we need Astral support in Jinx trl

grand shadow
#

uploading all package files I have to the repo

#

so that theyre there if needed

#

ig that means astral has working package management now

#

yippe

grand shadow
#

it is a bit slow but it does work

#

aghhh this is so cool

#

installing xorg :3

sage locust
#

that's really cool

#

@grand shadow update Jinx, i upstreamed a new release :3

#

it makes it faster and whatnot

grand shadow
#

yippieeeee it did work (after some trial and error to find out which libs to install... I really need to make an xorg-base meta package or something)

grand shadow
sage locust
#

gn then lol

grand shadow
#

gnnn

fleet osprey
#

(I do this often)

grand shadow
#

currently working on a parted port

#

forgot to update jinx, will do it tomorrow

grand shadow
#

mlibc did the thing

fleet osprey
#

lmao

grand shadow
#

well damn, locale being a stub in mlibc just breaks a very specific part of parted

#

fucking atari-fdisk

#

noboduy will use that

#

so I am just removing the init functions!

#

okay I got into a prompt

#

funny

#

%P terminator

#

fucked up?

#

(C99; not in SUSv2) For a conversion, the double argument is converted to hexadecimal notation (using the letters abcdef) in the style [-]0xh.hhhhp±; for A conversion the prefix 0X, the letters ABCDEF, and the exponent separator P is used. There is one hexadecimal digit before the decimal point, and the number of digits after it is equal to the precision. The default precision suffices for an exact representation of the value if an exact representation in base 2 exists and otherwise is sufficiently large to distinguish values of type double. The digit before the decimal point is unspecified for nonnormalized numbers, and nonzero but otherwise unspecified for normalized numbers. 
#

this is the only thing I found where P is mentioned

#

wait no

#

tomorrow I'll debug this more

sage locust
#

insans

grand shadow
#

I am just a parted port, dosfstools and a fat driver away from having this be able to install a distro of itself, exciting stuff

#

Maybe even only a parted port if I do mbr troll

robust geyser
#

you still need the fat partition for limine to load limine-bios.sys from

#

and the config

#

and the kernel and everything

grand shadow
#

Wiay I thought lime went back to supporting ext2

robust geyser
#

unless you go with grub, but i don't remember astral having mb2 support

grand shadow
#

Did that change again

robust geyser
#

a long time ago

grand shadow
#

Damn

grand shadow
#

oh wait this is decimal 50

#

I was looking at hex 50 oops

#

its complaining about the %....2

#

that does seem like a valid printf?

#

example from man 3 printf: %2$*1$d

#

ughh this is gonna be fun

#

oh wait seems like mlibc only handles it in scanf

#

well """handles"""

#

as in, stubs meme

#

actuall wait

#

my frigg is probably like outdated as hell

#

maybe its been implemented in printf

#

wait no in frigg it seems to be handled but is breaking somehow?

#

oh yeap

#

seems like even after upgrading frigg it still dies

#

oh thank you beos devs

#

gonna open a mlibc issue for this so someone smarter than me can figure this out

#

what does bro want me to do

#

something is very wrong here

#

maybe its buggy cuz I dont have it working with readline let me try with it

grand shadow
#

still buggy, time to see whats it even reading back from that scanf

#

surely mlibc's scanf supports %lf?

#

wait does mlibc scanf not even support %f

#

💀

#

oh wait I do remember, it was blocked on them trying to decide which library to use to handle the float conversion..... and it has been so for years now

#

genuinely considering dumping parted and just doing util-linux fdisk at this poin t

#

or writing my own

#

or I could also add a very barebones %lf support to mlibc locally

#

yeah doesnt seem to bad

#

float/double/long double tmp = 0;
float/double/long double div = 10;
get characters until dot or null
if not dot then tmp = tmp * 10 + digit
if dot then tmp = tmp + digit / div, div *= 10

#

then set the pointed address passed in scanf to tmp

grand shadow
#

small detour to implement that

#

still not working on real disks though, need to check my port

#

as one last test I will add a second disk, add a gpt to it, add a partition, and install bash and chroot into it

#

then I go eep

fleet osprey
#

imagine sleeping troll

#

couldn't be me

grand shadow
#

damn, it all worked until xbps-install

#

it just doesnt want to work with a --rootdir for some reason

#

maybe I'm misunderstanding that option

#

figured it out ig?

#

seems like you have to copy the keys and the xbps config before doing the command

#

and that works

#

so yeah it is that

#

ugh to lazy to do everything now

#

at least I know about that xbps thing for an eventual installer

grand shadow
#

@carmine swallow I do wonder if the missing float handling in scanf is the reason why mlibc factorio does not wotk

#

It also causes parted to not work, xclock to not tick (and anything from xorg with float configs really) and xscreensaver-gfx to segfault

#

I wonder if thats also why fvwm had those funky windows, I didnt really boot into the wm since adding that patch

grand shadow
#

did some more mlibc work, now finishing the float conversions to (hopefully) be able to upstream

grand shadow
#

okay that is doneish

#

after my other pr is upstream I will open a pr for this

#

time to see if I can get meson and ninja ported

grand shadow
#

ok I got ninja but still trying to figure out meson

grand shadow
#

omfg this is so stupid

prime juniper
#

Yeah I’m not looking forward to packaging python modules

robust geyser
#

also i think i made a function for packaging perl modules if you ever need that lol

grand shadow
#

we do a little

#

wait FUUCK I have to get the linux headers in too

#

thank you scritps folder for the get linux headers script

#

trolled

#

guess I gotta port xz

prime juniper
prime juniper
grand shadow
#

Yeah was super quick

#

Though cant finish what I was doing cuz uni

prime juniper
#

Real

grand shadow
#

Wonder how difficult it is to get mesa and virtio gpu accel working

#

If that needs drm then boooring

#

Damn it do

analog berry
#

For accel

grand shadow
#

udrm when

#

I might take a look at it some time in the future then

#

At least for virtio gpu accel

hearty fulcrum
grand shadow
#

Becoming the thing I swore to destroy :(

bronze nexus
#

I'm still wondering if it'd be possible for me to contribute this kinda thing to the OSDev community, but my Rust codebase would make that hard to do

#

Not that I'm at DRM yet at all

opal lotus
#

use lil

#

:3

grand shadow
#

I need to see what causes unpacking a tar archive to take this long, in theory it should all go straight to the page cache

#

but unpacking the linux source is being sloow

#

espeiclaly when it gets to drm

sharp carbon
#

probably file creation speed if I had to guess

#

the classic lots of small files is slow thing

formal patio
#

just implement profiling infra ultrameme

#

profiling stuff on managarm has revealed many unexpected timesinks, some of which turned out to be avoidable

grand shadow
#

okay I think I found the issue

#

oversight on my part when implementing ext2

#

when growing a file I actually allocated the blocks instead of just creating a hole in the end that would get filled later

#

so the later reads would read the page fo the disk from there instead of memseting a page to zero

grand shadow
#

BRUHHH

#

I waited all this time

#

for this

#

its stable but there is something slowing it down

grand shadow
#

I need to figure out what causes it to slow down so much after a while

proper meteor
grand shadow
#

I can take a look later

#

I do think its how Im hashing the vnode, offset for the cache table

#

Ill confirm that in a bit, gotta cook lunch

grand shadow
#

ok it is 100% the hashing I just need to do a field test by checking how many entries are put in every bucket

grand shadow
#

nvnm

#

I think it was just filling up the 2gbs of memory and having to do more disk io

#

linux does use a few gigs

#
  • the other stuff
#

ah I'll figure that out later I want to see if I can compile mlibc

#

so I'll add the headers to the sysroot and then port rsync

proper meteor
grand shadow
#

so meson runs but dies

#

dying on scandir makes me thinkg it is passing too small of a buffer to readdir

#

but meson does still seem to be kind of working and complaining

#

does not seem to be that

#

syscall log is needed, then

#

also it really wants sbrk() for some forsaken reason

grand shadow
#

I have been spending time with bf so havent looked into it

#

Tomorrow the fun resumes

#

I also wanna look into getting a fatfs implementation running

neon crane
#

if he's also a programmer he could join

proper meteor
grand shadow
#

I dont think theres any code off the top of my head that sleeps on a semaphore but has a timer

#

Unless its like an userspace timer, which just gives it an interrupted reason and sends EINTR down

grand shadow
#

Hes gonna get in cs next year

neon crane
#

is he younger than you?

grand shadow
#

He was doing physics then switched to math then wants to switch to cs now

proper meteor
grand shadow
#

I feel like working on a fat driver so I will put the mlibc compile stuff on hold

#

gonna do a driver for fat{12,16,32}

fleet osprey
#

NTFS driver when trl

proper meteor
#

Idk anything about fat

analog berry
#

vfat is just an extension that applies to all fat widths

grand shadow
#

Yesterday I got the typedefs and defines and stuff done, now Im going to actually do the fat

#

Start with mounting, dir traversal, fat traversal, etc

#

I wrote a fat32 implementation to lyre many eras ago and so I know what to expectish

proper meteor
#

is it hard to do?

#

like, compared to ex2

grand shadow
#

This will hopefully be the final stretch before an installation program

#

Its not that hard, but I think ext2 js easier

#

Especially for integrating in the vfs

sharp carbon
#

imo it depends on how advanced you want the driver to be

#

a basic fat driver (no lfn, bad performance) is easier than a basic ext2 driver

#

but a good fat driver (lfn, good performance, etc) is harder than a good ext2 driver

proper meteor
#

Terrible

#

what's lfn btw?

sharp carbon
#

long file names

#

aka more than 8 chars before the last dot and/or more than 3 chars after it and/or mixed case names and/or Unicode names

analog berry
proper meteor
#

thx

opal lotus
#

gnu tar has the same concept i think

grand shadow
#

I do plan on supporting lfn

#

Good performance is relative meme

formal patio
#

it can be a surprisingly large hit

#

we've noticed that on managarm where our block allocation on ext2 was suboptimal but that lead to severe issues in some circumstances

#

optimizing placement + flushing of the bitmaps basically made writing out a coredump go from 60+ sec to sub 100 ms

grand shadow
#

I always forget I actually implemented permissions

#

so I jsut get jumpscared

#

😭

grand shadow
#

did more fat work, working on directory parsing

proper meteor
bronze nexus
#

obese filesystem

opal lotus
grand shadow
#

I am still pondering whether I should port openrc or keep my simple init

#

having a more complete init system would be cool, but also having to implement more linux shit that openrc would likely expect would be ugh

#

I mean it runs on bsd so cant be THAT bad

fleet osprey
#

it runs on BaSeD chad

opal lotus
#

i am porting openrc because i actually implement linux interfaces

high whale
#

systemd demons

grand shadow
#

some progress

#

why is it yellow? idk I'll find out tomorrow

grand shadow
#

So excited for when I get fat to fully work and can write the install script finally

#

Then its a matter of writing a bunch more drivers for real hardware and forcing people to install astral troll

#

I dont have any real hw NICs and the only real disk driver is nvme

analog berry
#

damn the year of astral desktop is close

grand shadow
#

I think for the installer Im just gonna install a base system (maybe offer both a networkless and networked install images) and have that base system have everything to xbps-install more packages

#

arch astral

analog berry
#

yeah thats nice

analog berry
robust geyser
#

first os here to ship an iso you can use as an installer

#

that would be sick

analog berry
#

the one in basic iirc

robust geyser
#

ok but that one took every shortcut you could take lol

analog berry
#

ig

robust geyser
#

astral makes no compromises

analog berry
#

astral probably has the most ports of all

#

and can build itself

robust geyser
#

yeah :^)

#

can't wait for linux namespaces support so you can build the full distro on astral itself

grand shadow
#

Self hosting work stopped on mlibc, meson ran into some issues which I didnt debug because I wanted to get fatfs

#

But gcc and binutils and many other things do build just fine

#

Including the kernel

#

So clearily, I blame this on managarm picking a bad build system :^)

proper meteor
#

but my installer is not great

proper meteor
hearty fulcrum
#

no u

robust geyser
proper meteor
#

makes sense

grand shadow
#

Its mostly for limine, I dont have xhci

#

And if I were to use a filesystem for the usb itd be ext2

neon crane
#

just load it into RAM?

grand shadow
#

The base system is not that big

#

I do have to write a usb stack at some point (or force some poor soul to do it for me)

analog berry
#

I wish someone made a uUSB

grand shadow
#

I also still need to unfuck ps2 :^)

analog berry
#

Yeah lol

#

I might do at least ps2 since that's at least not that much code

hearty fulcrum
analog berry
#

You picked the name, now all that's left is code meme

flat copper
#

unironically you can calamares for installer :^)

prime juniper
#

It’s what I’ve looked at for Managarm at one day

opal lotus
#

@grand shadow do you have a CI running for xbps packages

#

or did you simply upload the packages to the server

robust geyser
#

the latter

grand shadow
#

Yeah I simply uploaded, its not something super nescessary for now

grand shadow
#

more progress

#

almost done with read support

grand shadow
#

rotund filesystem

#

fat12 and fat16 work, fat32 seems a bit borked so figuring out whats going on

#

oh right, forgot to set some metadata for the root cluster

bronze nexus
#

Wait you didn't have FAT yet

grand shadow
#

no

grand shadow
#

alright, fat32 works now, had a super stupid typo

#

so that is a working fat read-only driver

#

still gotta do write and optimizations

#

but thats a start

grand shadow
#

I am inching closer to getting write working, been busy

#

after that I will upstream some mlibc stuff

#

that has been sitting around for a while and I've been meaning to upstream

grand shadow
#

you know, why is fsinfo a thing if the data there is not guaranteed to be right

#

ugh

#

I love fat

grand shadow
#

alright, I got it to be able to cp /usr/bin/neofetch /mnt/EXISTING_FILE

#

dosfsck complains about freeing unused clusters, so I gotta check whats up

#

oh wait it could be because I am not writing to all fats

grand shadow
#

alright, dosfsck is happy now

#

so I think file read/write is done

#

just need to do directories

#

which I will do tomorrow

neon crane
analog berry
#

my bootloader readonly fat driver is like 2k

prime mulch
#

and fat12/16

neon crane
#

meanwhile nanoshell's read+write ext2 implementation looks like this

bronze nexus
#

loc != complexity

neon crane
#

sure

analog berry
grand shadow
#

its not the best thing in the world, I'm gonna optimize it more when I'm done with making it read/write without exploding

proper meteor
#

Astral running on a satellite when

#

cubesat

hearty fulcrum
grand shadow
grand shadow
#

time for directory operations

#

still missing those

#

link I just have to support linking a file with no disk dents

grand shadow
#

there were some troubles with long filenames that are now resolved, and I have written a function to create a dent in a dir

#

just gotta glue it and I will have create and link

neon crane
#

so ENOTSUP time

grand shadow
neon crane
grand shadow
#

Something like that can work in my design

#

Since I pass vnode pointers and the final pathname

#

So you could use linkat with AT_EMPTY_PATH to relink it at the same filesystem without a loss of data

#

Obviously wouldnt work across filesystem boundaries

#

And the file data gets released on a refcount == 0

grand shadow
#

some more progress

#

yes, I did mispell long

#

yes, fight me

fleet osprey
#

🔥

#

now implement Xbox FATX support trl

grand shadow
#

fat64 support for large disks

#

this does impress me as to how neofetch manages to be a big shell file

#

shit uses over 200kb

fleet osprey
#

this is why fastfetch is better KEKW

grand shadow
#

I think VOP_CREATE for fatfs is done

#

tomorrow I will do VOP_UNLINK and VOP_LINK work

#

and VOP_INACTIVE as well to go with VOP_UNLINK

#

which will leave just VOP_RENAME leftr

grand shadow
#

Did some unlink work, it works perfectly with short filenamew. Havent tested a long filename dent yet

grand shadow
#

Hoping to get fat work done soon so I can work on something akin to a install util (or at least for now install instructions like the gentoo manual) and then go back to doing self hosting work

#

Though if I ever want this installable on real hardware Im gonna need at least a not shit ps2 driver, ahci, some nics and maybe xhci

#

Contributions welcome meme

grand shadow
#

only two major functions left

#

will do that at some other time

#

then do the few remaining TODOs I feel are important, then do some more hands on testing aka install limine and boot out of it, and then optimization time

#

but glad to see fat working

#

gonna be real exciting when I cook up a install manual

grand shadow
#

VOP_RENAME is done

#

and I did VOP_SYNC in the meantime

#

so all of the vfs glue has been implemented

#

time to try something fun out

#

but for that I need to port dosfstools

analog berry
#

Damn

#

How big is the driver now

#

And how do u generate inode numbers

grand shadow
#

but since fat only allows one hard link per file, I use the offset of the directory entry on disk
this is to keep it consistent with readdir() without having to allocate and keep the readdir() vnodes in memory

#

of course, if the file gets rename()d it breaks

#

but blame the filesystem for being shit

grand shadow
analog berry
#

Idk supporting 32 bit kernel builds at this point seems dumb af

#

32 bit userspace I guess, but the kernel is pointless

grand shadow
analog berry
#

Tiny

grand shadow
#

I'm still missing some optimizations so like

#

yeah

#

but it does work

analog berry
#

Do u cache fat chains?

#

I cache vectors of contiguous spans in my driver

#

So best case is one entry, worst case is entry per block

grand shadow
#

I dont, at most it uses the page cache on the disk to at least not have to read the disk every next cluster

analog berry
#

Oh well I guess that works

grand shadow
#

I am not super worried about making it very fast, since at most it'll be used as the boot partition and maybe to move stuff in a usb drive when I get an xhci driver in a trillion years

analog berry
#

Still kinda nice to abuse the fact that most files will be contiguous so u save tons of cycles and also have fast binary search lookup

bronze nexus
#

Every time a VNode is opened, I just atomic_fetch_add a fake ino counter

#

And rely on the namecache for making sure VNodes are opened only once

analog berry
#

So if you reboot the PC all inode numbers are gone?

bronze nexus
#

Not just reboot, even dropping the last FD to a VNode will change the ino

analog berry
#

☠️

bronze nexus
#

But here's the kicker: It's FAT and I only need it for bootfs so whoms't care

analog berry
#

I guess

bronze nexus
#

it does not violate POSIX semantics if you ignore the part where a file will have its ino changed even though it's still the same file

#

It's also pretty unlikey an application will rely on checking the ino but not opening the file and getting confused when it checks the ino again

#

Which would be vulnerable to that race condition with proper POSIX vfs anyway

grand shadow
#

what the fuck is parted cooking

bronze nexus
#

I forgot who suggested it, IIRC hyenasky did. Fixed all the problems I was having with FAT and ino

scenic epoch
grand shadow
#

wuh

#

why is there a hardlink to

#

ld

#

ld.bfd

#

and why did this only happen after adding parted

#

on ubuntu this is not a hardlink

#

oh according to blfs it is a hardlink

#

ah whatever

#

I will just implement the vfs_link call in initrd.c

#

oohohhhh

#

I just never put binutils in the initrd before?

#

no I did

#

but now theres a package that pulls it

#

what

#

I'll add verifying if libuuid really needs binutils in userspace to my todo list

scenic epoch
#

also this seems like a cool project

#

can it run doom? trl

grand shadow
#

I am cooking I am cooking

grand shadow
scenic epoch
grand shadow
#

can run quite a lot of things

scenic epoch
#

you have achieved peak

grand shadow
scenic epoch
scenic epoch
#

x11 flobsh

#

wait is this wine

grand shadow
scenic epoch
#

wine is peak

#

port qemu on it you'll get something somewhat self sustaining /hj

fleet osprey
scenic epoch
#

just run linux on qemu trl

grand shadow
#

so true

scenic epoch
#

true indeed

#

especially if you got audio wifi and bluetooth drivers

grand shadow
#

I wish I could update the screenshot on the thread, that one is not even this current iteration of the os

scenic epoch
grand shadow
#

audio was being worked on by qwinci but that is now deep in pr limbo

scenic epoch
#

they probably expected forums to be used like actual forums as in like ask question, receive answer

#

definetely not long term

grand shadow
#

I AM COOKING

scenic epoch
#

nice tho

grand shadow
#

cooking

grand shadow
grand shadow
#

oh wait I gotta update the packages in the repo, been a while

grand shadow
#

RAHHHHHH

#

forgot to add the kernel to the xbps install command oops

#

unpacking stuff......

#

I forgot to pass the flag to xbps install to not configure the packages so some stuff like sudo mkight be missing setuid

#

but a system there is!

#

and the kernel

#

time to try to install limine to that disk

#

oh yeah I can also chroot

#

aghh I'm just so excited

#

this is so cool

#

how the fuck

#

I copied it from the /usr/share !!!

#

maybe it corrupted or something?

#

oh it is all zeros

#

I think I forgot to sync

scenic epoch
#

wait

#

are you running linux now

grand shadow
#

no I'm trying to install astral to disk

scenic epoch
#

oh

#

i thought you were emulating linux

grand shadow
#

I partitioned, made the filesystems, installed the base systems thru the package manager and now I am having some issues

#

nah

#

ok yeah I defo forgot to sync the fat fs

#

I'll just reformat it

#

HAHAHAHAHAHAHAHAHAHAHAHA

#

first boot of an astral install

#

that has been installed from the package manager

#

with the partitions made in astral

#

and the filesystems formatted in astral

#

gg

#

and the bootloader installed from astral

#

@sage locust look limine works in astral

#

and xbps seems to be working from the new install, installing gcc

#

oh oop I think that sync I forgot finally caught up to me

#

tomorrow I will do this again

#

and document all steps needed

scenic epoch
#

YOOOOOOOO

#

now make it automatic

#

muahahHAHAHAHAHAHAHAHAH

grand shadow
#

Im still thinking about the init system stuff, I might port sysvinit

#

I am slightly familiar with it and its much less linux specfic I think

#

Compared to something like openrc

robust geyser
#

limine 8.x holy

#

amazing job tho

#

you should implement shutdown :3

grand shadow
#

though its named poweroff instead

#

it does the normal SIGTERM wait 5 secs SIGKILL sync poweroff

#

(in init)

#

poweroff itself writes to /tmp/.initcmd

#

which is a fifo read by /init

grand shadow
fleet osprey
#

last updated when I updated the config file KEKW

#

do I need to become the certified Limine Updater for Astral

grand shadow
#

I dont have the patience to update userspace stuff so prs always welcome :^)

fleet osprey
#

tossed it onto my todo list

#

I'll get back to you in 3-5 business years

#

(said list is over 100 lines long)

sage locust
#

damn awesome!

prime juniper
#

Else I wouldn’t mind doing it (but time)

grand shadow
grand shadow
#

okay so, from what I remember from yesterday, the install process is:

#

format disk with an astral partition and a boot partition:

parted /dev/DISK
reboot

set up networking:

netd INTERFACE

make filesystems:

mkfs.ext2 /dev/DISKp1
mkfs.fat /dev/DISKp2

mount them:

mkdir /mnt
mount -d /dev/DISKp1 /mnt ext2
mkdir /mnt/boot
mount -d /dev/DISKp2 /mnt/boot fatfs

prepare xbps in the new root:

mkdir -p /mnt/usr/share
mkdir -p /mt/var/db/xbps
cp -r /var/db/xbps/keys /mnt/var/db/xbps
cp -r /usr/share/xbps.d /mnt/usr/share

install the base system:

xbps-install --rootdir /mnt -S -y astral mlibc bash coreutils init distro-files vim nano mount shadow sudo xbps net-base neofetch limine dosfstools e2fsprogs

chroot into the installed system:

mkdir /mnt/dev
mount /mnt/dev devfs
chroot /mnt
source /etc/profile
cd

write a limine.conf and copy required limine files to /boot (from now on using bios mbr):

cp /usr/share/limine/limine-bios.sys /boot

install limine

limine bios-install /dev/DISK

and at last:

reboot
#

I need to add some sort of command to allow you to not need to reboot after partitioning

#

like an ioctl on the raw disk or something

#

I remember the linux parted port having something like that

#

I should also probably make a base system metapackage

#

maybe make a sort of xbstrap script like arch has pacstrap

sage locust
#

xbstrap you say?????? :p

grand shadow
#

holy shjit mnaganarm reference

hearty fulcrum
#

lmao

grand shadow
#

time to try these steps

#

I really gotta make syncing faster

#

maybe have more worker threads that just do the i/o

wild marsh
grand shadow
#

since the --rootdir argument uses the stuff from inside the sysroot

wild marsh
#

ah

#

just ship a tarball to extract into the rootfs :^)

grand shadow
#

I mean gentoo does that

#

and void has an option to either do the config copy or tarball

#

either way, the install instructions work

#

just installed a perfectly working system and ran xbps-install gcc inside it

#

20 minute video and like a good chunk of it is syncing disks 💀 I really need to make that faster

robust geyser
#

it's an interface that parted uses to tell linux about partition addition, deletion and size changes

#

but if you don't want to support linux specific things maybe you could add support for astral in libparted, idk how hard that would be

grand shadow
robust geyser
#

ah that makes sense lol

#

you're probably familiar with what's needed for partition probing then

sage locust
analog berry
#

very nice tool

#

also nice for finding fs bugs ig

grand shadow
#

Will keep in mind ty

analog berry
#

but the progress you've achieved is crazy still

#

literally maybe some speedups + drm and its daily drivable

neon crane
#

very cool

grand shadow
#

And drivers

#

I need to have a lot more drivers

flat copper
grand shadow
scenic epoch
#

-# ||trl||

bronze nexus
prime juniper
#

.!t managarm

rigid timberBOT
#
managarm

It's Managarm, not Managram

prime juniper
#

(Or derivatives )

scenic epoch
#

kilogram

grand shadow
#

mammogram

scenic epoch
#

lounge 0

grand shadow
#

current source size

#

almost hitting the 30k lines of C code

analog berry
#

my hello world is somehow 1/3 of that and it doesnt do anything

#

or actually thats probably because tests make up a lot of the code and u dont have those

#

so thats why

gritty shore
#

an overengineered logging system

analog berry
#

its only a few k

gritty shore
analog berry
#

idk

gritty shore
#

whats the use of it

analog berry
#

#1385970208631427173 message

bronze nexus
#

I thought your kinda progress needed a lot more code

opal lotus
#

quantity != quality

bronze nexus
#

...

#

I guess it's also about what you prioritize

analog berry
#

yeah im surprised its that small

#

managarm is probably way bigger

#

if you count frigg etc

#

or even without it

grand shadow
#

I have been told I write dense code so

#

windows qemu moment

analog berry
grand shadow
#

so I am missing a lot of lines of code lol

#

qemu with whpx works on my desktop but not on my laptop

#

this is funny

grand shadow
#

you know, between sysvinit and openrc I might as well just pick the nuclear option

#

and have both like gentoo does troll

gritty shore
#

runit

sage locust
#

i think that was an off-by-1 bug in an old Limine version

scenic epoch
prime juniper
#

I’m aware

scenic epoch
grand shadow
#

okay I think I know why meson is complaining when building mlibc

#

apparently I am missing a very specific F_DUPFD_CLOEXEC op

#

tbhank you meson

#

BWAHAHAHAHAHA

#

that was it

#

that was so stupid

#

running ninja...

#

seems to be working

#

and it installs...

wild marsh
#

now ninja install without DESTDIR trl

grand shadow
grand shadow
#

actually true I could tyr that

wild marsh
#

nice

grand shadow
#

astral first os to actually build mlibc inside mlibc

#

big step towards self hosting

#

I really want to try building some of the other base system packages now

#

lets see, I know these build:
binutils, gcc, mlibc, the kernel

#

I gotta try gettext, intl, libxcrypt for the base libraries
coreutils, bash, ncurses, readline for shell stuff
some astral tools like init, netd and mount are just simple c files on makefile, I wont even bother
maybe some tools like grep, sed, make, tar
and the libraries those would need

#

something tells me to try doing astral from scratch..

fleet osprey
#

absolutely based

#

/proc/cpuinfo, /proc/meminfo and /proc/uptime for neofetch next? meme

grand shadow
#

I have been thinking about how I would approach that stuff

#

if I would do /proc or some other astral tool

#

and how /proc would work

wild marsh
#

one thing i was thinking about is making the proc files binary and providing utils to write out the linux-style output from them

#

(not in managarm ofc)

analog berry
wild marsh
sage locust
grand shadow
analog berry
#

neofetch is abandoned

sage locust
#

neofetch is dead and fastfetch is actually genuinely much better

proper meteor
opal lotus
#

and has more information

grand shadow
#

what more do I need before I can have the satisfaction of calling astral fully self hosting and farming reddit karma?

analog berry
#

Just show a timelapse of downloading the sources, then building and running in qemu, all from inside astral

grand shadow
#

honestly if I make astral faster I think I can do that 💀

#

I need to track down what is making it sluggish sometimes

#

I have a gcc build running in the background and its not really an acceptable speed

analog berry
#

Well as long as its a timelapse

#

Doesn't matter how slow it is

analog berry
grand shadow
#

I'll take a look

#

also I just noticed

#

I'm gonna have to port perl to have autotools proper

#

perl doesnt work in managarm very well IIRC but idk if its managarm or mlibc

grand shadow
analog berry
#

Well there are different ways to implement it

#

You can just dump qemu registers every N us, or record stacks in your kernel

grand shadow
#

I think having it in kernel would probably be better, when I did the qemu register dump thing it was insanely slow after a specific amount of time per dump

analog berry
#

Iirc managarm had a good way to profile stuff

#

@marsh sparrow right?

wild marsh
#

we have profiling via pmus, the pmu is configured to raise an nmi after every n clock cycles, and in the nmi handler we log the ip where we were interrupted

grand shadow
#

wait

#

I think the reason why it might have been super slow

#

is that it was building gcc with -g by default???

#

why does gcc do that

#

I'm gonna leave it building with "-O2 -pipe" and without that -g to see if it helps any

#

while I look into the profiler

analog berry
#

Isn't g just debug info

marsh sparrow
grand shadow
#

Yes but my fs driver isnt very fast and its a lot of info meme

marsh sparrow
wild marsh
wild marsh
marsh sparrow
#

paaliaq?

wild marsh
#

the plan is to eventually also write an unix-like os for it

marsh sparrow
#

ah

analog berry
#

fork managarm meme

wild marsh
grand shadow
#

port gcc troll

grand shadow
bronze nexus
#

lily-cc galaxybrain

grand shadow
#

when then means I gotta research into locales and implement them in mlibc

scenic epoch
#

no compiler needed

wild marsh
grand shadow
#

get 4 cpus then?

wild marsh
#

incredible

grand shadow
#

that was suspiciously quick?

#

make -j2 with 8g ram and vioblk

#

and 4 cores

#

ls is super slow for some reason

#

something is funky

marsh sparrow
#

@prime juniper probably knows if perl works on mlibc linux

grand shadow
#

I think something is funky with the page cache

#

I really need to rewrite this at some point

#

and do it completely differently

analog berry
#

fs code?

grand shadow
#

page cache code

#

I think I do it the way svr4 did which is like just not good

#

or some other old unix, I rmeember getting inspiration from oen but I forgot which

prime juniper
grand shadow
prime juniper
#

Nope

neon crane
#

@grand shadow as a shortcut couldnt you just compile the kernel and then copy all the userspace stuff from the host into the guest

#

or is that cheating

grand shadow
#

i want to be able to build the userspace stuff in astral

sage locust
#

tbf what you have already counts as self hosting to me

#

you can literally make git commits inside Astral and push them for your kernel, and then rebuild said kernel, install it, and reboot

#

it honestly doesn't get more selfhosting than that as a kernel

#

btw idr if you tried building Limine inside Astral too, but i don't see why it shouldn't build

grand shadow
grand shadow
#

which was iconv_open

#

but now thats in libintl and not in mlibc

#

so even that shoudlnt be an issue

analog berry
#

locale stuff is probably the most annoying shit ever

#

i wish everyone spoke the same langauge and used the same formats for everything

marsh sparrow
#

At least what's required from libc is not that bad

#

You basically need to be able to tell which unicode chars satisfy isalpha(), isdigit(), islower() etc

#

and you need to be able to convert to upper case etc

#

Both of these tasks are solved by large lookup tables that you export from ICU :^)

#

that's how glibc does it

#

Actually, I'm not sure if glibc exports from icu or if it maintains its own copies

grand shadow
#

me thinking my tcp driver shat itself while downloading the binutils tarball

#

it aint even close bruh

wild marsh
#

huh i didn't know you're in botswana :^)

analog berry
grand shadow
analog berry
#

Damn

#

Literally every astral component is 1 loc and somehow works better than everyone else

fleet osprey
#

so true

#

astral network stack is about to become the world's leading embedded network stack

#

replacing lwIP

analog berry
#

Lwip was huge iirc?

fleet osprey
#

exactly

#

if Astral's is Just Lighter™, the joke was that it'd 100% replace lwIP

#

in all seriousness, it probably never would, but maybe it might see some use? would be neat

analog berry
#

True

grand shadow
#

I mean it is certainly not *good* but it works well enough

#

considering it was my first time writing a tcp driver

fleet osprey
grand shadow
#

implement astral kexec and use astral as the bootloader 5head troll

fleet osprey
#

(it'll probably absolutely shit itself on PowerPC, since you don't target anything big-endian)

grand shadow
#

big endian cpus arent real wake up sheeple theres a little fairy in your computer that switches the bytes while you arent looking

grand shadow
gritty shore
grand shadow
#

I should do a small change on the kernel build stuff and move the regenerate stuff from jinx into a ./prepare.sh and add a kernel-src/BUILD.md detailing how to build just the kernel