#Astral

1 messages · Page 11 of 1

carmine swallow
#

it just waits on a semaphore

grand shadow
#

You can pass an interruptible flag to a semaphore

#

And check for an error

carmine swallow
#

does it return like EINTR or something on error?

grand shadow
#

It returns the wakeup reason which can be SCHED_WAKEUP_REASON_INTERRUPTED or something like that

analog berry
#

any reason why its an int and not an enum?

carmine swallow
#

ig that would work

grand shadow
#

I just use a define

analog berry
#

i see

#

i use enums extensively because its impossible to tell what that int might end up storing

grand shadow
grand shadow
#

if you do implement interruptible sleep uh send a new iso cuz its gonna take a little eternity to test all dsps

#

I'm still at dps1

carmine swallow
#

I could also add the name thing so it would be a little easier to know which ones you want to test

#

eg. just printing them to the log for now

grand shadow
#

would save some time

#

also @fleet osprey merged ty

fleet osprey
#

Np, anytime

carmine swallow
grand shadow
#

question

carmine swallow
#

Ill try just returning EINTR and see how that goes

grand shadow
#

does oss ever like

#

want non blocking writes

carmine swallow
#

it depends on the app, possibly

#

rn I don't have that implemented tho

#

nor mmap for that matter

grand shadow
#

ah

#

well I'll leave my desktop off and wait for the name and eintr stuff

carmine swallow
#

yeah that shouldn't take too long to implement

carmine swallow
#

it doesn't look like I ever get SCHED_WAKEUP_REASON_INTERRUPTED tho

#

no matter how long I press ctrl c

#

also one thing which I forgot about was that sometimes its actually possible to route output to eg. mic inputs (this is from the controller that I have on my pc passed through to qemu)

flat copper
carmine swallow
#

@grand shadow here is a new iso with the names, I don't know how to make the intr stuff work

grand shadow
#

maybe it doesn't work with semaphores?

#

but I think waitpid uses a semaphore

carmine swallow
grand shadow
#

maybe my signals are borked which is weird because it works everywhere else

#

lemme flash it to my usb and try it out

carmine swallow
#

now I realized that a shorter file could have been a good idea lol

#

then it would return earlier

#

I mean ig you can find some random text file and cat that to there, though idk what they sound like

grand shadow
#

true

#

@carmine swallow I have a headphone connected to the back so I assume its one of the rear speakers?

#

Or rear line out?

carmine swallow
#

could be line out yeah

#

also don't do it with text files, they don't seem to work very well

#

it just gets stuck with no sound at all

grand shadow
#

my phone ran out of battery shit damn

#

I'll try line out

#

I also have 2 hda controllers it seems like

carmine swallow
#

could be for like gpu or whatever

grand shadow
#

JESUS CHRIST

#

it outputs sounds to my mic

#

but its all broken

carmine swallow
#

lol

grand shadow
#

not mic

#

headphone

analog berry
#

Sound to mic?

#

Oh

grand shadow
#

I actually jumped

carmine swallow
#

what does it sound like

grand shadow
#

noise

#

really loud noise

grand shadow
#

random noise

#

on one hand it does play sound
on the other I don't think this is what should come out of it

carmine swallow
#

did you cat the wav into it

flat copper
#

wrong format likely

grand shadow
#

cat whatevername.wav > /dev/dsp5

flat copper
#

would be quite cursed if it didnt support 48khz 16bit

obsidian pivot
#

wait is .wav just raw audio data???

carmine swallow
#

pretty much, though there are some headers at the start that cause some audible clicks if you play them as the data

obsidian pivot
#

ah

carmine swallow
grand shadow
#

not card

#

computer

#

.

#

I am tired

fleet osprey
#

I noticed when you said it output sound to your mic 😅

carmine swallow
grand shadow
#

I think I should've output it into another dsp maybe?

#

idk

#

windows says my headphones are on a "speaker" and not on the "digital out"

#

but the again its windows

carmine swallow
#

yeah ig its possible

#

also I should probably do something about the default volume

grand shadow
#

its on the green thing on the back

#

I think I should connect it to the one on the front

fleet osprey
#

yeah, if I'm not mistaken:
- green - speaker / line out
- blue - line in
- pink - mic in

#

green should be good for heaphones, but iirc will be horrifyingly loud by default, unless set by software

grand shadow
#

yeah front headphone out still gives out the damn fucked up noise

carmine swallow
#

