#Astral

1 messages Β· Page 8 of 1

grand shadow
#

either way, @analog berry merged tysm

robust geyser
#

yaaay i can use irq->priv now :D

analog berry
grand shadow
analog berry
robust geyser
#

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

analog berry
#

lol

robust geyser
#

lost my mind for a second but i just adopted it

analog berry
#

@grand shadow btw is it expected that reset fucks up the console?

robust geyser
#

are you typing reset from xterm?

#

or the console

grand shadow
#

how fucked are we talking

analog berry
robust geyser
#

inb4 sleep memes

#

u should log the syscalls

grand shadow
#

lemme see if reset fucks up xterm

robust geyser
#
[submodule "kernel-src/io/acpi/uacpi"]
    path = kernel-src/io/acpi/uacpi
    url = https://github.com/UltraOS/uACPI
#

bruh

analog berry
#

yes

robust geyser
#

y no keep things consistent

grand shadow
#

I plan on moving kernel stuff to submodules soon

analog berry
#

^

robust geyser
#

thank god

grand shadow
#

from the jinx regenerate thing

robust geyser
#

good idea

#

but kinda annoying

grand shadow
#

because then I can git clone and compile the kernel

#

reset works on xterm

#

maybe flanterm meme?

analog berry
#

so according to syscall log

#

it does ppoll like usual

robust geyser
#

reset should work on flanterm

analog berry
#

and gets response

#

but then doesnt work

#

like the screen is not updated

robust geyser
#

yeah ur right

#

thats weird

#

iirc reset works just fine on flanterm so..

#

maybe astral console/tty driver does something weird

analog berry
#

btw why does exiting vim not restore the initial console state?

robust geyser
#

i dont think flanterm implements alternate buffer stuff

analog berry
#

oh

robust geyser
#

or secondary buffer

#

idk what the name is

grand shadow
#

yeah it works fine on xterm

#

the buffer stuff that is

analog berry
#

i see

robust geyser
#

there is some weird escape sequence that lets you switch to a different buffer

#

so when you start vim/nano/less

grand shadow
robust geyser
#

it doesnt mess everything up

analog berry
#

flanterm bug?

obsidian pivot
#

isn't xterm that one shitty pseudo console for X

#

terminal emulator

grand shadow
#

its the one with "Abandon all hope, ye who enter here" on the readme

obsidian pivot
analog berry
#

Btw why not port whatever managarm is running?

obsidian pivot
analog berry
#

it feels like a way nicer gui thing

#

or do u just like this

grand shadow
#

I Am Not Porting Wayland

grand shadow
analog berry
#

why not?

grand shadow
#

needs way too many linuxy apis than I'd like to implement

analog berry
#

unfortunate

grand shadow
#

maybe with uGpu

#

with your drm stuff

analog berry
#

do u know which specifically?

#

like drm stuff?

grand shadow
#

drm and evdev and some others

analog berry
#

then yeah ugpu will definitely come in handy

robust geyser
#

reset works on my flanterm terminal emulator

grand shadow
analog berry
#

astral bug gasp

robust geyser
analog berry
robust geyser
#

yes

#

ef07a10cc38b34aa003d17be97a9f3542e275069 for flanterm

analog berry
#

hmm

robust geyser
#

which is the commit from 3 months ago or smth

grand shadow
#

inb4 it needs callbacks or something

#

did the callback stuff even make it out of the limine tty stuff

analog berry
#

callbacks for what?

robust geyser
#

my callbacks dont do anything

#

they just log stuff

analog berry
robust geyser
#

probably didnt think it was needed

#

also idk waht the proper name for that is

#

so sorry if im wrong

analog berry
#

kinda annoying to have my vim shit in my console

#

after i close it

robust geyser
#

just ^L

analog berry
#

i wonder if thats a pun

#

like taking an L

robust geyser
#

its also broken here, so its not an astral meme :^)

analog berry
#

or like not in history

#

just above on my screen

robust geyser
#

