From 51bd94656599c733c1d6a7cdbe6ebc572b92d849 Mon Sep 17 00:00:00 2001 From: able Date: Wed, 13 Sep 2023 03:10:29 -0500 Subject: [PATCH] Catch 22 driver hell --- Catch-22; Why you and I can't use ableOS.md | 53 +++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Catch-22; Why you and I can't use ableOS.md diff --git a/Catch-22; Why you and I can't use ableOS.md b/Catch-22; Why you and I can't use ableOS.md new file mode 100644 index 0000000..738801a --- /dev/null +++ b/Catch-22; Why you and I can't use ableOS.md @@ -0,0 +1,53 @@ +# Catch-22 +A Catch-22 is defined by [wikipedia](https://en.wikipedia.org/wiki/Catch-22_(logic)) as +`Catch-22s often result from rules, regulations, or procedures that an individual is subject to, but has no control over, because to fight the rule is to accept it.` + +The Catch-22 in the case of [AbleOS](https://git.ablecorp.us/AbleOS/AbleOS) is +`Drivers not being developed so nobody uses AbleOS so drivers are not developed` + +This is a loop that makes it hard to develop for AbleOS and to combat this a singular or small set of developers must toil endlessly to develop a small usable set of drivers to give the layperson something to test out and play around with. + +If people are willing to test and play and hopefully document how they break a system they might also be willing to contribute a couple hundred lines of code to improve or make the beginnings of a new driver. + +AbleOS has a small benefit of being a microkernel with only userspace drivers which push forward the general userspace application tooling as they improve leading to a generally better tooling for all programs. + + +For example `logging` in AbleOS will be identical between driver and application +providing one single simple logging api + +I will not be explaining step by step this API like I have done previously +```rust +use timestamp::TimeStamp; + +enum LogLevel{ + Error, + Warn, + Info, + Debug, + Trace, +} +@documentation["This logger is an application specific logger that would stream the logs to the system logger"] +struct Logger { + @documentation["This history is read+append by default to prevent overwriting previous logs"] + history: Vector<(LogLevel, TimeStamp, String)>, + enabled: bool, + + last_timestamp: TimeStamp, + + @documentation["Log to the history"] + @validator[time: Timestamp > last_timestamp] + log: function(log_level: LogLevel, time: TimeStamp, note: String) -> None; + + @documentation["Set the log level filter, which ignores levels below itself. To turn off logging use disable()"] + log_level: function(filter: LogLevel) -> None; + + @validator[enabled == false] + enable(None) -> None; + + @validator[enabled == true] + disable(None) -> None; +} +``` + +As a driver/app developer this will not change when you swap from one to the other which lowers the bar for writing portable code and that is a giant plus to make it easier for application developers to work on drivers as well. +