I have no idea why that would be, unless its like playing some garbage that the allocated pages would initially have (assuming your page alloc doesn't zero them, I am not sure if it does)

grand shadow
#

the page alloc doesnt

carmine swallow
#

and as for why that would happen no idea, it does have buffer underrun debug messages but they are only printed to e9

analog berry
carmine swallow
#

at least on the passed through desktop card it does, Ill test it on the laptop too

grand shadow
#

you can have it cat automatically on /etc/rc if the keyboard doesnt work

analog berry
carmine swallow
#

yes I do, I bind all the devices that are in the same iommu group as the card to vfio and then use -device vfio-pci,host=00:1f.3

#

but the script isn't that portable because the devices/ids vary between systems

analog berry
#

I see

#

How do u make it so its not acquired by host driver

carmine swallow
#

well originally it is but when you manually do ```bash
echo "0000:00:1f.3" > /sys/bus/pci/devices/0000:00:1f.3/driver/unbind

analog berry
#

Oh I see

carmine swallow
#

Ill have to take a look at the widget dump for it again, maybe the first path (and the only one that I use in the astral driver) is some weird one

analog berry
#

What is that tigerlake thing?

#

Like some hda extensions?

carmine swallow
#

though I think there are some limitations with the hda on that to eg. the sample rates it can support without uploading firmware to the card

analog berry
#

So it is hda but with extensions?

carmine swallow
#

yes

analog berry
#

And they're fully backwards compatible?

carmine swallow
#

at least as far as I have tested yes, though like I said afaik it needs firmware upload for some sample rates and formats to work

analog berry
#

Thats interesting

#

Didn't know that was a thing

grand shadow
carmine swallow
#

I just didn't get any sound at all out of any of the dsp nodes which is weird considering that I have def got sound both from its internal speakers and headphone jack when playing sound to all possible paths

#

so yeah ig there are multiple issues to fix with it now

grand shadow
#

damn

#

hopefully theyre both symptoms of the same issue

fleet osprey
#

oh yeah I still need to try the new ISO on my Optiplex

#

I forgot about that

#

yeah I think mint was right the first time about it being an issue with it being an ISO
even with the latest limine (8.0.9), the ISO that's generated, directly flashed to a USB stick, does not boot on BIOS

#

welp, time to hack in a make img to generate a bootable USB/HDD image

fleet osprey
#

progress has been made but my build env is kinda screwed somehow (git weirdness?), so doing a clean rebuild

#

gonna head out for a bit and hope it's done soon™️, then go try out the image

#

most of the image gen borrowed from the limine-c-template makefile, adjusted to be in a script, similar to your gendisk.sh, and called via the makefile

#

or ofc can be called directly

fleet osprey
#

it works

#

ok that's actually kinda a lie

#

I've made the plumbing to
- make it gen the image
- be able to run the image, irrespective of the ISO

#

now I just need to fix it (doesn't seem to copy files "correctly", limine can't load the initrd

#

but that's a problem for future me (i.e. in 1 hour, after I take a shower)

#

but this is still huge

#

nvm, just realized my mistake and fixed it in 5s

#

real hardware test coming after I'm back though, USBs are slow

craggy tide
#

awesome!

fleet osprey
#

hmmm, the optiplex does not like this USB for some reason

#

it at least.... tries to do something with it now, but it just ends up resetting back to the BIOS

#

I'm not entirely sure if this is a case of
- it's just too old (doubt, it's a Core 2 Duo)
- old USB stick crapping itself
- Limine bug
- something else?

#

I've booted Limine on this PC before, but not recently

#

going all the way back to Limine 5.x in fact

#

but at least I know it can't be an image problem, since it boots fine in QEMU

#

I can probably rule the USB stick out too just by swapping the image file in QEMU to the bdev of my USB stick, hang on

#

hmmm, it actually doesn't work there, interesting

#

rufus probably botched it then, I'm just gonna directly dd it from my laptop

#

Rip no PS2
ACPI works tho

#

@grand shadow so this is another machine that gives that error, despite the fact that I know it has PS2 emulation
it may not be good PS2 emulation, but it does exist and is enabled
also note that after the kernel started (and only after the kernel started, worked fine in the BIOS and Limine), the USB keyboard actually turned off
since I have fancy RGB on it, I can actually see that it's just off now, lol

#

also I'll chuck the bootable USB/HDD image creation code I slapped together to get this thing booting at all, in a PR, should be useful

fleet osprey
#

#1061407633745125397 message
also, just tried these to no avail on the optiplex (verrified they work in QEMU)
one sec, will try on the thinkpad

#

Here's what it does repeatedly mashing (more than 4) keys

#

welp, that's enough debugging and programming for me for today, gonna call it

craggy tide
#

so what is the report wrt Limine working or not on some hardware (with up to date version)

fleet osprey
#

- does not work if Rufus is used to flash an ISO to USB
- does not work if an ISO is dd'd to the USB, v7 or v8.
- does not work but differently, if Rufus is used to flash an HDD image to USB
- partially works if a v7 ISO is booted with Ventoy - breaks Limine loading the initrd?
- maybe works if a v8 ISO is booted with Ventoy (untested)
- maybe works with v7 if an HDD image is dd'd to USB (untested)
- does work with the latest version if an HDD version is dd'd

#

all are for BIOS
UEFI mostly just works no matter what

craggy tide
#

is that specific to that one machine or like, in general?

fleet osprey
#

in general on all of my real hw I've tested

#

not sure if any of those would still apply in a VM

#

would be interesting to test, but not today

#

I wish i still had that Dell Latitude 5491, it was the one machine I was able to get to boot to actually boot the ISO dd'd to USB over BIOS

#

haven't had luck with any other machine, and I sold that one a bit ago

craggy tide
#

it would be interesting to know as well if you are generating the iso/hdd file using the C template's recipe or some other potentially broken system

fleet osprey
#

I also haven't put the C template's ISO through the same tests

#

that would also be another good thing to try tomorrow

craggy tide
#

yeah

#

like those things you listed are a surprising amount of failures for what it should be

#

certainly the BIOS port of Limine has been somewhat neglected recently, but i doubt it was neglected to the point that it is half broken consistently on most systems

#

that would be pretty bad

#

unless it's an issue withh isohybrid and xorriso commands

fleet osprey
#

nah it's not
the issue is primarily with the ISO

#

I've had nonstop issues with that

#

the HDD image seems mostly fine

#

the only HDD image failure I encountered is Rufus, and I bet is trying to inject it's own MBR there, and it's just exploding

#

given that it even fails on QEMU

craggy tide
#

rufus in non-dd mode is always annoying

#

not just rufus, but pretty much all these "boot image burners" or whatever that actually try to inject their own changes into the mix

#

instead of just copying the stream of bytes as-is

fleet osprey
#

lovely

#

well yeah, I'm positive that Rufus is the issue, the exact cause of why it's the issue is unknown to me, and I don't have the energy to go investigate it

#

I just know that it works perfectly in every test case I've thrown at it so far if I just dd the HDD image across, and dies dramatically (it might actually be triple faulting, it fully halts QEMU) if I use Rufus

craggy tide
#

yeah alright

#

i'll be waiting for tomorrow to run the tests off of the vanilla C template, and in the meantime i'll go double check what xorriso commands grub2-mkrescue uses, because isohybrids are so damn annoying to deal with - or more in general, ISO is really annoying to deal with

fleet osprey
#

fair
I've had nothing but issues with USB booting ISOs on BIOS, it seems to just suck in general, regardless of what is actually booting (Limine, GRUB, ISOLinux, hell even Windows Boot Manager has crapped out on me before)

craggy tide
#

it's really fragile

#

it is tempting to just say "screw it" and not support ISO altogether anymore

#

really reminds me of the Puppy Linux guy's post bashing the ISO format (for good reasons)

#

no one burns optical media anymore

fleet osprey
#

although to be fair to modern devices, UEFI has pretty much "just worked" in every case, ISO or HDD

#

this seems to be all specific to booting ISOs, from non-optical media, specifically on legacy BIOS

craggy tide
#

i mean yeah UEFI is much less finnicky

#

that said ISO failed to work on the snapdragon laptop a friend of mine tried this stuff on

#

while HDD image worked fine

fleet osprey
#

interesting
most stuff is just EDK2, which should support it no problem
the manufacturer must've either been using a REALLY old version, or somehow, intentionally or not, broken whatever code is responsible for loading in that manner

#

would love to know how that happened, but we'll probably never know

craggy tide
#

yeah, i am not sure about the details because i do not have such laptop myself

#

i should probably get one to be able to test an arm port of a future project of mine

#

but eh, it's expensive

fleet osprey
#

a lot of old (and even some new) phones (unofficially) can run UEFI as well

#

you can go pick up a Google Pixel 3a or the like for cheap, and have a tiny ARM device with a built in screen and storage that can run EDK2

#

anyways, I really need to actually go to sleep now lol, I've put it off for long enough, and if I sit here for too much longer I'll wake up in my chair in 8 hours :P

grand shadow
#

so it gets some interrupts but not all?

supple hatch
obsidian pivot
#

E

grand shadow
#

wonder what I will do today

#

@carmine swallow @robust geyser @analog berry anything yall need implemented/ported?

#

other than real hardware ps2 I cant even begin to debug that

carmine swallow
#

well the oneshot event would be nice, though I think it could just be a variant of the signal method on a semaphore?

#

basically it would only increment the count if the count is zero to begin with so then multiple calls to it don't increment the count more

grand shadow
#

would my event.h stuff suffice?
its interruptible and actually returns EINTR (as its based on my poll stuff)

#

though it wakes up all threads waiting on the event

#

instead of the semaphore 1

#

even has a timeout if you need that

carmine swallow
grand shadow
#

oh it doesnt do the next thread part

#

hm

#

I suppose I could add a semaphore_signal type of thing that can have a limit passed to it?

carmine swallow
#

yeah that would probably work, the reason why it would be good for it to allow the next thread to proceed is that its triggered within the hda irq handler if the ringbuffer space is getting low so then even if there are no threads immediately waiting for it the next thread can proceed to write to there (though now that I think about it it should do that anyway because there is a check for how much space there is within the buffer)

#

so idk if its really needed

grand shadow
#

yeah seems like it wouldn't be needed as you already check for the available space anyways

#

though you'd probably have to make sure the semaphore is only signaled if the buffer changed from enough to not enough?

#

idk how it works but you might get what I mean

analog berry
#

I guess a port of wine would be nice

grand shadow
#
        size_t avail;
        while (true) {
            bool irqstate = spinlock_acquireirqclear(&strm->bufferlock);
            avail = RINGBUFFER_DATACOUNT(&strm->buffer);
            spinlock_releaseirqrestore(&strm->bufferlock, irqstate);
            if (avail <= path->oss.fragmentsize) {
                break;
            }
            else {
                int err = semaphore_wait(&strm->buffersem, true);
                if (err == SCHED_WAKEUP_REASON_INTERRUPTED) {
                    return EINTR;
                }
            }
        }

in hdaqueue
if two threads are running here at the same time it looks like they can both leave the loop even though there wouldn't be space for both of them

grand shadow
charred sinew
#

add --with-insults to the ./configure of sudo build to get insulted when getting the password wrong

analog berry
#

Iirc its easy for 64 bit, for 32 u need ldt syscalls

carmine swallow
#

yeah for 64-bit you basically only need the syscall to set gsbase (and then signals and whatever else)

grand shadow
#

seems like I would need the better sigaction

#

that returns siginfo and a ucontext

carmine swallow
#

hopefully it runs better on astral than on managarm

analog berry
carmine swallow
#

ah yeah it needs ucontext

analog berry
obsidian pivot
#

common microkernel L

analog berry
#

Even ls on astral feels an order of magnitude faster

carmine swallow
#

also another fun thing would be openjdk

analog berry
#

Thats probably quite a bit harder than wine

carmine swallow
#

its not that hard either

#

at least in terms of patches

analog berry
#

Can I finally play Minecraft on astral

carmine swallow
#

in terms of stuff it uses idk, at least it works on managarm

analog berry
#

Well u still cant play Minecraft there

#

Only the server

carmine swallow
#

and for the server it would need the proper tcp server stuff that I didn't figure out

grand shadow
#

wouldnt for the minecraft launcher you need a web browser anyways

carmine swallow
#

you can launch minecraft without the launcher

carmine swallow
#

nice

grand shadow
#

(tcp tx is not really optimised tho)

obsidian pivot
#

just use wine

#

to play mc on openjdk

grand shadow
obsidian pivot
#

java -jar

grand shadow
#

yeah but what arguments

carmine swallow
#

yeah that and then a lot of arguments

obsidian pivot
#

java -jar <jar file> -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M

carmine swallow
#

they are listed in the version json (if you want auth stuff)

analog berry
#

Even just single player would be huge

carmine swallow
obsidian pivot
#

port mc for windows 10 meme

#

just run that on wine

#

done

#

(doesn't actually work)

grand shadow
#

I have zero willpower to touch the signal code but also openjdk and wine need siginfo and ucontext and it'd be very funny.....

analog berry
#

Do it

grand shadow
#

hmm

#

siginfo + ucontext -> possible qemu port -> wine -> openjdk

carmine swallow
#

tbh openjdk's template interpreter might work without ucontext, I am not completely sure tho (and even if it does work its a lot slower afaik)

#

because its an interpreter like the name says

wild marsh
grand shadow
wild marsh
#

ah

grand shadow
#

unless theres some more things it needs from the kernel?

wild marsh
#

it needs some signal stuff (sigsuspend, sigaltstack)

grand shadow
#

hmm

#

I dont have sigsuspend but I do have sigaltstack

#

sigsuspend should be fine

wild marsh
#

qemu uses sigaltstack and siglongjmp to spawn a coroutine on a separate stack

obsidian pivot
#

is siglongjmp in the kernel?

#

or is it a libc thing

wild marsh
#

libc

#

it's a longjmp that also restores the signal mask

obsidian pivot
#

I see

wild marsh
#

it sigsetjmps in the signal handler that's on an alternative stack, then returns, then siglongjmps back into it from outside the handler

grand shadow
#

seems like qemu only uses sig info in userspace emulation so I should be fine just implementing sigsuspend and trying qemu?

#

sigsuspend -> qemu -> siginfo + ucontext -> wine -> openjdk

wild marsh
#

yeah that should work i think

grand shadow
#

sigsuspend is a stupid easy system call anyways

#

its an atomic sigprocmask with a pause without timeout

wild marsh
#

iirc ucontext+siginfo was properly implemented in managarm after we had qemu portd

#

oh you'll also need sigwait

#

or signalfd

carmine swallow
wild marsh
grand shadow
#

does it need thread signaling stuff?

#

like tgkill or whatever the call was

wild marsh
#

don't think so

#

it's just using signalfd or it's own emulation to tie signals into the event loop ig

obsidian pivot
#

doesn't managarm just make tgkill just call kill

#

in its sysdep

wild marsh
#

so each thread has it's own pid

winged basin
#

signalfd/epoll interaction frightens me

#

they say when you read a signalfd, it always reads the current thread's signals

fleet osprey
#

and nothing showed up

#

those (2x press and release, of the same key, if I remember my scancodes correctly?) appeared within the first few seonds of boot

#

when I had barely pressed any

#

then nothing at all after

grand shadow
#

conclusion: ps2 is haunted

#

guess I'll just make enough NIC drivers so that you'll only use astral through ssh on real hardware meme

fleet osprey
#

lol

#

I may try to help unfuck PS2
@analog berry did you have any luck w/ your attempt?

analog berry
#

Nah I was working on uACPI so go ahead if you have the time

fleet osprey
#

alright

fleet osprey
#

alright so here's my plan to try to get the best of both worlds

#

PS2 Init Process
- try to test if it works by default
- yes? finish setup and hope it works (similar to my driver that works)
- no? go through the rest of the init process that normally goes on in the current driver

analog berry
#

Why, just remove the old one, its bad

fleet osprey
#

because it works fine for Mathewnd's machines
would rather not break that

#

because I have no idea if my old setup of "just pray it's good by default", that seems to be the only thing that works on my machines (maybe it's a Dell thing?), will work on his

analog berry
#

Literally everything works on his machines tbh

grand shadow
#

Not hda meme

#

Well it works 1/2

#

And yeah because theyre the only places I have to test so ofc theyll work 😭

#

The other old amd64 machine I have is broken

carmine swallow
#

I didn't yet figure out the hda issue with my laptop either, it should work ™️ and I also tried to test astral on my desktop but it hang in the hda code when enumerating codecs which isn't good

analog berry
#

Damn

fleet osprey
#

I think this perfectly describes how awful this will be

grand shadow
carmine swallow
#

yeah it would be nice, though based on all the current issues I kinda doubt that it will work

grand shadow
#

Out the headphones its the same weird noise

carmine swallow
#

likely its the same issue then

grand shadow
#

Ou the main speaker too

#

A different type of noise but still just loud noise too

robust geyser
#

wish i could try hda 😔

carmine swallow
#

the bad thing is that I have no idea what can these be caused by, except for the issue that I have on my desktop I suspect that the irqs are not triggering at all so then it gets stuck waiting for some command

#

I mean I already found one bug related to selecting the connection between widgets but that didn't really affect anything (and idk how common that code path even is, it might be pretty rare)

#

and all that it could cause is that there would not be any sound at all

grand shadow
#

Through the headphones its a loud noise that sounds like something made to kill your ears but thru the main speaker it sounds just like static

fleet osprey
#

my hacky PS2 init method works fine on QEMU :D
gonna try it out on my Optiplex and see if it's gonna like me now

oh also made a minor fix the Makefile, you may want to add -f to the rm command in the initrd target in the Makefile. It blows up if a previous build was interrupted for me

carmine swallow
#

though I kinda doubt that I could get anything out of the widgets anyway tbh

grand shadow
#

Id have linux in my laptop but my mom uses it from time to time so cant

#

though

#

I do think theres a linux install in one of the ssds in my main machine

#

actually lemme see this I might've forgotten that I had linux installed at all

#

I think windows killed it lol

#

I could boot up a live cd or something if itd be helpful @carmine swallow

#

Wait bruh this is fucking cursed lol

#

Windows boot manager is in the hdd but the install in the ssd

fleet osprey
carmine swallow
grand shadow
#

Yeah no for some reason only the hdd windows boot manager works and everywehre else drops into a grub rescue shell

grand shadow
#

Aleight

#

Bleh

#

Alright

sacred gyro
#

so I tried booting Astral on another one of my machines

#

and it appears as if as soon as Limine executes the kernel, it triplefaults

grand shadow
#

wtf

fleet osprey
#

wtf.... so on my optiplex, either the self test, or whatever ps2kbd_init() does, is causing the BIOS to just completely give up on trying to do USB -> PS2 emulation

grand shadow
#

all ps2kbd init does is

#
    isr_t *isr = interrupt_allocate(kbdisr, arch_apic_eoi, IPL_KEYBOARD);
    __assert(isr);
    arch_ioapic_setirq(KEYBOARDIRQ, isr->id & 0xff, _cpu()->id, false);
    kb = keyboard_new();
    __assert(kb);
    printf("ps2kbd: irq enabled with vector %u\n", isr->id & 0xff);
fleet osprey
#

¯_(ツ)_/¯

#

well, one of the things in my shitty codepath is causing it to just entirely give up, and drop all power to the USB port

// XXX this is a terrible idea that really shouldn't need to be done,
// but a lot of stuff, especially USB-based PS/2 emulation via the BIOS, craps out
// if you try to do the full init process!  Try to selftest immediately.
// If it works, immediately finalize and get out of here.
// If it doesn't, actually try to set it up.

printf("ps2kbd: trying method 1\n");
ps2_write_command(PS2_CTLR_CMD_READCFG);
uint8_t control = ps2_read_data();
int workingflag = 0;
bool dualport = control & PS2_CONFIG_CLOCKP2;


ps2_write_command(PS2_CTLR_CMD_P1SELFTEST);
uint8_t result = ps2_read_data();
if (result == 0)
    workingflag |= 1;


if (dualport) {
    ps2_write_command(PS2_CTLR_CMD_P2SELFTEST);
    result = ps2_read_data();
    if (result == 0)
        workingflag |= 2;
}

// looking good!
if (workingflag != 0) {
    ps2kbd_init();
    printf("ps2kbd: method 1 success\n");
    goto out;
}    
grand shadow
#

does it have real ps2

fleet osprey
#

so somehow even this minimal of an init kills it

#

no

grand shadow
#

hm

fleet osprey
#

tbf, my init is even less than this, it doesn't even test it, or read the config

#

so maybe just self testing nukes it?

carmine swallow
grand shadow
#

it created an empty .txt bruh

carmine swallow
#

it should give a prompt when its done

#

it took like 5s or smth

grand shadow
#

didnt give anything 💀

#

oop

#

running it again worked

#

ok so wtf am I looking for here

carmine swallow
#

I don't really know, it doesn't even look like it dumped the connections at all which isn't very useful

#

if you'd know the connection that's used on a working system and all the widget parameters from that path then they could be compared to the ones that they are configured to in astral

#

(though not with the image that I sent to you as it doesn't dump them)

carmine swallow
#

the lines with Wid=XX Codec=XXXXXXXX

grand shadow
#

if it helps (I think this is my headphone one, it says jack is plugged)


********** Wid=[0x19] **********
<VREF Hi-Z> <Input Disable><Output Enabled><H-Phn Enabled><Jack is plugged>
Output MUX select to index 0x00 <WID=0x0C>
Amplifier Gain :
    Output Amplifier Gain :
        <Gain Number of step=0, 0dB Offset=0, Step Size=0.00 dB,From 0.00dB to 0.00dB>
        => Index 00 <WID=0x0C> Mute L:0 R:0 , Gain L:0.00dB(0x00) R:0.00dB(0x00)
    Input Amplifier Gain :
        <Gain Number of step=3, 0dB Offset=0, Step Size=10.00 dB, From 0.00dB to 30.00dB>
        => Gain L:0.00dB(0x00) R:0.00dB(0x00)
Power State : [PS-Act : D0], [PS-Set : D0]
Wid=19  Codec=02A19050  Drv=02A19C50  Loc=00030200
#

********** Wid=[0x22] **********
Amplifier Gain :
    Input Amplifier Gain :
        <Gain Number of step=0, 0dB Offset=0, Step Size=0.00 dB,From 0.00dB to 0.00dB>
        => Index 00 <WID=0x18> Mute L:1 R:1 , Gain L:0.00dB(0x00) R:0.00dB(0x00)
        => Index 01 <WID=0x19> Mute L:1 R:1 , Gain L:0.00dB(0x00) R:0.00dB(0x00)
#

idk

fleet osprey
#

I'm gonna try just infinite looping after each thing that PS2 init does meme

#

I see no better way to see where it breaks

grand shadow
#

print "doing thing"
do thing
sleep idk 5 seconds
repeat for next thing

fleet osprey
#

that's.... actually a much more sensible plan than this, wow

#

there's a reason I don't design things :P

carmine swallow
# grand shadow idk

I found at least one bug, I were subtracting the channel count two times when setting the converter format so there was a mismatch between the converter and the stream format (idk how much would that affect the audio tho)

#

(also again be careful because of the volume if you test this, I should really do something about that eg. by dividing it by two or smth)

wild marsh
#

btw @grand shadow i just remembered i added a debug allocator into mlibc

#

a while ago

#

if you want to try debugging the gcc issue

#

it uses mmap for each allocation, adds guard pages, places the allocation at the end of the mapped range so an overflow segfaults, and it never frees any addresses (it remaps as PROT_NONE so no actual memory should be used) so use-after-free should just immediately crash

#

you can enable it with -Ddebug_allocator=true when configuring mlibc

robust geyser
#

ill try using that and building gcc

#
../../../base_dir/sources/mlibc/options/glibc/generic/malloc.cpp: In function ‘size_t malloc_usable_size(void*)’:
../../../base_dir/sources/mlibc/options/glibc/generic/malloc.cpp:5:31: error: ‘struct MemoryAllocator’ has no member named ‘get_size’
    5 |         return getAllocator().get_size(p);
      |                               ^~~~~~~~```
#

hmm

wild marsh
#

oh it's missing that

#

should be easy enough to implement :^)

