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

1 messages · Page 21 of 1

torpid ferry
#

but it is generally in that order of magnitude still

fiery turtle
#

Hmm

#

No errors either?

north holly
#

nope

#

_BQC returns zero btw

#

initially

fiery turtle
#

yeah sounds like bs

#

i wonder if you're supposed to first call some other method

#

linux does i think?

#

like display init

fiery turtle
#

that it updates from BCM

#

so no wonder its 0

#

btw

#

the package it retruns just has every value from 0 to 100

#
Return (Package (0x67)
{
    0x50, 
    0x32, 
    Zero, 
    One, 
    0x02, 
    0x03, 
    0x04, 
    0x05, 
    0x06, 
    0x07, 
    0x08, 
    0x09, 
    0x0A, 
    0x0B, 
    0x0C, 
    0x0D, 
    0x0E, 
    0x0F, 
    0x10, 
    0x11, 
    0x12, 
    0x13, 
    0x14, 
    0x15, 
    0x16, 
    0x17, 
    0x18, 
    0x19, 
    0x1A, 
    0x1B, 
    0x1C, 
    0x1D, 
    0x1E, 
    0x1F, 
    0x20, 
    0x21, 
    0x22, 
    0x23, 
    0x24, 
    0x25, 
    0x26, 
    0x27, 
    0x28, 
    0x29, 
    0x2A, 
    0x2B, 
    0x2C, 
    0x2D, 
    0x2E, 
    0x2F, 
    0x30, 
    0x31, 
    0x32, 
    0x33, 
    0x34, 
    0x35, 
    0x36, 
    0x37, 
    0x38, 
    0x39, 
    0x3A, 
    0x3B, 
    0x3C, 
    0x3D, 
    0x3E, 
    0x3F, 
    0x40, 
    0x41, 
    0x42, 
    0x43, 
    0x44, 
    0x45, 
    0x46, 
    0x47, 
    0x48, 
    0x49, 
    0x4A, 
    0x4B, 
    0x4C, 
    0x4D, 
    0x4E, 
    0x4F, 
    0x50, 
    0x51, 
    0x52, 
    0x53, 
    0x54, 
    0x55, 
    0x56, 
    0x57, 
    0x58, 
    0x59, 
    0x5A, 
    0x5B, 
    0x5C, 
    0x5D, 
    0x5E, 
    0x5F, 
    0x60, 
    0x61, 
    0x62, 
    0x63, 
    0x64
})
north holly
#

yes

#

.

fiery turtle
#

and if it detects linux it returns some other crap lol

north holly
#

lol

#

sanest aml

#

maybe if I call _DOS

fiery turtle
#

perhaps

calm latch
#

OBOS becomes DOS

north holly
#

maybe I need to call _DSS

fiery turtle
#

was about to send

#

lol

#

DSS is what actually commits changes

north holly
#

seems like I need to pass 0x8000'0001

#

which tells it to enable the display, then commit the changes

fiery turtle
#
If (((Arg0 & 0xC0000000) == 0xC0000000))
{
    CSTE = NSTE /* \NSTE */
}
#

your aml checks one bit

north holly
#

bruh KEKW

calm latch
#

2 bits ¿

fiery turtle
#

ye

#

you also have tons of these _DSS methods

#

are u calling like all or

north holly
#

nope

#

only for GFX0

fiery turtle
#

hmm

north holly
#

well not at all

#

last time I tested it

fiery turtle
#

considering GFX0 doesnt even have a DSS

north holly
#

well

#

I call PCI0.GFX0.DD1F.DSS

fiery turtle
#

why that specific DD

north holly
#

because that's where I get the brightness event

fiery turtle
#

ah

north holly
#

so I just did all my stuff there

fiery turtle
#

probably correct

left orbit
#

how long does run_tests.py --large take to run usually?

fiery turtle
#

like 5 minutes

left orbit
#

damn that is slow

#

ever thought about making it parallel?

fiery turtle
#

i guess as long as its legible when it fails

#

would be nice

north holly
#

use make

median crest
#

Add a big mutex around the logs meme

fiery turtle
#

its python soo

left orbit
#

well in case it fails you could just append to a results array and print the errors at the end

fiery turtle
#

ye

left orbit
#

i'll look into making the runner parallel in a bit

fiery turtle
#

that'd be based

left orbit
#

i want to give sso a shot because im bored + where is pitust meme

fiery turtle
north holly
#

while you guys do that, I will be staring at AML

left orbit
#

i see that uacpi has no actual string type, everything seems to be a uacpi_buffer

#

so i guess it's a small buffer optimization

fiery turtle
#

true

#

people sometimes use std::string as a small vector

#

exactly for that purpose

north holly
#

I hate AML

fiery turtle
#

who doesnt

north holly
#

acpi spec devs before starting work:

#

I think by now it's a good idea to just ditch this

#

since I can't figure out how to get it working

fiery turtle
#

lmao

#

rare oberrow L against acpi

north holly
#

I'll get it working eventually™️

#

maybe the reason I wasn't able to get it to wokr

#

*work

#

was because I was reading the spec

fiery turtle
#

yup

#

linux calls this on init

north holly
#

perhaps

fiery turtle
#

idk it does kind of a lot

north holly
#

so it seems to be telling the firmware to leave everything to the OS

fiery turtle
#

basically

#

theres a comment on top of bus_DOS as well

north holly
#

bus_DOS?

north holly
#

ah

#

thought you were talking about something in the acpi spec

frank canopy
#

used to be exactly. now it's usually a fixed speed at around the same value so you can use it for timekeeping since cpu speed can vary

left orbit
#

damn i forgot how shit python multiprocessing is meme

fiery turtle
#

indeed

left orbit
#

i WILL make it work.

fiery turtle
#

based

left orbit
#

they already run in parallel i just need to fix passing results from workers back to the python runner

fiery turtle
left orbit
#

large tests run in 33 seconds on my machine

#

that is pretty good

fiery turtle
#

daaamn

north holly
#

@fiery turtle I have an update to obos' score:

