#Eklatos

1 messages ยท Page 1 of 1 (latest)

livid oyster
#

Damn nice

#

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

buoyant fog
buoyant fog
#

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

livid oyster
buoyant fog
#

anyways props for doing it yourself

livid oyster
#

from a quick look at it

buoyant fog
#

i dont wanna offend anyone lol

livid oyster
#

I think you saying that is more offensive to one than just saying what you saw wrong lmao

buoyant fog
#

like ok

#

there was clearly a lot of effort put into it

#

which props for doing that

livid oyster
#

yeah props for making your own

buoyant fog
#

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

hollow garnet
livid oyster
#

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)

buoyant fog
livid oyster
hollow garnet
#

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

buoyant fog
#

ohh makes sense

buoyant fog
livid oyster
buoyant fog
#

well and Load/LoadTable are also call frames

hollow garnet
buoyant fog
#

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                                   
)                                                                
livid oyster
#

ngl microcode in software is pretty cool

hollow garnet
livid oyster
#

fair

buoyant fog
#

ngl i dont understand this attitude

livid oyster
#

but then

#

why make a kernel

buoyant fog
#

you're making an os and u dont want it to run on a lot of devices

livid oyster
#

your drivers will likely fail on countless devices

#

because of hardware quirks

#

so why make a kernel?

livid oyster
buoyant fog
#

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

livid oyster
hollow garnet
#

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

livid oyster
#

L, my days are 48 hours long

buoyant fog
#

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

hollow garnet
#

Yes, this is how the aml parser has grown (some real hardware I own had.... weird tables)

buoyant fog
#

what was weird about them?

livid oyster
#

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

buoyant fog
#

yeah the spec is more of an ideal world that will never exist

livid oyster
#

I'm not even writing an AML interpreter (using uACPI)

#

and have found that out trying to implement D states

hollow garnet
#

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

livid oyster
buoyant fog
#

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

livid oyster
buoyant fog
#

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
livid oyster
hollow garnet
livid oyster
#

idk

#

@buoyant fog

buoyant fog
#

server aml is tested against more kernels yeah

hollow garnet
livid oyster
#

just found a forgotten Debug statement in my AML

#
Debug = "SIOS"```
buoyant fog
#

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