DOCS: adding in some docs in various spots and added a contrib guide

pull/4/head
able 2023-05-28 04:51:51 -05:00
parent 2dd2a71507
commit 430b17a27f
8 changed files with 54 additions and 4 deletions

4
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,4 @@
# Commit style
`[SCOPE]: [COMMENT]`
SCOPE is what you changed
COMMENT is why you changed that

View File

@ -13,6 +13,8 @@ TODO
- HBVM assembler (with IDL support)
- HBVM Lisp/s-expr Compiler (Also (with (IDL (support))))
- Documentation
# Community
[Discord](https://discord.gg/5TnJ8sa7)
# Compiling
1. `git submodule update --init`

View File

@ -1,3 +1,4 @@
// TODO: Turn apic keyboard interrupt into a standard ipc message
use {
log::trace,
spin::{Lazy, Mutex},
@ -15,7 +16,7 @@ pub unsafe fn init() {
#[repr(u8)]
enum Interrupt {
Timer = 32,
Keyboard = 33,
ApicErr = u8::MAX - 1,
Spurious = u8::MAX,
}
@ -46,7 +47,6 @@ static IDT: Lazy<InterruptDescriptorTable> = Lazy::new(|| {
idt[Interrupt::ApicErr as usize].set_handler_fn(apic_err);
idt[Interrupt::Spurious as usize].set_handler_fn(spurious);
idt[Interrupt::Timer as usize].set_handler_fn(timer);
idt
@ -64,6 +64,8 @@ extern "x86-interrupt" fn page_fault(
}
extern "x86-interrupt" fn timer(_isf: InterruptStackFrame) {
// TODO: Pause the running program then schedule the next program
unsafe { LAPIC.lock().end_of_interrupt() };
}

View File

@ -12,4 +12,26 @@ pub struct IpcBuffer {
buffer: BufferTypes,
}
pub struct Protocol {}
impl IpcBuffer {
pub fn validate_messages(&mut self) -> Result<(), IpcError> {
Ok(())
}
}
pub enum IpcError {
InvalidMessage,
}
/// TODO: define this, possibly as the binary form of the IDL
/// DEPEND: This depends on an IDL
pub struct Protocol {
// TODO: add in settings
// like `invalid_message_handler` with some options similar to
// `Deny` Drops the message
// `Allow` Allows invalid messages (This disables validators IPC side and relies on programs to handle invalid messages)
// `CustomFunct` a callback
// and `report_invalid_messages_to_sender`
// `True`
// `False`
// settings: PSettings,
}

View File

@ -1,3 +1,7 @@
//! An ipc message structured in a nice convenient way
use alloc::vec::Vec;
/// TODO: Extend this into a full structure
/// DEPEND: This depends on an IDL
pub type Message = Vec<u8>;

View File

@ -48,6 +48,17 @@ pub fn kmain(cmdline: &str, bootstrap: Option<&'static [u8]>) -> ! {
let mut sc = SERIAL_CONSOLE.lock();
loop {
// TODO: Implement an API for sending and recieving serial stuff
{
fn read_ipc_buff() {}
fn write_ipc_buff() {}
// TODO: read from the IPC buffer and push to serial stream
let _msg = read_ipc_buff();
for byte in 0..0 {
sc.send(byte);
}
}
let byte = sc.receive();
if byte == b'\r' {
sc.send(b'\n');

View File

@ -1,4 +1,6 @@
//! The ableOS kernel.
//! Named akern.
//! Akern is woefully undersupported at the moment but we are looking to add support improve hardware discovery and make our lives as kernel and operating system developers easier and better
#![no_std]
#![feature(
@ -14,7 +16,6 @@
#![deny(clippy::pedantic, warnings)]
#![allow(dead_code)]
#![test_runner(crate::test_runner)]
// #![deny(missing_docs)]
extern crate alloc;

View File

@ -1 +1,5 @@
//! A module for small utilities to be used kernel wide
//! Simple functions and constants
/// Used when tab `\t` in hardware is not known and we will default to two spaces
pub const TAB: &str = " ";