[uACPI][INFO]: successfully loaded 1 AML blob, 1704 ops in 5ms (avg 323566/s)```
fiery turtle
#

free 200k?

north holly
#

yes

#

also I ran it on a faster machine

left orbit
#

send iso + command line

north holly
#

when it's done booting it suspends

left orbit
#

[ WARN ] Note: Framebuffer might die

#

didnt even get one in the first place tf

#

HOW DO I QUIT

#

WTF

north holly
left orbit
#

[uACPI][INFO]: successfully loaded 1 AML blob, 1705 ops in 5ms (avg 314941/s) slower than urs wtf

north holly
gentle peak
#

362128/s

gentle peak
#

i think

#

there's a key combo

north holly
#

qemu nographic

gentle peak
#

yeah

#

i know

north holly
#

yeah that worked

left orbit
#

[uACPI][INFO]: successfully loaded 1 AML blob, 1705 ops in 3ms (avg 446980/s)

#

it varies wildly

#

i get 270k then 440k

north holly
#

weird

left orbit
#

315k, 270k, 320k, 309k

left orbit
#

lmaoo

calm latch
#

284905

#

I guess my PC isn't that fast after all

gentle peak
#

the highest i got was 371k/s

north holly
#

maybe if I do lazy IRQL

#

it will help

left orbit
#

446k was the highest i got out of like 5 runs

#

ill try running it on windows under whpx

frank canopy
#

reminds me i should un-stub my mutex and event stuff since i have those implemented, its just that any timtout other than 0 or infinite is unimplemented atm

north holly
#

since a lot of spinlocks are taken, a lot of IRQL changes are made, which according to fadanoid, cr8 is pretty expensive

slim panther
#

[uACPI][INFO]: successfully loaded 1 AML blob, 1705 ops in 3ms (avg 499891/s)

left orbit
#

lets figure that out

north holly
#

let me fix it

slim panther
#

why do you need popcnt

north holly
#

and uacpi needs it

slim panther
#

can that not be emulated

north holly
#

it cna be

#

through libgcc

left orbit
#

technically everything can be emulated

north holly
#

try this

#

nvm

left orbit
#

i did +popcnt on the command line

#

but whpx was slow as balls

north holly
left orbit
#

not even worth mentioning

#

180k lol

north holly
#

that's also what I got

left orbit
#

i can try on bare metal

north holly
#

when I did that

left orbit
#

but you'd need to get rid of suspend ☠️

north holly
left orbit
#

ah right meme

north holly
left orbit
#

no i just don't think i'd be able to read quickly enough

#

wouldn't it literally suspend my computer

north holly
#

yes

#

as if you clicked the sleep button

#

in your DE

left orbit
#

assuming it can wake up properly

#

and restore the framebuffer contents

north holly
#

yes

left orbit
#

then i'd be able to read the score

north holly
#

(waiting on uDRM for that)

left orbit
#

i'm not rebooting now anyway because i am improving uacpi test runner

north holly
loud ice
#

okay after measuring sso isnt that big of a deal actually i think

loud ice
#

i should try rerunning the full uacpi benchmarks

fiery turtle
#

wait u managed to get it working?

loud ice
#

yeah

fiery turtle
#

Damn

loud ice
#

i also found out my measurements were crap

#

and i forgot about all the calloc'ed allocations lol

fiery turtle
#

Lmfao

loud ice
#

i'm getting 143k/s with tcg now (i also added a slightly better slab allocator to my shitty kernel)

frank canopy
#

my gut for handling strings like that has been a string table but the way zig makes that super easy relatively speaking has been skewing things a bit tbh

#

plus idk if string collisions are enough to be worth it at the scale above four-char ones where youd just use a u32

loud ice
#

most allocations still come from deep_copy_package though

#

and uacpi_execute_control_method

loud ice
#

cant do much about that

left orbit
#

@fiery turtle what do you use for formatting python?

fiery turtle
#

Check the CI script for tools that do the linting

fiery turtle
loud ice
#

well

#

you can

#

you could make the uacpi interpreter do something smarter

fiery turtle
#

Probably

left orbit
#

oh whoops

#

wow discord doesn't even show the full thing

#

but yeah it now prints the time each test takes and the total amount of time they all took

#

along with the progress on each test

#

the code ain't even that bad, i think it's ready for pr

#

i haven't really tested how it looks like when they fail but meme

#

the results are all printed sequentially and i basically stole the old code for printing that

#

shouldn't be too different

#
[28/65] references-4.aml:Call-by-value w/ Store() does NOT modify integers even through a reference OK in 0.01s
[29/65] references-10.aml:Recursively modify ArgX OK in 0.01s
[29/65] empty-objects.aml:Empty objects behave correctly FAILED in 0.01s
TEST OUTPUT FOR empty-objects.aml:Empty objects behave correctly:
        stdout:
        [uACPI][INFO] RSDP 0x0000783597103D90 00000024 v02 (uOEMID)
        [uACPI][INFO] XSDT 0x0000504000001090 0000002C v02 (uTEST  uTESTTBL)
        [uACPI][INFO] DSDT 0x0000508000000220 00000055 v02 (uTEST  TESTTABL)
        [uACPI][INFO] FACP 0x00005120000004C0 00000114 v06 (uOEMID uTESTTBL)
        [uACPI][INFO] FACS 0x0000506000000440 00000040
        [uACPI][INFO] SSDT 0x0000000000000000 00000055 v01 (uTEST  RUNRIDTB)
        [uACPI][TRACE] load of 'DSDT' (OEM ID 'uTEST ' OEM Table ID 'TESTTABL')
        [uACPI][TRACE] load of 'SSDT' (OEM ID 'uTEST ' OEM Table ID 'RUNRIDTB')
        [uACPI][TRACE] [AML DEBUG] String => "TestRunner ID SSDT loaded!"
        [uACPI][INFO] successfully loaded 2 AML blobs, 7 ops in 0ms (avg 33040/s)
        [uACPI][TRACE] initialized GPE block _GPE[0->128], 0 AML handlers (IRQ 0)
        [uACPI][TRACE] initialized GPE block _GPE[128->256], 0 AML handlers (IRQ 0)
        [uACPI][TRACE] fixed event 0 enabled successfully
        [uACPI][TRACE] activated all 'EmbeddedControl' opregions controlled by '\   ', 0 _REG() calls (0 errors)
        got a GPE
        [uACPI][TRACE] activated all 'PCI_Config' opregions controlled by '\   ', 0 _REG() calls (0 errors)
        [uACPI][INFO] namespace initialization done in 0ms: 0 devices, 0 thermal zones
        [uACPI][TRACE] _STA calls: 0 (0 errors), _INI calls: 0 (0 errors)
        [uACPI][TRACE] [AML DEBUG] Uninitialized
        [uACPI][TRACE] [AML DEBUG] Package @0000503000001bd0 (0000503000001c30) (0 elements)
        [uACPI][TRACE] [AML DEBUG] Package @0000503000001f30 (0000503000001f90) (0 elements)
        [uACPI][TRACE] fixed event 0 disabled successfully
                stderr:
        unexpected error: returned value '1' doesn't match expected '0'

[30/65] mutex-1.aml:Automatic mutex release OK in 0.01s
[31/65] indices-0.aml:Buffer Indices OK in 0.02s
[32/65] table-overrides.aml:Table overrides work OK in 0.01s
[33/65] store-copies-buffer.aml:Store Copies The Buffer OK in 0.01s
[34/65] eval-supports-plain-objects.aml:Eval supports plain objects OK in 0.02s```
#

i made one of the tests fail on purpose and that's how it looks like, i think it's okay

