#Astral

1 messages ยท Page 12 of 1

analog berry
#

i dont see the fb address printed tho?

fleet osprey
#

oh, it's on the next screen

#

thankfully I didn't shut it down

analog berry
#

lol

fleet osprey
#

bruh

#

shitty camera, why does it always apply stupid post processing

#

hang on

#

there

craggy tide
#

yeah

#

it is not in the memory map, without ventoy

#

(as expected)

analog berry
#

like i dont get it

fleet osprey
#

want me to transplant that bin into an ISO and try booting it with ventoy and see if it's any different?

craggy tide
#

yeah

analog berry
#

ventoy is just the thing that flashes the usb right

craggy tide
#

no

analog berry
#

how can it even affect this

craggy tide
#

i mean sort of

fleet osprey
#

no, it's a bootloader

analog berry
#

oh?

craggy tide
#

it does things that are more pervasive

fleet osprey
#

it's a heavily modified GRUB that loads ISOs from exfat / FAT32 at runtime

craggy tide
#

it's not a nice project

gritty shore
#

ventoy does chainloading I think?

analog berry
#

thats very weird

craggy tide
#

i vented my frustration at ventoy many times in the past

gritty shore
#

you mean

#

you ventoyed

craggy tide
#

for fucks sake

gritty shore
#

i will see myself out

craggy tide
#

it will likely be different

#

i predict the fb will be marked as usable memory

#

if not, there's still gonna be signficant changes to the memory map

analog berry
#

that would be a very serious bug tho

#

since thats very much not usable memory

craggy tide
#

it's ventoy, i honestly do expect them to be capable of that

analog berry
#

like linux would crash with that as well

fleet osprey
#

I actually haven't tried anything else on that specific machine, in UEFI mode, from Ventoy

#

I can verify if Linux and Windows will crash

analog berry
#

lets see the map first

craggy tide
#

yeah i was about to say

#

i may be wrong in my assumption

#

which is why we need to see the map

fleet osprey
#

sorry, I have ADHD lol, I have trouble staying focussed on one specific thing when new things come up
one sec

craggy tide
#

if the fb isn't marked as usable then the only other option is that the Limine allocator allocated over fb memory but like

#

i see that as highly unlikely

analog berry
#

yeah probably not

#

unless the memory map has some edge case

#

that limine is not handling well enough

craggy tide
#

we'll see

analog berry
#

inb4 its random garbage

fleet osprey
#

swapping BOOTX64.EFI in the limine-c-template and rebuilding should be a good enough test I assume?

craggy tide
#

i guess

#

you can put the .EFI file inside the limine/ dir

#

and rebuild

fleet osprey
#

huh, it's not working in QEMU, despite the sha256 of the BOOTX64.EFI in the ISO matching the one that I downloaded from your message

craggy tide
#

try removing the ovmf dir

#

sometimes the efivars get fricked

fleet osprey
#

nah, still just pops up the limine menu

#

after it redownloads ovmf

craggy tide
#

oh right

#

you have to update it inside limine-uefi-cd.bin

#

as well

fleet osprey
#

ah

craggy tide
#

you can mount that

fleet osprey
#

ah, that did it

#

one sec, copying this to ventoy

craggy tide
#

aight ty

fleet osprey
#

here's everything from ventoy

analog berry
#

looks the same?

#

i think?

fleet osprey
#

nah I see some changes at the end

#

definetly not the same

analog berry
#

i mean in regards to reserved/usable

fleet osprey
#

as do I, there's an extra reserved and an extra usable at the end

#

or not

#

I'm just blind

#

nvm

#

:P

analog berry
#

yeah

#

@craggy tide limine bug ig?

#

At least u have the entire map should be easy to repro

grand shadow
#

so it wasnt oberrow curse

fleet osprey
#

welp, anyways, now that that's been noted, back to the curse of the spreadsheet

craggy tide
#

ehh

#

i need to look into this

fleet osprey
#

alright, one sec

#

on Ventoy or direct, or both?

#

I'll just try both

#

doesn't print anything when booted direct (intentional?)

craggy tide
#

ventoy

#

uh not intentional ig

fleet osprey
#

yea, just tested it and it doesn't print anything in ventoy either

craggy tide
#

remember to also update the .bin file

fleet osprey
#

I did

craggy tide
#

alright try the second one

fleet osprey
#

wait was I supposed to let it boot, I thought it was gonna pop up before the menu again
but accidentally let it boot this time and it prints the mem map (half of it scrolls offscreen though) and then hangs

craggy tide
#

yeah

#

you're supposed to let it scroll like that and hang

#

that's intended behaviour

fleet osprey
#

ah, my bad, I figured it would be the same where it pops up in the EFI console before the limine menu

#

but anyways, you need the end of the map it printed?

craggy tide
#

ty

#

no this is fine

#

this is weird

#

especially given the above premise that the memmap is the same with ventoy and otherwise

#

that has to not be the case else it wouldn't explain why it works fine without ventoy

fleet osprey
#

maybe I could test directly chainloading with GRUB?

#

if it breaks there, that would rule out Ventoy garbage, and mean that it just explodes (somehow?) when chainloading

craggy tide
#

i wouldn't do random tests without having a clear idea of what we're testing

#

just not to waste time

fleet osprey
#

fair

craggy tide
fleet osprey
#

one sec

craggy tide
#

no probs

fleet osprey
#

new ss? looks the same

craggy tide
#

yeah

fleet osprey
craggy tide
#

this one actually has the fb entry

#

i made a mistake in the previous one that wouldn't show the fb entry because it was skipped over

fleet osprey
#

ah

craggy tide
#

whats important is that it seems fine there

fleet osprey
#

interesting, that's from Ventoy
I wonder why it wasn't page aligned when booting Astral then

craggy tide
#

try running it again, but edit the config on the fly to pass the kernel as a module or 2

fleet osprey
#

k

#

so just to verify your wording: add a line or 2 of module_path: boot():/boot/kernel?

craggy tide
#

yeah

fleet osprey
#