the buffer yeah

#

i get that

#

kinda annoying

#

it would be cool if flanterm implemented that tho

#

might look into it myself

analog berry
#

ye

#

i have no idea how any of that works as well

#

just understanding the idea of tty/pty/etc was hard enough

robust geyser
#

you can apparently use \e[?1049h and \e[?1049l to switch to and from the "alternate screen"

grand shadow
#

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%

robust geyser
#

also apparently its xterm specific :^)

analog berry
#

but everything supports it right

carmine swallow
#

I am pretty sure yeah

robust geyser
#

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

analog berry
#

even windows api??

#

lol

robust geyser
#

maybe, no idea

#

let me test that actually

analog berry
#

probably this stuff

robust geyser
#

yeah but the escape sequence

craggy tide
analog berry
#

but linux console sucks

craggy tide
#

okay

analog berry
#

anyway whats the actual reason

craggy tide
#

literally that

analog berry
#

why limit yourself meme

craggy tide
#

it's meant to run with TERM=linux with ncurses

analog berry
#

idk what that means but thats alright

grand shadow
#

its neither an astral bug nor a flanterm bug

#

its a feature meme

analog berry
#

u mean the terminal hanging or the lack of alternate screen?

grand shadow
grand shadow
analog berry
#

ah

craggy tide
#

if you ever ran nano on the linux console you'd see it behaves identically

analog berry
#

i got that much

robust geyser
#

i just tested it

#

can confirm

#

but still, i think it would be nice if flanterm was a more proper terminal emulator

analog berry
#

ye

craggy tide
#

i will accept a pr that implements it

#

as long as it doesn't break other stuff, directly or indirectly

robust geyser
#

might look into it then, soon

analog berry
#

u would just store a new char array somewhere

#

or like the entire state ig

craggy tide
#

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

robust geyser
#

its just two new sequences

analog berry
#

the old one i doubt it

robust geyser
#

yea conhost is absolute dogshit

analog berry
#

yup

robust geyser
#

tho tbh idk, it might work

#

it does!

analog berry
#

damn

robust geyser
#

with native nano

#

also works within wsl

analog berry
#

maybe nano just calls that win32 api?

robust geyser
#

probably

analog berry
#

u could test it by killing it from task manager

robust geyser
#

well it goes back to the original content of the terminal when i do

#

interesting

analog berry
#

then it does probably...

#

because the win32 api is manual

#

u cant arm it to switch back on exit

#

or maybe u can? idk

robust geyser
#

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

analog berry
#

maybe it has some tricks up its sleeve

robust geyser
#

definitely, its windows after all lmao

analog berry
#

lol

#

true

grand shadow
robust geyser
#

very nice

#

does it sync? :^)

obsidian pivot
#

le cool

grand shadow
#

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

robust geyser
#

ah, i see

#

that sounds like a good idea

grand shadow
#

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

grand shadow
#

that p was returned by the device

#

that should be all

#

for now

grand shadow
#

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

obsidian pivot
#

very cool

#

I assume shutdown also shuts down drivers?

grand shadow
#

there we go

#

I'll just look for some weird tty issue that happens on login when you backspace and call it a day

grand shadow
#

bruh

#

shadow defaulted erase to 0177 (del) instead of 010 (backspace)

grand shadow
#

well, that is all for today

#

tomorrow I will finally do the auth checks for signals I swear

analog berry
#

@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

stark walrus
#

O_O

#

no

#

I'll at least wait until shitos9

analog berry
#

yeah i dont think its worth to take up an entire shitos5 for marca if hes going to abandon it after a week πŸ˜‰

analog berry
#

i dont have a poweroff command

stark walrus
#

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

#

...

grand shadow
#

I think

grand shadow
#

Wait now that I have a fresh mind I think I did it wrong too πŸ’€ nvm

#

But yeah you have to account for it

analog berry
grand shadow
#

But yeah youd be mapping only one page and get a page fault (best case) or access wrong memory (worst case)

