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

1 messages ยท Page 68 of 1

fiery turtle
#

so we see how it comes up with that address

calm latch
#

How do I do it?

fiery turtle
#

uacpi_context_set_log_level

calm latch
#

also, you have a fast PC, you can compile it yourself trl

fiery turtle
#

we will see all io reads and writes

fiery turtle
#

wsl is slow af

calm latch
#

I'm also using WSL

fiery turtle
#

oh ok

#

u probably want the trace log level

#

debug logs every aml op

#

trace just logs IO

calm latch
#

This is ok, right?

#

Do I keep the printf on uacpi_map?

fiery turtle
#

yeah it can be called at any time at all

fiery turtle
#

@fiery ice btw u tested linux shutdown on it recently right

fiery ice
#

ye

#

via ZorinOS

#

and it works fine

calm latch
fiery turtle
#

what even is zorin os

fiery ice
#

linux distro that is similar to windows

#

it's the only gui one i had on hand

#

lol

fiery turtle
#

lol

fiery ice
fiery turtle
#

yeah because it traces every io

calm latch
#

Does that PC have UART?

fiery ice
#

no

calm latch
#

Idk why, but flanterm is really slow

fiery turtle
#

is this why u get bs?

calm latch
#

Idk

fiery ice
#

bruh

#

you somehow managed to break your OS XD

#

by adding the log

fiery turtle
#

what happened?

fiery ice
#

keyboard also does not work

fiery turtle
#

pmos is as stable as obos trl

calm latch
#

This returned 10

#

Internal error which is an external error probably

fiery turtle
#

yeah

calm latch
#

Maybe it OOMed trl

fiery turtle
#

if only there was uacpi_status_to_string trl

calm latch
#

Where did you say I was returning internal error instead of external error?

fiery turtle
#

it was from some screenshot of yours

#

more interesting is how tf did logs even affect that

calm latch
#

How much ram does that PC have?

fiery turtle
#

you can also try fixing the pci stuff then just retry without debug logs

calm latch
#

I feel like AI is gaslighting me

#

That should be correct

fiery turtle
#

Do u have Gemini or Claude?

calm latch
#

GPT codex 5.2

#

No

fiery turtle
#

Bruh

#

How

calm latch
#

This is also correct

calm latch
fiery ice
calm latch
#

I'm not paying for AI

hollow scaffold
#

its free

calm latch
#

This is fun, I cought the PS/2 bug in a VM

fiery turtle
calm latch
#

But I don't care about keyboard now

hollow scaffold
#

send patches

calm latch
#

To myself? trl

hollow scaffold
#

or make xhci and hid drivers

hollow scaffold
calm latch
#

I wanted to study today anyway...

#

Imma leave codex with it

#

And go do other stuff

fiery turtle
#

Lmao

calm latch
#

Ok, GPT 5.5 is much more reasonable

north holly
#

maybe

#

but idk why that thing like never boots

fiery turtle
#

Same

#

Well it used to boot

calm latch
#

I feel like I'm falling into another ACPI rabbit hole

#

You're supposed to get buses from _CRS

#

Also, QEMU is trolling?

#

Or GPT is gaslighting

#

Or both

#

So it's the gaslighting

fiery turtle
calm latch
#

I'm fixing the stuff still, but that one might fix it

#

My PCI code is completely broken trl

fiery turtle
#

Lol

calm latch
#

Also, I've checked managarm, and it configures PCI bridges??

fiery ice
#

give it 5 mins to boot

#

lol

fiery turtle
#

Lol

fiery ice
fiery turtle
#

Maybe should've disabled it for fix check

fiery ice
#

EC event err 10

#

oh wait

#

it now sees the power btn

#

but it does nothing XD

#

it just prints shutdown in 3 seconds

#

but nothing is happening

#

@calm latch

calm latch
#

yeah

#

gimme a sec, I'm fixing PCI still

#

Maybe it will work with that...

fiery ice
#

pls disable that debug log too

#

lol

calm latch
#

Idk, I feel depressed

#

Because it's C

fiery turtle
#

Ask chatgpt to fix it

torpid root
#

make no mistakes

calm latch
#

What am I supposed to do instead of UACPI_STATUS_INTERNAL_ERROR?

fiery turtle
#

Well why does it fail

#

I might add a KERNEL_INTERNAL_ERROR for this tbh

rustic compass
#

also would be nice if you could write down which parts of uacpi_status a function can return

#

which i plan to do with tons of subenums in uacpi-rs to make error handling easier given rusts strict type system

fiery turtle
#

So thats not really feasible for a lot of them

rustic compass
#

if its not too much hassle for you

fiery turtle
#

Where do you expect to see them?

#

Also is that something you can express in rust somehow?

rustic compass
fiery turtle
#

Is that useful?

rustic compass
#

depends on the users error handling tbh, at least for me i dont really like to have to group large amounts of error values into a blanket case in a match statement and just label them as unreachable

fiery turtle
#

We can do that at least for a simple case like the table api

#

But again that calls into the kernel api which can return anything

fiery ice
fiery ice
rustic compass
fiery ice
#

pc now shuts off

calm latch
#

Cool

#

Idk what made it work now, but I've improved everything

fiery turtle
#

There's nothing preventing that

fiery turtle
#

So it wasn't a uACPI bug, cool

fiery ice
#

seems like no

calm latch
#

yeah, my PCI code was jank

#

Idk how it even worked before

fiery turtle
#

Lol

calm latch
#

I mean not really, but it wasn't the best

fiery ice
#

and i was about to take inspiration from yours XD

calm latch
#

No, it's mostly the same, but I had a lot of stuff which was commented out, and it was reading from COM1 instead of PCI...

fiery ice
#

wdym reading from COM1?

calm latch
#

0x3f8 instead of 0xcf8

fiery ice
#

๐Ÿ’€

fiery ice
calm latch
fiery ice
#

then you should not need that port?

calm latch
#

