1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00
Achilleas Anagnostopoulos c09798622b acpi: provide more robust implementation for parsing AML method bodies
The previous implementation used brute-force approach where the parser
made an initial pass scanning the AML bytestream and looking for method
declaration opcodes. It then parsed out the method name and arg count
and populated a map which was used to detect the number of arguments to
be parsed upon encountering a method invocation. This approach proved to
be error-prone and would lead to an incorrect parse tree in the
following ASL example:

  Method (FOOF, 1, NotSerialized)
  {
    Return ("bar")
  }

  Method (TST0, 0, NotSerialized)
  {
    FOOF(0)
    \_SB.FOOF(2, 3)
  }

  Scope(\_SB){
    // Another FOOF method in \_SB which takes a different arg count
    Method (FOOF, 2, NotSerialized)
    {
      Return ("something")
    }
  }

In the above example the parser would correctly parse the first FOOF
call in TST0 but fail to parse the second invocation since the method
name contains a scope. The second invocation would actually yield the
following incorrect entity list (arguments appear as sibling entities):

Ref(\_SB.FOOF), Const(2), Const(3)

The new approach gets rid of the brute-force method and instead modifies
the initial parse of the tree not to parse the entities in the AML
method bodies but to instead track the start and end offset in the
AML stream for the body contents. In the second pass (where the parser
normally resolves symbol references), the parser can properly parse the
contents of method bodies since the entire AML tree is now known and the
parser can use the regular scope lookup rules to find the correct method
declaration for the invocation and figure out the argument count it
needs to parse.
2018-01-06 10:44:19 +00:00
2017-07-06 06:13:13 +01:00
2017-09-18 09:45:41 +02:00
2017-08-08 23:42:25 +01:00
2017-08-08 23:57:54 +01:00
2017-03-23 06:50:13 +00:00
2017-08-08 23:34:24 +01:00

gopher-os

Build Status codecov Go Report Card License: MIT

The goal of this project is to build a 64-bit POSIX-compliant tick-less kernel with a Linux-compatible syscall implementation using Go.

This project is not about building yet another OS but rather exists to serve as proof that Go is indeed a suitable tool for writing low level code that runs at ring-0.

Note: This project is still in the early stages of development and is not yet in a usable state. In fact, if you build the ISO and boot it, the kernel will eventually panic with a Kmain returned error.

To find out more about the current project status and feature roadmap take a look at the status page.

Building and running gopher-os

TLDR version: make run-qemu or make run-vbox.

A detailed guide about building, running and debugging gopher-os on Linux/OSX as well as the list of supported boot command line options are available here.

How does it look?

80x25 (stadard 8x16 font): 80x25 with standard 8x16 font

1024x768 (10x18 font): 1024x768x32 with 10x18 font

2560x1600 (14x28 font): retina mode (2560x1600) with 14x28 font

Contributing

gopher-os is Open Source. Feel free to contribute! To get started take a look at the contributing guide.

Licence

gopher-os is distributed under the MIT license.

Description
A proof of concept OS kernel written in Go
Readme 773 KiB
Languages
Go 84.9%
ASL 10.2%
Assembly 4%
Makefile 0.9%