analog berry
#

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

grand shadow
#

Yeah

analog berry
#

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

grand shadow
#

Did jinx rebuild init work

analog berry
#

yup

grand shadow
#

Epic

analog berry
#

pretty nice to be able to shutdown like that

#

also that bug was pretty stupid sorry

grand shadow
#

Lmao thats fine I think it was in my old acpi table mapping code too

analog berry
#

lol

analog berry
#

@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

grand shadow
#

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

analog berry
#

have u tested real hw yet?

grand shadow
#

Not yet, will do when Im home

analog berry
#

nice

grand shadow
#

@prime juniper does xclock tick on managarm

#

If so what was.needed to make it work

prime juniper
#

no

grand shadow
#

I thought it was some setitimer meme but it wasnt that

analog berry
#

in other words

#

what makes it tick

prime juniper
#

(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

grand shadow
#

Wtf

#

I remember having.an issue like that and it turning out to be some weird rounding issue

prime juniper
#

I honestly haven't looked into it at all, but I'm 99.99% sure that it used to work

grand shadow
#
-    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

prime juniper
#

does it work? does xclock actually work?

#

cuz if so, I'm going to yoink that meme

grand shadow
#

It doesnt tick but the clock does show the current time

prime juniper
#

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

winged basin
#

i wish i knew how to make xclock tick

#

i also assumed it was an iTimer thing

prime juniper
#
/*
 * 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;
grand shadow
prime juniper
#

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 meme

wild marsh
#

?

prime juniper
#

let's try your patch

analog berry
#

why is 0 / 1000 ub

#

its just 0

prime juniper
#

wait

#

you're right

wild marsh
#

zero divided by anything (!=0) is just 0

prime juniper
#

yeah I'm stupid

#

then idk

#

but I'm gonna yeet that patch

#

and test that

wild marsh
#

i guess _update = 0.0?

prime juniper
#

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

grand shadow
#

Yeah I imagined

#

I do wonder why it doesnt tick

prime juniper
#

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

grand shadow
#

Guess its out of battery or something

prime juniper
#

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)

grand shadow
#

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

prime juniper
#

yeah that's gonna be source digging

grand shadow
#

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

prime juniper
#

probably

grand shadow
#

I wonder if building another version of gcc makes the mlibc meme go away.....

#

It says it has 16 processors but its 6 core, does that mean the cpu originally had more and theyre just defective?

obsidian pivot
#

maybe hyper threading?

grand shadow
#

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

obsidian pivot
errant zephyr
#

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

grand shadow
#

I imagined

errant zephyr
#

or alternatively it's just that the controllers are the same and dont change

#

even though the cores dont really exist

grand shadow
#

Thatd explain why the default lapic ids are how they are

obsidian pivot
#

I assume they are out of order

#

i.e., instead of 0,1,2,3,4,5

#

it's 1,4,7,4,8,9

grand shadow
#

it was like 0 2 4 ...

obsidian pivot
#

point is they looked random

analog berry
#

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

analog berry
#

does the power button work?

grand shadow
analog berry
#

niice

grand shadow
#

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

analog berry
#

πŸ’€

grand shadow
#

"""synced the disks"""

obsidian pivot
grand shadow
#

(it was an initrd)

obsidian pivot
#

register gpe event handler

#

shut down

grand shadow
#

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

analog berry
#

thats amazing

#

power button too?

grand shadow
#

Gonna first try out some things in xorg

analog berry
#

it could be the "simple way"

#

aka fixed event u have right now

#

or the "complex way" via the EC

neon crane
obsidian pivot
#

it's a 6-core cpu

#

so 6 lapic ids

#

reported in the madt

neon crane
#

well, 12 due to hyperthreading?

grand shadow
obsidian pivot
analog berry
#

damn thats pretty cool

obsidian pivot
#

le very cool

grand shadow
#

so I really just assume it had defective cores

grand shadow
neon crane
analog berry
#

maybe it will boot into gui at least unlike managarm

obsidian pivot
neon crane
#

never seen that before

grand shadow
#

if it doesnt hang at ps2 init

#

I hate ps2! I hate ps2!

analog berry
#

managarm was failing mostly because drm bugs

grand shadow
#

why is it that the only two damn fucking computers that it works are the only ones that I can test

analog berry
#

sometimes bad xhci, sometimes bad ahci, sometimes ps2 as well

#

its always a different thing

analog berry
#

uacpi has been tested on probably like 50ish computers at this point

grand shadow
#

Oh quake is fucking SMOOTH in real hw

analog berry
#

nice

#

wait until u see it running on an igpu

obsidian pivot
#

astral is definitely one of the cooler oses on this server (idk about the kernel quality, but the user space is very cool)

neon crane
analog berry
#

i think its unrelated

#

he just never tested before

obsidian pivot
#

does astral support swap of some kind

grand shadow
obsidian pivot
#

or no

grand shadow
analog berry
grand shadow
#

And Id say the page cache is battle tested at this point since it compiled like half of gcc

obsidian pivot
#

when (and if) you implement swap

#

it's pinned in #virtual-memory

grand shadow
#

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

obsidian pivot
#

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

grand shadow
#

Gonna try some xscreensaver demos now

grand shadow
#

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

analog berry
#

yeye for laptops its usually the "hard" way

grand shadow
#

lemme see if the acpi shutdown will work tho

#

with shutdown

analog berry
#

u mean poweroff

grand shadow
#

yeah poweroff

#

good to see that astral at least still works on (my) real hardware

analog berry
#

did it power off?

grand shadow
#

nah its rebooting I had turned it off from holding the key too much

analog berry
#

yeah holding the key too long bypasses acpi

#

it does send the emergency shutdown event tho

grand shadow
#

I need to read a bit on what acpi than do for when I delve deeper into that

analog berry
#

wait uhh

grand shadow
#

poweroff does work tho

grand shadow
analog berry
#

how did u follow yourself? idk

grand shadow
analog berry
#

nice!

#

yeah if u want the power button to work there thats gonna take a bit of work (not too much)

#

this basically

grand shadow
#

hmmm 400 lines of phd code

analog berry
#

if u dump the tables from that laptop it probably has a PNP0C0C device

#

which is the power button

analog berry
#

write one reg read the other

#

or write both

#

etc

grand shadow
#

it'll be a TODOℒ️ for now

obsidian pivot
#

how do you hook it to uacpi though

analog berry
#

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

grand shadow
#

wrong reply

analog berry
#

lol

grand shadow
prime juniper
#

Yeah fuck

analog berry
#

yeah drm bugs

prime juniper
#

Fat fingers

analog berry
#

screen goes black after wayland is brought up

#

and never goes back

prime juniper
#

@formal patio DRM issues?

analog berry
#

either ps/2 code dies or the resoultion it tries to modeset is bogus

#

no idea after that

#

i think qookie had some ideas

prime juniper
formal patio
#

context?

prime juniper
#

Boot to weston and keeps black screen

analog berry
#

managarm no work

formal patio
analog berry
#

well his quake is pretty good as well sooo

formal patio
#

all the context switching, IPC et al is very likely more significant

#

so depends

obsidian pivot
#

I think the point matthew was trying to make is that running glxgears is fucking cool and it runs faster

formal patio
#

yeah I'm not saying it isn't, just pointing out that glxgears fps are to be taken with some caution

winged basin
#

digital rights management

obsidian pivot
#

dog ritual manager

grand shadow
#

yeah

#

for what oberrow said

#

plus if quake is smooth then astral is good enough I dont need to develop it further smh

obsidian pivot
#

if it can run:

while(1)
  fork();
analog berry
#

i wanna play gta sa on astral

obsidian pivot
#

then it's good

winged basin
#

will Astral get a DRM subsystem?

analog berry
#

for that we need wine and for me to implement igpu

obsidian pivot
analog berry
flat copper
#

:^)

obsidian pivot
#

port qemu

#

then

winged basin
analog berry
#

probably same complexity

obsidian pivot
grand shadow
obsidian pivot
#

then get qemu on astral qemu on host qemu

analog berry
winged basin
#

yeah

grand shadow
#

(I dont have rlimit)

obsidian pivot
#

then get qemu

grand shadow
obsidian pivot
#

then get windows

#

then run qemu

#

then run astral

#

then run glxgears

grand shadow
obsidian pivot
analog berry
# winged basin yeah

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

obsidian pivot
#

might port that to obos in a million years

#

or I could speedrun it and become the first adopter+tester on real hw

grand shadow
#

one thing I wanna do is try to passthrough my laptop's ethernet card and see if I can write a driver for it

winged basin
#

i am thinking about e.g. with DRM-PRIME then it will need some sort of VMM integration

analog berry
#

ill need to think of how to design that api well

analog berry
grand shadow
#

by ugpu my kernel will hopefully not suck as muchℒ️

analog berry
#

ill probably use your kernel as a test bed

obsidian pivot
analog berry
#

i want to get the very basic proof of concept running

#

e.g. glquake with actual acceleration

grand shadow
#

glquake would be very neat

analog berry
#

that will take probably a few months

#

to work on my one latpop

obsidian pivot
#

I wonder if anyone's ported openjdk

#

to their os

grand shadow
obsidian pivot
#

and if it has mesa

grand shadow
#

mamogram

obsidian pivot
#

wonder what mc needs to run...

grand shadow
#

web browser for launcher

obsidian pivot
#

without launcher

analog berry
#

or well as long as i can get mesa to work i guess

#

whatever

grand shadow
#

I mean I think drm is the worst thing?

analog berry
#

definitely is

#

everything else is smaller

grand shadow
#

I have no idea what all the linux specfic apis weston uses are

winged basin
#

westron needs drm, epoll, evdev i think

#

that's what netbsd needed for it

analog berry
#

ye

#

u can probably do epoll easily

#

evdev idk, probably also not that complex

grand shadow
#

maybe when ugpu gets closer to being real I can look into that

analog berry
#

i can run mesa in astral right now right?

grand shadow
#

then ig I could also move xorg to use xf86-input-libinput instead of keyboard/mouse

grand shadow
#

it runs with llvmpipe rn

analog berry
#

glquake works with it rn?

winged basin
#

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

grand shadow
#

yeah but has some graphical bugs

analog berry
#

why is that?

grand shadow
#

I have no idea

analog berry
#

with llvmpipe?

winged basin
#

and you have to be careful with epoll to not do the sensible thing too much as linux certianly doesn't

analog berry
#

lol

grand shadow
analog berry
grand shadow
#

tyr-quake (fully software) works but tyr-glquake has some glitches

grand shadow
#

I imagine everything is fine?

analog berry
#

well if it works on linux with llvmpipe

#

then..

#

either mlibc bug or astral fpu init bug

grand shadow
#

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

winged basin
grand shadow
winged basin
#

i'm looking at what solaris does right now (don't worry, i don't understand it either)

analog berry
#

its easy to get some float thing wrong

grand shadow
winged basin
#

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

winged basin
# analog berry wtf

it requires you to do certain things when you fork() to trigger the wild behaviour

grand shadow
carmine swallow
#

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)

grand shadow
analog berry
#

that would be very neat

#

then we could have the full stack on astral

#

usb+graphics+sound

grand shadow
#

plus you probably know better how it works than me meme

analog berry
#

@grand shadow can u reboot via poweroff somehow?

analog berry
#

oh u added that as well?

#

lol

grand shadow
#

yeah

analog berry
#

nice

grand shadow
#

almost the same code except it sends 'r' to the init pipe rather than 'p'

analog berry
#

big api

carmine swallow
analog berry
#

yes qwinci do htat pls

grand shadow
#

that'd be neat

analog berry
#

u now have the isr->priv field

#

what else might u want

carmine swallow
grand shadow
#

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)

analog berry
#

lol thanks

analog berry
#

that takes a little less than 10 years to compile

grand shadow
#

you only have to compile gcc once, thats one time less than twice and you dont need to compile llvm

analog berry
#

we should make a script like ./just-build-the-goddamn-thing.sh

#

that would do all the steps

grand shadow
#

or I could y'know
make the build system actually good

#

maybe I can look into that

analog berry
#

or that LULW

grand shadow
#

I'll first make it so that DISTROTYPE=minimal doesn't build everything and push that

carmine swallow
#

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)

analog berry
#
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

grand shadow
#

welp that was easy

#

no idea why I didnt do that before

analog berry
#

btw why do u have multiple accounts

#

on gh

grand shadow
#

huh

analog berry
#

oh its a github bug lol

#

it tells me mathewnd followed matheus

grand shadow
#

I sure do wonder how I followed myself

analog berry
#

thats why i thought maybe u had an alt

grand shadow
#

anyways I pushed a change to the makefile that should hopefully make it that DISTROTYPE=minimal only builds the MINIMALPACKAGES

#

brb

carmine swallow
#

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

grand shadow
#

wait

#

ohhhhhh

#

ohhhhhhhhhhhhhhhhhhhhh

#

I forgot to add minimalsysroot to the ./jinx install

#

I have dumb

carmine swallow
#

I tried running that manually but it didn't put anything to there

prime juniper
#

@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

grand shadow
#

@carmine swallow pull again

prime juniper
#

Enjoy netlink (not all of it tho)

grand shadow
prime juniper
#

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

grand shadow
#

aghhh they need better names I thought it was network related

prime juniper
#

Including some network route BS

prime juniper
#

But not originally if I recall correctly

#

It’s a Linux kernel interface for IPC if I trust Wikipedia

grand shadow
#

linux picking non ambiguous names challenge

prime juniper
grand shadow
#

if I told you "I'm implementing netlink" and you never heard of it before whatd you think

carmine swallow
grand shadow
#

epic

prime juniper
#

udev needs NETLINK_KOBJECT_UEVENT

#

You can ignore all other families if you need to implement this

#

(Afaics)

grand shadow
#

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

grand shadow
#

@carmine swallow do you plan on using multiple msi interrupts

carmine swallow
#

I am pretty sure that there is only one interrupt on the hda

grand shadow
#

then multiple msi interrupt support will be assertosℒ️

carmine swallow
#

I guess most devices that use multiple interrupts should support msix anyway

grand shadow
#

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)

carmine swallow
# grand shadow well I pushed msi

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)

grand shadow
#

alrighty nice work

craggy tide
#

@grand shadow when does summer break end for you?

gritty shore
#

i should stop looking at your thread, it makes me want to work on my thing but I have so much homework nooo

grand shadow
#

still have to go to work though

craggy tide
#

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

grand shadow
#

wdym

craggy tide
#

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

prime juniper
#

Unironically jealous of the progress

craggy tide
#

it's fine i'll just steal get inspired by the progress once time comes :^)

grand shadow
#

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

craggy tide
#

yes

#

that was the plan

grand shadow
craggy tide
grand shadow
#

also cvttsd2si seems to be the instruction that it uses to round without the roundf

#

(I have no idea about sse programming)

craggy tide
#

also figure out what's missing that doesn't make gtk work on Vinix (it works on Lyre)

grand shadow
#

it'd really be nice to see some progress on vinix eventually, it was one of the big inspirations for me

gritty shore
#

I chose a schedule that doesnt have classes on fridays

grand shadow
#

wonder if 0.5 is treated this way

#

hm actually seems like this is the expected behaviour of the function

#

not funciton

#

instruction

prime juniper
# grand shadow you can run webkit smh

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

robust geyser
#

i guess that's what happens when the main focus is put on impressive ports

prime juniper
#

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

robust geyser
#

that too

gritty shore
grand shadow
#

I've been having to implement some stuff in mlibc

#

nothing too deep (I barely know c++) but it is some things

grand shadow
robust geyser
#

phd code moment

#

but i like some of the abstractions

gritty shore
prime juniper
robust geyser
#

same with me going back to osdev

#

i just write some code

#

realize how shit it is

#

and drop the project lol

gritty shore
#

honestly I'm pretty happy with my current iteration

#

just gotta finish a sidequest first so I can develop it on my mac

prime juniper
#

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)

robust geyser
#

hopefully lol

gritty shore
#

did you try porting openrc

robust geyser
#

gn and good luck

gritty shore
#

or runit

prime juniper
#

Runit yes

#

Should work I think idr

#

But systemd meme

gritty shore
#

most people don't like systemd tho

prime juniper
#

Yet a lot of people use it

grand shadow
#

I tried porting openrc and it needed quite a few missing(?) linux stuff

prime juniper
#

But it’s already compiled, now it just needs to work

robust geyser
#

its the necessary evil

#

(systemd)

grand shadow
#

just use sysvinit

#

its that simple

prime juniper
#

I don’t think I have mlibc patches for the compilation part

gritty shore
#

the good thing about systemd is its UX

prime juniper
#

Which is based

gritty shore
#

runit fucking sucks in that sense kinda

gritty shore
#

so its fucking huge

grand shadow
#

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

#

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; */
gritty shore
#

awesome

grand shadow
#

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

grand shadow
#

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 meme

grand shadow
#

maybe this (missing %f) is also whats causing the tyr-glquake glitches?

analog berry
fleet osprey
#

Oooh nice debugging job! Love seeing deep dives into obscure issues like this

prime juniper
#

Nice work

carmine swallow
grand shadow
#

Omg howd I miss that

grand shadow
#

Ill let you push the fix with hda nothing else is really gonna use msi for now

carmine swallow
#

now time to figure out the cursed stuff ig KEKW (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)

carmine swallow
#

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

grand shadow
#

Ohhh neat

#

If you need me to implement anything lmk

carmine swallow
#

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)

