1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

50 Commits

Author SHA1 Message Date
Achilleas Anagnostopoulos
6f39b2af55 acpi: add scaffolding code for the AML method to OS VM bytecode compiler
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.
2017-12-30 07:33:20 +00:00
Achilleas Anagnostopoulos
3cdc10be24 acpi: define structs for holding the AML VM bytecode 2017-12-29 16:00:37 +00:00
Achilleas Anagnostopoulos
3a3b980eaa acpi: implement LazyRefResolver for entities that use lazy symbol references 2017-12-29 15:58:57 +00:00
Achilleas Anagnostopoulos
b278ce626b acpi: update AML parser to use the new entities 2017-12-29 15:58:57 +00:00
Achilleas Anagnostopoulos
12ad177381 acpi: move stream reader implementation into parser pkg 2017-12-29 15:58:56 +00:00
Achilleas Anagnostopoulos
782778cbea acpi: move parser opcode table into the parser pkg 2017-12-29 15:58:56 +00:00
Achilleas Anagnostopoulos
bd14d52b60 acpi: move entity visitor code to the entity pkg 2017-12-29 15:58:56 +00:00
Achilleas Anagnostopoulos
89882545f2 acpi: refactor scope lookup code and move it into the entity pkg 2017-12-29 15:58:56 +00:00
Achilleas Anagnostopoulos
44896b1680 acpi: move entities to the entity pkg, export them and add missing entities
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)
2017-12-29 15:58:51 +00:00
Achilleas Anagnostopoulos
89923eb481 acpi: move AML opcode definitions into the entity pkg 2017-12-17 21:26:39 +00:00
Achilleas Anagnostopoulos
692155b44b acpi: refine post-parse entity processing rules
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
2017-12-03 10:54:21 +00:00
Achilleas Anagnostopoulos
70c798f40a acpi: add pre-process step to capture arg counts for all function decls
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.
2017-12-03 10:21:40 +00:00
Achilleas Anagnostopoulos
7983394390 acpi: implement resolver interface for methodInvocation entities 2017-12-03 10:17:41 +00:00
Achilleas Anagnostopoulos
0a05164703 acpi: change scopeVisit to visit entities in a visited entity's arglist 2017-12-01 08:01:17 +00:00
Achilleas Anagnostopoulos
d9bd6f104e acpi: fix linter warnings for unhandled errors in AML parser 2017-11-27 07:15:11 +00:00
Achilleas Anagnostopoulos
61a033e2ad acpi: tweak parser and add tests for parser errors 2017-09-30 16:40:53 +01:00
Achilleas Anagnostopoulos
d020045887 acpi: tag entities with the handle of the table that defines them
This allows us to implement the Unload opcode which given a handle,
removes all entities that are tagged by it.
2017-09-30 16:36:26 +01:00
Achilleas Anagnostopoulos
2a84c75d8e acpi: implement AML parser for all AML opcodes in the ACPI 6.2 spec 2017-09-30 16:36:22 +01:00
Achilleas Anagnostopoulos
4dd7c0b077 acpi: implement functions for working with AML scopes
The scope resolution rules are specified in page 252 of the ACPI 6.2
spec.
2017-09-30 16:25:34 +01:00
Achilleas Anagnostopoulos
130e11507c acpi: define structs for basic AML entities 2017-09-30 16:25:29 +01:00
Achilleas Anagnostopoulos
5171822ba6 acpi: define mappings and helpers for AML opcodes 2017-09-30 14:08:55 +01:00
Achilleas Anagnostopoulos
93125caa8a acpi: implement memory-based reader for AML byte-code streams 2017-09-30 13:45:30 +01:00
Achilleas Anagnostopoulos
78d5fac550 acpi: probe for RSDT and enumerate/map other ACPI tables (inc. DSDT) 2017-08-28 07:28:31 +01:00
Achilleas Anagnostopoulos
49dfc5c9de acpi: define structs for standard header and various ACPI tables 2017-08-28 07:28:27 +01:00
Achilleas Anagnostopoulos
d17298acaa vga_text: Map EGA color indices to correct DAC entries for the VGA hw 2017-08-19 10:33:38 +01:00
Achilleas Anagnostopoulos
1ef27b3226 Update device drivers to use the device.RegisterDriver 2017-07-18 08:26:56 +01:00
Achilleas Anagnostopoulos
d180348116 Define DriverInfo and registration helpers 2017-07-18 08:23:43 +01:00
Achilleas Anagnostopoulos
eaeae85600 Implement LogoSetter interface for vesa fb driver 2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
c7fc9f0ac9 Add gopher logos (64, 96 and 128 pixels tall)
The gopher images were obtained from: https://github.com/golang-samples/gopher-vector
2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
cb7ae66556 Define LogoSetter interface and BestFit selection helper 2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
a5c6828fc2 Create tool for converting images to compatible console logo files
The tool processes an image and converts it to a logo.Image struct which
can be assigned to a logo-capable console.
2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
d71c4c1eea Add 8x16, 10x18 and 14x28 fonts based on the terminus font 2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
72feb11acb Document exported symbols 2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
f4f3745073 Extend vesa driver support to 15 and 16bpp framebuffers 2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
f02c767257 Extend vesa driver to support 24 and 32 bpp 2017-07-13 23:35:20 +01:00
Achilleas Anagnostopoulos
13ba4bbbed Implement vesa console driver for 8bpp framebuffers 2017-07-13 23:35:10 +01:00
Achilleas Anagnostopoulos
cbf0c82702 Change Dimensions() signature to support querying for characters or pixels 2017-07-13 22:06:50 +01:00
Achilleas Anagnostopoulos
952d0bf4a5 Define FontSetter interface, the Font type and helper methods
The helper methods provide support for selecting the best-fit font for
the console dimensions and for looking up a font by name.
2017-07-13 22:06:50 +01:00
Achilleas Anagnostopoulos
13ef4cd08d Map physical address of the vga text console framebuffer in DriverInit
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.
2017-07-08 22:18:24 +01:00
Achilleas Anagnostopoulos
3485523cdc Update the Driver.DriverInit method signature to accept an io.Writer
Drivers can use the writer as an argument to kfmt.Fprintf to log
additional output during their initialization.
2017-07-08 22:09:19 +01:00
Achilleas Anagnostopoulos
b1084c1362 Fix broken unit tests 2017-07-08 13:02:15 +01:00
Achilleas Anagnostopoulos
ffb8f86a9c Each driver should manually register a probe function for use by hal
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)
2017-07-08 12:26:40 +01:00
Achilleas Anagnostopoulos
4845f7a4ca Use uint32 instead of uint16 for TTY coordinates 2017-07-08 12:26:40 +01:00
Achilleas Anagnostopoulos
fd3ca91138 Use uint32 for console coordinates and fix dimension bug 2017-07-08 12:26:40 +01:00
Achilleas Anagnostopoulos
562fae2028 Detect hw and wire active console and TTY 2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
0f3af2e78d Refactor VT implementation
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.
2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
78c87ab165 Cleanup and revise TTY interface 2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
286b8d9c71 Rename Ega console to VgaTextConsole and implement the updated interface 2017-07-07 21:36:50 +01:00
Achilleas Anagnostopoulos
b72725742a Revise console interface 2017-07-07 06:25:24 +01:00
Achilleas Anagnostopoulos
425ad7319b Define driver interface
This interface must be implemented by all device drivers in the driver
sub-packages.
2017-07-07 06:25:24 +01:00