#
[26/65] empty-objects.aml:Empty objects behave correctly FAILED in 0.01s
STDOUT FOR empty-objects.aml:Empty objects behave correctly:
        [uACPI][INFO] RSDP 0x00007C5179F03D90 00000024 v02 (uOEMID)
        [uACPI][INFO] XSDT 0x0000504000001090 0000002C v02 (uTEST  uTESTTBL)
        [uACPI][INFO] DSDT 0x0000508000000220 00000055 v02 (uTEST  TESTTABL)
        [uACPI][INFO] FACP 0x00005120000004C0 00000114 v06 (uOEMID uTESTTBL)
        [uACPI][INFO] FACS 0x0000506000000440 00000040
        [uACPI][INFO] SSDT 0x0000000000000000 00000055 v01 (uTEST  RUNRIDTB)
        [uACPI][TRACE] load of 'DSDT' (OEM ID 'uTEST ' OEM Table ID 'TESTTABL')
        [uACPI][TRACE] load of 'SSDT' (OEM ID 'uTEST ' OEM Table ID 'RUNRIDTB')
        [uACPI][TRACE] [AML DEBUG] String => "TestRunner ID SSDT loaded!"
        [uACPI][INFO] successfully loaded 2 AML blobs, 7 ops in 0ms (avg 28497/s)
        [uACPI][TRACE] initialized GPE block _GPE[0->128], 0 AML handlers (IRQ 0)
        [uACPI][TRACE] initialized GPE block _GPE[128->256], 0 AML handlers (IRQ 0)
        [uACPI][TRACE] fixed event 0 enabled successfully
        [uACPI][TRACE] activated all 'EmbeddedControl' opregions controlled by '\   ', 0 _REG() calls (0 errors)
        got a GPE
        [uACPI][TRACE] activated all 'PCI_Config' opregions controlled by '\   ', 0 _REG() calls (0 errors)
        [uACPI][INFO] namespace initialization done in 0ms: 0 devices, 0 thermal zones
        [uACPI][TRACE] _STA calls: 0 (0 errors), _INI calls: 0 (0 errors)
        [uACPI][TRACE] [AML DEBUG] Uninitialized
        [uACPI][TRACE] [AML DEBUG] Package @0000503000001bd0 (0000503000001c30) (0 elements)
        [uACPI][TRACE] [AML DEBUG] Package @0000503000001f30 (0000503000001f90) (0 elements)
        [uACPI][TRACE] fixed event 0 disabled successfully

STDERR FOR empty-objects.aml:Empty objects behave correctly:
        unexpected error: returned value '1' doesn't match expected '0'

[27/65] table-loading-0.aml:Load tables from buffers OK in 0.03s```
#

fixed the indentation, let me pr this stuff

frank canopy
#

how badly will uacpi break if my mutex lock and event wait dont implement timeouts? a 0 timeout to just test is implemented but timing out a blocking wait is not

north holly
#

it doesn't break

#

I haven't ever had it implemented

left orbit
#

i don't imagine it will break, just mutexes that should time out won't

#

i guess that is the definition of it breaking tf

frank canopy
#

lol

#

if itll just maybe wait longer than expected in some cases then i can probably just plug it in yeah

left orbit
#

"1 workflow awaiting approval" NOOOO

#

brb i gotta go to the store, pls run the ci when u can @fiery turtle

#

nvm not going yet

torpid root
#

how did you people improve the scores so much

north holly
torpid root
#

nice

frank canopy
#

ill have to re-do my benchmarking too tbh

median crest
#

Once I finish cooking up the new locks I will update uacpi

gentle peak
#

well the performance improving update is currently still in a pr, not on master

fiery turtle
#

really cool work

#

ill review in a bit

left orbit
#

sounds good

fiery turtle
#

where the f is the run ci button

rustic compass
#

i found a bug in uacpi, one case in status to string is missing

left orbit
#

If you are comfortable with running workflows on the pull request branch, return to the Conversation tab, and under "Workflow(s) awaiting approval", click Approve and run.

#

oh, i see that i's missing

#

that is really weird i guess github moment

fiery turtle
#

uhhh lmao

rustic compass
left orbit
#

UACPI_STATUS_INVALID_TABLE_LENGTH i guess

#

yeah

rustic compass
#

status.h done, only 16 headers to go

fiery turtle
#

thanks for the report

fiery turtle
fiery turtle
#

that worked..

left orbit
#

poggers

#

lets see if it works

fiery turtle
#

how did u find it lol

left orbit
#

wow lint fails

#

uh i just went into actions

fiery turtle
left orbit
#

i figured since the workflow was created it must be there

#

it just need to be approved

#

oh so the binary operator goes on the new line

fiery turtle
#

u have access to these right?

left orbit
#

i see

#

yea i do

fiery turtle
#

nice

left orbit
#

single error

fiery turtle
#

not bad

#

you havent got to mypy yet tho LULW

left orbit
#

i think you might have ot approave again

#

yeah lol

#

its because i never contributed

fiery turtle
#

yeah

left orbit
#

github kinda dumb

fiery turtle
#

and no button again

left orbit
#

great ui github

fiery turtle
#

indie website

left orbit
#

really went downhill after msft acquisition

fiery turtle
#

yup

left orbit
#

WHAT

#

BREAK AFTER BINARY OPERATOR BAD

#

BREAK BEFORE BINARY OPERATOR BAD

#

WHAT AM I SUPPOSED TO DO

fiery turtle
#

loool

left orbit
#

i guess ill just build the string to print in a variable lol

#

ffs

fiery turtle
#

lemme see what its complaining about

left orbit
#
print(f"[{pass_count}/{len(cases)}] {case.name} "
      + f"{status_str} in {elapsed:.2f}s", flush=True)```
#

this

#
  • at the end of first line was bad
#

and this is bad too

fiery turtle
#

u dont need a plus there do u not?

left orbit
#

i need it because if i put it on one line it complains the line is too long

fiery turtle
#

no i mean

#

python can do "str1" "str2" iirc?

left orbit
#

oh really

#

wtf

fiery turtle
#
>>> x = "hello" " world"
>>> x
'hello world'
left orbit
#

yeah ur right

#

lets try that

fiery turtle
#

lol

#

yeah

left orbit
#

pusehd

frank canopy
#

wtf python

left orbit
#

i like how the ones that failed are still running

fiery turtle
#

lol

#

mypy didnt like it but flake8 passed

frank canopy
#

this sort of nonsense is why I despise python lmao

left orbit
#

ok type checking fails, makes sense

flat badge
rustic compass
#

@fiery turtle what happens if

 
uacpi_object_type uacpi_object_get_type(uacpi_object*);

gets a object with a type that is not present in the enum uacpi_object_type?

fiery turtle
#

thats not really possible

left orbit
#

ill install mypy locally and see if all works

frank canopy
fiery turtle
#

u can panic in this case if tahts appropriate in rust

frank canopy
#

did not actually know c also does that specific case though

flat badge
#

In any case, it's a feature in many langs to break up multi line strings

fiery turtle
#

its very useful in C

frank canopy
#

whats it good for in C? now im curious

fiery turtle
#

for macros and stuff

#

or breaking lines up

left orbit
#

mypy passes locally

frank canopy
#

ah yeah i can imagine its nice for macros

fiery turtle
#

e.g. make_str(arg0) "prefix" #arg0 "postfix"

