#uACPI - a portable and easy-to-integrate ACPI implementation
1 messages ยท Page 68 of 1
How do I do it?
uacpi_context_set_log_level
also, you have a fast PC, you can compile it yourself 
we will see all io reads and writes
i have wsl so no
wsl is slow af
I'm also using WSL
oh ok
u probably want the trace log level
debug logs every aml op
trace just logs IO
yeah it can be called at any time at all
sure
@fiery ice btw u tested linux shutdown on it recently right
what even is zorin os
lol
it's taking so long to boot now XD
yeah because it traces every io
Does that PC have UART?
no
Idk
what happened?
pmos is as stable as obos 
yeah
Maybe it OOMed 
if only there was uacpi_status_to_string 
Where did you say I was returning internal error instead of external error?
it was from some screenshot of yours
more interesting is how tf did logs even affect that
How much ram does that PC have?
you can also try fixing the pci stuff then just retry without debug logs
Do u have Gemini or Claude?
This is also correct
Student license
try claude free
I'm not paying for AI
its free
This is fun, I cought the PS/2 bug in a VM

But I don't care about keyboard now
talk is cheap
send patches
To myself? 
or make xhci and hid drivers
yes
I've changed the timers API recently, and like I know where to look so it's not interesting to debug
I wanted to study today anyway...
Imma leave codex with it
And go do other stuff
This is with it reading from PCI instead of COM1 
Lmao
Ok, GPT 5.5 is much more reasonable
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 ice can you test this one as well pls
I'm fixing the stuff still, but that one might fix it
My PCI code is completely broken 
Lol
Also, I've checked managarm, and it configures PCI bridges??
k
give it 5 mins to boot
lol
Lol
yeah that debug log is slowing it down A LOT
Maybe should've disabled it for fix check
yeah and with the log it's still broken
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
Ask chatgpt to fix it
make no mistakes
What am I supposed to do instead of UACPI_STATUS_INTERNAL_ERROR?
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
A lot of helper functions call into aml which can return any status
So thats not really feasible for a lot of them
still, then you actually know those calls can return all these error instead of uncertainty, at least from a user side
if its not too much hassle for you
Where do you expect to see them?
Also is that something you can express in rust somehow?
i can use subenums that allow me to create a smaller scope from the uacpi_status enum and only contain the elements actually needed and can be converted back into the big enum if necessary
Is that useful?
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
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
k, lemme try
it worked!
at least for the kernel api most error values shouldnt ever be returned as they just dont make sense there
pc now shuts off
That only depends on the sanity of the implementation
There's nothing preventing that
seems like no
Lol
I mean not really, but it wasn't the best
and i was about to take inspiration from yours XD
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...
wdym reading from COM1?
0x3f8 instead of 0xcf8
๐
are you not doing pcie?
I am
then you should not need that port?
But you need AML to do it, and that need PCI
So you've got to use the 0xcf8 if you have no ECAM
i support fallback but afaik it is using only ecam
Why do u need aml for ecam
Not ecam, but some other method
Wdym
Like the very first aml PCI access you can do with ecam no?
_CBA 
Yeah but why do u need it so early
uacpi loads pci after you can already access CBA i think
Plus the spec says that calling it activates some stuff
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
Well yeah but the question is why weren't you using ecam from the start on his laptop
It has ecam right
I just didn't have it implemented, idk
๐
Ah
Worked on all my PCs without it 
oh cool
PCs dont do a lot in pts so ye
Also, look at Managarm
nah dw, i already have pci / pcie
i did not test MSI / MSI-X yet tho
The configure PCI bridges as well
but i'm implementing NVMe now
I don't use those ๐
๐
i actually already support apm setup in hyper because someone requested it lol
but obviously not the fucked up runtime stuff it needs
lmao
write ur own
im still waiting for "uSB"
100% would use
@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
A few weeks yes
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
obv this would be for backward compat, with an option like UACPI_NO_GLOBAL_STATE or smth
this would actually kinda slap for prekernel stuff - could pass the global state through to the main kernel from a prekernel thats compiled in barebones mode
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
so that i can just put it into a static on the rust side? good idea 
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
yeah idk its not super useful
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 
yeah its really not a huge thing lol
eliminating all global state for no reason makes no sense to me
also, im kinda curious, when making uacpi where did you start?
Also Rust globals aren't illegal, you just need to put them in e.g. mutexes or spinlocks
yeah the ability to migrate an externally-provided barebones state interests me a lot more than having state not be global
but isn't the barebones state also kinda trivial
Because you're just reading the tables, not doing any AML
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
Also if you did this you would also need to migrate your prekernel heap to kernel proper heap
Which seems problematic
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
sketching out the basic kernel api, then basic table parsing iirc
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
cool
the microcode thing is brilliant btw, i legit never would have thought of it but its so elegant
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
yeah
still waiting for someone with a 300x claude subscription to make a JIT 
lmao
theres another small vm in uacpi besides the aml thing btw
the resource<->aml resource converter stuff
yeah i saw that when trying to debug my resource code lol
wait does ACPI define two bytecodes? ๐
nah lol
no the resource one is just an implementation thing
it defines very complex resource structures
that are basically unusable in C unless u convert them into something proper
I'm sure there are further optimizations before making a JIT lol
Also what's the microcode thing
but then you also need to convert back for _SRS
uacpi has microcode for each aml opcode
which is then used to evaluate them
So an IR?
Microcode isn't really IR
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
Ah so it's basically a kind of IR that describes how an opcode behaves
Not really IR
DSL or something
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, \
} \
) \
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.
Yes I understand what it is
Using the term IR implies you're doing preprocessing on it
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
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
the convenient part about this is that since AML is recursive with this microcode I can just "suspend" the current OP if it requires another op before resuming
and then when I resume it, it needs 0 context since it just continues at the instruction pointer where it was suspended
presumably some kind of soft stack?
yeah probably
when aml interpreter in zig 
we did talk about it
this is litearlly why i got curious about how you got started
is the itch to make that got too strong
i mean u can try to just start and see how it goes
yeah thats the plan
yeah
i always tell people that they can resue the uacpi python test runner which can accept any other runner binary
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
yeah im sure u could do some interesting things in newer languages
I have too many side projects already but if you end up deciding to work on it for real I'd gladly help
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
yeah true
it would only make sense for callbacks that are called all the time at runtime
like even java only jits hot paths
Added a shit ton of tests for the new table api, it should cover everything I think
Hopefully 5.0 this weekend
me still on 3.2.0:
๐
hmm, qemu does not expose Device() objects for the slots in any extra added root complex
Slots never have a device
Only roots
Or pci express root ports or hotpluggable ports
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
Same version as uacpi-rs
zuacpi is using a few commits back on the for-5.0 branch
yeah
thats just limitations of the qemu acpi hotplug
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
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
@fiery turtle
do other tables beside the fadt get cleaned up or is that the only table with special handling?
Its the only one
great, either github ci is fucked again, or intel is blocking github actions from downloading stuff
uACPI 5.0 branch (for-5.0) is basically done
I'd really appreciate testing
Changelog:
uacpi_kernel_mapis now expected to returnUACPI_MAP_FAILEDon error, and 0x0 is treated as a valid return value to allow hosts that use a direct map- added
UACPI_{START,END}_OF_LOG_MSGthat 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_MSGis 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_indexuacpi_table_countuacpi_table_get_by_indexuacpi_for_each_table&uacpi_table_info_get_by_indexthese 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 helpersuacpi_enter_sleep_state_simplea simple shortcut helper- A whole bunch of other shit im too lazy to list atm
W
i should finally write a proper uacpi crate for zinnia instead of using raw bindgen
yeah i'm aware, it's just not in a state that can be used in production
I'm slowly picking up speed with writing it
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?
This greatly simplifies my table api
The debug output tables are useful
are they a thing on x86 hardware or only on arm and co?
DBGP and DBPG2?
to use it in Managarm, we'd need full AML support, not just tables though
On all arches
Yeah
I wonder if we could speed it up by letting AI generate a baseline (+ human review ofc)
Yeah that sounds doable
Me when I get replaced by AI 
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
Its mostly pretty good but I haven't looked at other parts that much
I don't want to use it
nothing against the crate, I'm sure it's good
but i want full control over how uacpi is built
what does that buy you?
i can build with different cflags for example
You can fork the repo, that's what I will do to when I run the interpreter in userspace
i could
Userspace ACPI based
Avx10 + apx go brrr
W
Leaderboard maxxing
Insert 30 requests for you to test mine and others kernels on it
i mean sure
I plan to buy a cheap zen6 cpu + itx server board for automated testing of my kernels and anyone who asks but that's at least half a year in the future
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
But but the poor ipmi interface ๐ฅบ
Itโs probably easier to manage and more secure if you open it up more than wux did
Plus you can give every person like 4 cores
And then split the machine up etc
I think the server board has a socketed bios flash
Inb4 AMD has the 7th vulnerability with microcode uploading though ๐
Bold of you to assume it gets that many cores to beginn with with those ram prices ๐ญ
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
ipmi my beloved
well yes but not zen6 lol
random x86 sbc instead
but completely unvirtualized ๐
Holy
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
16650 UART + VNC would be fire
uart is alr done
yeah but support both at the same time
well ofc
make tabs to switch between them
well I wanna do some sort of api I can integrate into CI
(also offtopic?)
inl()
inl?
X86 port io
and to map it?
Im not sure what you're asking
the uacpi_map_gas function
Im saying you will have to read the counter yourself, you dont need to map ports
ah
Anyway, back to 5.0, if someone could test on real hw especially with custom MMIO helpers that would be really nice
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 
Yeah same lol, I hope to use mine for testing uacpi releases when its more mature
I do have a fuck ton of laptops at my house to test on though
didnt uacpi os exist?
So if you got some ISOs will throw them all onto them
Tomato started it but it was never finished
Lol nice
but, isn't it usable to some degree?
Not sure
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 