k, booted, still looks aligned, one sec, let me get a pic just in case

craggy tide
fleet osprey
#

ooh, different

#

one sec

craggy tide
#

the memory map looks fine

fleet osprey
#

it looks like what Astral was using as the base of that bad entry, is actually shown as the end address of the fb there?

craggy tide
#

it doesn't look anything like the astral one

#

do you think there's a chance you could extract the kernel out of this ISO and inject it into an astral image without changing anything else?

#

replacing the Astral kernel

fleet osprey
#

yeah, hang on, I can do that

craggy tide
#

aight

#

ty

fleet osprey
#

yeah it looks almost the same (less reserved space tho?), and Astral still fails

#

so then I guess it must be a weird bug with Astral's VMM that somehow only has ever cropped up on one machine, in one boot method, and only when using Ventoy to load an ISO.....

#

wtf????

grand shadow
#

I dont change anything from the map entries which wtf?

#

wait its still not aligned to 4096

fleet osprey
#

oh wait what I didn't notice that

craggy tide
#

the question is more so why it's only wrong on the Astral ISO

fleet osprey
#

well it's just Limine 8.0.9, pulled from GH

craggy tide
#

also the EFI cursor showing up there is weird

#

or at least what i assume is the EFI cursor

#

how old is this machine?

fleet osprey
#

2012-2013 ish

#

3rd gen Intel Core / "v2" Intel Xeon

grand shadow
#

anyways

craggy tide
#

right

grand shadow
craggy tide
#

idk the memory map seems all mangled

#

i'll uh

#

we should move somewhere else ig

fleet osprey
#

true

wild marsh
grand shadow
#

did you run into this when porting qemu

robust geyser
craggy tide
#

it's flanterm

robust geyser
#

oh ok

craggy tide
#

it's supposed to own the framebuffer fully

wild marsh
#

hm i don't see how a mutex can be uninitialized

#

unless it's locked after being destroyed

#

maybe add prints to the mutex functions that print the function name and mutex pointer?

robust geyser
#

inb4 memory corruption in astral

#

oberrow curse after all?

grand shadow
#

added the prints now its compiling again

#

@carmine swallow @robust geyser @analog berry @fleet osprey btw you probably should do a clean build, I changed the deps of pretty much all packages

narrow turtleBOT
#
Anti-spam Message

(ping spam) Possible spam detected for user: Mathewnd. Please contact a moderator to be unmuted.

wild marsh
#

.!unmute @grand shadow

narrow turtleBOT
#

Unmuted @grand shadow

wild marsh
#

are mods actually affected by the timout

grand shadow
#

yeah

#

couldnt even remove it from myself

#

seems like it never does anything with that mutex before this

#

time to peek in monitor.c

