#uACPI - a portable and easy-to-integrate ACPI implementation
1 messages · Page 59 of 1
EAGAIN means that a (usually non-blocking) operation failed to make progress
I think it was pretty tricky in managarm to do it right?
wdym?
isnt that what iretq said
this is not upstream yet in Managarm
and u said
yeah
^
u need syscall cancellation so u can canel e.g. huge writes
but its optional
u dont have to implement that
or if u have a blocking read that hangs
makes things SLIGHTLY easier ™️
It's not really optional
for a production os
im guessing for perfomance reasons?
no
oh
you can get pretty far w/o EINTR support as Managarm demonstrates but it's pretty much needed for process management to work properly
like u cant cancel blocking reads otherwise for example
wait managarm doesnt have EINTR?
wym so?
okay and is that rlly that BAD?
i mean what do u do if bash is doing a poll syscall
without user input
and u want to kill it
u cant because its in a syscall
nah id rather get it working now first
well if u dont have signals wtf are u going to use to interrupt them
idk timer interrupt?
output is sent to serial on this image, kernel is x86_64 defconfig 2c4a1f3fe03edab80db66688360685031802160a
wait why do u need this lol
they asked for it idk
you're gonna make a jit for uacpi-linux?
also note that uacpi-linux doesn't work on efi systems because it finds rsdp by searching low memory
maybe eventually I'll try jitting it just to optimize the qemu stuff but now I'm just going to try mimalloc
ah
There's a PR for it but it needs to be cleaned up
idea: AOT compile the qemu blob
to see pure perf gain u could AOT the simple math test i have
that would give u the perfect world speed up
where it doesnt do hw io
JITing AML sounds pretty stupid tbh
bragging rights
i doubt that you'll get a huge speedup
very important imo
i just make it so sched_perform_wait returns EINTR when the wait is interrupted (unless it's a non-interruptible wait ofc) and that error is propagated to the syscall boundary
true
which sounds like cheating
well there are methods u call all the time at runtime
e.g. battery stats
if u aot those u save tons of cycles in the long run
why not
that's true
because the compilation is not for free and 95% of the AML only runs once
for a produciton env i'd probably have a uacpi_eval_compile or something
thats used for methods called frequently
and it would recursively compile everything called by the method
including EC queries etc
like for example for monkuous' old laptop that does calls to a GPE AML handler with an absolutely gigantic while loop it could save tons of cycles and power
aml firmware devs after writing the most shit aml known to man
It wasn't very difficult with my kernel
yeah thats fair
@gentle peak did u get ACPICA working?
i just did like 30s ago yeah
ah
where do i add the timing stuff?
what was the issue?
the acpica docs omit several calls from the init sequence in some places
i was unfortunately looking at those places
okay now to be fair the fucking pointer shit u did to get ACPICA working was big brain
to get sized frees
specifically i was missing AcpiInitializeTables
ah
just to confirm this is the right init sequence right ```c
ACPI_STATUS status = AcpiInitializeSubsystem();
if (ACPI_FAILURE(status)) {
fprintf(stderr, "devicesd: failed to initialize subsystem: %s\n", AcpiFormatException(status));
exit(EXIT_FAILURE);
}
status = AcpiInitializeTables(NULL, 16, FALSE);
if (ACPI_FAILURE(status)) {
fprintf(stderr, "devicesd: failed to initialize tables: %s\n", AcpiFormatException(status));
exit(EXIT_FAILURE);
}
status = AcpiLoadTables();
if (ACPI_FAILURE(status)) {
fprintf(stderr, "devicesd: failed to load tables: %s\n", AcpiFormatException(status));
exit(EXIT_FAILURE);
}
pci_init_acpi_tables();
status = AcpiEnableSubsystem(ACPI_FULL_INITIALIZATION);
if (ACPI_FAILURE(status)) {
fprintf(stderr, "devicesd: failed to enable subsystem: %s\n", AcpiFormatException(status));
exit(EXIT_FAILURE);
}
status = AcpiInitializeObjects(ACPI_FULL_INITIALIZATION);
if (ACPI_FAILURE(status)) {
fprintf(stderr, "devicesd: failed to initialize objects: %s\n", AcpiFormatException(status));
exit(EXIT_FAILURE);
}```
i think so?
so basically
I think AcpiLoadTables is the uacpi benchmark
yeah
slap a timer around the call to that
right so i should probably move pci_init_acpi_tables() to above that lol
AcpiLoadTables took 0.000832993 seconds
now i have to modify uacpi to output with that much precision ig
can u just output nanosconds?
if you mentally block the decimal point that is nanoseconds
btw
technically this is not entirely fair
u want to put the start here
what the
and the end at the very bottom of the function
ah ok
lets give acpica a completely fair treatment 
alright with that it seems to be 683,482 nanoseconds
in uacpi i did this previously uacpi_info("elapsed nanoseconds %" UACPI_PRIu64 " (%"UACPI_PRIu64" ms)\n", UACPI_FMT64(end_ts - begin_ts), UACPI_FMT64(elapsed_ms(begin_ts, end_ts)));
uacpi is consistently around 217,999 nanoseconds
yeah nvm my experiments its too annoying to setup for now
damn so 3x holds up even in qemu
I was just gonna try it if it wouldnt take a while
yeah, now i wanna test real hw :)
ah yeah
luckily unless some catastrophic bug has been introduced in the past week or so this image should already be real hw capable
how do u print uacpi's score btw?
diff --git a/source/uacpi.c b/source/uacpi.c
index c6c569f..db05e4f 100644
--- a/source/uacpi.c
+++ b/source/uacpi.c
@@ -492,10 +492,10 @@ uacpi_status uacpi_namespace_load(void)
uacpi_info(
"successfully loaded %u AML blob%s, %"UACPI_PRIu64" ops in "
- "%"UACPI_PRIu64"ms (avg %"UACPI_PRIu64"/s)\n",
+ "%"UACPI_PRIu64"ms (avg %"UACPI_PRIu64"/s) %lu nanoseconds\n",
st.load_counter, st.load_counter > 1 ? "s" : "",
UACPI_FMT64(ops), UACPI_FMT64(elapsed_ms(begin_ts, end_ts)),
- UACPI_FMT64(ops_per_sec)
+ UACPI_FMT64(ops_per_sec), end_ts - begin_ts
);
}
it has some insane handcrafted aml so should be a good test
i wonder if its gonna be an even bigger difference because acpica has to do a two pass thing
and real hw has more things to two pass over
i should really look into setting up pxe this is painful
btw make sure u have slack mode enabled in acpica
or real hw might not work
and this is -O3 -flto right?
yeah
ok nice
would it fail quietly or can i try it without
it would fail loudly dw
if slack mode is off it acts more like spec and less like nt
alr just checking, never know with acpica
linux has slack mode on by default i think
with acpica i do get ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - \_SB_.PCI0.EHC1.HUB0.RMH0.PRT6 (20250404/dspkginit-497)
this is expected, i also get it in linux
however it does make the benchmark unfair because it now includes printing to fb
if lvl == err: return?
what
ah fuck
strcmp time
this error is because it resolves packages that have no reason to be resolved
because of its two pass thing
well it politely printed the location of the message for me so here we go again
lol
acpica: ```
10,902,209 nanoseconds
10,899,233 nanoseconds
10,910,798 nanoseconds
uacpi: ```
6,227,036 nanoseconds
6,240,330 nanoseconds
6,239,922 nanoseconds
yeah
i'm also curious how the performance differs outside init when everything is already mapped and caches are hot and such but i feel like that's much harder to benchmark
yeah
even though it's what matters more
i'll check in a few, doing main pc acpica tests first (since the image on the usb rn is the acpica one)
nice
main pc (Gigabyte B550M S2H, Ryzen 5800X, 64G RAM, 10097 ops)
acpica: ```
3,936,953 nanoseconds
3,951,551 nanoseconds
3,950,898 nanoseconds
uacpi: ```
1,903,459 nanoseconds
1,906,726 nanoseconds
1,902,077 nanoseconds
Toshiba was 4962 ops
pretty smol
During init at least yeah
What matters is the runtime performance but that's harder to test
yeah its kinda hard to test that
so Im adding it to the readme
@gentle peak can u give the actual model for this toshiba laptop?
Toshiba Portege R30-A, Intel Core i5-4200M, 4GB RAM
oh and uhh firmware versions
toshiba is 4.40
main pc is F19d
nice
also unrelated but recursive paging has a surprisingly significant positive impact on uacpi score
went from 7.5-8.0M to 8.0-8.5M
all i did was replace the manual page table walking in the page fault handler with recursive paging
lgtm apart from this leftover text
yeah fixing this atm
also when you update os scores the description for proxima should probably be changed to mention it runs uacpi in userspace now
yup will do
idk what term to use since it's not truly monolithic (drivers in userspace), not truly a microkernel (vfs and such in kernel), and hybrid means nothing
lol true
doesnt matter that much
you should probably come up with a new description tho
Updated
minikernel
:^)
millikernel?
i feel like making up my own new terminology is kinda counterproductive
if anything i'd call it a hybrid kernel but that term already exists and it's mostly marketing
Tbh I would still call it microkernel probably
@vast kestrel thoughts on the perf comparison docs?
Will look at it once I get off the train
nice
@gentle peak btw are you going to upstream ACPICA support as well?
could be nice to keep for the future
nah i already wiped it from my local tree
damn lmfao
i don't think i'm gonna bother supporting multiple acpi implementations in the same source tree
abstracting it might be a bit annoying
acpi is already gonna have to be abstracted because devicesd is a separate process from actual drivers but yeah adding another abstraction layer within devicesd itself is a bit excessive imo
ah
at most i might make an acpica-based protocol-compatible devicesd reimplementation but even that's probably not gonna happen (simply not worth the effort)
whats the annoying part btw
well ideally it would link with libc and stuff
and I didnt want to bother setting this all up for something I'll need in like a month or two
just link with -static and without -nostdlib
yea I guess
ok sec
imma try again
also mounting is annoying but that I can work with
couldnt u just do the shared drive thing
which cpu?
5 5600x
yeah that has so few aml ops its basically a measurement error
how 💀
monkuous gets like 5x that with the same image
ah yeah
the image i sent used CMAKE_BUILD_TYPE=Release CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
btw what is this
lto-wrapper: warning: using serial compilation of 3 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
lto-wrapper: warning: using serial compilation of 11 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
how do i shut it up
wait
can I mount images
then write to them
and without unmounting them
I can run qemu
i don't think that's safe
cuz idk if what I'm doing is actually working
but you can always use vvfat
ah good I get 4958701/s now
i have never seen this
i just added -flto directly to make and cmake
wait
apparently there's -flto=auto
what did u change
the release build
uhhh
Unix-like microkernel-based operating system with uACPI running in userspace
ig
with the intention of (Unix-like microkernel)-based operating system not (Unix-like) (microkernel-based) operating system
this one is the clean #1217009725711847465 message
yep
10.4M damn
if anyone else has images to update the score send them here
im going to update the leaderboard today
and thats gonna be it for a while
i also have imaginarum scores and ilobilix
but nothing else
also nyaux i think
I thought u couldnt link glibc statically?
interesting
huh mimalloc isnt that fast apparently
or rather
it doesnt matter much for uacpi
what score did u get?
around 5mil
well uacpi kinda is very much malloc bound so idk
maybe monkuous malloc is also fast
maybe mimalloc would be better in a multithreaded context
yep
and JIT would probably slow it down like korona said
I believe the malloc used in uacpi-linux is a variant of the proxima allocator, which is very fast for small objects but not super scalable and speed drops off quite a bit for every power of two you pass until you reach the page size
mimalloc seems to have a slight perf improvement but not that much
mimalloc should be quite good as a general purpose allocator but it's of course not fine tuned to this workload
yeah
iirc it's size classes are not only powers of two, so it will consume less memory than just using powers of 2
idk what else I could really experiment with without adding a JIT and rewriting most of the uacpi interpreter 
btw @mortal yoke give this a try in qacpi
or if u give me the binary i could try myself
(or instructions on how to get one)
depends on the workload
just for the benchmark
compiling the DSDT would probably be slower than just running it directly lol
for uacpi-linux I could cheat and just compile it once
because its so small
yeah
but that's cheating
like it would be interesting to see just the raw speedup as if compilation was free
because technically it would only be used for methods that u run a lot
true
but orders of magintude gains are only possible if u jit unfortunately
like if u optimize uacpi's interpreter for like a year u could maybe squeeze out like a 1.2-1.5 gain
but much higher than that i kinda doubt
aml evaluation perf is not that important anyway
only during interrupt storms 
catering to shit hardware is definitely a good idea 
of the utmost improtance
imagine optimizing any part of the os besides aml eval speed
yes
uACPI doesn't create .pc files, right?
I'll prob just add that to the meson.build so managarm can stop symlinking stuff into subprojects
one alternative might be to write an "ACPICA compatibility layer" AKA what you would need anyways for Linux people to be happy. then you get this basically for free.
oh, I should've read further down before I wrote that.
but yeah...
Yeah I figure out a way to make a fair test, I forgot aml had a way to get ticks
I think for a long time in acpica timer returned an incrementing number (and not ticks)
Or well, at least Linux did it, idk if acpica did
Lol
Why
on linux at least it just uses gettimeofday https://github.com/acpica/acpica/blob/038cfc8f6208d6ff989d8ce103f5fbe9ceb0d5ad/source/os_specific/service_layers/osunixxf.c#L1297
well in userspace
btw @fiery turtle, does uacpi_initialize do anything other than tables?
yes
i mean just open it
they finally attached a dump
fair lol
also continuing to be sad about the for_each methods just because that pattern doesnt mesh well with language interop so i still effectively need to use the ones that allocate an array for resources
wdym?
zig's got a couple of language features that are straight up not compatible with c calling conventions (most notable error returns, which involve two-register returns and an extra ghost parameter)
so if i need to pass a callback im locked out of error returns, and error return tracing
I mean cant u just iterate the array manually?
yeah no it works
just means cant benefit from any possible memory savings from using for_each methods
if there are any
for_each_resource is the main one that actually matters here, and idk how memory compares either way
That one is just a simple wrapper, it still allocates internally, so no memory losses there
And for each just iterates an existing array so it doesn't really need to allocate
One previously acquired from get current resources etc
👍
Btw couldn't u propagate the error via a struct pointed to by the user pointer?
yes but you still lose the error return trace
i looked into it before
the advent of the function to get the next device rendered the callbacks entirely unneeded
just saw the comment added here about using for_each_device_resource and thought id ask if there were actual memory savings or if its just a convenience thing
yeah no just convenience
the repo has your test runner py that should build the runner (though the default timeout of 2s is not sufficient for this)
ill build it myself, ill also tune for my cpu
for the timeout you can add ctx.loop_timeout_seconds = 20; to here https://github.com/Qwinci/qacpi/blob/main/tests/runner/test_runner.cpp#L213
aml debug: 10,000,000 additions took 6486 ms
slightly behind uacpi
i get 4.7
acpcia gets 16.7
nice
Yeah well done
no aml syntax highlighting... discord L
JavaScript syntax highlighter with language auto-detection and zero dependencies. - highlightjs/highlight.js
then you just have to wait 10 eons for 1) a new release of hljs 2) discord to update to it
nice
I think this test case is just a happy path in my parser. I store locals in a preallocated array so the tight loop doesn't trigger much memory allocation.
Nice
Would you use after free if someone returns a reference to a local?
Also is it public?
There are several annoying situations where I need to "promote" values from locals onto the heap. That would be one of them, though I'm not sure if I actually handle it or not. May just error out. I'll test it sometime 🙂
ah ok
i can test on my cpu if u want, should be faster
how do u process aml in general?
and how complete is it
the current imaginarium score is bigger than that, do u want me to update to this?
i've updated the leaderboard pls take a look
going to merge very very soon
ilobilix is now top 2 lol
i pronounce uacpi as wack pee

