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

1 messages · Page 54 of 1

real jetty
#

Was just skimming through but seems like you gotta really make the code ugly for an alien compiler

fiery turtle
#

I'm not sure about the extent yet

#

But so far doesn't look like its too much

#

No

slim panther
#

not yet i went to bed after that

fiery turtle
#

Me?

#

Oh

#

I don't even wanna try the older one lol

rustic compass
#

Maybe wait until they added c23? To the fork?

slim panther
jaunty fox
hollow elm
#

and not one released in the 90s

jaunty fox
hollow elm
slim panther
#

still don't understand them using openwatcom to begin with

frank canopy
#

i actually have encountered some scenarios where openwatcom is the recommended solution though idk if rdos is doing any of them

#

but the general thing ive heard is that openwatcom is way less bad at real mode compilation than gcc or clang

#

so it might be natural to then use one compiler for everything and if you have real mode parts that need compiled for some reason that lends itself to wanting openwatcom

#

id just. not compile to real mode. but thats just me ig lmao

#

no clue why rdos in particular is using openwatcom though

gentle peak
#

i believe rdos doesn't use a flat memory model?

#

thats the impression ive gotten from random messages ive seen on the osdev forums at least

frank canopy
#

oh yeah that might do it

#

the reason ive seen given to use openwatcom for real mode compilation is it handles non-flat segmented memory models better

slim panther
#

idk but the forum post mentions 64-bit support

fiery turtle
#

Took a few hours, but I can now compile kernel C files on the host machine, even on Windows. It re-creates the kernel source tree with some files copied verbatim and some containing fake test stubs, thanks to cmake magic it even automatically re-copies them if the source was changed

#

i made it so i can specify the kernel files I want to copy to the synthetic kernel tree

#

Now i can start writing tests finally

#

very nice

#

tbh the worst part was stubbing shit for MSVC, but its very convenient to debug stuff with the msvc debugger in visual studio

fiery turtle
#

also fixed a small uacpi bug that monkuous found a while back

slim panther
#

we should try running uacpi on ps4 trl

fiery turtle
#

id like to see a dump from it

slim panther
#

i dont have one sadly

fiery turtle
#

i have one but its not hacked

slim panther
#

check the firmware version

#

its acpi is funny

calm latch
slim panther
#

zamn

calm latch
#

Does it have ACPI?

slim panther
#

yes

#

it doesn't have a pic or pit though

calm latch
#

I thought it wasn't a PC

slim panther
#

well

#

it isn't an ibm compatible pc

#

but it has hpet

#

and tsc

#

it's a real oddball of a system though

fiery turtle
#

it has ahci as well i think

#

so it is a pc just slightly quirky

slim panther
#

yes

#

it has an arm co processor which it exposes via pci??

hollow elm
slim panther
#

yes the blu ray drive is sata

#

the hdd is usb

#

ethernet is via pcie

hollow elm
slim panther
#

and gpu i mean is just radeon

#

i wonder how non-ibm-pc-like the xbox series s is

hollow elm
#

wouldn't be surprised if it was almost just a pc

slim panther
#

i cant find anything about linux on it

hollow elm
#

maybe without legacy ibm pc peripherals

#

but without insane stuff like the arm soc as a southbridge

slim panther
#

"""""southbridge"""""

hollow elm
slim panther
#

no way there's no homebrew on the xbox

#

i guess there isn't any incentive because of dev mode

hollow elm
#

🤯 most people won't hack your system if you let them run their own code on it

hollow elm
slim panther
#

are there any consoles out there which could be feasible for hobby osdev

hollow elm
#

anything with webkit is just a ticking time bomb so theoretically yeah

slim panther
#

wii u

hollow elm
#

ps4/ps5

slim panther
#

oh wait that was already cracked using webkit

#

lmfao

hollow elm
slim panther
#

only few switches are still hackable

#

i have 2 of them

hollow elm
#

although the switch is just a nvidia tegra x1 more or less so you could just buy a dev board instead :^)

slim panther
#

most of the 1st gen ones have broken down

calm latch
#

I have Wii U which I need to hack anyway

hallow marten
#

Wii is doable

calm latch
#

Since its drive broke

slim panther
#

i have a wii u

hallow marten
#

Has been around for a while so more documentation most likely

slim panther
#

which is still fully functional

hallow marten
#

Kinda funny the Wii U was a flop but I know lots of people who have one me included

calm latch
#

I mean it still sold 20 million consoles?

#

Or 10

slim panther
#

or 5

calm latch
#

Several millions

#

That still a lot

jaunty fox
#

i think it's high time for a powerpc hobby os here

slim panther
#

i gotta do device tree support

calm latch
#

is there devicetree on wii/wii u?

calm latch
#

so once you're booted it's relatively normal?

#

cool

fiery turtle
#

wtf is this PR

#

what have i brought upon myself

fiery ice
#

why can't he just use his fork?

#

how many ppl actually use openwatcom here?

fiery turtle
#

0

#

i would be fine accepting openwatcom support if it wasnt that invasive, but holy shit at least clean up your pr

gentle peak
#

can watcom really not handle that? that's been standard c since C fucking 90

slim panther
#

what is this shit

gentle peak
#

also i'm guessing (hoping) the logging disable thing is because C90 doesn't have vararg macros and watcom doesn't support it?

fiery ice
#

lol

gentle peak
#

yea but this is older than C99

fiery ice
#

it should at least support it

slim panther
#

can openwatcom do scanf KEKW

gentle peak
#

like C90 literally defines assert-without-ndebug in terms of that construct

fiery ice
#

we are in 2025 why use old compilers that don't even work properly?

slim panther
#

exactly

fiery turtle
slim panther
#