left orbit
#

i should have tested it all locally anyway lol mb

fiery turtle
#

npnp

frank canopy
#

make gh work for its living lmao

fiery turtle
#

lets see how long windows takes, it used to take 20 mins

fiery turtle
#

nice

left orbit
#

not bad

#

it only does 2 cores though

fiery turtle
#

ubuntu took 6 minutes

left orbit
#

linux should see a bigger speed up with 4

#

oh 6 minutes is kinda slow

#

how long did it usually take?

fiery turtle
#

well it does 2 large test runs

#

32 bits and 64 bits

left orbit
#

ah true

#

so around 3 minutes per run

fiery turtle
#

these are old values

left orbit
#

13/14 min -> 6 min

#

thats good

fiery turtle
#

not bad at all

#

considering its 2 cores

left orbit
#

oh it only gets 2 cores?

#

i thought linux vms got 4

fiery turtle
#

oh idk

left orbit
#

i should have added a print but oh well

fiery turtle
#

wait uh

#

Run python3 /Users/runner/work/uACPI/uACPI/tests/run_tests.py --bitness=64 --large

#

i dont see paralellism here

#

is it done automatically?

left orbit
#

well it goes quick for me

#

yeah

#

it uses os.cpu_count()

fiery turtle
#

ohh

left orbit
#

you can specify --parallelism N manually if you want

#

it does the large tests in 29.29s for me locally with parallelism=24

fiery turtle
#

oh yeah i didnt see default=os.cpu_count() or 1

left orbit
#

so hopefully it speeds up your local workflow too

fiery turtle
#

it definitely will

left orbit
#

macos finished in 4 minutes vs 10 minutes previously

#

not bad

fiery turtle
#

yeah very nice

#

i wonder why its not exactly x4 if it gets 4 cores

left orbit
#

i think they overprovision their vms

#

so while technically you get 4 cores you don't get 4x the cpu time you get with 1 core

#

but i'm also not sure if they give you 4 cores

fiery turtle
#

yeah probably

left orbit
#

they all do wtf

fiery turtle
#

i guess they're just not 100% of the cpu

left orbit
#

for me large tests finish in ~100s on 4 cores

#

SUMMARY: 359/359 in 131.25s (ALL PASS!) on ubuntu

#

for 32 bit runner

#

SUMMARY: 359/359 in 121.25s (ALL PASS!) on windows for 64 bit runner

fiery turtle
#

nice, I'll clone locally and give it a try, see if i can find nits perhaps (ultrameme)

left orbit
#

amazing

#

also run_tests builds with ninja if it can, gives a nice speed up on my machine

fiery turtle
#

i think i have ninja so it should pick that up automatically right

left orbit
#

yeah as long as you nuke tests/runner/build-*

#

because that is already configured with makefiles

fiery turtle
#

yeah

left orbit
#

SUMMARY: 359/359 in 112.19s (ALL PASS!) locally with parallelism=4

fiery turtle
#

those ci jobs also install dependencies and stuff

#

that could be taking some time too

frank canopy
#

yep

left orbit
#

oh yeah of course

fiery turtle
#

SUMMARY: 359/359 in 133.12s (ALL PASS!) thats on ubuntu

#

in ci

left orbit
#

yeah its probably just because its a vm

#

so its a little bit slower

fiery turtle
#

ye

left orbit
#

that 133.12s is from when it starts the first test to the end of the last test so it's purely compute bound

#

doesn't include compiling aml

#

could also be that fork+exec is slow-ish in a vm too, idk

fiery turtle
#

yeah

#

either way its at least a 2x speedup for ci so its amazing

left orbit
#

never a bad thing :)

#

i'll look at sso in a bit, i still think it has potential

fiery turtle
fiery turtle
#

although its private meme

left orbit
#

and i think it should make a noticeable difference

#

getting rid of all the allocations is big

#

and it should able to hold up to 14-15 bytes

fiery turtle
#

14-15 would definitely save quite a lot

#

a pnp id string is like 9 chars

left orbit
#

unfortunately no such big improvements for 32 bit builds, since strings are 8, not 16 bytes

fiery turtle
#

yeah

left orbit
#

but most targets are 64 bit anyway

fiery turtle
#

thats fine

#

barely anyone uses 32

left orbit
#

ok i go to the store and when i come back i do sso

fiery turtle
#

omg it detected the fact that i have ninja on windows and found some old ass garbage clang

#

instead of MSVC

#

is there any way to tell it to prefer msvc?

north holly
#

?

fiery turtle
#

yes

#

with ninja

north holly
#

set(CMAKE_CXX_COMPILER "cl")

#

The same for C but without the XX

fiery turtle
#

doesnt look very portable

#

i want ninja to just prefer msvc if it exists

north holly
#

And you also need to do this before the first project statement

north holly
fiery turtle
#

this already works correctly if u dont force -G ninja

north holly
#

Do that

#

endif()

fiery turtle
#

I think just not doing -G ninja if it detects os() == Windows is good enough

#

i want a solution file on windows anyway

#

not a ninja file

fiery turtle
left orbit
fiery turtle
fiery turtle
left orbit
#

could you so that?

#

do*

#

im not home

#

and you can push to my branch

#

or merge and push to master if you want

fiery turtle
#

Yeah I can ofc, there's no hurry tho

#

Or do u want me to add that?

left orbit
#

alright sounds good

#

up to you

#

ill be home in about 30 min

fiery turtle
#

I tested on wsl and looks great

fiery turtle
gentle peak
left orbit
#

also cmake probably picks up clang from path

fiery turtle
#

I guess the default generator on windows just picks up MSVC

left orbit
#

yeah it should 100% given you want to test msvc

fiery turtle
#

Probably visual studio just does MSVC because its biased ultrameme

left orbit
#

thats the default yeah

frank canopy
#

yep

#

cmake's default output is a solution file on windows, which then gets compiled by msbuild iirc? but using msvc

#

(i used to be the designated person who has windows for a cmake-based project which was meant to use mingw instead of msvc and fought with it for quite a time to get it all working just right)

hollow elm
frank canopy
#

yeah was about to say lol

#

you can use ninja with msvc on windows but youll need to do all the toolchain stuff manually

frank canopy
#

also the pci attach api is possibly gonna be real nice to have tbh

#

itll let me map things onto the same setup ive already got for my primary pci access functions

north holly
hollow elm
#

and the compiler to use etc

north holly
#

Ye

flat badge
#

pci attach api?

hollow elm
#

yeah so why shove that into the main cmake file

north holly
frank canopy
# flat badge pci attach api?

in the same pr as making calloc optional; kinda like the io-map stuff but for pci stuff. most useful because it lets me attach the ECAM region pointer once instead of finding it again each time

#

because looping through the mcfg stuff each time is slow

fiery turtle
flat badge
#

Ah i see

frank canopy
#

i may actually refactor my pci access functions to take a struct instead of a bunch of arguments because ive got those arguments as basically a struct stored in most of the places it gets accessed

#

