reorg sysdata

This commit is contained in:
able 2024-05-23 16:59:17 -05:00
parent bbe29d54ab
commit c20376464e
24 changed files with 127 additions and 145 deletions

View file

@ -0,0 +1 @@
The standard library for ableOS.

View file

@ -0,0 +1,29 @@
/*
Refer to the spec in "spec/Logging Service spec.md"
*/
log := fn(log_level: int, message: ^char, message_length: int): int {
return 0;
}
error := fn(message: ^char, message_length: int): int {
log(0, message, message_length)
}
warn := fn(message: ^char, message_length: int): int {
log(1, message, message_length)
}
info := fn(message: ^char, message_length: int): int {
log(2, message, message_length)
}
debug := fn(message: ^char, message_length: int): int {
log(3, message, message_length)
}
trace := fn(message: ^char, message_length: int): int {
log(4, message, message_length)
}

View file

@ -1,14 +0,0 @@
# Dev
Dev is a (currently) hypothetical tool meant to be used to ease development and compilation on ableOS.
## Usage
A `meta.toml` file must be in the project root. A `src` folder and a `lib` folder must exist.
Binaries should be put into a folder named `bin`.
```
bin/
lib/
src/
```
The folders `lib/` and `bin/` should both be left out of source tracking.

View file

@ -1,16 +0,0 @@
[package]
name = "dev"
authors = ["able"]
[dependants.libraries]
file_service = "0.0.1"
[dependants.binaries]
susc.version = "1.0.0"
[build.debug]
command = "susc src/main.hbl"
[run.debug]
depends = ["build.debug"]
command = "bin/main.hbf"

View file

@ -1,5 +0,0 @@
#include "lib/file_service.h"
int main() {
File fhand = file_open("meta.toml");
}

View file

@ -0,0 +1,4 @@
# DiskIO Driver
The purpose of this driver is to read and write disk sectors as simply as possible.
This will be done by first getting a 'boot count'.

View file

@ -0,0 +1,4 @@
main := fn(): int {
return 0;
}

View file

View file

@ -0,0 +1,11 @@
[package]
name = "dev"
authors = ["able"]
[dependants.libraries]
[dependants.binaries]
hblang.version = "1.0.0"
[build.debug]
command = "hblang libraries/stn/src/lib.hb src/main.hbl"

View file

@ -0,0 +1,7 @@
main := fn(): int {
loop {
}
return 0;
}

View file

@ -1,15 +0,0 @@
[package]
name = "fisp_test"
authors = ["able"]
[dependants.libraries]
[dependants.binaries]
# Refers to @FunkyEgg's lisp compiler for ableOS
fisp = ""
[build.debug]
command = "fisp src/main.fisp"
[run.debug]
depends = ["build.debug"]
command = "bin/main.hbf"

View file

@ -1 +0,0 @@
(log info "Hello World\n")

View file

@ -0,0 +1,2 @@
# KVStore
This is a small single process in memory key value store.

View file

@ -0,0 +1,37 @@
Message := struct {
msg_type: u8,
key: String,
value: String,
}
/*
# Message Type
0 => Set Key type
1 => Get Key
*/
recv_msg:= fn(): Message {
return Message.{
msg_type: 0,
key: "",
value: "",
}
}
main := fn(): int {
loop {
msg := recv_msg();
if msg.msg_type == 0 {
continue;
}
if msg.msg_type == 1 {
continue;
}
if 2 <= msg.msg_type {
error("Unexpected message type in the bagging area");
continue;
}
}
return 0;
}

View file

@ -0,0 +1,2 @@
# Serial Driver
This program is a small serial driver for the emulated arm device in QEMU.

View file

@ -0,0 +1,7 @@
main:= fn(): int {
arch := "Arm";
ADDR := 0x09000000;
loop { }
return 0;
}

View file