But you need AML to do it, and that need PCI

#

So you've got to use the 0xcf8 if you have no ECAM

fiery ice
#

i support fallback but afaik it is using only ecam

fiery turtle
calm latch
fiery ice
#

you can get it from MADT

#

or some static table

fiery turtle
#

Like the very first aml PCI access you can do with ecam no?

calm latch
#

_CBA trl

fiery turtle
calm latch
#

You don't

#

but you might not have ecam?

fiery ice
#

uacpi loads pci after you can already access CBA i think

calm latch
#

Plus the spec says that calling it activates some stuff

fiery ice
#

at least, i'm doing it like that

#

this is called after uacpi_namespace_load

#

uacpi_namespace_initialize is what does stuff with PCI afaik

fiery turtle
#

It has ecam right

fiery ice
#

ye it def has

#

my os can see it

calm latch
fiery ice
#

๐Ÿ’€

fiery turtle
#

Ah

calm latch
#

Worked on all my PCs without it trl

fiery turtle
# fiery ice

There's eval simple integer if you dont have args

fiery turtle
calm latch
fiery ice
#

i did not test MSI / MSI-X yet tho

calm latch
#

The configure PCI bridges as well

fiery ice
#

but i'm implementing NVMe now

calm latch
fiery ice
#

๐Ÿ’€

steel inlet
#

when is uAPM releasing

#

(thanks android autocorrect)

pine leaf
#

what about uDT trl

#

