#Eklatos
1 messages ยท Page 1 of 1 (latest)
But you do at least have a scheduler, right
Because you said the kernel is not preemptible
(Big L ngl)
wonder what's up with the aml parser
which
huh intereting yet another aml interpreter impl
i wonder what this does
oh damn its also recursive
well if it works it works
a lot of duplication as expected if u dont do microcode
is it any good?
anyways props for doing it yourself
from a quick look at it
i dont wanna offend anyone lol
I think you saying that is more offensive to one than just saying what you saw wrong lmao
yeah props for making your own
a cool thing about it is it supports "disassembly" at execution time like NT
aka it prints what its executing
idk about how it handles references, or implicit casts, or mutability, or copy object etc
also i dont think it supports Load/LoadTable
but being recursive is probably the biggest gripe i could have with any aml interpreter
Yes, it's a really basic round robin scheduler with priority-ordered threads which can be stole from other cpus
why not make the kernel preemptible?
there's no way you have kernel design flaws so big that prevent that (without a rewrite of the kernel)
or wait it doesnt support copyobject at all i think
my entire dsdt doesn't seem to use CopyObject
The aml parser is.... well, it doesn't interpret aml for now (can't execute any method), and I don't really know for now how to do it.
It was just a test to learn about aml that has grown a little bit too far
ohh makes sense
its rather rare, but out of 400 blobs that i have there are 1055 instances of CopyObject
how you do it is by not doing it, unless you:
- want to serve the community by making a good one (already taken by infy)
- are a masochist, and don't mind your kernel not working on a large % of devices
the way i do calls is I have call_frame structs, where i just push a new one when a call happens
well and Load/LoadTable are also call frames
I think it was meant to make names "canonical" (always 4 chars with leading underscores)
ah
and e.g. for ToStringOp u do
static int parse_tostringop(struct aml_state *state)
{
int prev_inline = 0;
if (state->flags & AML_STATE_F_PRINT)
inline_push(state, "ToString", &prev_inline);
if (parse_termarg(state)) /* TermArg */
return 1;
if (state->flags & AML_STATE_F_PRINT)
inline_sep(state);
if (parse_termarg(state)) /* LengthArg */
return 1;
if (state->flags & AML_STATE_F_PRINT)
inline_sep(state);
if (parse_target(state))
return 1;
if (state->flags & AML_STATE_F_PRINT)
inline_pop(state, prev_inline);
return 0;
}
So it's recursive and a lot of code duplication
Whereas I just have it "microcoded" like this:
UACPI_OP(
ToStringOp, 0x9C,
{
UACPI_PARSE_OP_TERM_ARG_UNWRAP_INTERNAL,
UACPI_PARSE_OP_TYPECHECK, UACPI_OBJECT_BUFFER,
UACPI_PARSE_OP_OPERAND,
UACPI_PARSE_OP_TARGET,
UACPI_PARSE_OP_OBJECT_ALLOC_TYPED, UACPI_OBJECT_STRING,
UACPI_PARSE_OP_INVOKE_HANDLER,
UACPI_PARSE_OP_STORE_TO_TARGET, 2,
UACPI_PARSE_OP_OBJECT_TRANSFER_TO_PREV,
},
UACPI_OP_PROPERTY_TERM_ARG
)
ngl microcode in software is pretty cool
Tbh, if the objective was to make it run on a large % of devices, I would not have code anything and i'd be using linux ๐
fair
ngl i dont understand this attitude
you're making an os and u dont want it to run on a lot of devices
your drivers will likely fail on countless devices
because of hardware quirks
so why make a kernel?
(e.g., ahci init from a full reset is pretty damn weird)
and with people in this community a lot of them are willing to test your stuff so u can get a huge coverage this way
i had my stuff tested on like probably a 100 computers at this point
(and I was the first three)
I want it to run on all the devices I own, but "a large % of devices" requires so much time / hardware... my days are 24 hours long, I have to choose what I want to learn
L, my days are 48 hours long
it's not like every device requires a separate workaround
u solve issues as they come in
plus u can look at the linux quirk handling for the respective device to be ahead of that
Yes, this is how the aml parser has grown (some real hardware I own had.... weird tables)
what was weird about them?
note that firmware devs base their AML off of windows' implementation
and less so the spec
cuz they want their shit to work on windows
yeah the spec is more of an ideal world that will never exist
I'm not even writing an AML interpreter (using uACPI)
and have found that out trying to implement D states
From what I remember, it had tons of aliases with aliases not resolvable a parse time, and objects referenced in dsdt as another type of what they were defined in ssdt
and wake-from-suspend
if u give me a dump of the tables i could take a look, would be fun
and i could add them to my test suite
specifically, it tells me I should put a device in D2 for it to be able to wake me in _S3
btw if u want to keep developing your aml interpreter:
- if u port it to userspace i have a huge test suite u can reuse
- also about 350 executable real hw blobs
- ask me anything if u have any questions
the object to put said device in D2 does not exist
Maybe true for consumer hardware, but not always for servers / professionnal equipments
server aml is tested against more kernels yeah
Yeah, making it userland is something that felt necessary
I'll look at your tests in uACPI, thanks ๐
(And i'll try to get you dumps of the tables I refered to previously)
I'll look at your tests in uACPI, thanks ๐
it's just./run_tests.py --runner <your-runner>and from there it will give u a blob file, and the expected result after executing \MAIN