#
{
    Monitor *mon;

    qemu_mutex_lock(&monitor_lock);
    mon = g_hash_table_lookup(coroutine_mon, qemu_coroutine_self());
    qemu_mutex_unlock(&monitor_lock);

    return mon;
}```
wild marsh
#

i guess it got called before monitor_init_globals?

grand shadow
#

seems like so?

#

lemme add a print there

wild marsh
#

maybe it's coming from vreport?

#

it calls monitor_cur() to check whether it's null

grand shadow
wild marsh
#

info/warning/error reporting function that takes a va_list (and there's are corresponding report functions that take var args)

#

i guess you could just replace !monitor_cur() with true there?

#

but that's just a guess

#

oh and apparently print_loc also calls monitor_cur

grand shadow
#

so I assume it hit some error and is just dying super early to the point it cant even call cur_monitor?

#

I'll do that to see what it says

wild marsh
#

that'd be my guess yeah

grand shadow
#

I removed it from error-report.c but it still seems to happen?

wild marsh
#

hm

#

gdb port when? meme

grand shadow
#

I think I will just build qemu with debug symbols, printf(__builtin_return_address(0) and addr2line

wild marsh
#

monitor_cur is also called in qemu_vprintf meme

grand shadow
#

hmm true

#

rebuilding with the return address print and that

wild marsh
#

i fail to see where it'd call it though at a glance

grand shadow
#

astral so good qemu doenst know how to react

wild marsh
#

hmm it could be dying in module loading code?

#

dunno, out of ideas

grand shadow
#

welp

#

at least we know now

wild marsh
#

trolled

grand shadow
#

time to see what it wants to say

#

(probably wont be pretty)

#

oh bruh it just wanted to print a warning

wild marsh
#

lmfao

grand shadow
#

though it still didn't keep going

#

do I need pthread_kill?

#

seems like so

#

well

#

I will implement sigpending since its easy and I already have everything needed and then tomorrow I implement the thread signaling

grand shadow
wild marsh
#

pthread_kill should be easy enough no?

robust geyser
#

once again astral proven to not be shit

wild marsh
#

assuming your threads behave more like processes that are in one thread group (aka what it's like on lunix meme)

grand shadow
#

tgkill would literally just be loop through the thread list of a process and call signal_signalthread on it if it finds it

#

I can probably do it today

grand shadow
wild marsh
#

i wonder if qemu is gonna also be borked on astral or if that's managarm specific and not mlibc specific

#

qemu seems to struggle with disk io sometimes from what i can tell

#

a simple test bootsector can't reproduce it ofc but iirc grub fails to load when i tried booting the debian gnu/hurd disk image

grand shadow
#

Arhffhfdjdjcndks I think Im doing sigsuspend wrong? Apparently it wants the old signal mask to be restored after the signal returns

#

Jfc I hate signals

#

Ill deal with this tomorrow

fleet osprey
#

btw @analog berry got some ACPI errors for ya, since you were curious about any on my Optiplex
here's some from an HP ProBook 4540s

analog berry
fleet osprey
#

I can, one sec

analog berry
#

Acpi dump + dmesg output would be very nice to have

fleet osprey
#

also I need to swap BIOS -> UEFI for that

#

Limine has bugged video output in UEFI on this laptop, so that boot I sent there is BIOS

#

but Linux is installed as UEFI

#

would that be an issue?

#

if it is I can probably go install GRUB for BIOS on it

analog berry
fleet osprey
#

alright then I'll go install GRUB to the drive as an MBR then

#

just will take a little bit more time

analog berry
#

Nice, thanks!

#

Its very possible that its just a firmware bug because its relatively harmless, but again could be a sign of some other uacpi problem

craggy tide
#

@analog berry btw i fixed the issue from yesterday

analog berry
analog berry
fleet osprey
#

that's the ProBook, it's the one with the weird pitch that you've known about for a bit

craggy tide
analog berry
#

Huh?

craggy tide
#

basically a symbol (the image size) from the linker script had a bogus size compared to when using clang

#

i worked around the issue

analog berry
#

Why did that only manifest itself on that pc?

craggy tide
#

by not importing linker symbols that had difference operation in them

#

well for one it needed GCC

#

and UEFI

#

so that already narrows it down in terms of how many people tested it

#

and then it basIcally manifests as Limine trying to allocate itself in the memory map but the size is really large

analog berry
#

Is the default limine release built with clang or?

#

Why was astral even using gcc there

craggy tide
#

so i guess depending on the memory map layout and depending on the location of the loaded image in memory, it may not have any effect

craggy tide
#

Astral is using GCC because that is what the Limine Jinx recipe in Astral does

#

it uses the Astral cross compiler

analog berry
#

Ah

#

I see now

craggy tide
#

so basically you had to be quite unlucky (or luckly if you ask me lol) to hit the bug in such way that it would cause issues

#

also in the meantime i noticed and fixed another bug but that wasn't this bug

#

in any case

#

yeah

#

software be like

analog berry
#

Nice

fleet osprey
#

actually hang on. I have a dmesg with more in it, because i skill issued the grep

analog berry
#

Thanks ill take a look

#

ah i see

#

uACPI tries to _REG it very early, during namespace load, but it references a symbol thats added later on
This _REG is re-executed again after namespace init anyways

#

ill see why ACPICA doesnt try to do that, but its not really an issue other than the log spam

fleet osprey
#

๐Ÿ‘ just figured I would let you know since you were looking for error logs

analog berry
#

yeah definitely

#

its important to investigate any warning/error for uacpi at this point

supple hatch
#

i lobe uacpi

#

love

#

still waiting for qwinci to work on the uacpi-rs bindings for tables so i can stop using this crappy acpi crate ๐Ÿ˜ญ

#

qwinci great work btw

analog berry
supple hatch
analog berry
#

he literally sent it in your channel

supple hatch
#

he didnt?

analog berry
grand shadow
#

And ps2 works on none going to cry

analog berry
#

lmao

#

dw uPS2 is going to come out any minute

supple hatch
#

ur lying

robust geyser
#

u8042

analog berry
#

lmao

#

id name it that but then people would be like wtf is that

grand shadow
#

Astral is gonna be running webkitgtk on real hardware before ps2 works

errant zephyr
#

ps2+usb hid+i2c keyboard/touchpad+applespi

analog berry
#

tbh that might be a bit of an overkill for one library

#

lmao

errant zephyr
#

you need to do everything at once :^)

#

okay tbf you dont need usb hid in one package

#

but the rest are pretty much just keyboard and mouse

analog berry
#

like if i just do HID i need the host of the library to implement usb on their own

#

and for PS/2 i can just implement an i8042 driver myself

#

so it kinda idk

#

makes it a bit chaotic as to what needs to be implemented where

carmine swallow
#

and usb isn't that bad to implement yourself either, at least its not so annoying as ps2

analog berry
#

although a separate hid parser library like uHID could be done

#

it is just another bytecode afterall

#

maybe i2c could go into uPS2 as well somehow idk

supple hatch
#

release ups2 first

analog berry
#

ill start with i8042 ofc

#

it will have optional uacpi integration as well

#

for finding port numbers and device presence

fervent fjord
#

since when is ps2 annoying

#

its just outb inb

analog berry
#

u wish

carmine swallow
#

that's not the annoying part, the annoying part is the quirks and initialization + mixed scan data and responses

robust geyser
#

since when is writing bootloaders hard

#

u just int 0x13

fervent fjord
#

nah you guys are cooked for this take

analog berry
#

also ps2 extensions like multiplexing and touchpad etc

#

most laptops have those

fervent fjord
#

I have no idea about multiplexing because I just dont, but the rest is trivial even

#

its bad that I do but I seriously doubt the osdev mettle of someone telling me PS2 keyboards are hard

#

mice have a bit of silly to them with the different modes of scan for 3 and 4 buttons and touchpads

robust geyser
#

if you want it to work on the quirkiest hardware possible then it is hard iirc

analog berry
#

well mathewnd has ported tons of software and has a relatively advanced stable kernel

#

yet his ps2 doesnt work on real hw after 3 rewrites

#

so no its not as trivial as you think

fervent fjord
#

I cannot speak as to his project, because I just dont know, there could be complications from a lot of stuff that are project specific, but seriously, I dont get the difficulty

robust geyser
#

look at the ps2 driver in infy's old OS

analog berry
#

the difficulty is you have two ports that have overloaded meaning, the sequence to resetting and detecting devices is also racey, has unspecified timeouts, may reply with random garbage, may not reply at all, may need a different way of resetting, may die because of attempting to detect extensions

errant zephyr
#

basically its just quirky to death

fervent fjord
#

yeah but thats standard device fuckery, all devices have their issues like that

errant zephyr
#

and its a lot of legacy

fervent fjord
#

never attempt a SATA driver

errant zephyr
#

and its a device that is implemented by different people in different ways for the past 40 years

analog berry
#

u have to know which commands are allowed to timeout, which need retries, which need garbage byte discarding, which bytes are not actually garbage, which may hang the controller etc

#

its a giant mess basically

fervent fjord
#

but nothing of that is hard, its just tedious

analog berry
#

way worse than AHCI

#

semantics?

#

sure its not rocket science lol

fervent fjord
#

AHCI in my experience was more fucked up

#

PS2 is just a bit tedious

analog berry
#

ahci is really really bad yeah

#

but for the most parts its setting specific registers and waiting the right amount of time

#

for ps2 its way more mental gymnastics

grand shadow
#

I probably couldve gotten it to work if I could at least test it

analog berry
#

yeah

fervent fjord
#

it might not be PS2 then

#

could be anything really

analog berry
#

wdym?

#

we have the logs from those machines and they reach the bash prompt

fervent fjord
#

I dont know what you have

analog berry
#

the system boots fine, but ps2 says self test failed i think

#

e.g. @fervent fjord

grand shadow
#

Its likely some very specific step in initializing ps2 that I missed
Even nvme works on real hardware lol

analog berry
#

the point im trying to make is its not that trivial even tho "looool its just 2 ports 4HEad "

robust geyser
#

i kinda notice that the older the hardware usually the harder/trickier/quirkier it is to drive

analog berry
#

yeah i mean

#

its because of all the crust and implementations it has accumulated over the years, as well as extensions and not very good initial design

fervent fjord
#

people develop less PS2 controllers nowadays

#

especially with those starting to be baked in CPUs and stuff

#

so less variance

analog berry
#

sorta, nobody uses real 8042s anymore ofc, but a lot of laptops still ship builtin keyboard/mouse over ps/2, as well as some modern mobos that still have ps/2 ports

fervent fjord
#

yeah but back in the day you would have so many manufacturers, nowadays all of those usually live in the super io chip in the mobo which is made by like 3 companies, 1 of them, nuovoton, has like 80% market share

analog berry
analog berry
# fleet osprey

ok yeah i cross checked with ACPICA, it doesnt run _REG that early unless the namespace has already been loaded (aka we're in a method call or very late host-invoked table load), so ill add that condition as well

#

thanks for testing

flat copper
#

and it's chinese and quite shady (developers block all discussion of non-shit solutions for booting without injecting a potential rootkit)

errant zephyr
#

tbf

flat copper
#

the repo is full of prebuilt binaries for god knows what

errant zephyr
#

yeah

#

but i think they have sources for that

flat copper
#

yeah but even if they do they're wildly outdated

errant zephyr
#

iirc the sources ARE there

#

ah

#

fucking great

#

i mean tbf

#

i have no idea how to do what they do without doing weird shit

#

hmm

#

okay now i have one idea

#

kinda

errant zephyr
#

i have one good idea and it requires you to have an amd cpu and a bios that isnt patched for the smm memes

#

and i have another idea of just running a vm

#

and faking a disk that way

#

and another idea of stealing an AP to run a virtio

#

i have no idea if there is actually any non awful way to do it though

#

you basically need to convince a distro to mount a volume, losetup a file in that volume, and use that as the root

#

not sure if there's a way to magic that together even with linux

#

let alone the bsds

#

ok well with linux just patch the kernel ig :^)

#

or patch the initial ramdisk to do the magic

#

and then stage into the real ramdisk

#

for windows isos, fake up netboot

#

on linux maybe use the ramdisk stuff to copy the iso to there

#

or just inject a driver that autoprobes itself and always declares there to be the right iso in memory

#

and claims to be a block device

#

or fake some sort of device

#

somehow, ideally with aml

#

ok cursed idea

#

choose a device with a doorbell

#

point doorbell at lapic self-ipi

#

to the acpi event vector

#

simulate a disk in aml

fervent fjord
#

ventoy is bad because it doesnt use limine

#

no more hoops

fleet osprey
# grand shadow How many machines do you have holy shit

to quote my notes from testing Limine USB boot (where I tested Astral as well as the C template across various boot methods), mostly because I'm too lazy to retype it meme

[2] - I have the tested all cases possible based on following list of hardware:
        - HP ProBook 4540s                                          [UEFI (known buggy), UEFI CSM)
        - Dell OptiPlex 755                                         [Legacy BIOS]
        - Lenovo ThinkPad T14 Gen 1 (AMD)                           [UEFI only]
        - Custom PC, ASUS PRIME H610M-E D4, Intel Core i3-12100f    [UEFI]
        - Dell Precision T1650                                      [UEFI, UEFI CSM]
        - QEMU, see note 3!                                         [UEFI, Legacy BIOS]
      I planned to also test on the following, but couldn't due to one reason or another, unrelated to Limine
        - Dell Latitude E5250                                       [UEFI, UEFI CSM]
#

oh and if you would've asked that a month ago, I would also add a ThinkPad T480, and a Latitude 5491

#

I sold those 2 sadly

grand shadow
#

I think after I get qemu working I will go and do some more general improvements along the kernel

#

Like making pci check for drivers in a section

#

Same thing for other things which need 192829378 blahblah_init

#

To clean up the code

fleet osprey
#

ooh

#

nice

grand shadow
#

Goal is to have as little driver init code in main as possible

fleet osprey
#

good goal

supple hatch
#

techflash you can ever try nyaux on ur optimux prime pc memedown ?

#

mayybeeee

#

i mean do in ur own time but it would be quite helpful when i get to writing drivers for the OS, currently trying to fix uacpi atm

fleet osprey
# grand shadow Like making pci check for drivers in a section

just a note on this though - I would probably have a global driver_init or similar, rather doing it in PCI init
that way it's set up to handle non-PCI backed devices when support for those are ready
like probe for devices on all available devices, like PCI, USB, (maybe weird shit like i2c or whatever?), then based on that list of all devices found, init some drivers

supple hatch
#

like i plan to support things like smp and multiple ioapics in this rewrite

supple hatch
#

yooo les goo

#

๐Ÿ˜Ž

fleet osprey
#

if you would've asked an hour ago I could've done it immediately

#

but now you gotta wait until I get out of school :(

supple hatch
#

no need i still need to fix uacpi

fleet osprey
#

ah

supple hatch
#

ill let you know when thats fixed

#

then u can test it

fleet osprey
#

k

grand shadow
#

Same thing for acpi and usb and etc

fleet osprey
#

ah

grand shadow
#

why did init die memedown

#

the qemu window did open though

#

so thats progress

#

signaled so hard I killed init

grand shadow
#

does seem like some thread is stuck in kernel mode

#

nvm?

#

I think something is racey

#

oh defo

fleet osprey
#

uh oh

grand shadow
#

seems like something deadlocks the vmm

#

the kernel vmm space lock in particular

#

pulled out gdb and looking into this rn

grand shadow
#

the mutex has several threads waiting on it without a thread holding it which wtf

#

either my wakeup is broken or my semaphores are broken

grand shadow
#

seems like the thread just doesnt get woken up?

grand shadow
#

welp that was fucking stupid

fleet osprey
#

oh?

grand shadow
#

it was an issue in my yield -> sleep -> get interrupted by a signal instantly instead of sleeping path

#
        thread_t *next = runqueuenext(sleeping ? 0x0fffffff : thread->priority);
        bool gotsignal = false;
        for (int i = 0; i < NSIG && thread->proc; ++i) {
                void *action = thread->proc->signals.actions[i].address;
                if (SIGNAL_GET(&thread->signals.urgent, i)) {
                        gotsignal = true;
                        break;
                }
                if (action == SIG_IGN || (action == SIG_DFL && signal_defaultactions[i] == SIG_ACTION_IGN) || SIGNAL_GET(&thread->signals.mask, i))
                        continue;

                if (SIGNAL_GET(&thread->signals.pending, i) || SIGNAL_GET(&thread->proc->signals.pending, i)) {
                        gotsignal = true;
                        break;
                }
        }

        if (sleeping && (thread->shouldexit || gotsignal) && (thread->flags & SCHED_THREAD_FLAGS_INTERRUPTIBLE)) {
                sleeping = false;
                next = NULL;
                thread->flags &= ~(SCHED_THREAD_FLAGS_SLEEP | SCHED_THREAD_FLAGS_INTERRUPTIBLE);
                thread->wakeupreason = SCHED_WAKEUP_REASON_INTERRUPTED;
                spinlock_release(&thread->sleeplock);
        }
#

it gets the thread at runqueuenext but if it gets interrupted it doesnt put it back there

#

which means the thread gets lost in the limbos of the kernel

fleet osprey
#

ah

grand shadow
#

only happened now because the way qemu does coroutines forces this to happen

fleet osprey
#

you may want to implement some form of locked up thread detection
I've found that immensely useful when poking at Linux drivers

#

and that would've caught this

grand shadow
#

this is the thread effectively being lost by the scheduler and never found again ๐Ÿ’€

#

2 line fix anyway

fleet osprey
#

ah... yeah may not have solved that, I misunderstood what you meant ig

#

I thought you meant that the thread technically still existed, but the scheduler just didn't actually give it any time

grand shadow
#

still has some rough edges (wtf is causing it to segfault? and only one thread?)

#

but it does work

#

gonna see if some more complex iso works

#

what should I try

#

not too big so I dont have to wait for the download too much

fleet osprey
#

boot Astral in Astral troll

grand shadow
#

hmmmm

#

I think I have a minimal iso in my server

#

100 mb

#

damn

#

I'll just toss it into the hard disk image

fleet osprey
#

I wonder how many layers deep you could theoretically get before something blows up

#

maybe you could get Astral in Astral in Astral before any of the QEMU processes segfault, if you're fast enough

grand shadow
#

its super slow lmao

#

wait no

#

oops I passed the iso as a hard disk

fleet osprey
#

oh yeah that doesn't work with how you make your ISO for some reason
that's an issue I was looking at investigating eventually, because other Limine ISOs (particularly, I tested with the C Template) do work with that setup

grand shadow
#

yeah qemu is super unstable

#

I need to see what it complains about

#

also I wonder what 75 is

#

yeah I need to see WTF its trying to do with memory

#

but thats something for tomorrow

#

oop almost got to the limine screen

#

signal stack keeps being bad

#

which idk if is my sigaltstack issue or qemu's

#

I think it trying to load from disk is causing it to be slow

#

ohhh yeah the background

#

almost there

fleet osprey
#

damn

#

even if it can't do it yet, it's still impressive as hell that it's even to the point of trying

grand shadow
#

I just need to unfuck whatever qemu is trying to do with memory and make it faster

#

yeah its too unstable

#

it didnt load the kernel

fleet osprey
#

tbf, QEMU w/ TCG is just slow :P

grand shadow
#

yeah but here its like

#

ultra slow meme

fleet osprey
#

hmmm, wonder why
does it suck trying to load from disk perhaps?

#

like you're thinking?

grand shadow
#

that is probably one of the things

#

its still very slow regardless

#

but yeah it taking really long to load the disk is probably just astral's disk drivers sucking

#

tomorrow tho jesus christ thats enough osdev for me today

grand shadow
#

alright tomorrow I will make qemu stable and then make it fast (as fast as I can anyways)

craggy tide
#

also, any Limine is recursive Limine if it is running on my machine :^)

grand shadow
#

true

obsidian pivot
#

W

#

W

grand shadow
#

something is telling me my signal alternative stack is not right

#

addr2line says the } after return ret segfaults

#

which is more like the stack is bad

#

and its not a protection issue, there is just no range

#

I should log to see what signal stack it wants to set

#

I hate posix signals

obsidian pivot
grand shadow
#

well that was idiotic

#

I think I fixed it

#

time to see if I can load astral for real this time

#

So far so good

#

Go into limine promot

#

Aaand pressing enter made it kill itself

#

Nice

obsidian pivot
#

you click enter and it triple faults

#

bcuz curse

grand shadow
#

Qemu passed an invalid sigstack when I pressed enter for some reason

obsidian pivot
#

but ofc having qemu is a big W

grand shadow
obsidian pivot
#

no it's the triple fault part

#

since I got an astral iso I'm going to test it

#

on my hw

grand shadow
obsidian pivot
#

currently at af92e8eb871e3e6317e02b55637bc24a64eeed07

grand shadow
grand shadow
obsidian pivot
#

since I have no nvme no disk tests

#

idk if astral has ahci/ide

grand shadow
#

sadly it doesnt

obsidian pivot
#

which reminds me I have my disk controller on ide emu

#

because I was tryna run DOS

#

and thought that would matter for some reason

grand shadow
#

should put it on nvme emu meme

#

wait I dont think the sigaltstack is bad I'm just stupid

obsidian pivot
#

Was that vmm bug from techflash fixed

grand shadow
#

and doing it wrong I think

grand shadow
obsidian pivot
#

Guess my firmware is fucky then

#

OBOS almost boots fine on my hw

#

It only gpfs sometime during kernel init

grand shadow
obsidian pivot
#

Yes

grand shadow
#

do you have it built

obsidian pivot
#

Yes

grand shadow
#

can you do this

obsidian pivot
#

Sure

grand shadow
#

this time it'll be fr

#

oh god its gonna take so long to load

#

I think I'm just loading the kernel for now ๐Ÿ’€

#

actually waitttt

#

I might just run from tmpfs this one time

obsidian pivot
#

my camera is dogshit

#

But

#

It had an unaligned address before crashing

#

E057e400

#

Type 5

grand shadow
#

type 5 is bootloader reclaimable I think

obsidian pivot
#

Which is btlder reclaimable I think?

#

Jinx

grand shadow
#

which needs to be 4096 aligned

#

bruh

#

@fleet osprey what ended up being the issue with the unaligned bootloader reclaimable

obsidian pivot
#

I'm booting straight from limine btw

#

No ventoo or anything

obsidian pivot
#

This length looks sus

fleet osprey
#

official builds use clang, Astral's uses GCC, which had a bug, it was fixed now tho

obsidian pivot
#

0xA5433cc00bytes of reclaimable bootloader ram?

fleet osprey
#

if you want to bump to 8.0.10, it's fixed there

grand shadow
#

ohhhhh

#

yeah that sounds like a good idea

#

@obsidian pivot it wasnt astral vmm bug nor firmware bug it was gcc bug

obsidian pivot
#

common hyper W /j

#

Shit

#

Brain fart

fleet osprey
#

it was a GCC bug that created a Limine bug that makes Astral explode

obsidian pivot
#

Ignore thatmsg

fleet osprey
#

such a chain of events lol

obsidian pivot
#

so how exactly

#

do I bump limine

#

I have no idea how astral's code structure works

fleet osprey
#

Look at what I did in my pr

#

Just don't touch the config like I did (was only necessary due to major revision bump, 7.x.y to 8.x.y)
Only do the version bump

#

Hell I might just do it from the GitHub web editor on my phone

grand shadow
#

you still need the checksum of the package

fleet osprey
#

Bold of you to assume I can't obtain a sha512 on Android

obsidian pivot
#

it'd be funny if astral crashes on my hw because of an allocator bug

grand shadow
#

anyways time for the truth

obsidian pivot
#

during uacpi init

obsidian pivot
grand shadow
grand shadow
#

oh god its still slow

#

a bit faster though

obsidian pivot
#

bruh all I did was do the thing

#

git pull

#

why is it doing all this

#

and what does libotolize do

#

and why is it taking so logn

grand shadow
#

poor oberrow

#

I did a fuckton of changes to packages youre gonna be in there for a while

#

do a make clean and change DISTROTYPE to minimal

obsidian pivot
grand shadow
#

in the makefiel

#

oooooo

fleet osprey
grand shadow
#

just ssh into astral 5head

obsidian pivot
#

it's building GCC again

#

I've had enough of building GCC

#

(ptsd from m68k port)

#

((and slightly cursed gcc))

#

(((and binutils)))

#

((((it didn't like my ld script))))

#

(((((only compiling with gcc though)))))

#

((((((clang worked fine))))))

#

(((((((common GCC L)))))))

grand shadow
#

gcc

#

boo

fleet osprey
#

Bruh GitHub is stupid

#

It opened the PR on my own fork

obsidian pivot
#

sounds about right

#

they gave me free storage for my computer backup

#

(they don't know it)

#

((hehe))

#

dam that was fast

#

already on mlibc build

#

b r u h

#

t h a t

#

w a s

#

b i n u t i l s

fleet osprey
#

There we go
Created, committed, and made a PR, all from my phone, sitting on the toilet
Quite possibly the funniest thing I have done in my entire life

obsidian pivot
#

not a chain of events I thought I'd ever hear

#

but here I am

fleet osprey
#

@grand shadow you should merge it, for the funnies, lol

obsidian pivot
#

FUCK

#

LIMINE WASN'T BUMPED

grand shadow
#

just ./jinx host-rebuild limine

#

its that simple

obsidian pivot
#

good

grand shadow
#

@fleet osprey if it doesnt work I will come out of the toilet and get you

fleet osprey
#

Oh no

#

Uhh tbf I actually didn't test it

grand shadow
#

cant test atm cuz qemu is busy waiting for qemu waiting for limine to load an initird

fleet osprey
#

No reason it should break tho, it's a simple version bump

obsidian pivot
#

well guess I'm testing it then

grand shadow
#

it did not work

#

I am coming for you

fleet osprey
#

๐Ÿ‘€ whar

grand shadow
#

you forgot the tarball_sha512="

obsidian pivot
#

ban him

grand shadow
#

pushed the fix

fleet osprey
#

I missed the quote?
Bruh, GitHub default editor moment

obsidian pivot
#

no you missed the tarball_sha512="

fleet osprey
#

Oh shit it nuked the entire var?

obsidian pivot
fleet osprey
#

Wtf??? I'm ashamed in GitHub now

grand shadow
#

damn limine is still loading the initrd

#

its gonna be beuatiful when it works

#

or I could have just

#

passed a minimal nvme disk to it

#

oh

#

well too late now sunken cost time

#

ah fuck it

obsidian pivot
#

FINALLY

#

IT'S ALMOST DONE

grand shadow
#

btw do git pull again when youre done I removed a funny debug print I forgor about

#

(itll just rebuild the kernel if you run make)

#

aaaaa more sigaltstack memes I think

obsidian pivot
#

WHY

#

TH

#

FUCK

#

IS IT

#

is that

#

coreutils

#

or the other thing

#

gcc

grand shadow
#

probably coreutils since thats in the minimal iso

#

if you remembered to change it to DISTROTYPE=minimal in the makefile lol

obsidian pivot
#

I did

grand shadow
#

then its coreutils

#

it only builds gcc once

obsidian pivot
#

ye its coreutils

grand shadow
obsidian pivot
#

FINALLY

#

AHHHHHHH

#

THIS BETTER WORK

grand shadow
#

__ensure(!"unimplemented"); strikes again

obsidian pivot
#

FUCK

#

SAME PLACE GODDAMNIT

#

I'm off to sleep

grand shadow
#

damn rip

obsidian pivot
#

Don't wanna deal with this shit

grand shadow
#

did it run with the new limine

grand shadow
#

Was that what yall had run into?

#

gonna try this in real hardware then go to sleep

grand shadow
#

Cool probably some mprotect memes?

#

Too lazy to find out

#

(note the kernel didnt panic I just printed the context of the segfault)

robust geyser
#

love the kerneรง

#

you should try porting another wm maybe? :^)

fleet osprey
#

i3 my beloved :)

grand shadow
#

I like how fvwm looks but maybe I can add another option other than twm and fvwm

grand shadow
neon crane
grand shadow
#

Nah its just my brazilian ass doing a typo

wild marsh
grand shadow
#

I mean its just a missing sysdep its not that hard

#

Its like a pread but readv

#

Though yeah checking it again would be nice, I assume it mightve been fixed already

#

(since limine loads the kernel just fine)

#

Or maybe its a grub only issue

wild marsh
#

link to astral iso?

supple hatch
#

or nah

grand shadow
#

Its a bit old but should work

wild marsh
#

lemme try that then

wild marsh
#

Boot failed: Could not read from CDROM (code 0005)

#

and i don't see it calling preadv

#

only some warnings about mincore

grand shadow
wild marsh
#

but i don't think those are from qemu (maybe mesa? idr)

robust geyser
#

works for me

#

(the iso)

wild marsh
#

i have absolutely no idea why the reads seem to fail

grand shadow
#

Maybe managarm memes

robust geyser
#

qemu-system-x86_64 -cdrom bootdisk.iso boots into limine

#

probably

#

or maybe old qemu/seabios

#

maybe a bugged seabios version

wild marsh
#

qemu 8.1.4 with seabios 1.16.2

robust geyser
#

1.16.3 here

#

and qemu 9.0.2 or whatever

#

so yeah i doubt

#

what command line did you use?

wild marsh
#

qemu-system-x86_64 -m 256 -cdrom bootdisk.iso

#

inb4 the DEBUG message is from sdl

robust geyser
#

can you sha256sum the bootdisk?

#

793f17469b0518fd92dcfb4ccd1dc6abcb7374cf735cab383f59582fe3192126

wild marsh
robust geyser
#

also try qemu-img info bootdisk.iso

#

maybe qemu is fucking something up

#
image: bootdisk.iso
file format: raw
virtual size: 101 MiB (105549824 bytes)
disk size: 101 MiB
Child node '/file':
    filename: bootdisk.iso
    protocol type: file
    file length: 101 MiB (105549824 bytes)
    disk size: 101 MiB```