fuck
@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
I guess just shutting down is a fine test
That should be doable
๐ค
As long as nothing has an EC
Oh that would just be power button too so should be fine
I can rebase this evening 
Or like not rebase, but switch to a different commit
Idk you get the ide
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
What about uacpi_kernel_mmio_read64/write64 on 32 bit platforms?
Do I implement it as 2 32 bit reads?
I think clang compiles it into that??
Yeah
What????
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");
}
what could possibly do 64-bit mmio on a 32-bit machine?
it wouldnt make sense but why trust firmware to be normal anyway
better safe than not
I mean also it might be just reading 64 bits from ram
But it probably wouldn't be QwordAccess
Usually its AnyAcc
i686 build on 64 bit hardware?
Or 32 bit userspace with 64 bit kernel 
Anyway, if someone wants to try it
The old version is normal, right?
cc (and also @fiery turtle)
yeah i havent bumped the actual integer yet
does it shut down on power button press?
In qemu
I haven't tried it on physical hardware yet
It seems to work on the MacBook as well
thats great
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
bruh
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
let's hope this forces linux and other kernels away from it
uACPI Linux upstream?
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
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
well no because uacpi doesnt have a compiler/disassembler
so it will have to use that crap
well, we now have a new feature for 6.0
lol
Well at least for the Linux kernel to not have it regress so bad if they ever have to pull from downstream
one day i will vibecode one trust
im seriously considering it
especially since asl syntax is really simple
a token is basically almost always a direct match to an opcode
I think there's stuff that's a bit tricky though no?
ive never written a compiler so idk what would be tricky
yeah its more of a transpiler tbh
since output can be converted back to input without any loss
What would be needed for Linux upstreaming anyways?
I know there is some basic support for it on an out of tree repo
compatibility API
basically go through acpica headers, and implement all of those functions using uacpi api
should i make one in rust
yes
Couldn't a clanker do that with relative ease?
yes
probably
ok so what is stopping us from claiming uACPI superiority
I mean it can't hurt to test it rn 
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
i agree but its going to be really tough
lemme go grab the 2 repo urls
It's worth it though imo
no rate limit?
nope
what
the only possibility is to merge it as an opt-in config, then wait as it gains more trust overtime from cutting edge repos
which plan is that
all plans have a rate limit
unless you pay like 39583983948$ of extra usage
infinite bank account
CachyOS would probably be open to enabling it
and can go and read repos
and it's very good at that
it has direct github access btw
perhaps
via the connector
i think if u get a 20$/month codex plan u could probably do it in a few sessions
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
wdym by 2 files?
what
why would there even be a header
it's already done?
the header is already provided by acpica
what prompt did u even give
how is perplexity even profitable if they give out unlimited usage wtf
https://github.com/acpica/acpica
https://github.com/uACPI/uACPI
Can you give me the implementation of a compat layer for the Acpica API for uacpi?
the literal prompt
the model was 5.4 thinking
they make money from Computer and enterprise plans
it is still going BRUH
HOW LONG IS IT
we should've worded the prompt better but ok
ah perplexity relies on other models
the header
didnt know you could use claude and gpt
the c file
with the 20 bucks a month plan (9 as a student) you get 5.4 and sonnet 4.6
/**
* 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...
if i were paying id rather pay for gpt plus
like i said its going to be rough
or claude if they stop lobotomizing it
claude is expensive AF
even more now with 4.8
it doesnt cost more
and it's worse than 5.5
the plan is hte same price
you just have less usage
I think chatgpt is a better deal atm tho
yes
in terms of usage
and power too
yeah 5.5 is really good
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
"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
and i spammed a ton of stufff
if i had computer i could really let it loose in agent mode
tf you mean if i had a computer lol
tho there i have token limits
Doesn't mint have that 100 dollar Claude subscription

i think korona has 200$ from work
no, i mean computer credits for perplexity
is it that hopeless you think or not
i still have my gpt plus free trial
its probably possible with a very detailed description and opus 4.8 highest thinking mode
but thats a shit ton of tokens
why very detailed description
try to gimme one, i'll re-prompt again
to explain how it has to structure it, that it has to actually read headers, how it should test, etc etc
I doubt that is good
yeah
the idea is its a drop in replacement
ok updated it a sec to tell it to use acpica headers
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
yeah that is decent
i'll run it in parallel and see
do u have enough tokens for that?
/goal waits until rate limit
ah ok
so like it'll literally wait for days until tis done
lol
ok, let it loose on this one too
build a workflow in n8n that creates the code and tests it and feed it back into the model and then put the api key in the model
heck no XD
it will hoover up my money very fast via the api
but at least its automated 
๐
no shit 
well, at least it will work even if my pc is off XD
@hallow marten with your prompt it's already generating
a lot of uacpi api is actually very very close to acpica so this is definitely doable, its just a lot of work
i am something of a prompt engineer
tbh maybe someone with a sufficiently large gpu or one of those amd ai max boards could host a good open source model and use n8n to let the model figure out and test the bindgen in the background
bruh, why did it go and check my os too ๐
yeah you're cooked tbh
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
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
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
i'm still not seeing any stub, so it is good for now i think
Well the internal header is fine
The problematic stuff may be when it looks at random internal acpica global variables that Linux uses in some places
Thats not a problem, unload is not used I dont think
And the unload opcode has never seen any real use nor is it supported by acpica even
First thing I read is already bullshit
and here the full chat for this
Uacpi has no teardown api
Did bro read the headers?
yeah the .md was a second prompt
so it may have hallucinated the second one
the first one should be accurate tho
stupdi??
yeah ok it seems to not be completely dumb
Yes
Yeah that's good
it hasnt even started and it's at like 25k tokens already ๐
Alr im gonna go to bed and see what your clanker comes up with tomorrow
i dont think we're getting this done tonight guys
did you check the files that chat generated btw
Yeah definitely not
gonna leave perplexity running overnight too
Where?
these
it's doing kconfig
Yeah looks somewhat ok
I mean if it can even get something that compiles
well, it's worth a try
mine is getting something to compile atm
also, that chat comes with a cmake file
i think that kinda stuff is much better to do with a cli agent tool
nah, it's just to build the tests
because it can integrate nicely
like mine has written kconfig and makefile for uacpi already
Cool
Ofc
let's try with yours first then
looks all good to me
The shim is the first tiny step
this is not in the text editor
it looks fine in a text editor
it actually really looks good so far
might actually work lol
Great
well, gonna go to sleep, cya tmr
wtf are yall doing
enslaving a clanker to port linux to uacpi
huge
linux SUCKS
this was fake
ok now it works
kinda
theres still a bunch of stubs
but it gets linux through boot and reboot() works
wdym
it still built with ACPICA or ran the ACPICA version somehow
ah
but now it does run with uACPI
how does it do in the benchmark
?
this isnt accurate yet if I understand correctly, also this was TCG
ahhh
this was right
it stubbed the resource api
so
ah
but I think I'll run out of usage before it can fix it
Opencode lets you have a free local agent
It's not that bad
this is the kinda stuff that needs thinking
i could give it to codex 5.5 xhigh tho
but id rather wait till tomorrow
Yeah but fully working and put together a bit better etc
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
๐
Lmfao
*in a few hours

But no this is pretty cool honestly
And it gives a good base regardless for us to know what to do or whatever else
Even if we don't use it outright
Yeah
uACPI in Linux would be good but like how are you getting that merged
Even if you had the shim
I don't doubt that infy could get it merged
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
Did you only refer to Ultra kernel or any iso?
any ISO
Did you miss this? 
<old link>

it's a bit large because the sysroot is included in it
is that on uacpi 5.0?
it still is but it has to be uACPI 5.0

lemme see if I can quickly update
bonus points for UACPI_NATIVE_MMIO
or ig we already tested it with pmos, maybe builtin mmio is better to test
My AMD laptop with GPIO button also seemingly works
is this not updated yet or did I compile the wrong source
i havent bumped the integer yet yes
nice
@full nimbus https://safe.ilobilo.com.ge/image-qyRQxA6X.iso
Also, mine is both the latest table only in kernel and in userspace 
hmmm. am I missing something?
Though I've noticed there are some errors?
Maybe my stuff is just broken again
_SB_.MHSP
looks like its trying to use EC before u register it
u probably register it a bit too late
wdym?
nothing, I think I just somehow regressed my uacpi score
didn't even notice until now
ah
You said that was fine, but there's an error right after it prints the tables
thats just a warning but yeah
it has a duplicate object in there
u will probably see this on linux also
I kinda do that as well?
yeah that's needed unless you have other tricks to avoid it
I mean if if only a single thread of the server is running, there are no remote shoptdowns 
sure but no other core accesses uacpi during init
Ideally you batch them
I know
Alright release 5.0 is officially live https://github.com/uACPI/uACPI/releases/tag/5.0.0
Changes since 4.0.0
Non-backwards-compatible changes
For uacpi_kernel_map, NULL is now considered a valid return value to allow hosts that identity map all physical memory. Failure is now indicate...
@lofty dragon FYI as u have used the for-5.0 branch before
gg
@fiery turtle i think its done
gg
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
Since u have a kconfig option u can try the acpica boot logs and compare them
right
Holy
hey how cool is that
Nice
is that good
why is it so different
mhm this is with ACPICA
there's a bunch of different stuff
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
Yep
in uacpi there's no "Added _OSI"
Looks like it maybe stubbed a few things? Or didnt figure out how to use uacpi osi helpers
There's also nothing about _OSC
there's no in acpica eihter
it fixed it
I think this is fine
I will send the patches if anyone is interested 
You should rebase to 5.0, there's now by index api and a few other things
What does it mean by acquire by path
no idea, I'm updating it to 5.0 atm
Can you ask it
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
it's used like 3 times
Which files?
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,
Lol I see
ok yeah now sysfs works with the new api
Nice
very cool
Good work
yeah i worked so hard
Try booting it on real hw 
Lol
i will send a humonguous patch if anyone wants to do so
Maybe an ISO
what agent you using btw
As well
i can boot an iso rn on my resurrected laptop
the one that pmOS had a problem on
Clanker can make a bootable ISO almost instantly
mhm ok
With like busybox
opus 4.8
oh
Did it consume your entire subscription
money hoover 4.8
๐
Huh
how much you paying?
Interesting
im not but this is the cheapest plan
yea
๐
if you use it everyday and vibecode a lot I can see how the limit would be low
well, give us an iso to test on real hw
it's pretty cool lol
what booting opting should i use
just boot the first entry
test shell or verbose debug
k
it's stuck at loading initramfs ๐
how much should it take
shouldnt take long
Nice
it's loading for like 3 mins
ok then it may have crashed somewhere
Maybe it died
try the debug logs thing
Do u have earlycon enabled?
?