(inb4 it's just rebranded libfdt)

calm latch
#

There's smoldtb

#

(Not by infy, but still a nice library which I use)

fiery turtle
#

but obviously not the fucked up runtime stuff it needs

slim panther
crude summit
#

100% would use

rustic compass
#

@fiery turtle need to know if uacpi 5.0 is realistically happening within like a few weeks, if yes i would wait with bumping the uacpi version uacpi-rs uses until then else i just go to 4.? first

fiery turtle
#

A few weeks yes

fiery turtle
#

Added a few more items into the future โ„ข todo

#

im wondering how feasibile it would be to put all uacpi global state into a context and then do

#define uacpi_foo(...) uacpi_foo_ctx(&g_uacpi_ctx, ...)
#

so that rust users and others can be happier theres no global state

#

but thats not something im doing any time soon, just some thoughts I have

fiery turtle
frank canopy
fiery turtle
#

well the barebones context would obviously be incompatible with a full context, but I guess its possible to construct it such that it could be boostrapped

rustic compass
#

i dont really see the need for a non global state, there is only one uacpi instance ever at once unlike a heap allocator like hardend_malloc where its fucking annoying that its fully stored in the .bss meaning in need to do linker black magic to get more than one instance running at the same time

fiery turtle
#

yeah idk its not super useful

rustic compass
#

if you were to write something like a heap allocator i would really haunt you until you add that but uacpi, nah, but i do think it would be kinda funny having aml racing with itself KEKW

frank canopy
#

yeah its really not a huge thing lol

kind mantle
frank canopy
#

also, im kinda curious, when making uacpi where did you start?

kind mantle
#

Also Rust globals aren't illegal, you just need to put them in e.g. mutexes or spinlocks

frank canopy
#

yeah the ability to migrate an externally-provided barebones state interests me a lot more than having state not be global

kind mantle
#

but isn't the barebones state also kinda trivial

#

Because you're just reading the tables, not doing any AML

frank canopy
#

yes, the idea is more for marshalling from a prekernel than it is for within a single thing

#

use pre-mapped-and-allocated-copy tables

kind mantle
#

Also if you did this you would also need to migrate your prekernel heap to kernel proper heap

#

Which seems problematic

frank canopy
#

well uacpi already uses fixed buffer for barebones stuff iirc/for early tables access

#

so its more about reusing the references to that before it copies into real allocations later

fiery turtle
#

then tried learning how aml works by just dumping opcodes as text

#

then did some crappy interpreter impl, that was thrown away

#

then did it a few more times when i realized it didnt cover some edge cases with reference propagation

#

then somehow arrived at the microcode thing which kinda fell into place

frank canopy
#

cool

#

the microcode thing is brilliant btw, i legit never would have thought of it but its so elegant

fiery turtle
#

thanks! theres technically a lot to improve there

#

some redundant safe deep object copies, some stuff is out-of-line that could be entirely bytecode etc

#

but fast enough so eh

frank canopy
#

yeah

fiery turtle
#

still waiting for someone with a 300x claude subscription to make a JIT trl

frank canopy
#

lmao

fiery turtle
#

theres another small vm in uacpi besides the aml thing btw

#

the resource<->aml resource converter stuff

frank canopy
#

yeah i saw that when trying to debug my resource code lol

kind mantle
#

wait does ACPI define two bytecodes? ๐Ÿ’€

fiery turtle
#

nah lol

frank canopy
#

no the resource one is just an implementation thing

fiery turtle
#

it defines very complex resource structures

#

that are basically unusable in C unless u convert them into something proper

hallow marten
#

Also what's the microcode thing

fiery turtle
#

but then you also need to convert back for _SRS

frank canopy
#

which is then used to evaluate them

hallow marten
#

So an IR?

kind mantle
#

Microcode isn't really IR

frank canopy
#

no its true microcode - each opcode gets a list of microcode instructions that then get looped over when that opcode is hit

#

ir would imply it gets translated ahead of time

hallow marten
#

Ah so it's basically a kind of IR that describes how an opcode behaves

#

Not really IR

#

DSL or something

frank canopy
#

thats what microcode is

#

real cpus use the same idea

fiery turtle
# hallow marten Also what's the microcode thing

e.g.

UACPI_OP(                                                        \
    DivideOp, 0x78,                                              \
    UACPI_OP_PROPERTY_TERM_ARG,                                  \
    {                                                            \
        UACPI_PARSE_OP_OPERAND,                                  \
        UACPI_PARSE_OP_OPERAND,                                  \
        UACPI_PARSE_OP_TARGET,                                   \
        UACPI_PARSE_OP_TARGET,                                   \
        UACPI_PARSE_OP_OBJECT_ALLOC_TYPED, UACPI_OBJECT_INTEGER, \
        UACPI_PARSE_OP_OBJECT_ALLOC_TYPED, UACPI_OBJECT_INTEGER, \
        UACPI_PARSE_OP_INVOKE_HANDLER,                           \
        UACPI_PARSE_OP_STORE_TO_TARGET, 3,                       \
        UACPI_PARSE_OP_OBJECT_COPY_TO_PREV,                      \
        UACPI_PARSE_OP_STORE_TO_TARGET_INDIRECT, 2, 4,           \
    }                                                            \
)                                                                \
kind mantle
#

It really isn't comparable to IR. Just think of it like smaller function calls you would make in a bigger function, but for instructions.

hallow marten
#

Yes I understand what it is

kind mantle
#

Using the term IR implies you're doing preprocessing on it

hallow marten
#

Not necessarily

#

But microcode is a better name

fiery turtle
#

if u have uacpi in your kernel u can make it trace every uOP being executed if u set the debug log level

#

but its very noisy

frank canopy
#

zig might actually be good for stuff like this tbh

#

because you can inline else in a switch plus inline for to remove runtime iteration and force-unroll the microcode iteration loop

fiery turtle
#

and then when I resume it, it needs 0 context since it just continues at the instruction pointer where it was suspended

kind mantle
fiery turtle
#

yeah

#

it has an array of pending ops

#

with some inline storage

fiery turtle
#

when aml interpreter in zig trl

hallow marten
#

we did talk about it

frank canopy
#

is the itch to make that got too strong

fiery turtle
#

i mean u can try to just start and see how it goes

frank canopy
#

yeah thats the plan

fiery turtle
#

run some basic Return (0) etc

#

then u can start building the test suite further

frank canopy
#

yeah

fiery turtle
#

i always tell people that they can resue the uacpi python test runner which can accept any other runner binary

frank canopy
#

there is another reason beyond curious i want to do this tho - zig has error return tracing and for uacpi i lose that when going through kernel api because it doesnt marshal through the C stuff

#

so its a pita to debug if a uacpi kernel api is returning an error code to try and find it

fiery turtle
#

yeah im sure u could do some interesting things in newer languages

hallow marten
#

I have too many side projects already but if you end up deciding to work on it for real I'd gladly help

flat badge
#

a JIT would just be slower

#

It's not that aml does a lot of compute

#

By the time the jit has compiled the aml, the interpreter is already done

fiery turtle
#

yeah true

#

it would only make sense for callbacks that are called all the time at runtime

#

like even java only jits hot paths

fiery turtle
#

Added a shit ton of tests for the new table api, it should cover everything I think

#

Hopefully 5.0 this weekend

steel inlet
#

me still on 3.2.0:

fiery turtle
#

๐Ÿ’€

pallid lava
#

hmm, qemu does not expose Device() objects for the slots in any extra added root complex

fiery turtle
#

Slots never have a device

#

Only roots

#

Or pci express root ports or hotpluggable ports

pallid lava
#

then qemu does not do that

#

it does for any other device in the primary root bridge

fiery turtle
#

Yes because its hotpouggable

#

And you cant unplug a bridge

pallid lava
#

i mean

#

say you add a root port in root bridge 1 and 2, and add devices in those root ports

#

in the main root bridge, there will be a device() for those root ports and devices

#

in the other one there is not

#

and moreover acpi hotplug and hotunplug does not work for the secondary root bridge

#

it requires handling the native pcie way

#
qemu-system-x86_64 -M q35 -m 512M -enable-kvm -device pcie-root-port,id=rp1,chassis=1,slot=1,x-do-not-expose-native-hotplug-cap=on -device nvme,serial=nvme1,id=nvme1,bus=rp1 -device pxb-pcie,bus_nr=128,id=pcie.1 -device pcie-root-port,id=rp2,chassis=2,slot=1,x-do-not-expose-native-hotplug-cap=on,bus=pcie.1 -device nvme,serial=nvme2,id=nvme2,bus=rp2 -cdrom Core-15.0.iso ```
#

if you dump the dsdt you will see that the primary root bridge and descendants will be described by Device() objects and will have _ADR objects, which is how you can link a pci device to its acpi object

#

for the other root bridge, this does not happen, and since i explicitely disable native hotunplug, you will see that if you do device_del nvme1, it will work because acpi hotunplug is supported for the primary root bridge, but because of a byproduct of acpi nodes not existing for the devices in the secondary root complex, device_del nvme2 will fail with an error message

rustic compass
frank canopy
#

zuacpi is using a few commits back on the for-5.0 branch

fiery turtle
#

thats just limitations of the qemu acpi hotplug

pallid lava
#

hm, now that i think, it kinda makes sense for devices in secondary root complexes to not support acpi style stuff

#

since all acpi interactions and memes come from the south bridge

flat badge
#

PCIe hotplug is more versatile in general

#

I think ACPI hotplug exists mostly to handle edge cases where the PCIe bus does not support native hotplug properly

#

Linux prefers native hotplug as well

rustic compass
#

@fiery turtle
do other tables beside the fadt get cleaned up or is that the only table with special handling?

fiery turtle
#

Its the only one

fiery turtle
#

great, either github ci is fucked again, or intel is blocking github actions from downloading stuff

fiery turtle
#

uACPI 5.0 branch (for-5.0) is basically done
I'd really appreciate testing

Changelog:

  • uacpi_kernel_map is now expected to return UACPI_MAP_FAILED on error, and 0x0 is treated as a valid return value to allow hosts that use a direct map
  • added UACPI_{START,END}_OF_LOG_MSG that is applied to every single uACPI log message. That means you can add a prefix, or remove a newline at the end (by default, UACPI_END_OF_LOG_MSG is set to \n)
  • Added a whole bunch of table API
    • find_by_signature_at (allows specifying the offset where to start looking)
    • find_nth_by_signature (allows specifying the Nth instance of a table to look for)
    • uacpi_table_{ref,unref}_by_index
    • uacpi_table_count
    • uacpi_table_get_by_index
    • uacpi_for_each_table & uacpi_table_info_get_by_index these are for more sophisticated use cases as they return all the internal information available about a table, including its origin, refcount, flags, etc
  • UACPI_NATIVE_MMIO, a new option that allows a kernel to define its own MMIO accessors instead of the naive uACPI volatile helpers
  • uacpi_enter_sleep_state_simple a simple shortcut helper
  • A whole bunch of other shit im too lazy to list atm
slim panther
#

W

#

i should finally write a proper uacpi crate for zinnia instead of using raw bindgen

flat badge
#

there is also uacpi-rs, right?

#

Maybe we should make a joint effort to make it usable

kind mantle
#

#1287451030241542205

#

there is

flat badge
#

yeah i'm aware, it's just not in a state that can be used in production

rustic compass
#

And barebones mode is finished minus missing tables and uacpi 5.0

#

The current head of 1.0-dev is buildable, but untested

#

I plan to finish fadt and madt today

#

Any wishes for tables?

rustic compass
fiery turtle
rustic compass
rustic compass
flat badge
#

to use it in Managarm, we'd need full AML support, not just tables though

fiery turtle
fiery turtle
flat badge
#

I wonder if we could speed it up by letting AI generate a baseline (+ human review ofc)

fiery turtle
#

Yeah that sounds doable

rustic compass
#

Me when I get replaced by AI nooo

flat badge
#

lol

#

I think this depends on how well uACPIs ownership model maps onto rust, i haven't look into this

#

if it needs a lot of design work, then AI is probably not the right tool

rustic compass
#

Its mostly pretty good but I haven't looked at other parts that much

slim panther
#

nothing against the crate, I'm sure it's good

#

but i want full control over how uacpi is built

flat badge
#

what does that buy you?

slim panther
#

i can build with different cflags for example

rustic compass
slim panther
#

i could

rustic compass
slim panther
#

W

full nimbus
#

Leaderboard maxxing

slim panther
#

i can't wait for my fred laptop

#

it arrives in the next two weeks

full nimbus
#

Insert 30 requests for you to test mine and others kernels on it

slim panther
#

i mean sure

rustic compass
full nimbus
#

Holy basssdeeeedddd

#

You can probably do it in VMs for FRED atleast

#

Since KVM and QEMU supports it if the host does

#

Also iirc @north hull was working on similar for testing things

rustic compass
full nimbus
#

Plus you can give every person like 4 cores

#

And then split the machine up etc

rustic compass
full nimbus
#

Inb4 AMD has the 7th vulnerability with microcode uploading though ๐Ÿ’€

rustic compass
full nimbus
#

Linux has to have a list of valid hashes to upload for certain amd CPUs

#

I was just so tired of looking at that BS I just skipped supporting that

#

Esp since Iโ€™m not integrating sha256 into my kernel

slim panther
north hull
#

random x86 sbc instead

#

but completely unvirtualized ๐Ÿ™‚

fiery turtle
north hull
#

I just need to get some sort of capturecard I can VNC

#

well maybe two of them, some cheap bs

#

I kinda wanna VNC both the integrated gpu and the shitty gpu I have on there

#

lol

full nimbus
#

16650 UART + VNC would be fire

north hull
#

uart is alr done

full nimbus
#

yeah but support both at the same time

north hull
#

well ofc

full nimbus
#

make tabs to switch between them

north hull
#

well I wanna do some sort of api I can integrate into CI

full nimbus
#

(also offtopic?)

north hull
#

the website will just be ontop of that for memes

#

yeah we can move this

#

lmao

fiery ice
#

@fiery turtle if i use barebones mode, how can i change this?

#

and this too

fiery turtle
#

inl()

fiery ice
#

inl?

fiery turtle
#

X86 port io

fiery ice
#

and to map it?

fiery turtle
#

Im not sure what you're asking

fiery ice
#

the uacpi_map_gas function

fiery turtle
#

Im saying you will have to read the counter yourself, you dont need to map ports

fiery ice
#

ah

fiery turtle
#

Anyway, back to 5.0, if someone could test on real hw especially with custom MMIO helpers that would be really nice

full nimbus
#

If you have a test kernel I can use and insert my MMIO helpers into I would but my kernel rewrite isnโ€™t in a proper state wahhgone

fiery turtle
#

Yeah same lol, I hope to use mine for testing uacpi releases when its more mature

full nimbus
#

I do have a fuck ton of laptops at my house to test on though

pallid lava
#

didnt uacpi os exist?

full nimbus
#

So if you got some ISOs will throw them all onto them

fiery turtle
fiery turtle
pallid lava
#

but, isn't it usable to some degree?

fiery turtle
#

Not sure

full nimbus
#

Wait actually

#

I think my old C++ kernel attempt

#

That I did with a bunch of others

#

And ended up dropping out of

#

Had uACPI working to some degree

#

Atleast getting a score displayed?

#

That should be somewhat minimal to cram some bullshit into mmLol

pallid lava
#

i would test 5.0 but im very busy rn

#

next week for sure ill test it

full nimbus
#

@lethal trench do you remember who got uACPI working at all on there?

#

When my new phone gets here and shit il make a temp fork of my kernel for this instead

#

It should have enough memory management shit to make it atleast work enough to test?

#

It just wonโ€™t be able to do threading or interrupt shit

fiery turtle
#

I guess just shutting down is a fine test

full nimbus
#

That should be doable

#

๐Ÿคž

#

As long as nothing has an EC

#

Oh that would just be power button too so should be fine

calm latch
#

I can rebase this evening trl

#

Or like not rebase, but switch to a different commit

#

Idk you get the ide

full nimbus
#

My kernels goal rn is to get to a very stable base for shit before I do more stuff. So it could be repurposed for a uACPI OS thing easily once I get to the happy base state later

#

Minimal state being able to load userspace hello world and exit etc and having very solid codebase and structure for everything

calm latch
#

My OS usually works trl

#

(keyword usually)

full nimbus
#

Real (for my old kernel atleast, my new one is much better)

calm latch
#

Do I implement it as 2 32 bit reads?

#

I think clang compiles it into that??

fiery turtle
calm latch
#

This is not UB, right?

inline uint64_t mmio_readq(uint64_t *ptr)
{
    uint32_t low, high;
    uint32_t * __attribute__((__may_alias__)) ptr32 = (uint32_t *)ptr;
    asm volatile ("movl %2, %k0 \n\t"
                  "movl %3, %k1"
                  : "=r"(low), "=r"(high)
                  : "o"(*ptr32), "o"(*(ptr32 + 1)) : "memory");
    return ((uint64_t)high << 32) | low;
}
inline void mmio_writeq(uint64_t *ptr, uint64_t data)
{
    uint32_t low = data & 0xFFFFFFFF;
    uint32_t high = data >> 32;
    uint32_t * __attribute__((__may_alias__)) ptr32 = (uint32_t *)ptr;
    asm volatile("movl %k0, %2 \n\t"
                 "movl %k1, %3"
                 :: "ri"(low), "ri"(high), "o"(*ptr32), "o"(*(ptr32 + 1)) : "memory");
}
slim panther
#

what could possibly do 64-bit mmio on a 32-bit machine?

frank canopy
#

it wouldnt make sense but why trust firmware to be normal anyway

#

better safe than not

fiery turtle
#

I mean also it might be just reading 64 bits from ram

#

But it probably wouldn't be QwordAccess

#

Usually its AnyAcc

calm latch
calm latch
#

Or 32 bit userspace with 64 bit kernel trl

#

The old version is normal, right?

calm latch
fiery turtle
fiery turtle
calm latch
#

In qemu

#

I haven't tried it on physical hardware yet

#

It seems to work on the MacBook as well

fiery turtle
#

thats great

fiery turtle
#

ACPICA has been such a shitshow, some random guy came in with AI bug reports, opened a shit ton of PRs, and the maintainer merged them with barely any review, theres no tests nor CI run required to merge a PR

#

it caused regressions all over the code base

#

the compiler is fucked, the disassmebler is fucked

#

what a joke

#

i spent maybe 3 hours total fixing shit for uacpi tests that broke due to that

fiery ice
#

bruh

fiery turtle
#

I opened a PR to fix one of the regressions a month ago

#

0 fucks given

#

the backlog of prs fixing regressions is growing but the maintainer is gone it seems

fiery ice
full nimbus
#

uACPI Linux upstream?

fiery turtle
#

i hope he didnt send that garbage to the linux upstream

#

theres a reason why they use a fork it seems

#

because intel doesnt give a shit about the quality of that project

#

thank god ubuntu 26 ships acpica thats one release behind

full nimbus
#

If ACPICA keeps getting worse

#

Will things be forced to use uACPI mmLol

fiery turtle
#

the only reason it keeps working at all is because a ton of people use it so they are just forced to work as QA

#

seriously like they didnt even bother slapping a fucking github workflow that would start tests that they have

fiery turtle
#

so it will have to use that crap

fiery ice
#

lol

full nimbus
#

Well at least for the Linux kernel to not have it regress so bad if they ever have to pull from downstream

hallow marten
fiery turtle
#

im seriously considering it

#

especially since asl syntax is really simple

#

a token is basically almost always a direct match to an opcode

hallow marten
#

I think there's stuff that's a bit tricky though no?

fiery turtle
#

ive never written a compiler so idk what would be tricky

hallow marten
#

it's not a compiler

#

barely

fiery turtle
#

yeah its more of a transpiler tbh

#

since output can be converted back to input without any loss

full nimbus
#

What would be needed for Linux upstreaming anyways?

#

I know there is some basic support for it on an out of tree repo

fiery turtle
#

compatibility API

#

basically go through acpica headers, and implement all of those functions using uacpi api

hallow marten
fiery turtle
#

yes

full nimbus
fiery ice
#

yes

fiery turtle
#

probably

hallow marten
#

ok so what is stopping us from claiming uACPI superiority

full nimbus
#

I mean it can't hurt to test it rn mmLol

fiery turtle
#

it's a shit ton of tokens

#

theres a lot of api and context

fiery ice
#

huuh

#

i have unlimited

#

if you wanna try

full nimbus
#

If infy was able to get this merged and working that would be fucking huge for both infy in life and the hobby as a whole

#

And it definitely is capable

fiery turtle
#

i agree but its going to be really tough

fiery ice
#

lemme go grab the 2 repo urls

full nimbus
#

It's worth it though imo

hallow marten
fiery ice
#

nope

hallow marten
#

what

fiery turtle
hallow marten
#

which plan is that

#

all plans have a rate limit

#

unless you pay like 39583983948$ of extra usage

fiery turtle
full nimbus
fiery ice
#

via their web ui

#

unlimited requests

hallow marten
#

bro

#

thast like the worst vibecoding

fiery ice
#

and can go and read repos

#

and it's very good at that

#

it has direct github access btw

fiery turtle
fiery ice
#

via the connector

hallow marten
#

i think if u get a 20$/month codex plan u could probably do it in a few sessions

fiery turtle
#

but you have to explain to the clanker that you want to implement compatibility api on top of uacpi so that a kernel can be built against either one with 0 code changes

fiery ice
#

ok, it printed stuff

#

@fiery turtle wanna try?

#

it's just 2 files

fiery turtle
#

wdym by 2 files?

hallow marten
#

what

fiery ice
#

1 header and 1 c file

#

for compat between acpica and uacpi

fiery turtle
#

why would there even be a header

hallow marten
#

it's already done?

fiery turtle
#

the header is already provided by acpica

fiery ice
#

this file is LONG

#

oh god

fiery turtle
#

what prompt did u even give

hallow marten
#

how is perplexity even profitable if they give out unlimited usage wtf

fiery ice
#

the literal prompt

#

the model was 5.4 thinking

fiery ice
#

it is still going BRUH

#

HOW LONG IS IT

fiery turtle
#

we should've worded the prompt better but ok

hallow marten
#

ah perplexity relies on other models

fiery ice
hallow marten
#

didnt know you could use claude and gpt

fiery ice
fiery ice
fiery turtle
#
/**
 * AcpiInitializeTables โ€” map to uacpi_setup_early_table_access().
 * InitialTableArray / InitialTableCount are ignored; uACPI manages its own
 * internal table buffer.
 */
ACPI_STATUS AcpiInitializeTables(void *InitialTableArray,
                                 UINT32 InitialTableCount,
                                 BOOLEAN AllowResize)
{
    (void)InitialTableArray;
    (void)InitialTableCount;
    (void)AllowResize;
    return AE_OK;
}
#

yeah thats...

hallow marten
#

if i were paying id rather pay for gpt plus

fiery turtle
#

like i said its going to be rough

hallow marten
#

or claude if they stop lobotomizing it

fiery ice
#

summary here

fiery ice
#

even more now with 4.8

hallow marten
#

it doesnt cost more

fiery ice
#

and it's worse than 5.5

hallow marten
#

the plan is hte same price

#

you just have less usage

#

I think chatgpt is a better deal atm tho

fiery ice
#

yes

hallow marten
#

in terms of usage

fiery ice
#

and power too

hallow marten
#

yeah 5.5 is really good

fiery ice
#

5.4 doesn't joke either

#

and 5.5 is locked in the max plan for perplexity

#

so 200 bucks a month

#

no way they offer this too ๐Ÿ’€

#

how much are they losing on this

hallow marten
#

they probably do have a limit

#

you just havent hit it yet

fiery ice
#

tho i saw that on anthropic models you do have limits

#

on openai nope

fiery turtle
# fiery ice

"only supports a single descending callback"

/**
 * Depth-first iterate the namespace starting at the first child of 'parent'.
 *
 * 'descending_callback' is invoked the first time a node is visited when
 * walking down. 'ascending_callback' is invoked the second time a node is
 * visited after we reach the leaf node without children and start walking up.
 * Either of the callbacks may be NULL, but not both at the same time.
 *
 * Only nodes matching 'type_mask' are passed to the callbacks.
 *
 * 'max_depth' is used to limit the maximum reachable depth from 'parent',
 * where 1 is only direct children of 'parent', 2 is children of first-level
 * children etc. Use UACPI_MAX_DEPTH_ANY or -1 to specify infinite depth.
 */
uacpi_status uacpi_namespace_for_each_child(
    uacpi_namespace_node *parent, uacpi_iteration_callback descending_callback,
    uacpi_iteration_callback ascending_callback,
    uacpi_object_type_bits type_mask, uacpi_u32 max_depth, void *user
);
#

this is hopeless tbh

fiery ice
#

and i spammed a ton of stufff

hallow marten
#

we need someone with more tokens to do it

#

@ korona meme

fiery ice
#

if i had computer i could really let it loose in agent mode

hallow marten
#

tf you mean if i had a computer lol

fiery ice
#

tho there i have token limits

full nimbus
hallow marten
#

i think korona has 200$ from work

fiery ice
hallow marten
#

i still have my gpt plus free trial

fiery turtle
#

its probably possible with a very detailed description and opus 4.8 highest thinking mode

#

but thats a shit ton of tokens

hallow marten
#

why very detailed description

fiery ice
#

try to gimme one, i'll re-prompt again

fiery turtle
#

to explain how it has to structure it, that it has to actually read headers, how it should test, etc etc

fiery ice
#

@fiery turtle

#

updated prompt

hallow marten
#

I doubt that is good

fiery turtle
#

we dont need any headers at all

#

the headers are already provided by acpica

hallow marten
#

yeah

fiery turtle
#

the idea is its a drop in replacement

fiery ice
#

ok updated it a sec to tell it to use acpica headers

hallow marten
#
Task: port linux to uACPI (uACPI/ directory) from ACPICA. To achieve this task, write a compatibility layer/shim on top of uACPI that implements the ACPICA interface. This means
  that we only need headers from ACPICA and nothing else. Ensure the kernel can be compiled with any implementation selected (i.e we can compile the kernel with ACPICA or uACPI).
  Ensure to test the implementation using QEMU.
#

I wrote this

#

I think this is good

fiery turtle
#

yeah that is decent

hallow marten
#

I will /goal it and watch it work for 12 hours

fiery turtle
#

do u have enough tokens for that?

hallow marten
#

/goal waits until rate limit

fiery turtle
#

ah ok

hallow marten
#

so like it'll literally wait for days until tis done

fiery turtle
#

lol

rustic compass
fiery ice
#

it will hoover up my money very fast via the api

rustic compass
#

but at least its automated chad

fiery ice
#

๐Ÿ’€

hallow marten
fiery turtle
#

no shit KEKW

fiery ice
#

it's been reading for a few minutes rn

#

lol

hallow marten
#

yeah we're cooked

fiery ice
#

well, at least it will work even if my pc is off XD

#

@hallow marten with your prompt it's already generating

fiery turtle
#

a lot of uacpi api is actually very very close to acpica so this is definitely doable, its just a lot of work

hallow marten
#

i am something of a prompt engineer

rustic compass
fiery ice
#

bruh, why did it go and check my os too ๐Ÿ’€

fiery turtle
#

yeah you're cooked tbh

hallow marten
#

bro is cooked

#

he doesnt know what torture he's about to endure

#
Task: port linux to uACPI (uACPI/ directory) from ACPICA. To achieve this task, write a compatibility layer/shim on top of uACPI that implements the ACPICA interface. This means that we only need headers from ACPICA and nothing else. Ensure the kernel can be compiled with any implementation selected (i.e we can compile the kernel with ACPICA or uACPI). Ensure to test the implementation using QEMU. You can start with a partial implementation, but ideally do NOT half-bake things, this should be production ready. Avoid adding extraneous comments and anything unnecessary, remember this is a shim, so NO new headers should be needed.
#

this is the full prompt if u wanna try it

fiery ice
#

oh wait, my prompt is starting too

#

the structure it wants

#

i'll just share the prompt once done XD

#

so you can copy the files manually

hallow marten
#

this looks stupid still

#

im just using a local linux copy i have and uacpi and getting it to write code

#

and I'll send a patch

fiery ice
fiery turtle
#

Well the internal header is fine

fiery ice
#

oh and it's making tests too

fiery turtle
#

The problematic stuff may be when it looks at random internal acpica global variables that Linux uses in some places

fiery turtle
hallow marten
#

we should get anthropic to sponsor it

#

like bun

fiery turtle
#

And the unload opcode has never seen any real use nor is it supported by acpica even

fiery turtle
#

First thing I read is already bullshit

fiery ice
#

and here the full chat for this

fiery turtle
#

Uacpi has no teardown api

hallow marten
#

simple enough

fiery turtle
fiery ice
#

so it may have hallucinated the second one

hallow marten
#

are you like

fiery ice
#

the first one should be accurate tho

hallow marten
#

stupdi??

hallow marten
#

yeah ok it seems to not be completely dumb

fiery turtle
fiery turtle
hallow marten
#

it hasnt even started and it's at like 25k tokens already ๐Ÿ’€

fiery turtle
#

Alr im gonna go to bed and see what your clanker comes up with tomorrow

hallow marten
#

i dont think we're getting this done tonight guys

fiery ice
#

did you check the files that chat generated btw

fiery turtle
#

Yeah definitely not

fiery ice
fiery turtle
hallow marten
#

it's doing kconfig

fiery turtle
fiery ice
#

if you wanna try them

#

tmr

fiery turtle
#

I mean if it can even get something that compiles

fiery ice
#

well, it's worth a try

hallow marten
#

mine is getting something to compile atm

fiery ice
#

also, that chat comes with a cmake file

fiery turtle
#

Cmake file in Linux?

#

๐Ÿ’€

hallow marten
#

i think that kinda stuff is much better to do with a cli agent tool

fiery ice
#

nah, it's just to build the tests

hallow marten
#

because it can integrate nicely

hallow marten
#

like mine has written kconfig and makefile for uacpi already

fiery turtle
#

Cool

fiery ice
#

i don't wanna pay for tokens, lol

#

it's too expensive rn

hallow marten
#

does this make sense

fiery turtle
#

Ofc

hallow marten
#

yeah ok the linux shim looks great

#

the kernel functions it implemented

fiery ice
#

let's try with yours first then

hallow marten
#

looks all good to me

fiery turtle
hallow marten
#

this is the only weird thing so far

#

but yeah its obviously the easiest thing

fiery turtle
#

Wtf is that code alignment

#

But the code itself is correct

hallow marten
#

it looks fine in a text editor

#

it actually really looks good so far

#

might actually work lol

fiery turtle
#

Great

fiery ice
hallow marten
#

what is that

fiery ice
#

well, gonna go to sleep, cya tmr

hallow marten
#

I think it's actually cooking

#

holy shit it worked

#

it linked

#

and ran

slim panther
#

wtf are yall doing

hallow marten
#

enslaving a clanker to port linux to uacpi

slim panther
#

huge

hallow marten
#

linux SUCKS

hallow marten
#

ok now it works

#

kinda

#

theres still a bunch of stubs

#

but it gets linux through boot and reboot() works

steel inlet
hallow marten
#

it still built with ACPICA or ran the ACPICA version somehow

steel inlet
#

ah

hallow marten
#

but now it does run with uACPI

steel inlet
#

how does it do in the benchmark

hallow marten
#

?

steel inlet
#

since this you said was wrong

hallow marten
#

this isnt accurate yet if I understand correctly, also this was TCG

steel inlet
#

ahhh

hallow marten
steel inlet
#

mb discord mobile moment

#

it went to the wrong message

hallow marten
#

so

steel inlet
#

ah

hallow marten
#

but I think I'll run out of usage before it can fix it

full nimbus
#

It's not that bad

hallow marten
#

this is opus 4.8

full nimbus
#

And you can let it do the final fixes

#

They give you something called

#

"big pickle"

hallow marten
#

i could give it to codex 5.5 xhigh tho

#

but id rather wait till tomorrow

full nimbus
#

True

#

This will be sick when it's working

#

If it's cleaned up upstream hopefully

hallow marten
#

well it does work

#

but its a bit hacked together

full nimbus
#

Yeah but fully working and put together a bit better etc

hallow marten
#

i did make it write a proper document outlining how to work on it tho so maybe we could polish that

#

i feel like discount monkuous

#

he would've done it by hand

#

๐Ÿ˜”

fiery turtle
#

*in a few hours

#

But no this is pretty cool honestly

full nimbus
#

Even if we don't use it outright

fiery turtle
#

Yeah

kind mantle
#

uACPI in Linux would be good but like how are you getting that merged

#

Even if you had the shim

torpid root
#

I don't doubt that infy could get it merged

full nimbus
#

there isnt any reason it shouldnt get merged

#

its am extra AML engine that can help hardware compat

#

and it is a technically supeiror one

calm latch
full nimbus
#

any ISO

calm latch
full nimbus
#

yes wahhgone

#

il test soonโ„ข

torpid root
#

it's a bit large because the sysroot is included in it

fiery turtle
#

is that on uacpi 5.0?

torpid root
#

oops

#

I thought this was just "I got shitton of hardware gimme ur isos" lol

fiery turtle
#

lol

#

nah I was asking people to test uacpi 5.0 before i merge it

full nimbus
torpid root
#

lemme see if I can quickly update

fiery turtle
#

bonus points for UACPI_NATIVE_MMIO

#

or ig we already tested it with pmos, maybe builtin mmio is better to test

calm latch
#

My AMD laptop with GPIO button also seemingly works

torpid root
fiery turtle
#

i havent bumped the integer yet yes

torpid root
calm latch
#

Also, mine is both the latest table only in kernel and in userspace coolmeme

torpid root
#

hmmm. am I missing something?

calm latch
#

Maybe my stuff is just broken again

#

_SB_.MHSP

fiery turtle
#

looks like its trying to use EC before u register it

#

u probably register it a bit too late

fiery turtle
calm latch
#

My EC driver is broken

#

I've just noticed

torpid root
#

didn't even notice until now

fiery turtle
#

ah

calm latch
calm latch
fiery turtle
#

thats just a warning but yeah

#

it has a duplicate object in there

#

u will probably see this on linux also

torpid root
#

I'm a genius

fiery ice
#

linux to uacpi finally?

flat badge
#

yeah that's needed unless you have other tricks to avoid it

calm latch
#

I mean if if only a single thread of the server is running, there are no remote shoptdowns ultrameme

torpid root
hallow marten
torpid root
#

I know

hallow marten
#

Or ideally you do them asynchronously

#

Which I described before but I forgot

fiery turtle
#

@lofty dragon FYI as u have used the for-5.0 branch before

fiery ice
#

gg

hallow marten
#

@fiery turtle i think its done

fiery ice
#

gg

hallow marten
#

can I send boot logs for you to check cuz idk if they're right

fiery turtle
#

Which part?

#

I wonder how it solved resource conversion and stuff like that

#

Like it looks vaguely correct but I don't remember qemu Linux acpi boot logs by heart

fiery turtle
#

Since u have a kconfig option u can try the acpica boot logs and compare them

hallow marten
#

right

fiery turtle
hallow marten
#

hey how cool is that

fiery turtle
#

Nice

hallow marten
fiery turtle
#

Thats the only way to do I guess

#

The other way would be a small bytecode

hallow marten
#

why is it so different

#

there's a bunch of different stuff

fiery turtle
#

Well because those resources are not part of the spec, rather its a "convenient" mapping of them from aml to C

#

And how to do them is up to the library

#

For most of them its just assigning one field to the other

#

Like its the same thing in reality

fiery turtle
hallow marten
#

in uacpi there's no "Added _OSI"

fiery turtle
#

Looks like it maybe stubbed a few things? Or didnt figure out how to use uacpi osi helpers

fiery turtle
hallow marten
#

there's no in acpica eihter

#

it fixed it

#

I think this is fine

#

I will send the patches if anyone is interested trl

fiery turtle
fiery turtle
hallow marten
#

no idea, I'm updating it to 5.0 atm

fiery turtle
hallow marten
fiery turtle
# hallow marten

Huh, thats an interesting api ig, ill grep the linux source to see if thats actually used by anything

#

Maybe worth adding

#

But it sounds a bit insane

#

Since aml paths are not standardized obviously

#

Nor are object names

hallow marten
#

it's used like 3 times

fiery turtle
#

Which files?

hallow marten
#
drivers/hwmon/asus-ec-sensors.c
947:    return ACPI_SUCCESS(acpi_acquire_mutex(data->mutex.aml,

drivers/platform/chrome/cros_ec_lpc_mec.c
43:     success = ACPI_SUCCESS(acpi_acquire_mutex(aml_mutex,

include/acpi/acpixf.h
700:                        acpi_acquire_mutex(acpi_handle handle,
fiery turtle
#

Lol I see

hallow marten
#

ok yeah now sysfs works with the new api

fiery turtle
#

Nice

hallow marten
#

very cool

fiery turtle
#

Good work

hallow marten
#

yeah i worked so hard

fiery turtle
#

Try booting it on real hw trl

fiery turtle
hallow marten
fiery turtle
#

Maybe an ISO

fiery ice
fiery turtle
#

As well

hallow marten
#

but then i have to have an initrd

#

and stuff

fiery ice
#

the one that pmOS had a problem on

fiery turtle
hallow marten
#

mhm ok

fiery turtle
#

With like busybox

hallow marten
fiery ice
#

oh

fiery turtle
#

Did it consume your entire subscription

fiery ice
#

money hoover 4.8

hallow marten
#

barely

fiery ice
#

๐Ÿ’€

fiery turtle
fiery ice
#

how much you paying?

fiery turtle
#

Interesting

hallow marten
fiery ice
#

wait what+

#

the 20 bucks a month one??

hallow marten
#

yea

fiery ice
#

HOW

#

i heard it was so bad for limits

hallow marten
#

well im not using it every day lol

#

it did use like ~50%

#

for this thing

fiery ice
#

๐Ÿ’€

hallow marten
#

if you use it everyday and vibecode a lot I can see how the limit would be low

fiery ice
hallow marten
#

im trying

fiery ice
#

k

#

booting

hallow marten
#

it's pretty cool lol

fiery ice
#

what booting opting should i use

hallow marten
#

just boot the first entry

fiery ice
#

test shell or verbose debug

#

k

#

it's stuck at loading initramfs ๐Ÿ’€

#

how much should it take

hallow marten
#

shouldnt take long

fiery turtle
fiery ice
#

it's loading for like 3 mins

hallow marten
#

ok then it may have crashed somewhere

fiery turtle
#

Maybe it died

hallow marten
#

try the debug logs thing

fiery turtle
#

Do u have earlycon enabled?

fiery ice
#

i'm gonna try loading it as ramdisk

hallow marten
#

?