@ -1,16 +0,0 @@
[package]
name = "htasm_test"
authors = ["able"]
# Similar to cargo libraries
[dependants.libraries]
# Similar to cargo install
[dependants.binaries]
htasm = ""
[build.debug]
command = "htasm src/main.S"
[run.debug]
depends = ["build.debug"]
command = "bin/main.hbf"

View file

@ -1,10 +0,0 @@
jmp start
start:
li64 r1, 3
li64 r2, 1
lra16 r3, r0, hello_string
li64 r4, 0x14
string
.db "Hello, world!\n"

View file

@ -17,29 +17,32 @@ resolution = "1024x768x24"
[boot.limine.ableos.modules] [boot.limine.ableos.modules]
[boot.limine.ableos.modules.failure] # [boot.limine.ableos.modules.failure]
path = "boot:///failure.hbf" # path = "boot:///failure.hbf"
[boot.limine.ableos.modules.ecall] # [boot.limine.ableos.modules.ecall]
path = "boot:///ecall.hbf" # path = "boot:///ecall.hbf"
[boot.limine.ableos.modules.sds_test] # [boot.limine.ableos.modules.sds_test]
path = "boot:///sds_test.hbf" # path = "boot:///sds_test.hbf"
[boot.limine.ableos.modules.main] # [boot.limine.ableos.modules.main]
path = "boot:///main.hbf" # path = "boot:///main.hbf"
[boot.limine.ableos.modules.keyboard_driver] # [boot.limine.ableos.modules.keyboard_driver]
path = "boot:///keyboard_driver.hbf" # path = "boot:///keyboard_driver.hbf"
cmd_line = "arch=${ARCH}" # cmd_line = "arch=${ARCH}"
[boot.limine.ableos.modules.vfs_test] # [boot.limine.ableos.modules.vfs_test]
path = "boot:///vfs_test.hbf" # path = "boot:///vfs_test.hbf"
[boot.limine.ableos.modules.limine_framebuffer_driver] [boot.limine.ableos.modules.bin]
path = "boot:///limine_framebuffer_driver.hbf" path = "boot:///bin.hbf"
cmd_line = "height=10 width=10 arch=${ARCH}"
[boot.limine.ableos.modules.serial_driver] # [boot.limine.ableos.modules.limine_framebuffer_driver]
path = "boot:///serial_driver.hbf" # path = "boot:///limine_framebuffer_driver.hbf"
cmd_line = "arch=${ARCH}" # cmd_line = "height=10 width=10 arch=${ARCH}"
# [boot.limine.ableos.modules.serial_driver]
# path = "boot:///serial_driver.hbf"
# cmd_line = "arch=${ARCH}"

View file

@ -1,3 +0,0 @@
li64 (r1, 2);
eca ();
tx ();

View file

@ -1 +0,0 @@
un();

View file

@ -1,33 +0,0 @@
import "sysdata/test-programs/hblib/std" as std;
fn main(){
std::Error(":o) h0nk");
std::Warn("Your mom is a worm!");
std::Info("Hello, world!");
// std::Debug("XYZ");
// std::Trace("Trace Deez");
// let ADDR = 0xFFFF_FFFF_8100_0000;
// let ADDR_PLUS_ONE = ADDR + 1;
// let ADDR_PLUS_NINE = ADDR + 9;
// li64(r25, 1);
// st(r25, r0, ADDR, 1);
// li64(r25, 0);
// st(r25, r0, ADDR_PLUS_ONE, 8);
// li64(r25, 17);
// st(r25, r0, ADDR_PLUS_NINE, 1);
// li64(r1, 3);
// li64(r2, 2);
// li64(r3, ADDR);
// li64(r4, 0);
eca();
tx();
}
main();

View file

@ -1,11 +0,0 @@
/// Act as a shim of a virtual file system that recieves one message from buffer 2
import "sysdata/test-programs/hblib/std" as std;
fn main() {
std::ipc_recv(2);
un();
}
main();
tx();