carmine swallow
grand shadow
#

You can push it witj the hda driver too then, thatd be how Id implement it anyways

analog berry
grand shadow
#

Qwinci probably has got it down to an art atp I think he wrote one for vinix and for his oses

carmine swallow
analog berry
#

nice, thats p cool

prime juniper
carmine swallow
prime juniper
#

Leo is really busy tho meme

carmine swallow
#

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)

formal patio
#

yeah I won't touch sound for a while

#

iGPU stuff is torchering me enough already lol

analog berry
formal patio
#

skylake displayport modesetting

#

it's not working yet

#

(obv)

analog berry
#

i see

robust geyser
#

i swear to god

#

everything that qwinci touches

#

has to play audio

#

(not a bad thing)

grand shadow
#

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

carmine swallow
# grand shadow If you need me to implement anything lmk

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

grand shadow
#

Ill fix that when Im home

obsidian pivot
#

@grand shadow have you made it so that building astral is easier

#

now

grand shadow
#

and you can add the packages you want to the makefile

obsidian pivot
#

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

obsidian pivot
#

as to not interfere with drivers

#

and stuff

grand shadow
#

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

obsidian pivot
#

(just note, this might include some slight obos curse in astral)
((depends on how skill issued I am))

grand shadow
#

the mm stack is pretty stable so anything I will blame on you meme