either that or ill keep to working on the memory manager that i keep getting distracted from by all the uacpi things

fiery turtle
#

noo dont u want to spend countless hours doing random optimizations to get extra uacpi points ultrameme

frank canopy
#

no but i do want to get more devices working

#

also i still need to figure out if the uacpi event thing is closer to a KEVENT or to a semaphore because i do not know linux apis and thus event_fd means nothing to me and the docs are as usual hard to read for linux things like that

north holly
frank canopy
fiery turtle
#

like

frank canopy
#

the all caps is because its a type in the NT kernel so its always all caps

fiery turtle
#

its a very very simple thing

#

u have an integer

frank canopy
#

so its a semaphore then ok

fiery turtle
#

if its value 0 reads block

#

if its value is greater than 0, u decrement and instantly return

#

u can also increment this value

frank canopy
#

my brain operates entirely on windows terminology so i kept seeing event and getting hung up expecting the windows event object lol

fiery turtle
#

im not sure if kevent is similar

vast kestrel
#

In the windows world event is a bit different to a semaphore

fiery turtle
#

but sounds like it is

left orbit
#

ok im back i'll do the windows check

#

i got choccy milk

frank canopy
#

signaling a signaled event is a no-op for what windows calls events

vast kestrel
#

And given acpi comes from Microsoft it would make sense to be similar, even if it isn't in practice

frank canopy
#

it doesnt keep a counter of how many times its signalled

vast kestrel
#

^

fiery turtle
fiery turtle
frank canopy
#

oh heck yeah choccy milk is good

fiery turtle
#

aka a mutex

left orbit
#

is ninja fine on mac?

#

i guess so

fiery turtle
#

i think

frank canopy
vast kestrel
#

And in general the wait can return with a different state (auto-reset vs manual-reset)

frank canopy
#

yeah

fiery turtle
#

ah ok

#

well aml events are just semaphores with a 64-bit counter

vast kestrel
#

AutoReset is basically using a mutex for an event

frank canopy
#

theres two kinds of events, one resets to unsignalled if you wait it and acts more like a mutex (though mutexes also exist and are separate on windows) and manual reset ones dont reset so waits on a signalled one are no-ops

#

yeah that

fiery turtle
#

linux eventfd is also the former example

frank canopy
#

the kernel also calls them synchronizationevent and notificationevent whereas windows usermode calls them autoresetevent and manualresetevent

left orbit
#

workflow waiting for approval

#

but yeah it's just the windows check

fiery turtle
left orbit
#

it will

#

or rather it won't need approval

frank canopy
#

oh and the function to signal a windows event also has an option to not lower irql when it returns so you can do a non-preemptable signal-and-wait with it

left orbit
#

this is for new contributors only to prevent malicious prs i guess

#

or maybe to prevent people from spamming ci on popular repos

#

but not like they cant do it on their own public repos if they want to harm github/microsoft

#

tooootally hasn't been done already meme

fiery turtle
#

yeah idk its dumb

fiery turtle
left orbit
#

lfg

flat badge
fiery turtle
#

is it?

fiery turtle
left orbit
#

time to drink some choccy milk and give sso a go

flat badge
#

unlock -> lock is usually not defined for a mutex

left orbit
#

btw have you looked at zig? :D

fiery turtle
#

thats a good combo

left orbit
#

im curious

fiery turtle
#

i had some pr churn going

#

wrapping up for uacpi 1.0

winter orbit
#

which will come first uACPI 1.0 or dark finishing all 16 major device drivers 1607 implements in ACPI.sys chad

fiery turtle
#

how many callbacks is that

winter orbit
#

167

#

I think

fiery turtle
#

how big is one callback?

winter orbit
#

I haven’t counted all of them

winter orbit
frank canopy
fiery turtle
#

im predicting at least a week for uacpi 1.0

winter orbit
#

let me post the wall

fiery turtle
winter orbit
#
"ACPI0007"
"FixedButton"
"PNP0000"
"PNP0001"
"PNP0002"
 "PNP0003"
 "PNP0004"
 "PNP0100"
 "PNP0101"
 "PNP0102"
 "PNP0200"
 "PNP0201"
 "PNP0202"
 "PNP0800"
 "PNP0A05"
 "PNP0A06"
 "PNP0B00"
 "PNP0C00"
 "PNP0C01"
 "PNP0C02"
 "PNP0C04"
 "PNP0C05"
 "PNP0C09"
 "PNP0C0B"
 "PNP0C0C"
 "PNP0C0D"
 "PNP0C0E"
 "PNP0C32"
 "SNY5001"
 "IBM0062"
 "DockDevice
 "ThermalZone"
 "Processor"
#

there

#

Only 16 of these matter though

#

screw dockdevice

left orbit
#

before that happens tho i'd like a proper ultra protocol binding thing

fiery turtle
#

i mean i can make u the admin of the repo right

left orbit
#

yeah

fiery turtle
#

ah ok

winter orbit
#

does uACPI actually stand for Ultra

fiery turtle
#

it micro and ultra

winter orbit
#

Okay

fiery turtle
#

lmao

left orbit
#

uNIX when

winter orbit
#

uNT

fiery turtle
#

u is not uacpi

#

or whatever

fiery turtle
winter orbit
#

GNU/uNIX

fiery turtle
#

GNu

winter orbit
#

that’s better actually

slim panther
#

ultra digital rights management

frank canopy
#

so processor, fixed button, all five types of interrupt controller, AT EISA and MCA timers, all three DMA controller types, AT-style speaker sound, generic acpi bus, generic acpi eio bus, AT RTC, "plug and play bios", system board, generic reserving resources, math coprocessor, apm bios, embedded controller, acpi fan, power button, lid, sleep button, HIDACPI button, dock, thermal zone, processor, and idk what sny5001 and ibm0062 are

#

idk why i have the devids file open always but i do

left orbit
#

ci about to be green 🔥

winter orbit
#

some of
Them are just empty IRP handlers yeah

left orbit
#

i should really do the string stuff instead of waiting for that

#

adhd be like

winter orbit
#

Each one of those create a unique PDO though nooo

frank canopy
#

so when is pr 106 being merged into uacpi i want it

winter orbit
#

And MS shoved it all inside ACPI.sys

#

I thought windows 11 would be better but it’s architected exactly the same

fiery turtle
frank canopy
#

that reminds me, is RTC guaranteed to be in acpi somewhere?

fiery turtle
#

thanks a lot, based work

left orbit
#

thanks 🎉

fiery turtle
#

but usually yes

frank canopy
#

eh true

fiery turtle
#

and it even exposes methods to read it

winter orbit
#

don’t trust firmware devs

#
  • firmware dev
left orbit
#

your contributor list on the main page is no longer a list, just a bunch of avatars

fiery turtle
fiery turtle
frank canopy
# fiery turtle but usually yes

i just want to know if i need to bother with figuring a way to make drivers do a root device if they dont get one from enumeration for rtc lol

frank canopy
fiery turtle
#

if a firmware dev tells u not to trust them u better listen

