#uACPI - a portable and easy-to-integrate ACPI implementation

1 messages · Page 26 of 1

north holly
#

try this iso (it disables lto for the allocator)

left orbit
#

same crash

#

680k-ish

north holly
#

try this

#

(it disables LTO in it's entirety)

left orbit
#

i dont think it crashes anymore

#

728k

north holly
#

ok

left orbit
#

1.23M

north holly
#

@fiery turtle if my spinlock kernel api aren't stubbed, but instead my allocator has no locks when it should, does that score not count?

left orbit
#

1.48M

north holly
#

amazing

left orbit
north holly
#

now I need to fix my fucking spinlocks™️

left orbit
#

it just keeps getting better

north holly
#

@dusky glade

north holly
dusky glade
#

good job tho

left orbit
slim panther
#

@north holly fix logging format

#

trips my ocd

left orbit
#

ok i give up trying to run it and get a better score

#

1506330 ops/s is the final score

north holly
#

@gentle peak I need your wisdom

#

how do I optimize

#

me spinlocks

left orbit
#

maybe u should ifdef the minIrql checks lmao

north holly
#

minIrql is a parameter

left orbit
#

yeah?

#

isnt it compile time known?

north holly
#

almost

gentle peak
#

idk how much of what you're doing is necessary since im not familiar with the design of your kernel

#

so the only advice I can give is using acq rel memory order instead of seq cst

north holly
#

nvm

gentle peak
#

also I seriously doubt spin locks are the bottleneck

north holly
#

numbers

fiery turtle
#

idk if this falls under that

#

kinda does

frank canopy
#

@fiery turtle btw, does early table access use synchronization calls? i need early table access done so i can set up prcbs for synchronization

#

also if thats arguably wrong then my score is debatable because while my old PMM is synchronized iirc, the zig gpa is being given no mutex type atm

frank canopy
#

perfect

frank canopy
#

cool

#

ill just have to figure out how to swap out my map/unmap once the MM is initialized lol

fiery turtle
#

u can check the current uacpi init level to decide if u want to call early map or normal map

frank canopy
#

oh yeah tru

#

i was gonna do my own init level but that also works

#

before my MM gets initialized my map is an addition for the bootloader hhdm, afterwards its a completely different function lol

#

but i need the madt to get sync stuff online which the mm needs so whatever

fiery turtle
#

yeah thats pretty normal

#

uacpi warns you if there's any unmapped memory that was mapped early

north holly
left orbit
#

tghdefrnbexF ed

north holly
#

could someone test this and give me the results

left orbit
#

of Course

north holly
#

thanks

#

it doesn't stop locking the allocator

#

and optimizes spinlocks

left orbit
#

i got 1.3M

#

sometimes it does that tho

#

well, triple faults then does that

north holly
#

meh

north holly
left orbit
#

1.335M

north holly
#

rebooting has stopped working in obos

north holly
#

pls and thx

left orbit
#

why not use the 1.5M from earlier

north holly
#

since the allocator had no locks while it should've been locked

left orbit
#

i need to run it a bunch of times in hopes of being put on a good cpu lol

north holly
#

lol

left orbit
#

tahts even better

north holly
#

thanks again

#

@fiery turtle I updated my score in the pinned message

left orbit
#

no worries

calm latch
#

for qemu

left orbit
#

i use qemu-system-x86_64 -serial stdio -cpu host,migratable=off,+invtsc,tsc-frequency=100000000 -M q35 -accel kvm -cdrom obos.iso

north holly
#

qemu-system-x86_64 obos.iso -M q35 -m 1G -accel kvm -cpu host -debugcon file:/dev/stdout

#

I initially sent

#

that

left orbit
#

might be missing 1 zero in the tsc frequency

#

but it doesn't affect anything

#

the vm might just run a bit slower

north holly
#

mainly because I don't have TSC

north holly
#

smh I have been boycotted

left orbit
#

totally yeah

#

i did that on purpose

#

obos actually scores 13.7M

north holly
#

🤯

calm latch
left orbit
#

just dont tell anyone that they can add that extra zero to the cmdline tf

left orbit
north holly
#

i7-13700

#

knew it

left orbit
#

u missed the K

#

very important

north holly
#

I'm surprised I remembered that from the one screenshot you sent

calm latch
#

It's like 5x slower on 5900X

north holly
#

try rebooting

calm latch
#

Though I'm testing on Windows in WSL

north holly
#

AMD skill issue meme

north holly
left orbit
#

yeah i do wsl too

#

i just have to run it a bunch of times

calm latch
#

pmOS has gotten 1.8 million on that PC

left orbit
#

because hyperv is trolling

calm latch
#

On my PC

#

too much trolling

#

5900X should be on par with 12700K or something

north holly
#

unfortunately, my optimziations also kinda break obos on real hardware

#

(todo)

calm latch
#

Not too far away from 13700K

#

I can test baremetal ultrameme

#

After pmOS

north holly
#

OBOS is broken on AMD

left orbit
#

this is kinda bad because aml is different

north holly
#

remember

calm latch
#

Still

left orbit
#

wont give you the same number as qemu aml

calm latch
#

Should give something similar

left orbit
#

oh no lol

#

it doesn't

fiery turtle
left orbit
#

proxima did 9M in qemu with some optimizations

#

and on bare metal it did ~1M

#

just because it runs like 26k aml instructions

#

instead of 1.7k

#

it varies wildly between hardware

fiery turtle
#

its more like, what that aml does

left orbit
#

yeah

#

i was about to say

fiery turtle
#

maybe it has literal sleep calls

#

which is very possible

left orbit
#

qemu mainly stresses allocator + sychronization primitives

fiery turtle
#

yea

north holly
#

credits to marca for helping me optimize spinlocks

#

man told me like one thing and this happens

#

he isn't on this server anymore

#

tho

fiery turtle
#

What did he tell you

north holly
#

You could also see if forcing alignment on the atomic_flag to something like 8 bytes helps

#

#350158983316766730 message

#

(beware before clicking on the link, it's in hotgarbage)

#

((come prepared))

#

(((gl)))

fiery turtle
#

Yeah I ain't reading that channel

zenith crescent
north holly
#

lol

fiery turtle
#

alright leaderboard update time

north holly
#

lesgo

north holly
# north holly lol

for anyone who doesn't know, think of that channel like breaking every rule of this server at once

left orbit
#

also please don't use . as the separator in the numbers ☠️

north holly
#

.

#

...

calm latch
#

north holly
#

I can't wait for my position in the leaderboard to not change at all because everyone else optimized their stuff too

calm latch
#

I need to retest pmOS urgently

north holly
#

unless pmos didn't

#

then I'm in luck

#

because 1.3M>700k

zenith crescent
#

I need to get my kernel to a state where I can use uACPI...

calm latch
#

Can it wait for 20 minutes?

#

I need to recompile clang

north holly
#

No.

north holly
#

that means decimal

#

like 1.5

#

1.7

#

a comma is the proper separator

fiery turtle
#

A decimal separator is a symbol that separates the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choice of symbol also affects the choice of symbol for the thousands separator used in digit grouping.
Any such...

left orbit
#

yeah comma is a more proper separator

fiery turtle
#

it depends on the country

left orbit
#

yeah it does

#

BUT

fiery turtle
#

i stick to US english in the docs, so . is consistency

left orbit
#

yeah.

#

but US english uses "." as a decimal point??

#

😭

fiery turtle
#

yea

zenith crescent
#

it's not just US english that does. British english also does it

left orbit
#

WHAT

#

that is so foul

north holly
#

exactly

calm latch
#

I've seen people in Spain use '

left orbit
#

even better

north holly
#

isn't decimal separator like

#

1.5

north hull
#

how is this a surprise

left orbit
#

YEAH

#

THATS WHAT I THOUGHT MY WHOLE LIFE

#

1.5 means 1 1/2

north hull
#

yes

north holly
#

and . is decimal separator

fiery turtle
#

thats the same thing

north hull
#

lmao

left orbit
#

or well, 1.500 would be 1+1/2 whereas 1,500 is 1500

median crest
#

local discord users learning about different languages, life is beautiful

north holly
#

I'm in canada, so idk how that differs from US english except for the fact that canada wants to try and be different

zenith crescent
north hull
#

I'm Finnish and it always trips me up that we reverse them

calm latch
north holly
#

A decimal separator is a symbol that separates the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choice of symbol also affects the choice of symbol for the thousands separator used in digit grouping.
Any such...

zenith crescent
north holly
#

pretty much

fiery turtle
#

I think oberrow was right

left orbit
#

1,234,567.89

fiery turtle
#

thousands separator is ,

left orbit
#

yeah i was right

#

I SAID THAT

fiery turtle
#

lol sorry maybe u did

north holly
#

so did I

left orbit
#

😭

#

hey but i was first

fiery turtle
#

. is decimal and , is thousands

north hull
#

yes

#

in English

north holly
#

US english

fiery turtle
#

its the same in europe i think

zenith crescent
north holly
#

in "canadian english" the thousands separator is a space

zenith crescent
north holly
#

but I have never seen any canadian do that

north hull
calm latch
left orbit
north holly
#

same thing in "canadian french"

left orbit
#

help

north holly
#

except the decimal separator is ,

median crest
#

just use scientific notation and fractions

north holly
#

il sera "100 000,50" dans le francais canadienne

median crest
#

no fighting about separators

zenith crescent
fiery turtle
#

@hollow elm im updating the leaderboard and managarm is still using the old measurement with old uacpi, do u want to quickly do an update to latest to check if its better? (some people got a 5x speedup from just the update)

left orbit
#

i got it

hollow elm
north holly
#

there was a man page explaining TTYs but I forgor what it was

#

does anyone know

#

??

left orbit
#

man pty or smth

median crest
left orbit
#

oh there u go

fiery turtle
median crest
#

man 7 pty is for ptys themselves iirc

left orbit
#

pty is a diff thing nvm

#

yeah

hollow elm
zenith crescent
median crest
#

though termios doesnt go in depth about what they are, you probably should read that one article hold on

left orbit
#

what score have u got queued up for proxima?

north holly
#

ttys demystified

#

yeah

median crest
fiery turtle
left orbit
#

nice

north holly
#

I got 2 days and 5 hours to get bash

fiery turtle
#

some osses have shifted places

median crest
#

I probably went like down a place or two

fiery turtle
#

but proxima is still undefeatable

calm latch
#

New pmOS score?

#

On 5900X

left orbit
#

i just got 2.7M

north holly
left orbit
fiery turtle
fiery turtle
left orbit
#

bro actively ignoring me 😭

calm latch
#

Oh

north holly
#

damn it

left orbit
#

lmaoo

north holly
#

obos hasn't shifted

calm latch
#

I didn't know it was pmOS

left orbit
#

well u sent the iso

#

i even pinged u i cant see the logs

fiery turtle
#

lmao

left orbit
#

or well i replied to ur message

calm latch
#

I was looking at other monitor and wasn't paying attention

left orbit
#

the logs scroll by so fast because of all the other servers that launch

#

if u can give me an image with just devicesd that would be nice

#

maybe i can get a better run

calm latch
#

It's even doing some dumb calculations in background

fiery turtle
#

do u have a Intel Core i5-13600K @left orbit ?

calm latch
fiery turtle
#

an i5?

calm latch
#

I think it's i7

fiery turtle
#

with 3.2M

left orbit
#

yeah i7 sorry

fiery turtle
#

when iretq os on the leaderboard

median crest
fiery turtle
median crest
#

astral phd os confirmed

fiery turtle
#

nah managarm is just using the old uacpi

north hull
#

I am gonna implement uACPI this week ❤️

fiery turtle
#

pmos is currently behind obos but i guess that will change shortly after the final iretq remeasure

calm latch
#

huh

#

when did obos get this fast?

fiery turtle
#

obos is 1.37M

#

and your currently recorded score is 703k

calm latch
fiery turtle
#

werent u gonna send a lightweight version?

#

or are u going with this

calm latch
#

How much time do I have?

fiery turtle
#

how much do u need

calm latch
#

Idk 20 minutes

fiery turtle
#

thats fine

calm latch
#

one exit(0) I guess

fiery turtle
#

(not merged yet)

#

pmos not updated yet

calm latch
left orbit
fiery turtle
#

damn

left orbit
#

beats managarm while running in userspace

#

crazy

#

or, well, old managarm :p

calm latch
#

It's because it has sse

fiery turtle
#

astral fell off of third place

calm latch
#

And my pthread_lock is just a couple of atomic ops

left orbit
#

i did scores for like 4 people on the list

#

lmao

fiery turtle
#

i have your cpu recorded only for pmos

left orbit
#

obos, pmos, ilobilix

#

thats for sure

fiery turtle
#

the one oberrow submitted was using Intel i5-4590T

left orbit
#

we were posting a bunch of scores here

#

what score do u have for obos?

fiery turtle
#

1.3M

left orbit
median crest
left orbit
#

i did it on my 13700k :p

fiery turtle
#

ah ok

left orbit
#

i also did ilobilix tf

calm latch
#

Does this test do raw memory accesses?

fiery turtle
#

no

left orbit
#

consistency

fiery turtle
#

ah right

slim panther
#

astral fell off

left orbit
#

also who did astral?

#

ah was it qwinci

#

thats right

fiery turtle
#

yeah

calm latch
#

Hmm this doesn't use lto

fiery turtle
#

okay looks correct now

#

inb4 beats proxima

calm latch
fiery turtle
#

@left orbit didnt your os score insane as well?

calm latch
#

\s

slim panther
#

i will remove timers

calm latch
#

With uACPI

#

Idk how it does though

fiery turtle
calm latch
#

ticks

fiery turtle
#

no i mean 2418

calm latch
#

Basically bogus score

#

Idk

fiery turtle
#

do u pass a bunch of weird options to qemu?

calm latch
#

sudo qemu-system-x86_64 -serial stdio -m 512M -cpu max,+hypervisor,+invtsc,+tsc-deadline -M q35 -accel kvm -cdrom limine/pmOS.iso -smp 4

fiery turtle
#

whats your qemu verison

calm latch
#

QEMU emulator version 8.2.93

fiery turtle
#

recent enough

#

idk where u get the extra 700 ops from

slim panther
#

@calm latch by the way you lose a lot of perf my running with smp

left orbit
fiery turtle
#

ah damn

slim panther
#

[ 0.006877] [ 0] acpi: successfully loaded 1 AML blob, 1732 ops in 0ms (avg 3082947/s)
[ 0.006756] [ 0] acpi: successfully loaded 1 AML blob, 1711 ops in 0ms (avg 3909784/s)

left orbit
#

and i'm probably gonna rewrite like 90% and implement missing stuff so it might drop a mil or so

fiery turtle
#

hows is there a different amount of ops

#

between runs

left orbit
#

smp?

slim panther
#

upper one is -smp 4

#

lower one no smp

fiery turtle
#

ah, its the per-cpu processor objects

slim panther
#

imagine it makes up ops

#

schizo configuration interface

fiery turtle
#

yeah definitely run with -smp 1 if u want the biggest score

slim panther
#

okay even with -smp 32 i'm still getting around 2.5 mil

zenith crescent
slim panther
#

(i only have 16 harts)

fiery turtle
left orbit
#

not in kvm group tftf

slim panther
zenith crescent
#

ah ok

left orbit
#

ilobilix Yet another monolithic Linux clone wannabe. Currently under a rewrite

#

nice description

slim panther
#

okay small issue

#

i want someone to test my kernel but i dont have isos meme

fiery turtle
#

do u ship floppies or something

slim panther
#

even worse

#

try to guess

fiery turtle
#

tape drives

slim panther
#

there is no image building step meme

fiery turtle
#

how do u even boot it

slim panther
#

vvfat

fiery turtle
#

bruh

slim panther
#

it's really fast to iterate on

#

but it has its limitations lol

calm latch
#

I just xorriso pmOS

fiery turtle
#

fair but u should have a way to build it for testing on real hw

slim panther
#

well

#

you just copy paste the directory

#

onto a fat32 stick

fiery turtle
#

well if u send a tarball with your os and paste the command im sure people can test

slim panther
#

oky

#

let me remove the useless parts of the buildroot so i can upload on discord

fiery turtle
#

considering you're literally second

#

do u do lto and o3?

slim panther
#

no

#

O3 idk

fiery turtle
#

missing out on free points

slim panther
#

whatever cmake release is

#

lto doesn't seem to work

#

clang gets confused

zenith crescent
fiery turtle
#

u should be doing this

slim panther
#

uh oh

#

3.2 mil with -smp 32

#

yea slightly better

#

but not significantly

#

3.93

fiery turtle
#

the lb score is 3.9M soo

slim panther
#

yea, not much difference

#

likely bound by PMM again

calm latch
#

Nah my pmm is bad and it's still fast

fiery turtle
#

well you're behind menix

slim panther
#

trolled

#

my pmm is a bitmap

calm latch
#

Mine is segregated fit

hallow marten
#

just do freelist

#

bruh

calm latch
#

On first access

#

Even though it can give contiguous ranges of any size in O(1) and map that immediately

#

So like there is room for improvement

fiery turtle
#

aight so i guess im merging then

#

i think i got everyone

slim panther
#

yea, i'm not getting higher than 3.9m

north holly
#

I'll continue my optimizations soon™️

fiery turtle
#

iretq might get a higher score, but w/e we can queue that up for the next update

north holly
#

rn I got bash to worry about

fiery turtle
#

you're second anyway and i doubt you'll beat proxima

slim panther
#

yea

#

not happening unless fpu

left orbit
#

i will one day.

fiery turtle
slim panther
#

ik

#

but i wont even come close

median crest
#

One day I will rewrite astral and all of you will have 10x less score troll

fiery turtle
#

we know the actual ceiling is like 14M

#

probably

slim panther
#

14m is insane

calm latch
#

You can do jit in uACPI 2.0 trl

fiery turtle
#

that was LTO + O3 + AVX2 + some stuff stubbed

fiery turtle
#

just generating hardcoded x86 instructions for each aml op might already speed it up by an order of magnitude

#

although its kinda stupid and a waste of time since it takes like a few ms to load even on most insane firmware

slim panther
#

If anyone could test and verify score, please do.

qemu-system-x86_64 -machine q35,smm=off -cpu host -accel kvm -name "menix x86_64" -serial stdio -no-reboot -no-shutdown -m 2G -smp 1 -drive format=raw,file=fat:rw:install,if=none,id=fatfs -device virtio-gpu -netdev user,id=net0 -device virtio-net,disable-modern=on,netdev=net0 -device nvme,serial=deadbeef,drive=fatfs  -bios /usr/share/ovmf/x64/OVMF.4m.fd
#

needs ovmf*

median crest
#

My score is with old uacpi but I douvt itd matter that much

fiery turtle
slim panther
#

i don't install bios limine

#

i exclusively target efi

fiery turtle
median crest
slim panther
#

with no diff on my side

median crest
#

I can send an iso ig

#

qemu-system-x86_64 -cdrom astral.iso -M q35 -enable-kvm -cpu host,migratable=off

slim panther
fiery turtle
#

3rd place reclaimed LETSFUCKINGGOOOOOO (but I already merged the pr so next time ig)

median crest
#

no -O2

fiery turtle
#

but why no o3

slim panther
#

why u no optimize

median crest
#

and lto breaks

slim panther
#

what

median crest
#

idrk why

slim panther
#

what happens

median crest
#

it doesnt zero out the struct pages at boot

#

and so an assert fails

slim panther
#

huh

#

which struct pages

median crest
#

I could try looking at why lto doesnt work

fiery turtle
#

solution: disable LTO instead of fixing the bug meme

median crest
median crest
dusky glade
#

nyaux has pci config support now

#

(on tcg)

fiery turtle
#

lesgo

dusky glade
left orbit
#

im sorry mathew i can't get it >4M

median crest
#

oh wtf

#

it had like a 10% improvement

fiery turtle
#

lto + o3 would probably make it unironically beat menix

#

second place???

median crest
#

once I finish this cogmind run I'll see why lto breaks

fiery turtle
#

astral phd os confirmed

slim panther
left orbit
#

astral not beating menix in this lb update sadge

median crest
#

soon

slim panther
#

can you try menix on your cpu

left orbit
#

sure

fiery turtle
#

^

#

because menix might do better on it

left orbit
#

entire leaderboard gonna be tested on 13700k soon

slim panther
#

based

fiery turtle
#

lmao

left orbit
#

why zip

slim panther
#

i'm getting my 265k on monday

left orbit
#

i will eat u

slim panther
fiery turtle
#

thats better than having random cpus

slim panther
#

sorry

fiery turtle
slim panther
#

im sorry

#

tech debt

left orbit
#

/usr/share/ovmf/x64/OVMF.4m.fd

#

AAAAAAAAAAAA

slim panther
#

fent

fiery turtle
slim panther
#

works on my arch trl

#

but yea, no non uefi boot

#

i'm making an efi stub equivalent

#

for the sake of it

left orbit
#

it does 1M on my machine

#

wtf

slim panther
#

what

fiery turtle
#

bruh LULW

left orbit
#

unlucky wsl

slim panther
#

try again

left orbit
#

i did like 10 times

fiery turtle
#

menix is not hyperv friendly

slim panther
#

woe

left orbit
#

990K-1.1M

slim panther
#

that's cursed

#

that's worse than what i had before

#

@fiery turtle what cpu you got

#

maybe it's an intel thing

#

wait @dusky glade you have a good cpu, right?

dusky glade
#

yea

slim panther
#

try it

#

pls

#

whole world shattered

fiery turtle
left orbit
#

i got 2M once lmao

slim panther
#

bruh

left orbit
#

[ 0.057703] [ 0] acpi: successfully loaded 1 AML blob, 1708 ops in 6ms (avg 255050/s)

#

new top score for menix

#

update leaderboard rn

slim panther
#

💀

left orbit
#

[ 0.012915] [ 0] acpi: successfully loaded 1 AML blob, 1708 ops in 0ms (avg 2012157/s)

#

yeah no i cant lol

slim panther
#

99% some virtualization meme

#

the 13700k is 20% faster than mine

left orbit
#

it is a hyperv meme lol

#

hate this shit so much

slim panther
#

amd stays winning

gentle peak
fiery turtle
#

wdym by die

gentle peak
#

absolutely tank the performance

calm latch
#

Score invalidated?

gentle peak
#

on my cpu, normal proxima is 6.4M, but on the 13700k the exact same build is like 5M

#

if I stub out the locks my cpu gets a lower score than the 13700k

fiery turtle
#

weird

#

some uarch differences?

gentle peak
#

maybe

left orbit
#

menix does 3.87M normally but it does 1M on my pc

#

soooo yeah..

#

also it triple faults on my pc meme

#

on a write to the STAR msr

gentle peak
#

I still think it could be caused by the kvm-on-wsl testing setup

left orbit
#

same

#

it probably is

#

windows is scheduling the vm improperly

north holly
#

Under VT-x or AMD-V virtualization, executing PAUSE many times in a short time interval may cause a #VMEXIT. The number of PAUSE executions and interval length that can trigger #VMEXIT are platform-specific.
I think I might know why obos runs a bit slower

#

on amd

#

virtualized

#

it uses the pause instruction for all spinlocks

#

which causes a vmexit

#

actually

#

nvm it also happens on intel

gentle peak
#

are your locks that contended?

north holly
#

they shouldn't be at all

#

assuming 'contended' means what I think it means

gentle peak
#

if the lock isn't able to be taken immediately upon calling acquire it's contended

#

the more threads are trying to acquire the lock at the same time, the more contended it is

north holly
#

then no locks are contended at all

#

everything I've been sending have been uniprocessor builds

gentle peak
#

then pause shouldn't be executed at all either

fiery turtle
#

smh no mwait and c/p states or wahtever

median crest
#

just dont have locks

lilac knoll
#

why pause causes vmexit

north holly
#

*might cause a vmexit

lilac knoll
#

why

north holly
#

because cpus are stoobid

fiery turtle
lilac knoll
#

hm

#

inb4 that encourages people to avoid pause so that their vm stays scheduled in 💀

fiery turtle
#

depending on how the host handles this vmexit, it could be either very cheap or super expensive

#

also what else do u do, like literally start spinning like crazy?

#

that would tank the perf even more

north holly
#

aren't vmexits in and of themselves expensive

#

like the cost of one vmexit is very big

#

even if the actual handler doesn't do much

lilac knoll
fiery turtle
#

if u spin without relaxing the cpu ur likely hurthing the pair thread, wasting enery, etc etc

slim panther
fiery turtle
lilac knoll
fiery turtle
#

lol

#

well i guess

median crest
#

#ifndef WILL_RUN_IN_VM meme

fiery turtle
#

well theres the hypervisor bit in cpuid

north holly
#

it's been nearly a year since the last LAI commit

vagrant hull
#

lai is kill

vagrant hull
#

@fiery turtle please fix these warnings else streaks will kill me if i try to upstream the port of uACPI to Ironclad lol

#
/base_dir/ironclad/source/uacpi/interpreter.c: In function 'handle_create_field':
/base_dir/ironclad/source/uacpi/interpreter.c:1740:17: warning: 'field_data.region' may be used uninitialized [-Wmaybe-uninitialized]
 1740 |                 uacpi_shareable_ref(field->bank_region);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/base_dir/ironclad/source/uacpi/interpreter.c:1595:32: note: 'field_data.region' was declared here
 1595 |     struct field_specific_data field_data;
      |                                ^~~~~~~~~~
/base_dir/ironclad/source/uacpi/interpreter.c:1751:17: warning: 'field_data.field0' may be used uninitialized [-Wmaybe-uninitialized]
 1751 |                 uacpi_shareable_ref(field->index);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/base_dir/ironclad/source/uacpi/interpreter.c:1595:32: note: 'field_data.field0' was declared here
 1595 |     struct field_specific_data field_data;
      |                                ^~~~~~~~~~
/base_dir/ironclad/source/uacpi/interpreter.c:1754:17: warning: 'field_data.field1' may be used uninitialized [-Wmaybe-uninitialized]
 1754 |                 uacpi_shareable_ref(field->data);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/base_dir/ironclad/source/uacpi/interpreter.c:1595:32: note: 'field_data.field1' was declared here
 1595 |     struct field_specific_data field_data;
      |                                ^~~~~~~~~~
/base_dir/ironclad/source/uacpi/interpreter.c:1745:35: warning: 'field_data.value' may be used uninitialized [-Wmaybe-uninitialized]
 1745 |                 field->bank_value = field_data.value;
      |                 ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/base_dir/ironclad/source/uacpi/interpreter.c:1595:32: note: 'field_data.value' was declared here
 1595 |     struct field_specific_data field_data;
      |```
strong heath
#

I indeed will

fiery turtle
#

They're completely bogus tho

flat badge
#

Wmaybe-uninitialized is quite unreliable

strong heath
#

If mint finishes porting it, it could be a good addition until I find uACPI but written in Ada ™️

fiery turtle
#

Ask chatgpt for c to Ada converter trl

fiery turtle
flat badge
#

the simple fix is just adding a memset or similar to every initialization

fiery turtle
#

I was thinking of something smarter because its asking me to zero a 64 byte struct for no reason

#

hmm maybe if i update my wsl2 to ubuntu 24

sterile egret
#

-Wno-maybe-uninitializedthere, fixed meme

fiery turtle
#

yeah i wish, but i dont control the flags used by whoever compiles uacpi sadcat

median crest
fiery turtle
#

Lol

#

Didnt know that was a thing even

median crest
#

Apparently it is

strong heath
#

Ada's one is much more accurate

#

Never false positives

fiery turtle
vagrant hull
fiery turtle
#

yeah gcc 11.4 (that comes with ubuntu 22) doesnt produce those warnings even with uninitialized explicitly enabled

#

daily gcc compile from source session incoming i guess

#

or maybe i should just run docker

strong heath
north hull
#

nixos ftw

fiery turtle
#

well what does that mean

#

do u have to make bindings yourself, or are they natively imported

#

like zig

#

or

median crest
strong heath
#

gcc can autogenerate bindings for Ada

#

which I forgot to tell to @vagrant hull

#

oops

fiery turtle
#

fkn annoying

north hull
#

and then eventually to nixos

strong heath
vagrant hull
#

bruh

fiery turtle
vagrant hull
#

thank god i am lazy and i did not start writing them

strong heath
#

hell yeah

vagrant hull
#

lazyness saved me once again

strong heath
#

clutch

fiery turtle
#

employee of the month

north hull
#

So do I gotta implement something else besides the function prototypes in kernel_api.h

north hull
#

ah

#

im assuming the uacpi_libc stuff?

fiery turtle
#

readme has all the headers listed, but platform/libc.h is probably the most important for that

north hull
#

aight

#

but to start off I dont need to touch none of that?

fiery turtle
#

yeah

north hull
#

neat

#

will get going then 😄

fiery turtle
#

good luck!

north hull
#

so I noticed like obos doesnt seem to implement uacpi_kernel_pci_device_open and uacpi_kernel_pci_device_close

#

or am I dumb

fiery turtle
#

obos is probably on an older uacpi commit?

north hull
#

ahh

fiery turtle
#

or you specifically are looking at an old commit

north hull
#

no thats prolly it im guessing

fiery turtle
#

bruh are u fucking kidding, ubuntu 24 gcc (GNU 13.3.0) still doenst produce the goddamn uninitialized warnings

median crest
#

Its like 3 lines of code in that function so its not that vomplicated

fiery turtle
#

that was my next step i just didnt really want to do it

#

let me try clang before i go there

median crest
#

Just do a static build and stash it in a random server for ci or something

fiery turtle
#

its kinda hard to ship random binaries into github ci

#

because u start from scratch every time

mortal yoke
#

just push the binaries to a throwaway branch KEKW

fiery turtle
#

yeah no its hopeless, ubuntu 24 is not enough

#

im gonna build gcc from source

north hull
#

so whatsup with this

fiery turtle
#

since this is your first time looking at this

#

im curious what u think

median crest
#

I get ptsd from looking at that

fiery turtle
#

is whats up with this

fiery turtle
north hull
#

well ig my question is, is it optional?

median crest
#

Yeah

fiery turtle
#

i mean its behind an ifdef

north hull
#

well yeah

fiery turtle
#

so i was hoping that would make it more obvious

#

that it is

north hull
#

I mean it is what I assumed but

#

eh

#

lol

fiery turtle
#

should i add an (OPTIONAL) comment perhpas

north hull
#

maybe

#

so do I like just define that macro at the top

fiery turtle
#

btw, if not sure about some option, there's platform/config.h

north hull
#

and then impl it

fiery turtle
#

it explains each option in depth

north hull
#

ok

fiery turtle
north hull
#

oh options

#

right

#

yeah see thats what I was kind of wondering

#

lol

mortal yoke
fiery turtle
#

u use your build tool to propagate the define everywhere

north hull
#

yeap that makes sense

fiery turtle
#

if u modify kernel_api.h directly u have to ship uacpi's entire source in your kernel

#

so u cant use a submodule

north hull
#

lol

#

rather not

fiery turtle
#

its designed so that u dont have to modify uacpi's source directly

north hull
#

though the way I am building it with my project is rather scuffed

fiery turtle
#

everything is configurable

#

via build options

north hull
#

ah config.h is helpful indeed

median crest
#

Define it properly, dont do like I did

left orbit
#

how are you liking that llvm 15 and qemu 4? tf

median crest
#

Real osdevs use lfs wsl

left orbit
#

also does ubuntu like abuse snap?

left orbit
#

for like the longest time

#

its such a retarded idea i might do it

median crest
#

I mean it doesnt sound that hard to pull off

#

Itd be super funny do it

left orbit
#

well no its probably not hard but annoying lol

#

you need linux to build it so thats one thing

fiery turtle
#

im on latest gcc

north hull
#

@fiery turtle I hate to plague u with questions but should I just ignore UACPI_PRINTF_DECL(2, 3)

left orbit
fiery turtle
#

so the compiler does checking when calling this function

#

as if it was printf

north hull
#

ah

left orbit
north hull
#

ah right I shouldve hovered over it

#

lmao

fiery turtle
left orbit
#

ahh

mortal yoke
fiery turtle
#

tbh i didnt even understand what this was in reference to or what it means

mortal yoke
thorny orbit
fiery turtle
#

will i break my apt if i do make install for gcc compiled from source

mortal yoke
#

if you did it with the default prefix of /usr/local probably not?

fiery turtle
thorny orbit
#

it will rewrite /usr/bin/gcc

fiery turtle
thorny orbit
#

or dpkg can return error

mortal yoke
fiery turtle
#

well if it bricks my wsl i know who to blame LULW

thorny orbit
#

for removing gcc i always using this command: sudo rm -rf /boot

left orbit
#

see where it tries to install it

#

if it doesnt do /usr/local then have fun reconfiguring and rebuilding i guess tf

#

but it should

mortal yoke
#

yeah I did remember right, configure puts it by default in /usr/local

median crest
#

Which just prints the commands

left orbit
#

yeah even better

#

i was trying to think if there is a way to tell install to do a dry run

#

without thinking about telling make to do a dry run

fiery turtle
#

thanks ill try

#

its still compiling

median crest
#

Just use astral to compile and try gcc out

fiery turtle
#

somehow compiling via wsl takes longer than compiling via astral trl

left orbit
#

i WAS gonna give mintia amd64 port a go but i guess i'm doing lfs wsl now

fiery turtle
#

lmao

median crest
#

Once I make my I/O better and rewrite my scheduler it could unironically be kinda fast I think

median crest
fiery turtle
#

help imrpove astral instead

left orbit
#

hopefully it just works™️

fiery turtle
#

what is the end goal of that

#

or just running a custom linux for fun?

left orbit
#

idk wasting my time i guess

fiery turtle
#

u also need ms specific drivers i think

#

for gpu etc

median crest
#

Science

median crest
left orbit
#

nah the kernel is like separate from the distro

fiery turtle
#

ah

left orbit
#

every wsl distro shares the kernel iirc

#

but i built one anyway

#

since you can download it as mathew said

fiery turtle
#

bruh libbacktrace also takes 10 years to compile

fiery turtle
#

because its like highly specialized for wsl

left orbit
#

it's nothing special though, just some weird drivers i guess

#

but all in all i can skip the kernel and a bootloader

fiery turtle
#

im assuming they also ship the config that they need for wsl?

#

with like all stuff disabled they dont care about

left orbit
#

i found out you can even make wsl spawn a console with earlyprintk

#

yeah they do

#

its in the repo

left orbit
#

the kernel has like most of the unused shit turned on anyway

#

i still built like amdgpu and intel gpu drivers for some reason

#

nouveau too

fiery turtle
fiery turtle
#

least lazy ms project

left orbit
#

and the next time you launch wsl it will spawn a console

#

dont do it now because you gotta wsl --shutdown but yeah its a thing

fiery turtle
#

interesting

left orbit
#

like yeah

#

read only sadly

fiery turtle
#
❯ lspci -vt
-+-[c5af:00]---00.0  Red Hat, Inc. Virtio console
 +-[b8de:00]---00.0  Microsoft Corporation Device 008e
 +-[a648:00]---00.0  Microsoft Corporation Device 008e
 +-[7cdb:00]---00.0  Red Hat, Inc. Virtio file system
 \-[0000:00]-
#

wsl pci topology is insane

#

they use pci segments exclusively

left orbit
#

[ 0.000000] printk: bootconsole [uart8250] enabled interesting

fiery turtle
#

they also use aml

median crest
#

Omw to make astral bootable on wsl

fiery turtle
#

i wonder what their mcfg looks like

#

ah there isnt one

left orbit
#

assuming you make your kernel compatiblke with linux boot proto

fiery turtle
#

lol WSL propagates the battery from host

left orbit
#

that is kinda cool

fiery turtle
#

there's a special VMOD device which is wsl specific

#

which handles all wsl stuff i guess

#

and i dont see them exposing PCI topology in any way

#

so i wonder how linux figures out the pci segments to look for

median crest
#

Magic

#

Inb4 hardcoded in kernel

left orbit
#

nah

fiery turtle
median crest
left orbit
median crest
fiery turtle
#

nah its an iasl bug

#

its Displayed Device Name

#

aka how to show it in UI

#

there's also a virtual TPM device

#

Name (_STR, Unicode ("Enclave Page Cache 1.0")) then wahtever this is

#

Hyper_V_Gen_Counter_V1 and this

#

Name (_HID, "ACPI0012" /* NVDIMM Root Device */) and whatever this is

median crest
#

I really need to do acpi stuff in astral but before that I have like 3 other things I need to do

fiery turtle
#

astral suspend to S3 support plead

#

func fact WSL supports up to 1000 processors

#

and includes all of them in the aml blob under if statemets

left orbit
#

wtf lol

fiery turtle
#

or up to 2048 my bad

#

its just 25k lines of code of this

left orbit
#

least scuffed aml

fiery turtle
#

they were too lazy to generate this at runtime

median crest
#

Does aml not have a for

fiery turtle
#

their entire aml is under if statements

fiery turtle
#

like C variable names

#

if u know what i mean

left orbit
#

you cant generate names at runtime

#

?

#

sad

fiery turtle
#

yeah u cant

#

well with safe modifying code u absolutely can

#

no one is that creative

#

especially since AML supports dynamically loading other aml code

left orbit
#

why can't you Name ( "CPU" + Counter, ... )

fiery turtle
#

TLDR: who knows

#

they could allow it

#

atm all names are stored literally

#

there isnt a StringOp prefix to them

#

its just literally 4 bytes in a row

left orbit
#

ah okay that makes more sense

fiery turtle
#

and that 4 byte literal could mean a lot of things depending on context LULW

#

could be a field read, could be a method call, could be a ref

#

depending on context

#

but they could say e.g. NameOp accepts either a name literal or a TermArg that resolves to a name

#

thats definitely implementable

#

and if you're curious

#

im still compiling gcc

#

or libstdc++ ig

left orbit
#

what kind of a cpu do you have

#

that it takes this long

fiery turtle
#

i9 9900k

left orbit
#

wtf

#

did you do -j$(nproc)?

fiery turtle
#

idk how my wsl is that bad

#

i did -j8 initially but now doing -j16

left orbit
#

hmmm

fiery turtle
#

its on an nvme too

median crest
#

At this rate astral will beat wsl

fiery turtle
#

i really need to reinstall this windows because its very old and has accumulated a ton of crap

left orbit
#

ur guys' wsl are cursed in a way where u dont get invtsc

#

and me wsl is cursed in a way where i get 99% variance in uacpi scores

#

cant win either way

fiery turtle
#

wsls are cursed no matter where u look

median crest
#

I think thats like scaling

#

And hyperv likes it

left orbit
#

i have no idea what that means

#

but i am glad it works for me

fiery turtle
median crest
#

Like if your cpu doesnt support scaling the tsc hyperv just assumes it wont be invariant cuz of vm migrations and doesnt expose the bit

#

Its annoying because you cant disable this

left orbit
#

i wonder how fucked would trying to boot limine on wsl be

fiery turtle
#

u would just stub the linux boot protocol i guess

left orbit
#

i would love if it was somewhat upstreamable tho

fiery turtle
#

but then limine wont be able to talk to any of the disk drives

#

it would need a virtio-fs driver

left orbit
#

why not?

#

oh

#

god

fiery turtle
#

there isnt a bios or anything

#

and the memory map it can figure out from the nvdimm aml device somehow

left orbit
#

virtio-fs driver for limine wouldn't be too hard maybe

fiery turtle
#

finally, a uacpi integration for limine LULW

mortal yoke
fiery turtle
#

yeah i think:

            Device (\_SB.NVDR.N000)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    Return (CDSF (Arg0, Arg1, Arg2, Arg3, _ADR))
                }

                Method (_LSI, 0, NotSerialized)  // _LSI: Label Storage Information
                {
                    Return (LSIM (_ADR))
                }

                Method (_LSR, 2, NotSerialized)  // _LSR: Label Storage Read
                {
                    Return (LSRM (Arg0, Arg1, _ADR))
                }
            }
#

u use _LSI and _LSR

#

and that returns some nvdimm garbage that probably contains the phys address

#

of where ram exists

left orbit
#

wtf

#

i wonder how the memory map is constructed

#

the one passed to linux

fiery turtle
#

hardcoded like the rest of this info probably

left orbit
#

this whole thing is only slightly cursed

fiery turtle
#

or wait yeah limine can just get this memory map propagated in this case

#

from the linux proto

left orbit
#

rsdp too

#

i guess