robust geyser
#

me no know how nooo

#

i thought this would be easy sadge

wild marsh
#
size_t MemoryAllocator::get_size(void *ptr) {
    if constexpr (logAllocations)
        mlibc::infoLogger() << "MemoryAllocator::get_size(" << ptr << ")" << frg::endlog;

    uintptr_t page_addr = reinterpret_cast<uintptr_t>(ptr) & ~size_t{pageSize - 1};
    AllocatorMeta *meta = reinterpret_cast<AllocatorMeta *>(page_addr - pageSize);

    if (meta->magic != allocatorMagic)
        mlibc::panicLogger() << "Invalid allocator metadata magic in MemoryAllocator::get_size" << frg::endlog;

    return meta->allocatedSize;
}
robust geyser
#

holy

#

qookie the goat

#

okay it compiles, ill try running it now, thanks!

wild marsh
#

actually, for it to never release addresses you need to change a variable

robust geyser
#

does that matter?

wild marsh
#

well with it off an use-after-free doesn't crash

robust geyser
#

ok ill run with the option enabled

grand shadow
robust geyser
#

constexpr bool neverReleaseVa = true;

#

need to remake image nooo

grand shadow
#

you only need to rebuild mlibc thankfully

#

the joy of dynamic linking

wild marsh
#

