Compare commits

...

3 Commits

5 changed files with 38 additions and 12 deletions

View File

@ -1,5 +1,24 @@
# Releases
## AcadiaOS 0.1.1 (WIP)
### Denali
- AHCI Driver can use more than one command slot.
- Resets AHCI Controller on start.
- Uses IDENTIFY DEVICE to get sector size.
### Glacier
- Unit Testing setup for Host Machine
- Unit Tests for: Vector
- Added Iterators for: Vector, Array, ArrayView
- HashMap Move Semantics
### Yunq
- Moved message parsing/serialization to shared library.
## AcadiaOS 0.1.0 (2023-12-08)
This marks the first release of AcadiaOS! There is very little user functionality currently but a

View File

@ -31,7 +31,7 @@ glcr::Status {{interface.name}}Client::{{method.name}}(const {{method.request}}&
const uint32_t kSentinel = 0xBEEFDEAD;
buffer_.WriteAt<uint32_t>(0, kSentinel);
buffer_.WriteAt<uint64_t>(8, {{loop.index0}});
buffer_.WriteAt<uint64_t>(8, {{method.number}});
cap_buffer_.Reset();
{% if method.request == None %}

View File

@ -26,10 +26,10 @@ glcr::Status {{message.name}}::ParseFromBytes(const yunq::MessageView& message)
{%- if field.type == Type.CAPABILITY %}
{%- if not field.repeated %}
// Parse {{field.name}}.
ASSIGN_OR_RETURN({{field.name}}_, message.ReadCapability({{loop.index0}}));
ASSIGN_OR_RETURN({{field.name}}_, message.ReadCapability({{field.number}}));
{%- else %}
// Parse {{field.name}}.
ASSIGN_OR_RETURN({{field.name}}_, message.ReadRepeatedCapability({{loop.index0}}));
ASSIGN_OR_RETURN({{field.name}}_, message.ReadRepeatedCapability({{field.number}}));
{%- endif %}
{%- endif %}
{%- endfor %}
@ -43,10 +43,10 @@ glcr::Status {{message.name}}::ParseFromBytes(const yunq::MessageView& message,
{%- if field.type == Type.CAPABILITY %}
{%- if not field.repeated %}
// Parse {{field.name}}.
ASSIGN_OR_RETURN({{field.name}}_, message.ReadCapability({{loop.index0}}, caps));
ASSIGN_OR_RETURN({{field.name}}_, message.ReadCapability({{field.number}}, caps));
{%- else %}
// Parse {{field.name}}.
ASSIGN_OR_RETURN({{field.name}}_, message.ReadRepeatedCapability({{loop.index0}}, caps));
ASSIGN_OR_RETURN({{field.name}}_, message.ReadRepeatedCapability({{field.number}}, caps));
{%- endif %}
{%- endif %}
{%- endfor %}
@ -61,9 +61,9 @@ glcr::Status {{message.name}}::ParseFromBytesInternal(const yunq::MessageView& m
{%- if field.type != Type.CAPABILITY %}
{%- if not field.repeated %}
ASSIGN_OR_RETURN({{field.name}}_, message.ReadField<{{field.cpp_type()}}>({{loop.index0}}));
ASSIGN_OR_RETURN({{field.name}}_, message.ReadField<{{field.cpp_type()}}>({{field.number}}));
{%- else %}
ASSIGN_OR_RETURN({{field.name}}_, message.ReadRepeated<{{field.cpp_type()}}>({{loop.index0}}));
ASSIGN_OR_RETURN({{field.name}}_, message.ReadRepeated<{{field.cpp_type()}}>({{field.number}}));
{% endif %}
{%- endif %}
@ -88,17 +88,17 @@ uint64_t {{message.name}}::SerializeInternal(yunq::Serializer& serializer) const
{%- if not field.repeated %}
{%- if field.type != Type.CAPABILITY %}
serializer.WriteField<{{field.cpp_type()}}>({{loop.index0}}, {{field.name}}_);
serializer.WriteField<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
{%- else %}
serializer.WriteCapability({{loop.index0}}, {{field.name}}_);
serializer.WriteCapability({{field.number}}, {{field.name}}_);
{%- endif %}
{%- else %}
{%- if field.type != Type.CAPABILITY %}
serializer.WriteRepeated<{{field.cpp_type()}}>({{loop.index0}}, {{field.name}}_);
serializer.WriteRepeated<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
{%- else %}
serializer.WriteRepeatedCapability({{loop.index0}}, {{field.name}}_);
serializer.WriteRepeatedCapability({{field.number}}, {{field.name}}_);
{%- endif %}
{%- endif %}

View File

@ -17,6 +17,7 @@ class LexemeType(Enum):
ARROW = 7
SEMICOLON = 8
DOT = 9
EQUALS = 10
class Lexeme():
@ -214,8 +215,11 @@ class Parser():
methods: list[Method] = []
method_names = set()
next_method_number = 0
while self.peektype() != LexemeType.RIGHT_BRACE:
m = self.method()
m.number = next_method_number
next_method_number += 1
if m.name in method_names:
sys.exit("Method %s declared twice on %s" % (m.name, name))
method_names.add(m.name)
@ -266,8 +270,11 @@ class Parser():
fields: list[Field] = []
field_names = set()
next_field_num = 0
while self.peektype() != LexemeType.RIGHT_BRACE:
f = self.field()
f.number = next_field_num
next_field_num += 1
if f.name in field_names:
sys.exit("Field %s declared twice on %s" % (f.name, name))
field_names.add(f.name)

View File

@ -103,7 +103,7 @@ glcr::Status {{interface.name}}ServerBase::HandleRequest(const glcr::ByteBuffer&
switch(method_select) {
{%- for method in interface.methods %}
case {{loop.index0}}: {
case {{method.number}}: {
{% if method.request != None %}
{{method.request}} yunq_request;