but its not wack pee at all i consider it more along the lines of cool shit
well thanks
oof I should've updated
alright
well u can sumbit an update for the next batch
1000 commits passed
also made an issue for submissions now https://github.com/uACPI/uACPI/issues/135
at least try to look professional as second place
\
why the hell is this only under ifdef x86_32
like is this not an issue on 64 bit somehow
Ub jumpscare
so the thing is that Linux uses a lot of inline asm which works in some context and doesn't in others (e.g. movw %%ax, %0 : '=r'(foo)` when foo is a uint8_t). and the reason this works is that the faulty inline asm statements are optimized away because the compiler sees that they are unreachable (with -O0 it doesn't).
Why does it have unreachable asm in the first place?
switch(sizeof foo) {
case 1: asm("movb ...");
case 2: asm("movw ...");
case 4: asm("movl ...");
case 8: asm("movq ...");
};
Hm
Because Linux.
Yeah there's even more shit not asm related
not me not realizing this is bad because in zig the switch would happen at compile time and it'd work out fine
that's crazy
can't you just put the switch in a constexpr function?
idk, do you think a currently accurate score is more or less important than having a bigger score? entirely possible it's an optimization level difference though
then you can't goto a label in the calling function which is not constexpr
see this shit is why i like zig comptime lol
or any decent language for that matter
Let's just assume you will catch up before the next update its fine lol
lol
i also just realised that ive not been using ReleaseFast optimization for the number getting
so ill blame that and not actually check it so i can keep using ReleaseSafe for debugging
Ye
ReleaseSafe is not actually that much slower
but the few extra debug checks probably still make a tiny difference
yeah thats why im not actually checking the speed differene here and just blaming it without evidence 😉
also why i use releasesafe and not debug because dear lord debug is so slow
The fuck
Even though the kernel never
generates memory accesses in that region, since the page tables mark
them incorrectly as being WB, our (AMD) processor ends up causing a MCE
while doing some memory bookkeeping/optimizations around that area.
huh?
how do u even pinpoint it to that if you just get a random MCE
test with WB page tables: generates MCE
test without them: doesn't generate MCE
yeah but how like i wonder how they arrived at that initially
It came to them in a dream
I have successfully fixed at least two bugs with this debugging method.
same
Ah yes
As you're falling asleep you're like hey maybe I should look into direct map generation
mice?
like the animal
@fiery turtle can you test this?
qemu-system-x86_64 \
-M q35 \
-cpu host \
-display none \
-debugcon stdio \
-bios OVMF_x86_64.fd \
-enable-kvm \
-cdrom chronos-x86_64.iso
-smp 4 -m 2G | grep 'avg'
I wanna see how it does on your cpu
Why uploading ovmf? Think it would make it faster? It's the same 💩
he might not have the ovmf
duh
its faster
without the ovmf its slower
😁 I mean, these fw files come with the qemu distribution on the testing machine. Which, given, it's completed several such tests, does have it. You don't need to upload your copy. On arm eg they managed to make 64MB. only if you want to distribute a vm with your OS "installed" and if your installation involves storing fw variables (BootX), then you should provide your fw. For the purpose of this testing, it doesn't seem necessary.
6.2M
wtf
thanks
@trim frost are you still using talc?
yes, haven't touched pretty much anything for like a month
ah
did you switch?
i'm using my own freelist impl now
how fast is it
so just a bit slower
i wanna write my own allocator but im too lazy
qemu-system-x86_64 -serial stdio -m 2G -drive if=pflash,unit=0,format=raw,file=ovmf-code-x86_64.fd,readonly=on -cpu host -accel kvm -machine q35 -cdrom menix.iso | grep 'avg'
@fiery turtle
This is just C not being powerful enough
In C++ you could do it properly™️
5.4
neat
you can do that with templates te s
cpu?
AMD Ryzen 5 2600
im so confused
how does this make sure the range of pages all belong to the same bottom most table
it just does ptep++ unconditionally and it somehow works??
* Context: The caller holds the page table lock. The pages all belong
* to the same folio. The PTEs are all in the same PMD.
comment above says ```
- Context: The caller holds the page table lock. The pages all belong
- to the same folio. The PTEs are all in the same PMD.
PMD is the next level table
yeah
it holds 512 pte_t tables
and the PTEs are contiguous within the PMD
ah, Linux terminology being weird
either the comment meant in the same PTE
yeah
yeah
so my guess is that by "in the same PMD" they mean "in the same PMD entry"
actually isn't ptep the pointer to an array of ptes you want to write?
probably because multi-page folios originate from HugeTLB and that provides alignment guarantees or something
hmm maybe
it batch sets the PTEs in the bottom most page table without making sure it doesnt OOB to a random phys page after
i mean, isn't ptep a pointer to a continuous arrays of entries you want to write, and pte is a pointer to the table entry?
pte is just an integer value to write
ptep is a pointer to continuous entries
but no one makes sure there's enough continuous entries
the pages could potentially belong to different PMD entries
maybe the idea is one folio is guaranteed to be contiguous in page tables
yeah so basically i think folios can only be multi-page if they're from a huge page allocation
and huge page allocations have a different logic for pmd/pud
what ze hell is a constexpr
compile time evaluation
the question you should be asking is, what is a mutexpr?
crazy
I have a really cursed idea for ultra, im gonna use Kconfig, but ill have cmake call something to parse the output .config and then use that output to make a series of set() calls
so basically cmake-compatible Kconfig
Kconfig because its simple and has tons of frontends
TIL
but thats pretty cool yeah
meson being based as always
keyval = import('keyval')
kconfig = configuration_data(keyval.load('.config'))
cool
shouldn't be that hard to parse from cmake or a helper script but yeah
my main concern with meson is like
if i ever run into a missing feature i literally cant work around it
because theres no such thing as user functions etc
you can do shit like custom targets et al
yeah ig
I do that for shader stuff for nvidia-open
so u can call into a custom script still right
I basically need to run them through a script, and two objcopy steps
almost thought that was mesa code
nah I wrote that 
nice
NVK on linux works fine afaict
unless you do some specific GPGPU compute stuff
is managarm missing stubs basically?
I haven't ported the syncobj or dmabuf stuff to managarm yet
letsgoo
i tried that once with cmake
do not
dmabuf should be fairly easy, wiring up the DRM ioctls for nvidia drivers will be fucking annoying tho
true
incredibly aids to manage with cached vars and stuff
like overrides, defaults, etc
just use meson ™️
aka meson
meson is more like scratch
just use zig build smh
cargo
hell nah
i'm tempted to switch to meson with rust
because cargo is straight up ass
but crate management is mediocre
real
i kinda did that with uacpi and spin
I forgot that I'm using Rust in userspace
i can never go back to anything else after using zig build and im a known cmake enjoyer lol
yeah
cmake is pretty good
zig build is just too good to now use for me anymore
even has config header support tho idk if kconfig is one of the options

imo build systems that are literally turing complete and easy to abuse tend to become messy
exactly
but stuff like cargo is just horribly unusable
I need to fix the build system mess in pmOS
tbh zig cc is a bigger deal to me than the zig build even though i really like zig build
what is that
cmake for rust? 💀
calls clang but handles all the cross-compilation nonsense for you automatically
ah lol
what's the point of zigbuild in a c project
https://64.github.io/cmake-raytracer/ (this man is on this server mind you
)
ah nice
really good cross-compilation support
cc @lilac knoll
yeah ive seen that lmao
cool project
cross-compilation?
in a build system?
why would i care about that
meson and cmake can do that
how easy are we talking
because in meson you can literally just use the env stuff as a variable
change one line or a cmdline arg
I mean I can just point it to my cross file and I'm done?
zig build -Dtarget=whatever
sounds like a gigantic skill issue
and cross files can handle more stuff that's necessary for cross-compile like exe_wrapper
meson is so easy to cross compile that they even print the env info during setup
it's almost as if it was made to do this
shrug
ive found zig build's cross-compilation support to be better than anything else ive tried but also meson didnt exist last time i used something else so the only comparison was cmake or full autoconf bs
or at least meson wasnt a thing anyone talked about or i ever saw anyone mention existing at the time
lmfao
meson > cmake >>>>>>>>>>>>>>>> autoconf
u mean based and not funny
maybe one of these days ill finally look into meson but meh
used cmake from 2012-2015ish and then didnt touch native code until like last year
that's like saying you'll never buy a ryzen because amd made bulldozer once
around when silk.net started using zig build for its native libs, because being able to do zig build -Dtarget=whatever with ten different target triples and have the defaults be sane enough for everything to just work
to which major version?
2.x is meh but has problems and 3.0 is wip to address a lot of the problems rn
yeah 2.x works but def has issues
i'd probably use meson for 10.x if i go for C again, but i have to see how hard it is to do what i need it to do
Wait wdym go for C
from what i can tell, everything you do now is possible to be done in meson
see #polls
Why do you want to rewrite it?
What would you change
Ultra proto support 
tech debt moment
nothing really, i just want to remove technical debt, the protocol wouldn't change
id vote zig for that because zig is nice for osdev but its probably too niche for a big project like limine
Which language did you want personally
you're welcome to help out btw
if you want
may be a cool project to work on together from scratch
i could use your expertise
collab i did not expect but i totally wanted
We'll see but I'm kinda tired of getting side tracked, I just wanna focus on my kernel
can we get ext* back
like
@lofty dragon
you can make abstractions to make it much easier to impl and maintain
as of rn i'm just thinking of sticking with C
not only is it leading in the poll
but also
tooling is best for C and C++
and i hate C++
"giant stacks"
yeah that's true as well
Ada also uses gcc 
Ada would be funny
Ada only has GCC support
i'd also like to use a language that has first class support from more than 1 compiler only
which C and C++ fulfill
but again, i hate C++
yea that really narrows it down to c
That's basically only those
well there is D
That would be fitting given you're sponsored by the creator
The runtime seems insane
betterC needs no runtime
no goto 
that's V, not D
wait, no
Ah right
why even rewrite limine?
ignore that
D is an actual language
If I were to write it from scratch id give zig a try tbh
also 1 compiler
Just to learn it idk
someone explain to me the point of zig
YOOOO
Less annoying than rust and safe
Zig only has 1 compiler and the same tooling issues
unless there is a Zig C backend?
safe in what manner
yes there is a C backend but idk how user friendly it is
no clue what that does
i honestly couldn't care less about defer
Basically more modern features preventing you from doing stupid stuff
goto is king
hm
How much time do you expect this rewrite will take
for one it's an idea i still haven't committed to, but it's mainly to clean up the codebase from technical debt
i would love to make a zig bootloader
And is it definitely happening
but not enough experience myself
technical debt or general ugliness
Just do it 
i have no idea
it may take 1 month, 1 year, 3 years or anything in between
i replicated limine's decompressor yesterday using tinf
Are you still working on vinix?
no
Damn
well i'd be working on Vinix but i don't get paid (on time, or reliably)
still need to cook up the boot sector, stage2 and build the entire image
yoooo
So are you like completely done or just waiting for payment
That's a tiny part tho
if god exists why did he give us bios
i am never "completely done" about anything; i'll work on it if i want to, whenever i want to, but yeah
also i don't find kernel dev all that fun i'll be completely honest
do it for me then
Damn
🙏
i have been having way more fun playing with csmwrap than a lot of other things i've done lately
U can just steal bios_call.asm from hyper ill allow it lmao
That's fair
real mode is not that bad?
Ye
and i would rather do nothing
than write real mode code
i just dont like it
like maybe at some point ill just force myself and do it
but until then it's the blocker, even if its easy
i should say that i don't find it fun, at the moment
i just go by phases
but in the end i should end up with zimine 
that's a bad name
i know
i codenamed it zloader
deezig nutzig
qloader reference???
i hate summer
whjat he fuck is that
I wish summer was edible
bro it's a language for os dev
PRN Loading kernel... >>
VAR kernel_loaded = 1
lmao
someday ill work on a zig bootloader tbh
been feeling that itch for a while
but limine exists and i havent felt the desire to figure out real mode stuff
sadly zig can't generate good 16 bit code so you have to actually write the boot sector in assembly
it would be fun to actually build the boot sector from a .zig file
ok local dos enjoyer
lol
i wouldnt write the boot sector in 16-bit c either tbh, iirc most c compilers arent great at 16-bit stuff
have you?
I mean, I do plan on writing a bootloader
with a small Forth
and then writing most of the stuff in Forth
such as protocol and file system support
how much 16-bit code is even in the menix ap trampoline
there's like 2 instructions iirc
i like the part in that thread where that person is using an LLM as plain as it can possibly be seen, and you guys kept essentially arguing with the LLM, which kept spouting nonsense like LLMs do
like
idk if you guys were just fucking around knowingly
i reacted with 
yeah but like
i was just trying to get him to admit he's bullshitting
after MANY LLM messages
yeah but u dont need to read from disk and all that shit
ah
idk how bios boot works
it was only two messages
ap trampoline just jumps to 32-bit code, enables some cpu features and jumps to kernel lol
or I'm completely braindead
you could see that he types like ass, broken grammar, no capitalisation, different wording, and then the LLM messages were the opposite of that
three
more
three messages
there is one big downside to doing zig bootloader stuff, and thats that theres some bugs with uefi support that might be llvm issues actually we arent sure but you cant get stack traces on efi in zig
that's how I noticed it
do you want me to actually count them, because i can count them
32 bit codegen is also broken
fastcall isn't actually fastcall
on windows it's supposed to pass 2 regs in ecx, edx but it does all on stack
ok but i aint touching 32-bit, if im writing a zig bootloader im writing a long mode kernels only one and in that case go straight from real to long mode
does vectorcall work tho
no
🔥
ill blame llvm here since zig uses llvm for that part
vectorcall changes how float args are passed
I count 7 now
no it's zig
parameters aren't marked with inreg
three in rapid succession
ah ok in that case not an llvm issue for once
yeah
and the fix is very simple
ion the CallingConv enum
just change x86_fastcall to use X86Regcall type
or something like that
i dont remember the actual type name
mhm
@dire owl #1383345907143282708 message
#1383345907143282708 message
#1383345907143282708 message
#1383345907143282708 message
#1383345907143282708 message
#1383345907143282708 message
#1383345907143282708 message
7
.
some of those are even just copied from the website he made
yeah sorry that i was actually counting them myself as you asked me to
yeah, sorry abt that
yeah
maybe I'm actually stupid
and like
i have started catching up to LLM-speak way more lately
i used to not be able to, or not think about it
now it sticks out like a sore thumb
most of the time
must be because i have actually tried to use LLMs
to do stuff
and failed most of the time
yeah, I didn't notice cuz I wasn't looking for it
i'm happy i do work that's so mentally fucked that no ai can understand it
I still need to read through all that LLM-generated bullshit
yeah
0 points if there's a smoking gun
like it being a screenshot from ChatGPT where the input text bar is still visible
most of the time i asked info about shit i am working on to LLMs they just lie to me and invent stuff, so much so that i just don't bother asking anymore about anything but the most trivial shit that it copy pastes from some random stack overflow reply
for those i only ask because Google sucks now
they are a better search engine, but only for the simplest of things that have been asked a million times
idk why or how korona, with all his smarts, can say that LLMs are useful for any actual programming
I had a Professor (string theorist) who said that ChatGPT gave him some ideas for research
it may be useful if you absolutely do not rely on it and use it purely as an intern throwing ideas at you
and that he doesn't need as many bachelor students now thanks to ChatGPT
chatgpt is a virtual intern
also, never let an llm make a meaningful decision
but also, didn't Korona say he basically uses ChatGPT as a search engine?
Uh oh
tbh google did something weird with their search engine because it fucking sucks now
it's so much harder to find answers to complicated questions
you only find really simple questions that are missing many keywords from the original source
i'm finding myself putting some keywords in quotes more often than before
just so they don't get naenaed
it was bad for a long time
that's why so many people suffix "reddit" to their queries now
Google has significantly gotten worse and providing less quality content and reddit is kind of a filter since upvotes and stuff
reddit is slowly being lost to automatically generated, automatically posted ai content
most of the "story" subreddits (r/relationships, r/amitheasshole, r/amioverreacting, etc) are completely overrun with ai-generated posts and nobody seems able to tell
and like half of the informative comments on any post on any subreddit with 500+ upvotes near the top of the comment section, are just chatgpt output
i dont even know what the motivation for this is
dead giveaway is an emdash
most likely ai-generated
also if OP actually responds lol
i suspect a lot of these are actually real stories and people are just so lazy they summarized it to chatgpt and asked it to make it a well-written, fleshed out reddit post (or they fed their post to chatgpt and asked it to make it nicer or something and it added a bunch of emdashes and other chatgpt-isms in the process)
which they copypasted
yea that could be true too
I've recently started casually using em dash out of spite
Linux be like:
static pgprot_t protection_map[16] __ro_after_init = {
[VM_NONE] = PAGE_NONE,
[VM_READ] = PAGE_READONLY,
[VM_WRITE] = PAGE_COPY,
VM_WRITE, looks inside: readonly page
wha??? 😭 ?????
why tf does linux do that
Copy on write
well in this case its not for copy on write
it's for lazy allocation
the pf handler marks it as pte_mkwrite on a write fault
or just maps a shared zero page if its a read fault
basically its slightly stupid semantics but what it actually means is basically just a set of template flags for a page mapped with these flags
and the writable flag is set in the fault handler only
Is that even a useful optimization
who knows
how does linux do physical to virtual translations?
page + page_offset
Probably a rare, stupid program where that would actually help
and not just cause degradation due to the extra COW fault when you inevitably write to that zero page
iirc for a long time the COW fault would actually copy the page of zeroes into the new page????? rather than just noticing it's the special zero page and memseting which is faster
and this didn't change until shockingly recently


