This commit includes the required code to process all methods defined by
an AML entity hierarchy and invoke a function for converting each method
statement into a sequence of opcodes that can be executed by our
internal VM.
The mapping of the AML opcodes to the VM opcodes is facilitated via the
opcodeMap which allows us to apply a particular compiler function when
converting each AML opcode. Currently, this map is empty so all AML
opcodes are mapped to "nop" instructions.
This commit moves the AML entity definitions into the entity package and
makes them exportable so we can reference them from other packages.
In addition, the commit adds some missing entity structs that were
previously treated as generic entities (e.g. Processor, PowerResource
and ThermalZone).
Finally, this commit cleans the definitions and adds missing struct
attributes for the various field types (Field, IndexField, BankField)
This commit updates the post-parse step so that:
- the visitor not longer recurses into method bodies. Since code inside
methods may potentially generate dynamic/scoped entities or even use
conditional invocations (if CondRefOf(X) { X(...) }), symbol resolution
will be deferred to the AML interpreter.
- parent-child relationships between entities are checked and updated if
not properly specified
Since the ACPI standard allows forward function declarations this step
is required so we can properly parse the argument list for function
invocations. Contrary to other AML entities, method invocations do not
include any sort of pkgLength information so unless we track the
expected argument count for each function, our parser will not be able
to figure out where the argument list ends.
Currently, the kernel can write to 0xb80000 because this is part of the
initial identify mapping set up by the rt0 code. When we establish new
mappings for the kernel using its real VMA address then writes to the
framebuffer will cause a page fault unless we explicitly map it.
This commit removes the HWProbes() function from the console and tty
packages and replaces it with a global ProbeFuncs slice which is fetched
by the hal package when the hardware autodetection code runs.
Each driver should provide an init() function that appends a probe function
to the global ProbeFuncs slice.
This approach allows us to support conditional compilation of drivers in
the future (e.g. using build tags)
This commit refactors the old VT implementation to work with the revised
TTY interface and adds support for:
- scrollback
- terminal state handling
When a terminal becomes activated, it overwrites the attached console
contents with the contents of its viewport.