#

thats the result for me

wild marsh
#

prints the same thing

robust geyser
#

interesting

#

some people say it might be something to do with permissions

wild marsh
#

i mean it reads fine for a bit and then fails later on

robust geyser
#

odd

wild marsh
#

from seabios code (return value is the code that's shown) ```

// Validity checks
if (buffer[0])
    return 4;
if (strcmp((char*)&buffer[1], "CD001\001EL TORITO SPECIFICATION") != 0)
    return 5;
#

inb4 off by one error in pread or something

#

hm i wonder if it behaves any better if i put the iso on tmpfs

#

okay it works better if i put the iso in /tmp

#

so it's a bug in libblockfs

#

now the kernel panics

grand shadow
#

Damn assertos moment

errant zephyr
#

lmfao

grand shadow
wild marsh
#

weston doesn't draw any server side decorations

#

sdl supports libdecor though which provides client side decorations for it so we could get that

wild marsh
grand shadow
#

Just run it on xwayland ez

wild marsh
#

i don't think it makes a difference for sdl?

carmine swallow
#

btw @grand shadow what is the codec model on either one of the pc's/laptop that you tested the hda driver on? iirc you can find that in device manager when going to the properties of the soundcard (or alternatively you could just send the string in the bios path property or whatever its called that contains the pci vendor/device id)

grand shadow
#

Lemme see

#

Ill send of both since Im gome

#

Home

carmine swallow
#

thanks, the reason that I wanted them was that I want to make sure that there is not some random weird gpio stuff that would have to be done for those specific cards because if its something like that then there is no way I can fix the issue by just guessing what the problem is

grand shadow
#

this is my desktop

#

my desktop has the nvidia gpu one too but I sent the mobo one

#

INTELAUDIO\FUNC_01&VEN_10EC&DEV_0295&SUBSYS_1025143F&REV_1000\5&42ED54C&0&0001

#

my laptop

carmine swallow
#

looks like they are alc887 for the desktop and alc1220 for the laptop

#

or maybe alc295 for the laptop, idk there seems to be some conflicting info but its good enough anyway

grand shadow
#

Hopefully you can figure out whats wrong that makes them not work

carmine swallow
#

at least for the desktop one doesn't look like there are any other quirks than some pll hw bug (I highly doubt that it would cause the issue you are having tho)

#

but ig I can add the fix for it

grand shadow
#

What is this pll bug

carmine swallow
#

idk it doesn't explain what it causes ```c
/*

  • Fix hardware PLL issue
  • On some codecs, the analog PLL gating control must be off while
  • the default value is 1.
    */
analog berry
#

A phase-locked loop or phase lock loop (PLL) is a control system that generates an output signal whose phase is fixed relative to the phase of an input signal. Keeping the input and output phase in lockstep also implies keeping the input and output frequencies the same, thus a phase-locked loop can also track an input frequency. And by incorpora...

carmine swallow
#

yes

#

though the thing with hda in general is that there are a lot of quirks (there is a 10k line file in linux for the quirks in realtek codecs, though tbh that's like the majority of all of them anyway)

#

idk how likely do you run into them tho

#

especially with a playback only driver that doesn't do any jack detection or anything more advanced like that

winged basin
#

horrible

carmine swallow
#

yeah that's bad

carmine swallow
#

I added the quirk, idk if its worth testing again yet tho (and not rn anyway because I am rebuilding astral)

#

if only I would have more machines myself that I could test this stuff on KEKW I only basically have the tigerlake laptop and then my desktop that has alc897

#
  • qemu and vbox ofc but pmuch any driver will work on them no matter how garbage it is
obsidian pivot
#

@grand shadow

#

I have pulled

#

Astral

#

and my limine is a version behind

#

I run the jinx rebuild command twice for limine

obsidian pivot
#

from make initrd img

fleet osprey
obsidian pivot
#

well maybe not

#

I'm rebuilding it

fleet osprey
#

yeah, if Limine isn't built, how do you expect to be able to build an image using it's files ๐Ÿ˜…

obsidian pivot
#

no like

#

I rebuilt astral

fleet osprey
#

that probably should've rebuilt Limine, but just run that command for me

#

just to verify

#

because if it doesn't exist or is empty, well there's your problem

grand shadow
grand shadow
#

and limine is there

#

Hm

fleet osprey
#

I'm already trying it from a clean build just in case

#

but I don't see any reason it wouldn't work unless host-pkgs/limine just flat out doesn't exist, or is empty

obsidian pivot
#

it exists

#

*existed

fleet osprey
grand shadow
#

doesn't work for me either

#

seems like whatever make does doesnt make {,} expand

obsidian pivot
#

finally finished

#

time to

#

test it

grand shadow
#

I'll push the fix

#

done

#

@obsidian pivot pull and it should work

obsidian pivot
#

PS2 bugged

grand shadow
#

the mathewnd curse

obsidian pivot
#

But it at least boots though

grand shadow
#

and does power button work? (for infy)

obsidian pivot
#

Power button works

grand shadow
#

based

obsidian pivot
#

But never shuts down

grand shadow
#

it takes like 5 seconds for SIGKILL

#

cuz bash ignores sigterm

obsidian pivot
#

It said powering off

grand shadow
#

oh bruh

obsidian pivot
grand shadow
#

well its still safe to turn off your machine meme

grand shadow
obsidian pivot
#

Your bug

#

OBOS can shutdown fine

grand shadow
#

bruh

obsidian pivot
#

On this hw

#

Gl

grand shadow
obsidian pivot
#

I'll check

#

Doesn't look like anything with ps2 in bios settings was touched

#

And my older obos rewrites worked with ps2 emulation on that machine

#

Tbf they didn't support multiple ports

grand shadow
#

did they do the whole ps2 reset stuff

obsidian pivot
#

Probably not

#

Didn't even touch the controller

grand shadow
#

hm

obsidian pivot
#

I have a laptop I can test eventually

#

With native ps2

analog berry
#

astral skill issue then

#

i doubt it even reached uacpi there

craggy tide
analog berry
#

but u can try with a different log level

craggy tide
#

make uses /bin/sh

#

so if /bin/sh isn't bash, bashisms won't work

grand shadow
#

yeah I figured

grand shadow
#

but he can see

analog berry
#

add printfs to kernel i guess

grand shadow
obsidian pivot
#

You see I would

#

But I gtg

obsidian pivot
grand shadow
#

my guess would be obos does some more initialization or smth I dont do

obsidian pivot
#

For what

grand shadow
#

acpi

obsidian pivot
#

Well I just initialize uacpi as I did in my 3rd kernel

#

Which was taken from the test runner

#

In February

#

Or January maybe

#

And I also added the gpe finalization thing

#

I need to fix gpes in obos

carmine swallow
obsidian pivot
#

I get infinite irqs

#

On onos

#

*obos

analog berry
#

not that it should matter

#

but maybe it does on that hw

#

anyway we need logs to see what happens

obsidian pivot
#

Maybe it does

#

My log level is info

#

For uacpi on obos

analog berry
#

by logs i mean in astral kernel

#

perhaps new printf statements in the write handler for /dev/acpi

obsidian pivot
#

I thought you meant to see if gpes are finalized

#

But anyway

analog berry
obsidian pivot
#

Bruh obos seg faults

#

On real hw

analog berry
#

lmao

analog berry
obsidian pivot
#

My panic has no stack trace

#

So I have no clue how this could've happened

#

All I get is an rip

obsidian pivot
fleet osprey
# obsidian pivot also

btw, just did a fully clean build and have no issues with installing Limine like this
sounds like you did something wrong on your end

craggy tide
#

no no

#

as i said it's a bashism

#

it depends on which /bin/sh on the host

fleet osprey
#

oh? I missed that, was on the bus

#

my bad

craggy tide
#

his /bin/sh is not bash, that's why he had the issue

#

it was fixed anyways in latest Astral commit

fleet osprey
#

ah, alright

grand shadow
#

doesnt bash when ran on /bin/sh do a compat mode of sorts or smth

#

I could've sworn it did

#

but maybe not

#

on my system it seems like /bin/sh is dash

fleet osprey
#

yes-ish iirc

#

it does run with some compatibility stuff, but not all

#

you have to do extra steps within the script itself to ensure that you're running 100% compliant to POSIX with no extra extensions

#

which is stupid, but iirc is just how it is

grand shadow
#

downloading qwinci's iso to test

#

@carmine swallow WTF

#

It bugs out for a few seconds then just works????

#

wonder if it could be playing unitialized memory for a bit until it starts running the actual song?

analog berry
#

dont forget theres also the header for this file format

grand shadow
#

ohhhh true