winter orbit
#

yeah we’re terrible people

vagrant hull
fiery turtle
fiery turtle
vagrant hull
#

eh

#

not as good

frank canopy
# fiery turtle yeah

what are they called? went looking in my acpi dump and not finding anything really

winter orbit
#

ok I need to lock in oof I keep getting distracted by discord and our crappy kernel pushlock code

fiery turtle
winter orbit
#

on a for once on topic note:

#

I think I need to build uACPI as C++

left orbit
#

oh god

fiery turtle
#

huh?

left orbit
#

that will end terribly

winter orbit
#

yeah there’s something seriously wrong with the way our .. environment builds uACPI
When I build it as standard C it crashes MSVC

left orbit
#

☠️

#

msvc moment

fiery turtle
#

bruh

frank canopy
left orbit
#

least broken msvc build env

flat badge
#

uefi has an rtc protocol

#

to read it

flat badge
#

which should in theory work on any platform (= also on arm servers etc)

fiery turtle
#
OperationRegion (RTCM, SystemCMOS, Zero, 0x3F)
Field (RTCM, ByteAcc, Lock, Preserve)
{
    SEC,    8, 
    Offset (0x02), 
    MIN,    8, 
    Offset (0x04), 
    HOR,    8, 
    Offset (0x07), 
    DAY,    8, 
    MON,    8, 
    YEAR,   8, 
    Offset (0x32), 
    CNTY,   8
}

Method (_GRT, 0, NotSerialized)  // _GRT: Get Real Time
{
    Local0 = Buffer (0x10){}
    CreateWordField (Local0, Zero, Y)
    CreateByteField (Local0, 0x02, M)
    CreateByteField (Local0, 0x03, D)
    CreateByteField (Local0, 0x04, H)
    CreateByteField (Local0, 0x05, MIN1)
    CreateByteField (Local0, 0x06, S)
    CreateByteField (Local0, 0x07, V)
    CreateWordField (Local0, 0x0A, TZ)
    CreateByteField (Local0, 0x0C, DL)
    FromBCD (YEAR, Local5)
    FromBCD (CNTY, Local6)
    Y = ((Local6 * 0x64) + Local5)
    FromBCD (MON, M) /* \_SB_.AWAC._GRT.M___ */
    FromBCD (DAY, D) /* \_SB_.AWAC._GRT.D___ */
    FromBCD (HOR, H) /* \_SB_.AWAC._GRT.H___ */
    FromBCD (MIN, MIN1) /* \_SB_.AWAC._GRT.MIN1 */
    FromBCD (SEC, S) /* \_SB_.AWAC._GRT.S___ */
    TZ = 0x07FF
    DL = Zero
    V = One
    Return (Local0)
}

Example

frank canopy
fiery turtle
#

Unlucky

#
❯ grep -rni '_GRT' -l | wc -l
150
frank canopy
#

instead ive just got a PNP0B00 device that defines a decode16 io region and optionally a single irq (if hpet is disabled)

fiery turtle
#

about 30% of machines have it

left orbit
#

how can i disassemble the tables from an acpidump?

fiery turtle
left orbit
#

thanks

frank canopy
#

iasl is the one that specifically disassembles

#

it also assembles

fiery turtle
#

its intel ASL compiler

#

yeah

frank canopy
#

and sometimes it tries to assemble the aml as if its asl because it gets confused in my experiencce

winter orbit
#

This file specifically

#

Will just blow up MSVC

fiery turtle
#

i recently fixed it for clang-for-windows

#

maybe it will work now

winter orbit
#

oh I’ll run the sync script

left orbit
#

Method (_GRT, 0, Serialized) // _GRT: Get Real Time

#

nice

fiery turtle
#

clang was stripping a comma in a macro

#

with va args

fiery turtle
left orbit
#

it also does _SRT

winter orbit
left orbit
#

i wonder how insane my motherboard's aml is

fiery turtle
#

look around see if u can find a 50 conditions while loop

winter orbit
#

Only 50?

fiery turtle
#
While ((GP50 || (GP51 || (GP52 || (GP53 || (GP54 || (
    GP55 || (GP56 || (GP57 || (GP60 || (GP61 || (GP62 || (GP63 || 
    (GP66 || (GP67 || (GP70 || (GP71 || (GP93 || (GP94 || (
    GPAP || (GPBP || (GPCP || (GPDP || (GPEP || (GPFP || (GPGP || 
    (GPHP || (FCDP || (FTVP || (FQSP || (GP96 || (GP97 || (
    GPD0 || (GPD1 || (GPD2 || (GPD3 || (GPD4 || (BPFE || (TPBP || 
    (ECDS || (B1ST || B2ST)))))))))))))))))))))))))))))))))))))))))
winter orbit
#

The worst thing I’ve seen was on an nvidia product

fiery turtle
#

rookie aml

fiery turtle
#

yeh, could be a 100

#

too bad they only have so few registers to check

winter orbit
#

Imagine bios developers started testing against uACPI

left orbit
#

no weird while loops but```
While (One)
{
If ((!IBSY || (IERR == One)))
{
Break
}

If ((Local0 > Local1))
{
    RPKG [Zero] = 0x03
    Return (RPKG) /* \IPCS.RPKG */
}

Sleep (One)
Local0++

}```

#

a possible infinite loop

fiery turtle
fiery turtle
#

thats why uacpi has while loop timeouts

left orbit
#

it's a method called IPCS in scope \

#

idk if those names have any meaning

fiery turtle
#

nah anything without a _ prefix is private so to speak

winter orbit
#

Win11 doesn’t have a lot of extra stuff

left orbit
#

ah makes sense

fiery turtle
left orbit
#

god this aml is so convoluted

#

120k lines of pain

fiery turtle
#

yeah

left orbit
#

i ain't reading all that

fiery turtle
#

some of it is hand written, some is runtime gen

#

so its a patchwork

left orbit
#

i forgot to check for debug logs

#

fun

fiery turtle
#

they usually have a custom method called ADBG or similar

#

that writes to proprietary debug regs

hollow elm
#

does uacpi let you capture Debug writes somewhere?

left orbit
#

can't find anything matching *DBG

#

i think it prints them

fiery turtle
#

as trace level

hollow elm
#

ah

fiery turtle
#

seems like most blobs have it

left orbit
#

not my blobs sadly

fiery turtle
#

guess u got the unlucky stripped debug logs blob

hollow elm
#
ssdt1.dsl
26:        Name (ADBG, Buffer (0x0100){})
#