wtf are you in my head

robust geyser
#

yeah but mkfs.ext2 is slow as balls

wild marsh
wild marsh
#

well on managarm grep is a bit bugged even without it so

robust geyser
#

lmao what the fuck

grand shadow
#

yeah

#

it wasnt just grep

#

sed too

obsidian pivot
#

the memory is tired

#

let it sleep

grand shadow
#

so I assume on the desktop it'll be fucked too

wild marsh
grand shadow
#

I'll run it again and show the output

grand shadow
#

I mean it makes sense

wild marsh
grand shadow
#

youre not unmapping just changing the prot

grand shadow
wild marsh
#
    if constexpr (neverReleaseVa) {
        void *unused;
        if (int e = mlibc::sys_vm_map(meta, meta->pagesSize + pageSize * 2, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0, &unused))
            mlibc::panicLogger() << "sys_vm_map failed in MemoryAllocator::deallocate (errno " << e << ")" << frg::endlog;
    } else {
        if (int e = mlibc::sys_vm_unmap(meta, meta->pagesSize + pageSize * 2))
            mlibc::panicLogger() << "sys_vm_unmap failed in MemoryAllocator::deallocate (errno " << e << ")" << frg::endlog;
    }
wild marsh
#

until you mprotect as accessible and access them

prime juniper
wild marsh
#