obsidian pivot
#

from the vmm

grand shadow
#

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

obsidian pivot
obsidian pivot
#

dam your vmm looks really simple

#

this is gonna be fun

grand shadow
#

yeah I tried to keep things simple in astral

#

its just a linked list of regions

obsidian pivot
#

I haven't look inside yet tho

grand shadow
#

a lot of the magic is just thanks to struct page

obsidian pivot
grand shadow
#

wdym

obsidian pivot
#

like no fast way

#

to fetch a struct page from a virt. address

grand shadow
#

not rly no

obsidian pivot
#

.

grand shadow
#

but you just get the physical and then the struct page from that

obsidian pivot
#

and does struct page represent a virt. page or phys. page

grand shadow
#

physical

obsidian pivot
#

so how do you get info for a virtual page

#

I'm going to quite a bit of metadata for this

grand shadow
#

using the vmmrange_t its in

#

there is no struct page for virtual pages

carmine swallow
grand shadow
obsidian pivot
#

I'll start in a bit

#

gtg now

grand shadow
#

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

carmine swallow
#

the good thing is that the code alone is pretty easy to understand

grand shadow
#

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

analog berry
#

why astral instead of obos

grand shadow
#

actually I wouldn't even need to have a VMM_MAP_OK

#

just VMM_MAP_ERRNO == 0 when its ok like literally everywhere else