can you ask him that

gentle peak
#

What The Fuck

slim panther
#

why no gcc

gentle peak
#

Just use the fucking _Pragma

fiery ice
slim panther
#

it doesn't have that

gentle peak
#

it does

fiery turtle
slim panther
gentle peak
#

we tested it yesterday

#

watcom has _Pragma

slim panther
#

bruh

fiery turtle
#

^

#

He doesn't even know his own crappy tool

slim panther
#

again, just don't support it

#

tell him to use a c99 compiler

#

I'd bet even fucking tcc can compile uacpi

kindred beacon
#

also lol @ the random rdos directory

fiery turtle
#

Like the thing is it can be supported cleanly, but wtf is this slop

real jetty
#

Lmao at always inline

fiery ice
gentle peak
#

this does not have the same semantics!!! (unless those are the only fields in that struct but i don't think so)

gentle peak
fiery ice
#

oooof

real jetty
#

Yeah i was about to say lol

kindred beacon
#

I'm sorry but this PR is just low-quality and should stand no chance unless fundamental changes are made IMHO

fiery turtle
#

He didn't even bother abstracting it behind platform.h

#

Just slap everything under ifdefs

kindred beacon
#

going around and bending backwards to a compiler that doesn't support stuff like FUCKING VARIABLE DECLARATIONS in the middle of blocks is insane

slim panther
#

^

fiery turtle
#

It doesn't even support them at the begining

slim panther
#

just say min requirement is C99

fiery turtle
#

Only at function entry

fiery ice
#

be even more specific, lol

real jetty
#

Yeah.. and youd need to keep maintaining it with this burden of a compiler always in mind

slim panther
#

true

fiery turtle
#

Exactly

fiery ice
#

and also, uACPI in userspace?

fiery turtle
#

Works fine if your kernel is sane

slim panther
fiery turtle
#

Like @calm latch

fiery ice
slim panther
#

iopb

#

that's what the map io funcs are for i think

fiery turtle
#

There are multiple ways on x86

gentle peak
#

iopb (which allows you to specify which io ports can be accessed) and iopl (which gives access to all io stuff, including disabling/enabling interrupts)

calm latch
fiery ice
#

k

calm latch
#

Like io doesn't have to be fast

gentle peak
#

that too, io port access is incredibly slow anyways

fiery ice
#

i'll keep my uACPI on kernel space

fiery turtle
#

Depends on your design

calm latch
gentle peak
#

because it's single-threaded, presumably

kindred beacon
#

thank me later

#

shit like this gets me real mad

#

even if I obv don't call any shots there

fiery turtle
#

lol thanks for your comment leo

#

well put

kindred beacon
#

HAHAHAHAHA tests fail

fiery turtle
#

he managed to break CI as well

#

lmfao

#
/Users/runner/work/uACPI/uACPI/source/tables.c:981:5: error: call to undeclared library function 'memcpy' with type 'void *(void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    memcpy(id.signature.text, signature_string, 4);
    ^
/Users/runner/work/uACPI/uACPI/source/tables.c:981:5: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
gentle peak
#

to really top it all off, it breaks compile for sane compilers

fiery turtle
#

lmfao

#

who needs apple clang

gentle peak
#

or gcc

fiery turtle
#

they can go fuck themselves, support openwatcom instead

gentle peak
#

because this is not a clang-specific error, the only reason macos is the one that failed is because it was fastest

#

i wonder if msvc even allows that when compiling with reasonable options

#

also, shouldn't that be using uacpi_memcpy instead of memcpy?

fiery turtle
#

lets see

calm latch
#

If they're doing it in userspace anyway, why not use a sane compiler?

kindred beacon
#

I mean realistically memcpy is always going to be there anyways

#

for gcc/clang at least meme

slim panther
#

nobody uses those

kindred beacon
#

ah sorry forgor

fiery turtle
gentle peak
#

ah ok

#

msvc is still insane

kind mantle
#

Lily-CC is clearly the better option meme

fiery turtle
#

he added that memcpy himself btw

#

its not in the original uacpi source

#

so he didnt even check his code

gentle peak
#

well watcom probably allows it

fiery turtle
kind mantle
fiery turtle
# gentle peak well watcom probably allows it

he said

The op code tables fail to compile, and I have no idea why but I suspect it is related to the incredibly complex macro structure used. I will need to redo this to decrease complexity, and in fact, also to increase readability (and debuggability) of the code.
#

so i guess he never actually compiled it

gentle peak
#

oh yeah no successful compile

#

why did he pr this?

fiery turtle
#

no idea lmfao

#

openwatcom doesnt support macros

real jetty
#

Ah how nice it is from him to increase readability

gentle peak
#

(also, the opcode table issue is probably due to the [] = ... syntax, since i believe that's C99)

fiery turtle
#

ah

#

could be that

gentle peak
#

love that he (implicitly) complains about readability and then prs this

fiery turtle
#

lmao

gentle peak
#

oh wait .wpj probably stands for watcom project doesn't it

#

this is just an ide config file

kind mantle
#

Why exactly are people seriously using the watcom compiler if it doesn't support basic shit like compound initializers?

gentle peak
#

and real mode (proper real mode, unlike 80386-compatible-running-in-real-mode)

fiery turtle
#

also he hardcoded pointer_size as 4, does it not support 64-bit x86?

jaunty fox
kind mantle
vast kestrel
fiery turtle
#

how do they not support such basic things if its an actively maintained compiler

jaunty fox
#

it seems rdos guy is not enabling C99 compile mode, so he doesn't want things like e.g. VA_ARGS

gentle peak
#

most of the bs could've been avoided by simply enabling a compile mode??

jaunty fox
#

nor stdint.h nor many other things

kind mantle
jaunty fox
#

also why he hoisted declarations to top of blocks

fiery turtle
#

Why not enable it?

jaunty fox
#

presumably he builds in c89 mode only

fiery turtle
#

Maybe he doesnt know about it

kind mantle
#

It is beyond me why any project developed today supports any compiler older than C99

jaunty fox
kind mantle
fiery turtle
#

I can tell by the quality of his PR trl

gentle peak
#

this is not true unless you use watcom or something similar

jaunty fox
#

he is not aware of register allocation apparently

#

which watcom does btw

gentle peak
#

this is not true if you use a mainstream compiler like gcc/clang (because i don't count msvc as mainstream, and thus the two mainstream compilers support eachothers extensions for the most part)

gentle peak
kind mantle
#

He's thinking of reaaaaaally old compilers, so old that none of them actually exist today

jaunty fox
gentle peak
#

i mean yeah

#

but watcom

kind mantle
#

I seriously doubt he can write assembly as fast as from GCC/clang

jaunty fox
# gentle peak but watcom

i don't stand for watcom slander, it's a fantastic compiler which unfortunately needs significant work on its modern c/c++ support

fiery turtle
#

i think it has that, hes just not enabling it on purpose

#

it literally supports 0b

gentle peak
#

wait so why did he get rid of all of the binary literals

#

is he using an ancient version of it or something?

fiery turtle
#

i guess so

kind mantle
#

You know, with all the modern langs it's cool to hate like Rust and Zig, I wasn't expecting someone that seriously thought C was slow.

gentle peak
kind mantle
#

lmao

fiery turtle
#

this guy lmfao

kind mantle
#

There's good reason why modern OSes use paging

jaunty fox
#

the greatest hit is still the neanderthal aspergers theory

kind mantle
#

bruh what

gentle peak
#

i really hope this is just a ux thing

kind mantle
#

as well as discovering mind-to-mind communication
MF what scientology shit is this

fiery turtle
#

@jaunty fox do u still have a link to the commit that added 0b support?

jaunty fox
fiery turtle
#

Thanks, ill add this to my reply

#

it literally supports this in C99 + extensions mode

calm latch
kind mantle
#

WTF is this guy's problem with autism

#

Why does he want to paint us as some form of troglodytes

dense steppe
calm latch
#

thonk how many people use uACPI with clang vs GCC?

fiery turtle
#

probably most use gcc

fiery ice
#

i use clang

north hull
#

clang!

calm latch
#

I mean me too

lofty dragon
#

i use both

slim panther
#

:3

#

clang for the win

fiery turtle
#

Lol he closed the pr

#

didnt survive leo criticism

kindred beacon
#

good that PR was just insane

fiery turtle
#

lol nvm

#

he replied

#

what the actual fuck

calm latch
#

Does watcom not have atomic intrinsics as well?

calm latch
#

16 byte compare exchange

fiery turtle
#

it's 16 bit lol

#

only for global lock i think

calm latch
#

Wait

calm latch
fiery turtle
#

mutex between uacpi and firmware?

calm latch
#

No, the kernel API

fiery turtle
#

the global lock is a firmware thing

gentle peak
fiery turtle
#

yeah basic git is very hard

calm latch
calm latch
fiery ice
#

prob for watcom

#

lol

mortal yoke
#

also wtf #define uintptr_t unsigned int *

fiery ice
#

cursed stuff

fiery turtle
mortal yoke
#

that's also going to break any kind of arithmetic done on it, though you probably don't do any in uacpi?

jaunty fox
fiery ice
#

wth are those libs

jaunty fox
#

targets

fiery ice
#

oof

fiery turtle
#

fuck uacpi abstractions, include libc directly

fiery ice
#

string.h is memcpy?

calm latch
#

I think so

mortal yoke
#

yes memcpy is in string.h

jaunty fox
#

at this point frankly it would be better if someone else made a reasonable port to watcom

mortal yoke
#

or just don't bother and tell them to fuck off lol

calm latch
#

But string.h is not even related to watcom

fiery ice
#

preferably someone that knows what they are doing

calm latch
fiery turtle
jaunty fox
#

or even zastd=whatever sets c99 + extensions like binary literals

fiery turtle
#

how do u write software for so many years and still lack basic skills like that

frank canopy
#

dear lord

calm latch
#

But that's not their case?

jaunty fox
#

mr rdos seems to be somewhat adapted to the demands of mostly assembly with a little c programming around 30 years ago

fiery turtle
mortal yoke
#

lol

fiery turtle
#

also its supposed to be a POS os?

calm latch
#

who uses it?

fiery ice
#

i hope it has been tested VERY troughly then

dense steppe
#

so the difference in semantics between struct mystruct foo = { .x=1, .z=3 }; and struct mystruct foo; foo.x=1; foo.z=3; is that the former zero-initializes foo.y, while the latter leaves it uninitialized and therefore UB to use?

gentle peak
#

yes

dense steppe
slim panther
#

KEKW how does this guy not know that difference

mortal yoke
calm latch
#

Though I guess he has a bunch of drivers and network support

jaunty fox
fiery ice
#

prob

calm latch
#

wtf

dense steppe
fiery ice
dense steppe
fiery turtle
#

they arent dumb enough to pay for a gpl os lol

fiery ice
#

some do

#

lol

jaunty fox
#

it's $10 a licence so it's no great cost

fiery ice
#

i saw POS with literal windows on them...

dense steppe
fiery turtle
pine leaf
fiery turtle
#

they really dont want you to freely use the hardware do they

dense steppe
#

they're just that good at securing their stuff

pine leaf
#

indeed, they actually are
they basically achieved perfection with the XBOne, and then just did that but again™️ for One S/X and Series S/X

fiery ice
jaunty fox
#

meanwhile PS3 was sold as an ideal machine to run linux on

calm latch
fiery turtle
#

but no fun allowed anymore

mortal yoke
#

which is probably the biggest reason why its all so locked down tbh

dense steppe
fiery ice
#

they are just greedy

fiery ice
pine leaf
dense steppe
#

ahh

fiery ice
#

you literally can pay double at some points for console games vs pc one

dense steppe
#

so we gotta do hypervisor pwn

pine leaf
#

yes, except that you can't see it

calm latch
pine leaf
#

even at the bus level

pine leaf
#

all data going in or out of the APU is encrypted

#

only time plaintext data exists is inside the APU silicon

fiery turtle
fiery ice
#

1k$ ps5 pro that is literally the base 500$ version?

calm latch
#

Like a gaming console should cost much less than an equally powerful PC

calm latch
fiery ice
dense steppe
calm latch
fiery ice
#
  • they also lock them to 30 fps on most games
calm latch
#

(a big loss)

fiery ice
#

you get 60fps only for some

pine leaf
fiery turtle
#

gameos etc

pine leaf
#

the chances of them ever being hacked is low tbh
there's just no drive to get into them, they're just mid PC hardware

#

nothing funny like PPC or ARM

calm latch
#

Wait, the pull request has disappeared again?

frank canopy
#

my guess is gameos is the os that runs under hypervisor and runs the game software

#

so the game software doesnt have to include an entire os

pine leaf
# fiery turtle gameos etc

GameOS is where games run
SystemOS is where the "systen" UI and services run (chat features, dashboard, etc)
iirc there's one more VM running in the background too but I don't remember what it's called / does

#

all of that is running inside a tiny hypervisor that gatekeeps everything

#

each one is an independant copy of Windows

dense steppe
#

so you always have hw<->hypervisor<->(one of gameos and systemos)

fiery turtle
#

so its nested virtualization?

dense steppe
calm latch
#

does openwatcom not support (void)x; for unused variables?

dense steppe
#

gameos and systemos probably communicate with each other via the hypervisor

pine leaf
#

not VMs inside of VMs

fiery turtle
#

using whpx?

pine leaf
#

nah, the HV is not Windows

#

it's a tiny little block of code with no attack surface

fiery turtle
#

so its a new kernel?

pine leaf
#

iirc the one on the 360 was like, 64KB or something

dense steppe
#

it'd be funny if it was xen or something

fiery ice
#

windows runs under a HV too

pine leaf
dense steppe
fiery ice
#

when you use wsl

pine leaf
#

it's sole job is to run the VMs and make sure they don't try anything funny

fiery ice
#

it makes windows run in a type 1 hypervisor

#

so win and linux can be parallel

pine leaf
#

since it hasn't been exploited yet

#

nobody's dumped it

fiery ice
#

maybe it is in some leaks?

pine leaf
#

has M$ even had a leak recently, they haven't that I've heard of

#

last one I know of was the OG Xbox + NT4 + NT5 source leak

pine leaf
#

title suggests nothing Xbox related
I'm not gonna go check it myself, but I'd doubt it

#

anything Xbox-related would probably also be modern Windows-related, and that'd make a huge splash

pine leaf
#

ah

#

wow, so useful, the same public Windows SDK but with 5 different DirectX functions meme

kindred beacon
#

BROOOOOOOOOOOOOO

#

who's gonna tell them

fiery ice
fiery turtle
fiery ice
#

but only the original one

pine leaf
#

it's so similar that people have made compatibility layers w/ DLL injection, that make it just work™️ on regular Windows

fiery turtle
#

he made a whole new pr

fiery ice
#

no way

#

wait, it's literally the same pr with just 1 more commit...

#

the memcpy one

fiery turtle
#

git is really hard what can u do

kindred beacon
#

you're welcome

fiery ice
calm latch
#

but 64-bit locked operations are not supported in 32-bit mode, and the atomic inc and dec cannot return the real value as an atomic operation.
Huh?

gentle peak
#

i386 doesn't have xadd, is he talking about that?

calm latch
#

i386 doesn't have ACPI either

fiery turtle
#

yeah

#

anything with acpi will have cmpxchg8b

gentle peak
#

well yeah but try telling that guy his acpi module will have to be i486+ at the very least

#

i586 if uacpi needs cmpxchg8b

calm latch
fiery turtle
#

he should compile his acpi driver in 16-bit mode chad

calm latch
#

Also he should have FP

#

Since it's in userspace

fiery turtle
#

yeah

#

fistp is a thing etc

calm latch
#

which can do 8 byte stuff I think?

#

At the very least atomic loads and stores

gentle peak
#

pretty sure some of the cpus he's targeting don't have FP at all (yes these systems won't have acpi but above comment applies)

calm latch
#

And you can emulate the rest?

gentle peak
#

also 8-byte fp ops are only atomic on >=pentium iirc

calm latch
#

hmm

#

It's not used at all?

fiery turtle
#

only 32 is used atm

calm latch
#

yeah

#

how does atomic increment work on x86? thonk

gentle peak
#

xadd

slim panther
#

xdd

fiery turtle
#

xd

calm latch
#

x

fiery ice
#

fiery turtle
#

@kindred beacon lol thanks for the comment again, i dont have the patience to explain things like that

#

id rather just ignore it until it goes away

#

lmao

kind mantle
#

Wait

#

Watdom doesn't support (void) expr ?

#

lmao

gentle peak
#

idk at this point because he made a bunch of changes to things that watcom just supports

fiery turtle
#

^

#

he's using some stupid version of watcom

gentle peak
#

The reason for these fixes is that the structures are only partly initialized. I cannot see the difference between declaring a variable and then initializing the same (partial) fields.
bro

fiery turtle
#

because it does support a lot of these things from what i can see

gentle peak
kind mantle
#

Casually includes stddef.h and still defines u?int[0-9]+_t

gentle peak
#

uintX_t is from stdint.h

kind mantle
#

i know

gentle peak
#

which doesn't exist in C90

slim panther
#

size_t

fiery turtle
#

apparently slapping an include <string.h> is fine but including stdint is not

gentle peak
#

well stdint.h only started being a thing in C99

#

i don't know if watcom has it

kind mantle
#

This just gets stupider by the second

slim panther
#

priorities

#

it's a freestanding header, you can just copy paste it smh

#

i double dare yall to just tell him to use clang

kind mantle
#

??????
This does nothing other than break things

slim panther
#

???

#

nah trust me, this makes sure the compiler doesn't OOM while allocating the var name

mortal yoke
kindred beacon
#

close for low-effort insanity

calm latch
#

were there 486s with ACPI?

kind mantle
#

tbh seeing how awful this person prolly is with views on autism, just ban from uACPI GitHub if he opens PRs again

fiery ice
#

why even target that ancient hardware anyway

fiery ice
kind mantle
#

Just go to his site's homepage

slim panther
#

every single time

kind mantle
#

I do not appreciate that and in my projects someone would be blanketly banned just for that.

#

Probably among other things, he tries to link autism to neanderthals, a species we combined with a very long time ago

fiery ice
#

why even put it there

kind mantle
#

He calls us "aspies" 💀

calm latch
#

Even if it doesn't, your C library should provide it

kind mantle
calm latch
#

otherwise what are you doing

fiery turtle
#

i left a comment on the PR, hopefully it makes it a bit more clear

#

but its basically what leo said but nicer

jaunty fox
fiery ice
#

like ppl on X

fiery turtle
kind mantle
#

RDOS source code is distributed as GPL, except for commercial usage.

#

Not how GPL

frank canopy
fiery turtle
#

ah yes, the GPL-capitalism clause

regal snow
#

what happend

kind mantle
#

Delusional

calm latch
#

Delucional

jaunty fox
#

this for instance is just wild speculation

fiery ice
#

oof

calm latch
kind mantle
fiery ice
#

a very very bad PR

mortal yoke
# kind mantle Delusional

also you are allowed to use it commercially for free as long as what you are trying to run it on isn't an embedded system

fiery turtle
#

basically a very incompetent person trying to port uacpi to openwatcom

kind mantle
vast kestrel
#

At this point he is trying to port uacpi to whatever compilation it does

fiery turtle
#

yeah thats the thing

frank canopy
#

whats worse is this is almost tempting me to try and do it properly. and i barely know C and dont use openwatcom

fiery turtle
#

its not even an openwatcom port

fiery ice
fiery turtle
#

its a port to his crappy os buildsystem

vast kestrel
#

It's like passing to GCC --be-stupid and porting to that

kind mantle
vast kestrel
#

Y e s

fiery turtle
frank canopy
#

i literally know enough c to make zig bindings for uacpi and thats it

fiery ice
#

lol

frank canopy
#

and this is tempting

vast kestrel
#

-Duintptr_t="unsigned int*"

gentle peak
#

The problem is that nobody wants to maintain openwatcom support

kind mantle
#

I know enough C to know that this rdos person doesn't know C.

gentle peak
#

Just adding support for it now seems simple enough

jaunty fox
gentle peak
#

But that's gonna bitrot insanely quickly

fiery turtle
calm latch
#

Btw, can't uACPI just use atomic.h through some flag or something?

fiery turtle
#

hm?

calm latch
#

So people with weird compilers can just be directed to implementing that

kind mantle
calm latch
#

Yeah

gentle peak
#

Yknow I was gonna try myself but $ pacman -Ss watcom $

jaunty fox
#

what is shocking is he isn't even familiar with watcom's capabilities around e.g. struct packing, which i found by ctrl-f the manual

fiery turtle
#

atomic.h in uacpi is in platform/, its meant to be overriden by your platform unless you're lazy and use whatever is shipped by default

#

so yeah

gentle peak
#

Fixing that requires editing the main source

gentle peak
kind mantle
#

Yeah but we found that lots of uACPI source code is supported by owc

calm latch
#

But uACPI is relying on compiler-specidic functions for atomics

fiery turtle
calm latch
#

But if your compiler doesn't support stdatomic, you can implement it yourself

regal snow
#

why does he like autism so much

#

or hate

fiery ice
#

idk

calm latch
fiery turtle
#

the docs say it works for msvc gcc and clang, for anything else u gotta do it yourself

gentle peak
#

Fuck it I'm gonna see how much of the BS comes from watcom and how much comes from this guy

fiery turtle
#

lool

#

monkuous saves the day for rdos

calm latch
#

What if it turns out to be a decent compiler? spun

leaden fox
fiery turtle
#

its literally a fine compiler

#

u just have to know how to use it

leaden fox
#

I channel the neanderthal spirit through my sutism

gentle peak
#

Why is there an uninstal.exe in the linux package

#
$ file /opt/watcom/uninstal.exe 
/opt/watcom/uninstal.exe: PE32 executable for MS Windows 4.00 (GUI), Intel i386, 5 sections``` ???
fiery turtle
#

run it trl

kind mantle
#

lmfaooo

fiery turtle
fiery ice
#

LOL WHAT

calm latch
#

Why not

gentle peak
#

does this support rdos in-tree??? or is this something else

fiery turtle
#

probably upstreamed support lol

gentle peak
#
/opt/watcom/rdos/dwarf.dll: PE32 executable for Unknown subsystem 0xffffad05, Intel i386, 4 sections``` lovely
fiery turtle
#

what the hell is uhh

#

is rdos an nt clone?

leaden fox
fiery turtle
#

from what ive seen its likely

fiery ice
#

maybe

fiery turtle
#

an nt clone using open watcom

fiery ice
#

lol

fiery turtle
#

at least use goddamn msvc lol trl

fiery ice
#

does it even run windows .exe files?

kind mantle
frank canopy
#

because thats the single point in favor of openwatcom

fiery turtle
#

i forgot about the stupid segmentation meme

#

lol

kind mantle
#

Isn't segmentation extra painful if you use dynamic libs?

frank canopy
#

openwatcom can do non-flat segmentation and true real mode compilation thats its only benefit

fiery turtle
#

people might think open watcom is a pile of trash if they look at that pr lol

frank canopy
#

yeah lol

vast kestrel
#

I wonder how the prs he made to ow look like

fiery turtle
#

poor ow devs LULW

vast kestrel
#

He had an issue saying ow doesn't support switch with long long think

jaunty fox
#

he had some irritation with watcom using bool

fiery turtle
#

jesus

#

he's been using it for 10 years and he doesnt know it has _Pragma?

fiery ice
#

i don't even wanna see his source

vast kestrel
#

Wait that's from fucking 2016

mortal yoke
#

or more like 90% of it lol

fiery ice
#

yeah i saw the info

#

WHY

hollow scaffold
#

Why would anyone compile using OW?

gentle peak
#

at least it supports #pragma once

fiery ice
#

do you hate yourself so much that you have to write bad code?

fiery turtle
hollow scaffold
#

svn 😭

fiery turtle
#

ohh thats why hes so terrible at git

fiery ice
#

there is no way

#

oooooof

hollow scaffold
fiery ice
#

...

kind mantle
#

what

hollow scaffold
#

sorry

kind mantle
#

Does he store segments in eax or smth

calm latch
#

Wait

fiery ice
#

he fucking uses pack

calm latch
gentle peak
#

right well i can't find a way to detect the pointer size without just checking a bunch of raw target macros (like __386__ and such)

fiery ice
#

why not use it at least in uACPI

gentle peak
#

guess that's why the guy hardcoded 4

kind mantle
fiery turtle
gentle peak
fiery turtle
#

U can check either or

kind mantle
calm latch
fiery turtle
#

Not in freestanding

gentle peak
#

i'm not particularly a fan of using c library headers in uacpi

calm latch
#

I'm defining those myself in pmOS

gentle peak
#

esp non-freestanding ones

fiery turtle
#

^

calm latch
fiery turtle
#

Well gcc does

calm latch
#

How is this not freestanding?

mortal yoke
#

UINTPTR_MAX is in stdint.h

gentle peak
fiery ice
gentle peak
calm latch
#

Yeah

hollow scaffold
kind mantle
#

centralized

gentle peak
#

i guess this'll do

fiery turtle
gentle peak
#

the build the aur package has doesn't

#

just 32 bit x86

fiery turtle
#

Hmm

gentle peak
#

but it's not like i'm hardcoding anything without checking first, so shouldn't be too much effort to add if i figure out how to get a 64 bit build of it

fiery turtle
#

True

hollow scaffold
fiery turtle
#

Lol

kind mantle
#

Hm yes lettuce add NFTs generated by AI to git

fiery ice
#

every line of code is paid

gentle peak
#

types.h only has 65 lines???

hollow scaffold
gentle peak
#

does this thing use the line number post-macro expansion or something

fiery turtle
#

Hidden commercial uacpi code chad

kind mantle
gentle peak
#

well it's just a warning so i won't bother

hollow crescent
#

try adding an #error into the one you are looking at

gentle peak
#

it's a nonsensical warning (W135: Shift amount too large) but still

hollow scaffold
#

is there uacpi port to linux maybe

hollow crescent
#

oh wait

#

watcom c

#

that might explain it

gentle peak
hollow scaffold
gentle peak
#

they're on this c UACPI_OBJECT_DEBUG_BIT = (1 << UACPI_OBJECT_DEBUG), UACPI_OBJECT_REFERENCE_BIT = (1 << UACPI_OBJECT_REFERENCE), UACPI_OBJECT_BUFFER_INDEX_BIT = (1 << UACPI_OBJECT_BUFFER_INDEX),

kind mantle
#

Noobs taking on huge projects and making nothing standard is such a phenomenon

gentle peak
#

does watcom use 16 bit ints by default??

#

oh wcc does but i should be using wcc386

kind mantle
#

Hm yes 16-bit acpi

calm latch
#

I mean you can do that trl

#

Though would 1M of address space be enough for uACPI?

fiery turtle
#

Sure

gentle peak
#

right well this is annoying, openwatcom does support designated initializers, but only as actual initializers, e.g. &(struct uacpi_table) { .index = idx } is invalid, you have to add struct uacpi_table tmp_table = {} at the top of the function and set .index manually later

#

so it's only really useful if you already have all the values at the top of the function

fiery turtle
#

Ah

#

Annoying ngl

gentle peak
#

Error! E1073: Invalid option '-zastd=c23' how fun, the version i'm using doesn't include support for either binary constants or the c23 option

fiery turtle
#

Maybe clone the github repo?

gentle peak
#

yeah maybe

mortal yoke
#

it has a garbage build.sh that takes ages to run though lol

gentle peak
#

although if i'm adding openwatcom support i want it to work on a released version of the compiler and not just trunk

fiery turtle
#

Its from January I think

gentle peak
fiery turtle
#

Hmm

#

Or no its march lol

mortal yoke
gentle peak
#

oh this is also fun: struct x = {} is invalid syntax on owc! you have to either leave it uninitialized and use memcpy or something, or provide all fields explicitly

#

or maybe {0} works?

#

oh thank god

#

oh and designated initializers only support constant values

mortal yoke
calm latch
#

constexpr?

mortal yoke
#

now I know to avoid openwatcom at all costs at least KEKW (though I didn't even know about it to begin with before this garbage rdos stuff)

fiery turtle
#

There go some uacpi points

calm latch
#

You can probably rewrite it without using them oof

#

Is this that difficult to implement in compiler?

mortal yoke
#

no

fiery turtle
gentle peak
#

yeah i'm doing that

#

at least you do seem to be able to declare variables at the top of blocks, not just at the top of functions

#

which is a relief

fiery turtle
#

Yeah I do

#

Does it support that at least?

gentle peak
#

seems so yeah

#

also seems like __VA_ARGS__ is broken? this triggers source/event.c(437): Error! E1030: Cannot take the address of an rvalue c uacpi_trace( "executing GPE(%02X) handler %.4s\n", event->idx, uacpi_namespace_node_name(event->aml_handler).text );

fiery turtle
#

Field of an rvalue struct

#

Maybe that doesn't work

gentle peak
#

yea the manually expanded version doesn't work so it's not va args thankfully

#

fixed when replaced by c uacpi_object_name name = uacpi_namespace_node_name(event->aml_handler); uacpi_trace( "executing GPE(%02X) handler %.4s\n", event->idx, name.text );

fiery turtle
#

Oh well

fiery turtle
gentle peak
#

well files where i used it compiled fine so

#

maybe it only works with -zastd=c99?

#

oh great the syntax (struct foo){} just doesn't work at all

#

so in some places i have to replace it with a memset

calm latch
#

0?

gentle peak
#

no, it's the (struct foo){} part

#

aka initializers as random expressions don't work

#

things like struct foo x = {0} work fine

#

but things like random.thing.foo = (struct foo){0} don't

fiery turtle
gentle peak
#

ah yeah ty

#

i don't think watcom supports atomics at all

#

i'll probably have to use inline asm for those but for now i'll just make them assume single threaded no interrupts

fiery turtle
#

Yeah just do that

gentle peak
#

oh ffs apparently owc doesn't support offsetof(type, foo.bar)

#

you have to do offsetof(type, foo) + offsetof(<type of foo>, bar)

fiery turtle
#

What the hell

gentle peak
#

and i don't see anything like typeof

fiery turtle
#

I don't think I use that in uacpi

#

Since msvc didn't have that as well until recently

gentle peak
#

resources.c:882

#

NATIVE_F(gpio_connection, interrupt.triggering)

#

and a bunch more interrupt. stuff right below that

jaunty fox
#

there is __typeof seemingly

gentle peak
#

oh? i couldn't find it with a simple ctrl+f in the user manual

dire owl
#

Yeah, it's more the segmented memory model stuff.

jaunty fox
#

i sometimes just search the repo

dire owl
#

If you want compact, medium, large, or huge, what are your options?

fiery turtle
gentle peak
jaunty fox
#

they appear to have the nested offsetof too

gentle peak
#

but i was wrong about what the issue was

dire owl
gentle peak
#

apparently interrupt is a fucking keyword in owc

#

or a predefined macro for a keyword or something

fiery turtle
#

I don't think I use type of at all otherwise it wouldn't compile under msvc

gentle peak
#

yeah it's not typeof

dire owl
fiery turtle
dire owl
#

Oh, there's also Digital Mars.

gentle peak
#

guess i know the reason for this change now

fiery turtle
#

Lmao

dire owl
gentle peak
#

you'd think they'd prefix it with __

#

and not have the alias by default

fiery turtle
#

Imagine reserving arbitrary words as keywords

dire owl
#

nah, they didn't give a fuck about the standard

#

some of those conventions are pre-standard afaik

calm latch
#

wait, will the watcom support be official?

dire owl
#

oh god

#

this RDOS guy seems like the actual Neanderthal

#

stuck in 80s PC programming

tired temple
#

You guys are such a gossip. 😁 have written whole novel about rdos today here.

dire owl
#

he seems to have the mindset of a ~1992 DOS programmer

calm latch
#

maybe this server is too advanced halfmemeleft

jaunty fox
#

he has lofty ambitions and sometimes makes snide comments about uACPI not being real "portable c" but in fact you cannot implement uACPI in "portable c" - it needs must be in "really existing C" because true "portable c" is underpowered

calm latch
dire owl
jaunty fox
#

and while it's a bit easier now with c11 atomics and such it's truly impossible in c90

dire owl
#

and is seemingly taken seriously by psychiatrists

gentle peak
#

wait it actually fucking compiled?

dire owl
gentle peak
#

i didn't even have to modify the opcode tables the guy was having trouble with

dire owl
#

also idr if he was neurodivergent himself

gentle peak
#

well i still have to link it

#

how does linking work with openwatcom

#

why is the help bnf

fiery turtle
fiery turtle
dire owl
#

oh, he does seem to have a MSc

fiery turtle
fiery turtle
gentle peak
#

i'm gonna have dinner then figure out linking

fiery turtle
#

Linking is gonna be fun

#

Btw any way to add watcom builds to CI?

#

So it doesn't bitrot

frank canopy
#

wait you actually got it to compile? damn

gentle peak
fiery turtle
#

Not bad

gentle peak
#

need to figure out where i'm supposed to get mem* from

#

oh there's a compiler driver i missed

#

that's useful

#

much better than using the compiler directly

#

still doesn't link anything providing memcpy and friends by default

#

got it! everything except uacpi kernel api resolves

#

test_runner uses new c++ features that watcom doesn't support unfortunately

#

it complains about <filesystem>, <string_view>, <variant>, <span>

#

and some syntax errors but i hope those are symptoms of those missing headers

fiery turtle
#

Yeah test runner uses cutting edge c++ unfortunately lol

#

Just for fun for the most part

#

He left a new comment complaining that it doesn't build still

#

While monkuous gets it to build in an hour

gentle peak
fiery turtle
#

Yeah definitely

gentle peak
#

Wait does openwatcom not support fucking enum classes

fiery turtle
#

Bro

gentle peak
#

right and it doesn't have attributes either

#

of course

#

and no unordered_map either

#

great!

fiery turtle
#

what the fuck lol

#

unordered map is like

gentle peak
#

the in-source docs say since c++11

fiery turtle
#

c++11

#

yeah

gentle peak
#

it also doesn't support auto vars

fiery turtle
#

💀

gentle peak
#

Error! E029: col(38) symbol 'nullptr' has not been declared wtf

fiery turtle
#

not even nullptr lol

slim panther
#

????? that's a keyword

fiery turtle
#

the building block of c++

#

lmfao

gentle peak
#

at least cmake supports owc out of the box

fiery turtle
#

damn

gentle peak
#

apparently owc's std::map doesn't have .at(key) or [key]??? cppreference doesn't list any "since ..." for these

fiery turtle
#

how the fuck are u supposed to use it then lol

gentle peak
#

Error! E715: col(30) member 'at' has not been declared in 'std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std:

frank canopy
#

c++ type moment

#

fuckin absurd type name

gentle peak
#

oh wait it does have map[key]

#

crisis averted

fiery turtle
#

note that it has slightly different semantics

#

.at throws

#

[] silently makes a new element

gentle peak
#

Fuck

fiery turtle
#

lol

frank canopy
#

lmao

gentle peak
#

i'll do map.find(...)->second

#

cppreference says it's equivalent and it's available

fiery turtle
#

find works yeah

#

just make sure its not .end()

gentle peak
#

have to replace the auto there but

fiery turtle
#

u mean == .end()

gentle peak
#

oh right yeah

fiery turtle
#

yeah looks correct

gentle peak
#

actually how the fuck am i supposed to replace auto there

jaunty fox
fiery turtle
#

std::decltype(m_parsed_args)::const_iterator?

#

or std::map<...>::const_iterator

gentle peak
#

clangd doesn't even accept that

gentle peak
#

my c++ args are managed by cmake

#

the cmakelists.txt has set(CMAKE_CXX_STANDARD 20) so it should have it

gentle peak
fiery turtle
gentle peak
#

it does need the ugly std::map<..., std::vector<...> > space between the closing brackets

fiery turtle
#

loool

jaunty fox
#

perhaps cmake is not doing it right, or i suppose you can convert uacpi to c++03

gentle peak
#

and yeah decltype isn't supported by owc

fiery turtle
#

c++11 too

jaunty fox
fiery turtle
#

huh

#

@gentle peak can u try make VERBOSE=1 to see what args its passing?

gentle peak
#

i'll check out the generated makefile ig?

fiery turtle
#

there's VERBOSE thing u can use

gentle peak
#

cmake doesn't generate that for watcom wmake apparently

fiery turtle
#

what the hell is wmake lol

gentle peak
#

the make included with owc

fiery turtle
#

💀

gentle peak
#

and yeah cmake --build . -v makes no difference

#

ok yeah i manually added -za0x and now nullptr is recognized

#

decltype doesn't work still

fiery turtle
#

interesting

gentle peak
#

Error! E938: col(23) 'auto' is no longer a storage specifier in C++11 mode what do you mean "no longer" it didn't work in the first place

frank canopy
#

oh storage specifier i bet thats an issue

#

is that different from type?

fiery turtle
#

thats literally how c++ works

fiery turtle
#

auto means automatically cleaned up

#

its implicit

gentle peak
#
tests/runner/argparser.h(257): Error! E157: col(38) left expression must be integral
tests/runner/argparser.h(257): Note! N393: col(38) included from tests/runner/test_runner.cpp(8)
tests/runner/argparser.h(257): Note! N717: col(38) left operand type is 'std::ostream (lvalue)'
tests/runner/argparser.h(257): Note! N718: col(38) right operand type is 'std::basic_string<char,std::char_traits<char>,std::allocator<char>> const (lvalue)'```
what the fuck
fiery turtle
#

on the stack variables for example

frank canopy
#

yeah so its disallowing auto as a type because auto is a storage specifier ig

gentle peak
#

you can't do stream << std::string("whatever");??

gentle peak
fiery turtle
#

lol

fiery turtle
#

it means automatically deduce the type

frank canopy
#

well sorta the c# rules for overloading say the right operand must be numeric iirc

#

not the left

gentle peak
#

oh for fucks sake does not support foreach

fiery turtle
#

thats also c++11 probably

gentle peak
#

doesn't support this init syntax either

fiery turtle
#

of course

frank canopy
#

lmao

fiery turtle
#

yeah pre c++11

calm latch
#

like it can't be hard to implement

gentle peak
calm latch
gentle peak
fiery turtle
#

automatic storage specifier

#

it does nothing basically

vast kestrel
#

Saying "C++" and "can't be hard to implement" is a recipe for disaster

fiery turtle
#

it just exists as the opposite of static

calm latch
#

also just auto is int trl

gentle peak
#

i don't know c++ what am i supposed to do here

#

this was auto

calm latch
fiery turtle
vast kestrel