also lol ```
8215: Debug = "Fn+ESC Pressed"
8222: Debug = "Fn+F1 Pressed"
8229: Debug = "Fn+F2 Pressed"
8238: Debug = "Fn+F3 Pressed"
8247: Debug = "Fn+F4 Pressed"
8254: Debug = "Fn+F6 Pressed"
8261: Debug = "Fn+B Pressed"

rustic compass
#

@fiery turtle what is a uacpi_data_view and what exactly does it do/represents?

fiery turtle
#

a slice

#

of a buffer or a string

rustic compass
#

the union confuses me why 2 pointer? isnt a slice ptr + len?

fiery turtle
#

because the data might be char data for strings, or binary data for data buffer

#

its a union

#

so its just for convenience

rustic compass
#

no i mean:

uacpi_u8 *bytes;
const uacpi_u8 *const_bytes;
fiery turtle
#

because this is used as an in param or out param sometimes

#

so its either writable or readable data

#

depending on where its used

#

its just an anonymous data view

rustic compass
#

so the union contains 4 pointers?

fiery turtle
#

1 pointer with 4 names

left orbit
#

you said it yourself, it's a union

#

it's the same pointer but with a different type

#

for use in different scenarios

rustic compass
#

i got confused by the empty line

fiery turtle
#

are you familiar with C unions?

#

i think for rust u just want to store one pointer and have like as_something() ig

rustic compass
#

i know the concept of a union

fiery turtle
#

idk how rust does it

left orbit
#

rust has unions too

#

and iirc they work the same as C ones

fiery turtle
#

untagged?

left orbit
#

or you can at least have repr(C) unions

#

that do the same thing

#

but muh ub unsafe and all that crap

#

idk

fiery turtle
#

i think for the purposes of rust having this data structure literally translated would be not super idiomatic

left orbit
#

not at all, no

frank canopy
#

INFO (uacpi): successfully loaded 1 AML blob, 1705 ops in 2ms (avg 689201/s) welp

#

this is still old branch but also

left orbit
#

i blame zig allocator for being slow

#

you're using gpa right?

frank canopy
#

yeah gpa

#

on releasefast

left orbit
#

it's slow as balls

#

uacpi does a lot of allocations that fit buckets 5-10

#

and it needs to create a lot of them

#

so every 30 or so allocations you end up creating a new bucket

#

and that is slow-ish

#

because it needs to insert it into the treap

#

and all that

fiery turtle
frank canopy
#

main branch

fiery turtle
#

ah

#

well 700k is solid as well

left orbit
#

i think a better allocator would put you above 1M

#

given that your pmm isn't poop

frank canopy
#

also the time in nanos computation hits a divide by 0 exception if i use tcg since i only use hypervisor leaves for calibration lmao

#

my pmm is singly linked lists of free pages with each next-pointer stored in the first bytes of the free page itself, using an hhdm to access it

#

im currently in the middle of redoing all of my memory manager stuff though

left orbit
#

that should be good enough

frank canopy
#

yeah im 100% sure the bottleneck is GPA

#

but also im not really going for records here

#

am a bit surprised though, this is lower perf then last time i tested it lmao

#

lemme try kvm on wsl2 instead of hyperv accel

winter orbit
#

it did

frank canopy
#

on wsl2 with kvm accel i get 1669364/s, on windows with whpx accel im now getting 1006173/s and idk what changed

fiery turtle
slim panther
winter orbit
#

MSVC is NOT beating the insane allegations

winter orbit
fiery turtle
#

how is msvc subject to the same bug as clang on windows

winter orbit
#

that's how we build 32bit MSVC ros

fiery turtle
#

i wonder if its some libc bug

winter orbit
frank canopy
#

interestingly on kvm accel my actual device enumeration takes like 5-10 seconds to process but uacpi is ~75% faster to load aml compared to whpx/hyperv

#

whereas on whpx the device enumeration is fast enough that i dont notice it but uacpi is slower

fiery turtle
# winter orbit it's insane

and i compile with msvc all the time and it works fine, but my msvc is latest so thats why it works probably

winter orbit
#

nah this is latest we just do some weird stuff

fiery turtle
#

ah

frank canopy
#

either way on kvm accel i now get consistent 1.6-1.7mil ops/s

winter orbit
#

we actually have targets for clang, gcc and msvc at once

left orbit
left orbit
#

is interpreter.c the only place where string/buffer objects are created/used?

winter orbit
#

but that's likely getting dropped

#

with this being imported

frank canopy
#

qemu-system-x86_64 -drive format=raw,file=drive.bin -accel kvm -d int,cpu_reset,guest_errors --no-reboot -M type=q35,smm=off,hpet=on -cpu qemu64,+invtsc,+pdpe1gb,+rdrand,+arat,+rdseed,+x2apic -m 4G -debugcon file:aaa.txt is my image and cli for anyone interested in comparing results

left orbit
#

amazing

fiery turtle
winter orbit
#

yes

fiery turtle
#

ah ok based

winter orbit
#

this is 2022

left orbit
#

INFO (uacpi): successfully loaded 1 AML blob, 1705 ops in 0ms (avg 3282507/s)

#

holy

winter orbit
#

2019 and 2022 are probably all we will support going forward

left orbit
#

speed

frank canopy
#

ok i guess my computer is just slow

left orbit
#

what cpu?

frank canopy
#

if others are getting double the perf

fiery turtle
#

but u have most stuff stubbed right

frank canopy
#

ryzen 7 3700xt

#

stall sleep and acquare/release mutex and wait event are stubbed

fiery turtle
#

yeah

#

once u implement those it will tank

#

not by a lot if u make a good mutex impl

frank canopy
#

and schedule/wait for work returns status unimplemented rn

fiery turtle
left orbit
#

not used during init/ns load

frank canopy
#

yeah

left orbit
#

it looks like it but i wanna make sure

fiery turtle
#

nope

left orbit
#

ah rip i gotta read more code then meme

fiery turtle
#

types.c via user api

left orbit
#

oh that is gonna be so fun

fiery turtle
#

create_object etc

fiery turtle
left orbit
#

are those objects opaque outside uacpi?

fiery turtle
#

yeah users cant mess with anything directly

left orbit
#

good

fiery turtle
#

there are getters for the string/buffer view

#

the struct u saw earlier

#

but its a view so its up to u what u set the pointer to

left orbit
#

good

#

time to commit some aliasing crimes

fiery turtle
#

lol

#

its legal in C

#

at least via unions

left orbit
#

alright then i gotta do it that way

fiery turtle
#

so far it works with O3 + LTO so no ub crimes have been commited by uacpi

#

at least not ones that would break instantly

frank canopy
#

actually yknow what, i literally have semaphore and mutex already, why not actually just plug the dang things into uacpi lmao

left orbit
#
// This is private API, but we have to use it for tests here.
extern "C" {
    #include <uacpi/internal/resources.h>
}
#

makes sense

fiery turtle
#

trolled

left orbit
#

i can just

#

is_inline = 0

winter orbit
left orbit
#

or not do anything because it won't be set by default

#

yayyy

fiery turtle
#

yea

left orbit
#

but now buffer has two union members

#

.data and .inline_data

fiery turtle
fiery turtle
fiery turtle
#

lmao

winter orbit
#

foundation of win32ss btw

fiery turtle
#

these comments remind me of pre-corporate linux

winter orbit
fiery turtle
#

now they arent even allowed to mention MS

frank canopy
#

welp i had to setup early table access to plug in sync stuff and now thats got a gp fault

fiery turtle
#

F

#

where does it happen

#

I forgor to rebase api-changes on top of iretq's changes and now i have to wait forever for ci 💀

frank canopy
#

i got interrupted before i could check the gp fault, checking now

rustic compass
#

@fiery turtle do apis that take uacpi_object ptr decrement its refcount when they drop it internally?

fiery turtle
#

like which

#

unless there's a comment saying otherwise the refcount is the same as it was pre-call

#

well and for uacpi_eval's arguments specifically, AML can take a RefOf(obj) internally and store it in some global variable

#

so thats something to be aware of

#

thats why uacpi doesnt allow stack-allocated objects

rustic compass
#

well rust likes its stack variablesmeme

frank canopy
#

ok why the heck is this a gp fault and not a page fault

frank canopy
#

🎉 cool

fiery turtle
#

for anyone who wants free uacpi points u may want to update now :^)

#

(should be faster now because dynamic array grows by factors)

frank canopy
#

oh i think i see what broke my thing

#

i think anyway

rustic compass
#

@fiery turtle

typedef uacpi_status (*uacpi_region_handler)
    (uacpi_region_op op, uacpi_handle op_data);

typedef uacpi_status (*uacpi_notify_handler)
    (uacpi_handle context, uacpi_namespace_node *node, uacpi_u64 value);

what the fuck is that?

fiery turtle
#

handlers for address space io and Notify requests

#

or do u mean as in what this means in C

rustic compass
#

yes

fiery turtle
#

it typedefs a function pointer type

#
typedef uacpi_status (*uacpi_region_handler)
    (uacpi_region_op op, uacpi_handle op_data);

Function pointer type called uacpi_region_handler with signature uacpi_status foo(uacpi_region_op op, uacpi_handle op_data)

rustic compass
#

so basicly:


type Binop = fn(i32, i32) -> i32;
fiery turtle
#

that

frank canopy
#

ok i feel kinda dumb now but at least i found my bug

#

turns out when i allocate something i should also initialize the struct contents

#

im down from 1.6->1.4 mil/s by adding mutex and semaphore stuff

fiery turtle
#

still pretty good

frank canopy
#

qemu-system-x86_64 -drive format=raw,file=drive.bin -accel kvm -d int,cpu_reset,guest_errors --no-reboot -M type=q35,smm=off,hpet=on -cpu qemu64,+invtsc,+pdpe1gb,+rdrand,+arat,+rdseed,+x2apic -m 4G -debugcon file:aaa.txt is my image and cli for anyone interested in comparing results (its the same cli)

#

thats still old branch btw

#

ive not pulled in new master

gentle peak
#

updated the leaderboard update message

fiery turtle
gentle peak
#

i should really add proper uacpi<->proxima error code conversion functions

rustic compass
#

your function pointer shenanigan is causing me real headache, i probably need rust macros and i never wrote onenooo

fiery turtle
#

why is that

rustic compass
#

my current idea is that i create a Region/NotifyHandler function wrapper that wraps the kernel supplied handler and does safe type conversion, but for that i need compile time code expansion aka macro

gentle peak
frank canopy
#

cool

fiery turtle
#

or i guess u want it to be free in terms of overhead

frank canopy
#

upgraded to newest uacpi master and ive got 2993260, 3185403, 3112091 as first three runs under kvm (seems pretty consistent around 2.9-3.2 mil)

rustic compass
frank canopy
#

thats with mutexes and semaphores implemented not stubbed

gentle peak
fiery turtle
rustic compass
#

so i have a internal function signature that is uacpi one just in rust and a public one that the kernel uses

fiery turtle
frank canopy
#

apparently the zig gpa isnt as slow as id thought

#

again thats got full semaphores and mutexes

fiery turtle
#

thats like second place now

frank canopy
#

only sleep and stall are still stubbed

fiery turtle
#

but a lot of people still havent updated ig

frank canopy
#

(well and schedule/wait for work but thats not relevant to init benchmarking)

gentle peak
#

considering everything on the leaderboard rn is with unupdated uacpi, it'd probably be in between astral and menix

fiery turtle
#

fair

frank canopy
#

we'll find out when more people update ig

#

either way im callin this good for now lmao

fiery turtle
#

very very solid yes

gentle peak
#

i wonder what it'd take to get proxima to 7M

fiery turtle
#

SSO perhaps meme

dusky glade
#

using the nyaux allocator perhaps

rustic compass
#

what is sso?

dusky glade
left orbit
#

i am half way through interpreter.c

dusky glade
#

slowly starting out using the nyaux allocator

fiery turtle
left orbit
#

types.c and utilities.c done

fiery turtle
#

big

dusky glade
left orbit
fiery turtle
#

daamn

left orbit
#

leaving 7 bits for length and 1 bit for the flag

fiery turtle
#

makes sense

calm latch
#

I forgot to dump the tables 😦

dusky glade
#

that is real btw

left orbit
#

and now instead of accessing buf->data, buf->text and buf->size you use thesec #define UACPI_INLINE_DATA_MAX_SIZE sizeof(void *) + sizeof(uacpi_size) - sizeof(uacpi_u8) #define UACPI_BUFFER_IS_INLINE(buffer) ((buffer)->inline_data.is_inline) #define UACPI_BUFFER_DATA(buffer) (UACPI_BUFFER_IS_INLINE(buffer) ? \ (buffer)->inline_data.inline_data : (buffer)->data.data) #define UACPI_BUFFER_TEXT(buffer) (UACPI_BUFFER_IS_INLINE(buffer) ? \ (buffer)->inline_data.inline_char_data : (buffer)->data.text) #define UACPI_BUFFER_SIZE(buffer) (UACPI_BUFFER_IS_INLINE(buffer) ? \ (buffer)->inline_data.size : (buffer)->data.size)

calm latch
median crest
#

I really wanna see how fast my new locks will make it, uncontended it will be 1 cas for lock and unlock

#

compared to the shitshow it was before

left orbit
#

nyaux multi arch kernel?

#

☠️

fiery turtle
#

especially with new uacpi

dusky glade
#

check arch abstraction

calm latch
dusky glade
fiery turtle
#

lmao

dusky glade
calm latch
#

I should've advertised RISC-V as well

#

I was the first RISC-V OS to support uACPI I think

left orbit
#

does aml concatenation always result in a buffer/string?

fiery turtle
#

yes

gentle peak
#

if i do everything i can think of to improve perf (including stuff like stubbing mutexes, compiling with -march=native -mtune=native, etc) i can get the current uacpi commit to 7,832,670/s

fiery turtle
#

insane

calm latch
#

I need to try uACPI with AVX512 ultrameme

gentle peak
#

oh right i should remove -mgeneral-regs-only and see what that does

left orbit
frank canopy
left orbit
#

me when int + int = string

gentle peak
left orbit
#

or is concatenation done using some special operator

fiery turtle
left orbit
#

i have no idea what that means

fiery turtle
left orbit
#

well

#

and int

fiery turtle
#

concatenate is Concatenate(123, 321)