forked from AbleOS/ableos
reorg sysdata
This commit is contained in:
parent
bbe29d54ab
commit
c20376464e
1
sysdata/libraries/stn/README.md
Normal file
1
sysdata/libraries/stn/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
The standard library for ableOS.
|
29
sysdata/libraries/stn/src/lib.hb
Normal file
29
sysdata/libraries/stn/src/lib.hb
Normal 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)
|
||||||
|
}
|
|
@ -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.
|
|
|
@ -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"
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include "lib/file_service.h"
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
File fhand = file_open("meta.toml");
|
|
||||||
}
|
|
4
sysdata/programs/diskio_driver/README.md
Normal file
4
sysdata/programs/diskio_driver/README.md
Normal 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'.
|
4
sysdata/programs/diskio_driver/src/main.hb
Normal file
4
sysdata/programs/diskio_driver/src/main.hb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
main := fn(): int {
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
0
sysdata/programs/fb_driver/README.md
Normal file
0
sysdata/programs/fb_driver/README.md
Normal file
11
sysdata/programs/fb_driver/meta.toml
Normal file
11
sysdata/programs/fb_driver/meta.toml
Normal 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"
|
7
sysdata/programs/fb_driver/src/main.hb
Normal file
7
sysdata/programs/fb_driver/src/main.hb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
main := fn(): int {
|
||||||
|
loop {
|
||||||
|
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -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"
|
|
|
@ -1 +0,0 @@
|
||||||
(log info "Hello World\n")
|
|
2
sysdata/programs/kvstore/README.md
Normal file
2
sysdata/programs/kvstore/README.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# KVStore
|
||||||
|
This is a small single process in memory key value store.
|
37
sysdata/programs/kvstore/src/main.hb
Normal file
37
sysdata/programs/kvstore/src/main.hb
Normal 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;
|
||||||
|
}
|
2
sysdata/programs/serial_driver/README.md
Normal file
2
sysdata/programs/serial_driver/README.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Serial Driver
|
||||||
|
This program is a small serial driver for the emulated arm device in QEMU.
|
7
sysdata/programs/serial_driver/src/main.hb
Normal file
7
sysdata/programs/serial_driver/src/main.hb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
main:= fn(): int {
|
||||||
|
arch := "Arm";
|
||||||
|
ADDR := 0x09000000;
|
||||||
|
loop { }
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -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"
|
|
|
@ -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"
|
|
|
@ -11,7 +11,7 @@ The memory service uses the first byte in the message to identify the request ty
|
||||||
<!-- Currently this does not deallocate -->
|
<!-- Currently this does not deallocate -->
|
||||||
[U8] -> 1
|
[U8] -> 1
|
||||||
[U8] -> Page count
|
[U8] -> Page count
|
||||||
[U64] -> ptr to dealloc from
|
[U64] -> ptr to dealloc from
|
||||||
|
|
||||||
## Map Device Into Memory
|
## Map Device Into Memory
|
||||||
Typically only used for simple drivers such as vga.
|
Typically only used for simple drivers such as vga.
|
||||||
|
|
|
@ -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}"
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
li64 (r1, 2);
|
|
||||||
eca ();
|
|
||||||
tx ();
|
|
|
@ -1 +0,0 @@
|
||||||
un();
|
|
|
@ -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();
|
|
|
@ -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();
|
|
Loading…
Reference in a new issue