carmine swallow
obsidian pivot
#

two

#

I don't wanna implement ttys

#

this is a procrastination strategy

analog berry
#

makes sense

grand shadow
#

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

obsidian pivot
carmine swallow
#

idk how useful that is tho, swap in general is pretty useless on modern machines

obsidian pivot
#

stop you'll scare fadanoid

#

iprogramincpp

#

and I

carmine swallow
#

lol

obsidian pivot
#

I would've said hyenasky, but he ain't here no more

analog berry
#

but this is a skill issue

#

(to think it is)

obsidian pivot
#

make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.

#

hmm

carmine swallow
analog berry
#

yeah

#

evne if u have lots of ram

carmine swallow
#

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)

analog berry
#

At least two reasons:

  1. 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)
  2. 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

obsidian pivot
analog berry
#

Not to mention just more free memory == more memory to use for caching stuff

obsidian pivot
#

also

#

page cache can be paged out

#

to make it more of a cache

carmine swallow
#

that sounds cursed

obsidian pivot
#

not rly

analog berry
#

paged out back to the file it came from? lol

obsidian pivot
#

idr how this worked exactly

analog berry
#

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

obsidian pivot
#

#1141057599584878645 message

obsidian pivot
grand shadow
obsidian pivot
#

btw when you make the kernel pageable, not everything becomes pageable