i had it hang or crash once yesterday or so? when trying to use -i iirc

prime juniper
#

Oh

#

Damn

wild marsh
#

so that should work then hmm

prime juniper
#

If you can repro, you should open an issue against bootstrap (or mlibc / Managarm if it can be traced to either of them)

wild marsh
#

i haven't investigated yet since i ran into it when investigating the egl issue

grand shadow
#

@carmine swallow

wild marsh
#

i was doing something | grep -i egl or so

prime juniper
#

Interesting

wild marsh
prime juniper
#

If I don’t forget I might try it tomorrow (just a simple grep -i on some meme in usr/include)

grand shadow
carmine swallow
grand shadow
#

plus, the vmm would be screaming and sending sigbuses everywhere lol

grand shadow
carmine swallow
#

well I don't really know, it just shows the path and looking at that its a dac connected directly to the output

#

these kinds of things are hard to debug

robust geyser
#

why does typing in bash make free page count go down by 2 LMAO @grand shadow

#
syscall: pid 35 tid 36: mmap: hint 0000000002591000 length 8192 prot 3 flags 50 fd -1 offset 0 (468 cached pages, 1007775 free pages)
syscall return: pid 35 tid 36: 39391232 0 (468 cached pages, 1007775 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000000000000 length 12288 prot 0 flags 34 fd -1 offset 0 (468 cached pages, 1007773 free pages)
syscall return: pid 35 tid 36: 39403520 0 (468 cached pages, 1007773 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000002594000 length 8192 prot 3 flags 50 fd -1 offset 0 (468 cached pages, 1007773 free pages)
syscall return: pid 35 tid 36: 39403520 0 (468 cached pages, 1007773 free pages)
syscall: pid 35 tid 36: write: fd 2 buffer 00000000011C3FF8 size 4 (468 cached pages, 1007771 free pages)
syscall return: pid 35 tid 36: 4 0 (468 cached pages, 1007771 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000000000000 length 12288 prot 0 flags 34 fd -1 offset 0 (468 cached pages, 1007771 free pages)
syscall return: pid 35 tid 36: 39415808 0 (468 cached pages, 1007771 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000002597000 length 8192 prot 3 flags 50 fd -1 offset 0 (468 cached pages, 1007771 free pages)
syscall return: pid 35 tid 36: 39415808 0 (468 cached pages, 1007771 free pages)
syscall: pid 35 tid 36: ppoll: fds 0000000002598FF0 nfds 1 timeout 0000000000000000 sigmask 0000000010306020 (468 cached pages, 1007769 free pages)
syscall return: pid 35 tid 36: 1 0 (468 cached pages, 1007769 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000002597000 length 12288 prot 0 flags 50 fd -1 offset 0 (468 cached pages, 1007769 free pages)
syscall return: pid 35 tid 36: 39415808 0 (468 cached pages, 1007771 free pages)
syscall: pid 35 tid 36: read: fd 0 buffer 00007FFFFFFFEBEF size 1 (468 cached pages, 1007771 free pages)
syscall return: pid 35 tid 36: 1 0 (468 cached pages, 1007771 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000000000000 length 12288 prot 0 flags 34 fd -1 offset 0 (468 cached pages, 1007771 free pages)
syscall return: pid 35 tid 36: 39428096 0 (468 cached pages, 1007771 free pages)
syscall: pid 35 tid 36: mmap: hint 000000000259A000 length 8192 prot 3 flags 50 fd -1 offset 0 (468 cached pages, 1007771 free pages)
syscall return: pid 35 tid 36: 39428096 0 (468 cached pages, 1007771 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000000000000 length 12288 prot 0 flags 34 fd -1 offset 0 (468 cached pages, 1007769 free pages)
syscall return: pid 35 tid 36: 39440384 0 (468 cached pages, 1007769 free pages)
syscall: pid 35 tid 36: mmap: hint 000000000259D000 length 8192 prot 3 flags 50 fd -1 offset 0 (468 cached pages, 1007769 free pages)
syscall return: pid 35 tid 36: 39440384 0 (468 cached pages, 1007769 free pages)
syscall: pid 35 tid 36: write: fd 2 buffer 00000000011C3FF8 size 4 (468 cached pages, 1007767 free pages)
syscall return: pid 35 tid 36: 4 0 (468 cached pages, 1007767 free pages)
syscall: pid 35 tid 36: mmap: hint 0000000000000000 length 12288 prot 0 flags 34 fd -1 offset 0 (468 cached pages, 1007767 free pages)
syscall return: pid 35 tid 36: 39452672 0 (468 cached pages, 1007767 free pages)
syscall: pid 35 tid 36: mmap: hint 00000000025A0000 length 8192 prot 3 flags 50 fd -1 offset 0 (468 cached pages, 1007767 free pages)
syscall return: pid 35 tid 36: 39452672 0 (468 cached pages, 1007767 free pages)
syscall: pid 35 tid 36: ppoll: fds 00000000025A1FF0 nfds 1 timeout 0000000000000000 sigmask 0000000010306020 (468 cached pages, 1007765 free pages)```
wild marsh
#

the minimum allocation is 2 pages

robust geyser
#

yeah but why would it allocate every time i type 😭

#

well its gonna take a while until it runs out of memory, theres still 998k pages remaining

#

but somehow, even with that much memory, sed says "memory exhausted"

#

maybe it just runs out of virtual memory?

wild marsh
#

there are 34359738368 pages in the lower half of the address space

robust geyser
#

well, thats a lot of virtual address space

#

idk why else would it give that error tho

grand shadow
#

I wouldnt think its running out of memory

#

since my vmm would start sending a sigbus to whoever tries to do page in

craggy tide
#

@fleet osprey did you get around to doing those tests?

fleet osprey
#

I asked a question in #lounge-0 that you never answered

#

#lounge-0 message

craggy tide
#

well, i was sleeping

fleet osprey
#

ah, timezone differences ig
3PM over here

craggy tide
#

i sleep regardless of the position of the sun anyways

fleet osprey
#

btw @grand shadow you shouldn't have sched_sleep in the scheduler header if it doesn't really exist, lol

#

it threw me off, and got a linker error

grand shadow
#

oh god

#

I think thats there from before I realized a sched_sleep() the way I was gonna do would be a lost wakeup

#

use sched_sleepus

fleet osprey
#

yeah I noticed and am adjusting my code

#

just wanted to make note of that

#

perfect, that works exactly like I need it to, time to try it

#

PS2 dies reading the config meme

#

what.....

#

I wonder what happens if I just blindly assume it's a dual port

#

sending selftest also kills it.... ???

#

does sending any data to it at all just kill it?

#

I think it must

#

I wish I knew what DOS was doing to it behind the scenes

#

although actually I guess FreeDOS also works with it

#

I could go look at the source there

#

this is awful, nevermind
I give up trying to read all of that

#

@grand shadow so yeah that's the issue, it dies as soon as you send a single command to it

#

and that's why mine worked, because I didn't send anything to it, just blindly assume it's on IRQ1

grand shadow
#

bruh

#

wtf

fleet osprey
#

yeah, dell memes ig

#

I guess the weird buffer issue isn't the only bug with it

#

I have no idea how many Dell machines that applies to, I only have 2 of them, an Optiplex 755 from 2007, and a Precision T1650 from 2012

#

if anyone else has a Dell desktop, I can chuck you an ISO or USB image that you can test, that way we can determine if it's actually worth fixing

#

if it's specific to old Dell desktops, it's probably not worth fixing tbh

#

but if it's an issue with any Dell desktop (or maybe even laptops?), then that may actually be worth looking into a workaround

analog berry
#

just wait for me to figure this out ig

fleet osprey
#

really? I don't see any other reason for it

#

why would it explode the second that you try to read the controller config

#

or do a self test

analog berry
#

one possible reason is blindly assuming ps2 ports

#

u need acpi to get the actual port number

#

it could be different

fleet osprey
#

oh? interesting

#

because the keyboard entirely turns off with just these 2 lines:

ps2_write_command(PS2_CTLR_CMD_READCFG);
uint8_t control = ps2_read_data();
analog berry
#

turns off how?

fleet osprey
#

as in, the entire USB keyboard just drops power

analog berry
#

ah

fleet osprey
#

it's an RGB keyboard, RGB is always on if it's getting 5V

#

everything turns off

analog berry
#

well also like

#

linux and windows probably never even hit this codepath in firmware

#

because they force disable emulation

#

so its possible that its bugged

#

but it doesnt work on your laptop either right

fleet osprey
#

it works fine with FreeDOS though

fleet osprey
analog berry
#

freedos is also pretty advanced lol

#

it does have ehci right

fleet osprey
#

yes but not by default

#

default is PS2

#

and not even ehci iirc

#

uhci only

analog berry
#

its also not 64 bits right

fleet osprey
#

and my machine isn't supported by it

fleet osprey
analog berry
#

anyway its possible that astral is doing something that makes the firmware expect a modern os

fleet osprey
#

the Optiplex is a Core 2 Duo E8400, it's 64-bit

analog berry
#

and then uses this codepath

#

freedos ofc

fleet osprey
#

FreeDOS is a DOS, lol
it's 16-bit real mode

analog berry
#

also

fleet osprey
#

yeah but it still sends a selftest

fleet osprey
#

which is enough to knock the entire thing offline here

analog berry
fleet osprey
#

I haven't tried Linux w/o USB support to force PS/2 on here yet

#

entirely possible that not even Linux works on it meme

analog berry
#

here's the quirk table

fleet osprey
#

my Optiplex isn't there

#

so yeah will try booting some Linux distro while blacklisting all USB

#

try to force PS/2

#

will report if it works, I doubt it

analog berry
#

i wonder if ultra legacy ps/2 driver would work there

#

can u try booting this there

fleet osprey
#

yea, sec

#

ok testing now

analog berry
#

im expecting it to not work

#

hopefully

fleet osprey
#

it actually dies with video stuff

analog berry
#

what did it say?

fleet osprey
#
Reading kernel from disk...
Preparing kernel environment...
Failed to set the video mode!
Press any key to reboot...
analog berry
#

F

#

i guess will never know

fleet osprey
#

GPU is an RX 580

#

I can try a few others

#

I have an HD 5450 and a GT 210

analog berry
#

yeah the bootloader relies on finding some specific video mode or something idk, its a pretty crappy one

#

if u can thatd be great

fleet osprey
#

k, one sec

analog berry
#

it wants at least 1024x768@32bpp

#

if it cant find it it will fail

fleet osprey
#

yeah hang on

#

I need to wait for it to cool

#

mf is at like, 100C

analog berry
#

lol wtf

fleet osprey
#

I tried to unplug it and am in excrutiating pain

analog berry
#

why is it so hot?

fleet osprey
#

no idea

#

it was literally just driving a monitor

#

not even accelerated

#

was just idling at a terminal in Astral

#

lol

analog berry
#

lol

#

well astral obviously doesnt do any thermal zone management

#

so it probably just kept working at that fan speed

fleet osprey
#

yeah

#

the fan wasn't spinning meme

analog berry
#

lmao

#

like the gpu fan or cpu?

fleet osprey
#

GPU

#

CPU fan was

analog berry
#

ah

#

well the gpu fan lives on its own so idk

fleet osprey
#

it's a Dell

#

CPU fan control sucks

analog berry
#

yea

fleet osprey
#

it's controlled by the firmware unless you do horrific hacks to talk to SMM

analog berry
#

which astral does btw via aml

#

and it can even explicitly via control methods, but obv doesnt for now

fleet osprey
#

it's not in ACPI iirc

#

it's on an embedded controller

#

undocumented

analog berry
#

acpi abstracts it away, u dont need to know the EC layout

#

u just execute a method of the FAN object

fleet osprey
#

yeah you can read the RPM from ACPI iirc

#

but can't control it

#

it's i8k

fleet osprey
#

Dell doesn't expose that feature

#

you just can't lol, trust me, I've tried

#

the only way is the SMM jank

wild marsh
#

ssdt that adds the control methods :^)

analog berry
#

^

#

what is i8k?

fleet osprey
#

I don't know what it actually stands for

analog berry
#

oh its dell smm interface

fleet osprey
#

yes

#

that's the only fan control method for Dell machines

#

Desktop, Laptop, anything

analog berry
#

bruh

fleet osprey
#

it's the only way

analog berry
#

a vendor without weird proprietary crap is a bad vendor

fleet osprey
#

yeah

#

my friend actually knows the guy who wrote the code

#

in the firmware

analog berry
#

lol

#

he should really congratulate the guy on inventing such a beautiful new interface

fleet osprey
#

the magic hex bytes in decimal are 13731 and 13475, and he says that the guy wanted the machine to boot in 13.475 seconds

#

so that just became an inside joke because it's stupidly precise goal

#

and now they use 13475 (and various variations of it in hex) whenever they're exposing something that they think is stupid

analog berry
#

lol

fleet osprey
#

anyways I've stalled for long enough, I bet the GPU has cooled down enough to pull it out now

analog berry
#

btw 2007 is probably earliest AML uacpi has been tested with which is interesting

#

its from the more crazy days

#

does it have any errors or anything in the log?

#

in astral i mean

fleet osprey
#

1 warning

#

checksum mismatch

#

that's it

analog berry
#

nice

#

your other pc had duplicate methods i think

#

for handling firmware events

fleet osprey
#

"my other PC" could refer to many things

#

was it the laptop I should here recently?

analog berry
#

oh yeah probably

fleet osprey
#

that's a ThinkPad T14 Gen 1 AMD

#

pretty recent

#

shocking it has issues

#

it's from at least 2020 iirc

#

your image just hangs

fleet osprey
#

black screen, everything locks up

fleet osprey
analog berry
#

i wonder if its stuck in ps2 init 💀

fleet osprey
#

well the kbd didn't turn off

analog berry
#

any way u can do acpidump > dump.txt on it?

fleet osprey
#

anything useful in there?

analog berry
#

yeah

fleet osprey
#

cool, I'm not an ACPI nerd, so I don't know what any of that means, lol
I recognize some of the table names from very early attempts at poking at it in my OS

#

and Hackintoshing as well, I had to poke at them

analog berry
#

im mostly looking at the aml disassembly, u can see yourself

acpixtract -a dump.txt
iasl dsdt.dat
obsidian pivot
#

unfortunately no MSDM table

fleet osprey
#

want me to chuck the output here?

#

oh wait

#

nvm just re-read ur msg

analog berry
#

yeah just in case u were curious

obsidian pivot
#

whats dmar table

#

in acpi\

#

seems to have something to do with the iommu

#

or dma

fleet osprey
#

the generated dsl file all just looks like gibberish to me, but I trust that it's actually useful somehow
never got far enough into my OS to really try doing ACPI stuff

#

would probably get more meaning out of it if I did

analog berry
#

i think its a bug in uacpi

obsidian pivot
#

impossible

analog berry
#

its harmless but yeah

obsidian pivot
#
Name (_S5, Package (0x04)  // _S5_: S5 System State
    {
        0x07, 
        Zero, 
        Zero, 
        Zero
    })```
#

how do I interpret this

#

(I'm doing fnuy things with ports)

analog berry
#

0x07 is the value that should be written to SLP_TYPa

#

for the system to enter S5

wild marsh
#

what are the other 3 values for?

obsidian pivot
analog berry
#

the rest are unused i think, they used to mean something

wild marsh
#

huh

analog berry
wild marsh
#

interesting

obsidian pivot
#

ok

analog berry
#

anyway there's a bug here that makes the iteration escape the scope in some case

#

ill debug tomorrow

obsidian pivot
analog berry
#

whatever the GAS structure says

analog berry
obsidian pivot
#

ok

analog berry
#

Just scroll below

#

Anyway will have to get back to ps2 later

#

I dont see it in the quirks table so im assuming astral skill issue for now

analog berry
#

Btw if u can run Linux without USB drivers on it that would be nice

fleet osprey
#

oh on the optiplex?

#

ye

#

hang on

obsidian pivot
fleet osprey
#

great

#

let me try on Arch ig, hang on

#

hell, may need to just go compile a new kernel, I bet Arch's also has USB built in

#

yeah, Ubuntu's config just sucks meme

CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_SL811_HCD_ISO=y
# CONFIG_USB_HCD_TEST_MODE is not set
CONFIG_USB_ISP1760_HCD=y
# CONFIG_USB_DUMMY_HCD is not set
#

damn even Arch does that

#

welp, time to go recompile Linux, so I can test if the Linux PS2 drivers works, so I can see if the issue is Dell's PS2 implementation, or Astral's driver being iffy

grand shadow
#

likely the latter

fleet osprey
#

well Dell's implementation is known dogshit

#

I sent the description of the weird buffer issue before

obsidian pivot
fleet osprey
#

mine is the opposite, lol

obsidian pivot
#

well it's more like

#

I click a key

#

and it thinks I'm holding it

grand shadow
#

my desktop seems to do ps2 emulation perfectly, even emulates the mouse

#

guess I was lucky

#

or it just emulates it in a way astral's driver expects meme

obsidian pivot
#

u could just replace all sort of display stuff with serial

#

instead of keyboard

#

use serial

#

instead of Xorg/bash

#

ssh over serial

grand shadow
#

atp write a nic driver and have ssh and all the other benefits of a working internet connection

fleet osprey
#

oh lol, mine is not at all that
mine has the unfortunate issue of
- press key #1
- puts it in key buffer, and fires an IRQ
- OS pops char from buffer, buffer now empty
- press key #2
- puts it in buffer, does not fire an IRQ
- press key #3
- puts it in buffer, does fire an IRQ
- OS pops key #2 from buffer, buffer now has 1 dead char
- press key #4
- puts it in buffer, does not fire an IRQ
- press key #5
- puts it in buffer, does fire an IRQ
- OS pops key #3 from buffer, buffer now has 2 dead chars

#

and this repeats into in infinity

obsidian pivot
#

obvious solution is to just

#

have a thread polling the ps/2 statys thing

#

for data /j

fleet osprey
#

it's bad enough that it breaks DOS

robust geyser
#

no, the obvious solution is to drain the buffer on each irq

#

k

#

fair enough

fleet osprey
#

yeah

#

so I really wouldn't be shocked if their driver has other bugs

grand shadow
#

how does it even get past qa

robust geyser
#

works on linux™️

fleet osprey
#

lol

#

if they tested it at all (they probably didn't), they probably keysmashed and checked if anything at all appeared

grand shadow
#

gotta make sure it works for that one guy still running an ancient windows version

fleet osprey
#

it's an OptiPlex

#

it's an office PC

#

it's meant to be used as a glorified typewritter

#

or to run excel

#

it's meant to have the drive imaged with the company's Windows XP install and then left to sit for 8 years until it's decomissioned

fleet osprey
#

I bet it died

grand shadow
#

💀

#

So it wasnt astral

fleet osprey
#

yeah

#

it just eats hit and dies if you ever send a command to the PS2 controller

grand shadow
#

Does it have any nic

#

And if so which

fleet osprey
#

e1000

grand shadow
#

Hmmmm

#

I do need to write an e1000 driver

fleet osprey
#

I also have another one that's also e1000 but different™️

#

iirc lspci shows different model, but still e1000 driver

grand shadow
#

Maybe it has some fucked up quirk

fleet osprey
#

yeah the Precision has an 82579LM "Lewisville"
Optiplex has 82566DM-2

#

oh yeah I also have 3x R8169 devices

#

my laptop, primary desktop, and mini PC, are all Realtek 8169

analog berry
fleet osprey
#

nvidia GPU

#

need I say more?

analog berry
#

But you have more GPUs right

fleet osprey
#

I probably could test it out, but I'm busy

#

and definetly not rn

#

it's 1:30AM

analog berry
#

Yeah sure

supple hatch
#

why do i always get the weird issues mathew 😭

#

like does god hate me or smthin

#

no matter what language, C or rust i always get weird ah issues that take forever to deebug

#

its so annoying

#

also ps2 is weird

#

usually usb emulation is shitty

#

so if u dont get that shit working dont beat yourself up about it, not your fault rlly

analog berry
#

Im unironically tempted to do uPS2

#

But maybe later at some point

supple hatch
#

!!

analog berry
#

The main point would be quirk tables for broken ps2 emulation

#

So that init is skipped in that case

supple hatch
#

yea honestly that would be cool

#

i think it would be really cool if u did somthin like that

#

but whatever works best for u, i think it'd help hobby oses a lot

#

usb is difficult

analog berry
#

I would/could ship touchpad and multiplexed ps2 drivers

supple hatch
#

that would be cool also

analog berry
#

Thanks, ill think about how I would design it

supple hatch
#

def! i'd be glad to support a project like that

#

might even contribute if i can

analog berry
#

Well you most likely wouldn't be able to use it because rust KEKW

supple hatch
#

i can still write C

#

im not a total rust shill

#

im only writing in rust for nyaux cause build system lol

obsidian pivot
#

yet

grand shadow
#

The astral curse is ps2 never working

analog berry
#

Id like to see the acpi dump of that ps2 emulation pc, whether it mentions ps2 devices in the dsdt

#

If it doesn't I can easily work around that in astral and skip init in that case

grand shadow
#

anyways

#

for today uh

#

I will implement sigtimedwait and port qemu

#

damn 90 syscalls already

grand shadow
#

wonder which web server would be easier to port

carmine swallow
#

civetweb was pretty easy

#

if you just want something to test stuff with

grand shadow
#

hmmmm

carmine swallow
#

iirc it didn't even need any patches

errant zephyr
#

it performs like shit despite using epoll and whatnot

grand shadow
#

epoll

#

__ensure(!"unimplemented"); meme

errant zephyr
#

i support both

grand shadow
#

qemu time

supple hatch
#

hehehe

earnest zinc
#

Tail wags Hello!

supple hatch
#

hey

obsidian pivot
#

"Max The Cat"

fleet osprey
#

new astral issue, btw
Dell Precision T1650, Xeon E3-1240 V2, only happens with UEFI boot
Possibly specific to Ventoy? Need to test it more

#

Oh, and my primary desktop in UEFI mode is also affected by this.

grand shadow
grand shadow
analog berry
#

qwinci had a fix for this

#

iirc

grand shadow
#

yeah

fleet osprey
obsidian pivot
#

ok I think I got it now:
say "m68k" to summon fadanoid
say "aml" to summon infy

analog berry
#

yes

fleet osprey
#

a0a902e968ab8dcd6c6c8cc87f5c31fb27be7c12

grand shadow
#

hm

fleet osprey
#

it looks like I'm missing your merge commit for my PR, and one other

grand shadow
#

something is overlapping in the same page when allocating space for the hhdm

#

if (e->type != LIMINE_MEMMAP_USABLE && e->type != LIMINE_MEMMAP_BOOTLOADER_RECLAIMABLE && e->type != LIMINE_MEMMAP_KERNEL_AND_MODULES && e->type != LIMINE_MEMMAP_FRAMEBUFFER)

#

its one of these

#

USABLE and RECLAIMABLE are guaranteed to be aligned iirc

fleet osprey
#

just in case, rebuilding the ISO fully up to date with your gh

grand shadow
#

can you add a print before the vmm_map to see each thing it tries to map

obsidian pivot
#

btw this probably counts as oberrow curse

grand shadow
#

its not a vmm corruption or anything its just real hardware being stupid meme

obsidian pivot
#

I think oberrow curse is just memory bugs

#

in general

#

sooooo

fleet osprey
#

so what am I printing here, the info from entry (e)? I haven't looked at the Astral vmm yet (and never actually got far enough to make one in my OS meme) so I'm not necessarily an expert here

grand shadow
#

printf("base %p length %x type %d\n", e->base, e->length, e->type);

fleet osprey
#

👍
will retest on the t1650, one sec

grand shadow
#

that doesnt seem page aligned?

analog berry
#

limine bug ig

fleet osprey
#

or ventoy bug

#

ventoy is fucky

#

as mentioned, I need to test w/o it

analog berry
#

limine is the one doing allocations

fleet osprey
#

true, I wonder why it's not page aligned then, since the spec says it's garuanteed to be

analog berry
#

@craggy tide any ideas?

grand shadow
#

welp I have to do a clean build

#

and once I'm done yall will have too

#

switching out mlibc's iconv and intl options to libiconv and libintl (from gettext)

fleet osprey
#

eh, that's not that bad with DISTROTYPE=minimal

#

only takes ~15-20m on my machine, depending on outside system load

craggy tide
fleet osprey
#

unless it was modified from my PR that bumped the version, (just checked, it wasn't) it's 8.0.9

craggy tide
#

it seems like it is carving the framebuffer entry out of bootloader reclaimable memory

#

but that is weird unless the firmware originally marked the framebuffer as usable memory

#

which was then allocated as bootloader reclaimable

fleet osprey
#

it may very well be a Ventoy bug, since it does set the video mode
give me 2m here and I can test directly w/o ventoy

craggy tide
#

okay

fleet osprey
#

yeah it totally doesn't do that when booting direct

#

only happens when booting from ventoy, specifically in UEFI mode on this machine

#

it may affect others, but none that I personally owen

craggy tide
#

can you show the memory map

#

when not booting with ventoy

flat copper
#

you should specifically check if you're booting with ventoy and show a big fat warning that it's not supported

analog berry
#

i mean unless its not a ventoy bug

craggy tide
analog berry
#

we havent seen it yet but yeah possible

craggy tide
#

like the only way this can happen really is if the framebuffer is marked as usable memory

#

which would be weird

analog berry
#

how would that be possible, its usualy just one of the bars addresses

#

of the gpu

craggy tide
#

i don't know

#

i am trying to think of another mechanism you could end up with that memory map

analog berry
#

maybe u could add printf to limine to dump the memory map given to u

#

and we could run that

craggy tide
#

i mean yeah we can do tests

analog berry
#

then we can at least submit a bug report

fleet osprey
#

ah, that works
I was about to go write a tiny kernel that dumps the memory map to COM1

#

lol

craggy tide
#

if confirmed i would still like to work around the issue

analog berry
#

the workaround would be to scan the bars manually and see if they fall into any usable entries?

fleet osprey
#

if yall want I can spend a few minutes doing that and get the memory map

analog berry
#

nono we need the original firmware map, not the limine map

fleet osprey
#

oh 🤦

analog berry
#

the limine map we already saw in astral

fleet osprey
#

does Limine have some builtin way to dump that? I thought there used to be a console you could open or something, but don't see it in v8

craggy tide
#

yes

#

there is a function to dump the memory map

#

i am trying to figure out a good way to print the fb address, give me a sec

fleet osprey
#

👍 will continue working on that compatibility spreasheet then

analog berry
#

the what?

fleet osprey
#

#lounge-0 message

analog berry
#

im honestly astonished theres a difference

#

like these are tools to do the same thing

#

lol

fleet osprey
#

yup

#

current status:

#

with a 4KB text file of notes about various failures meme

craggy tide
#

try this

fleet osprey
#

one sec

craggy tide
#

it prints the memory map (as raw as possible) followed by the framebuffer address

gritty shore
#

I mean

#

limine shell

#

whatever

craggy tide
#

no

analog berry
#

bring back the ntfs driver

craggy tide
#

i will if you maintain it, deal?

analog berry
#

i will maintain it if its complete meme

craggy tide
#

it's not complete

#

lol

analog berry
#

once*

craggy tide
#

never will be

#

unless someone steps up and does it

analog berry
#

true

craggy tide
#

i have 0 interest in doing it myself

fleet osprey
#

Without ventoy

analog berry
#

wheres the fb address?

craggy tide
#

that's not the full memmap

#

you have to press a key to continue

#

(it shows the rest)

fleet osprey
#

oh 🤦 I thought that meant like, to continue to the menu

#

sec

craggy tide
#

nope

analog berry
#

wait why did u do it like that lol

craggy tide
#

like what?

analog berry
#

having to press the key to see the whole thing

craggy tide
#

because efi console

#

in qemu it's really tiny

analog berry
#

ohh

craggy tide
#

i did not want it to scroll away too fast

analog berry
#

its usually giant on real hw which is nice

craggy tide
#

and the memmap can be quite big

#

yeah

fleet osprey
#

holy shit
it's like, 20 screens, and the console doesn't fill the whole screen

#

hang on

analog berry
#

now i see why meme

fleet osprey
#

Thankfully it fits 2 chunks at a time

#

each of those are 2 keypresses (1 screen) apart

#

that's one hell of a memory map

#

wtf

analog berry
#

thats normal, u can compress it quite well