carmine swallow
analog berry
analog berry
#

u dont swap it out

#

u just remove it

grand shadow
#

^

obsidian pivot
#

yeyeyyeyeyeyeyye eyyeyeyyeye

obsidian pivot
grand shadow
#

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

analog berry
#

other than that i wouldnt bother

analog berry
#

then wakes up kcompactd to compact the pages

obsidian pivot
#

vmm.c

#

amazing file name

grand shadow
#

I also dont have the concept of a paged and nonpaged pool so you'd probably have to add that to my slabs

obsidian pivot
#

O_O

#

1000 line file

grand shadow
#

ext2.c is 1.9k thats nothing

analog berry
#

inb4 oberrow introduces the curse into astral

grand shadow
#

I would cry

#

I worked so hard to make it at least stable

obsidian pivot
#

fnuy typo

grand shadow
#

lmao I forgot to fix that

#

ah well doesnt matter flanterm supports it

#

its an easter egg now meme

obsidian pivot
#

how should I write commit messages

analog berry
#

kerenC

grand shadow
#

git commit -m "thing: change"

analog berry
obsidian pivot
#

too much work

analog berry
grand shadow
#

wait really

carmine swallow
# obsidian pivot fnuy typo

also if you want a compile commands json I have a cmakelists I can borrow meme (just use it with host gcc and run cmake but don't actually build it)

analog berry
#

also git add -p if u didnt already know

grand shadow
#

git add -p is useful

#

I just didn know about -v

#

also it doesnt highlight the diff, cringe

analog berry
#

yeah i use it all the time

#

i never remember what i changed

obsidian pivot
analog berry
grand shadow
#

it uses nano by default

#

I should change it to vim

analog berry
#

it uses the variable from the config file