diff --git a/Cargo.lock b/Cargo.lock index 75c9a25c..d042e5c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -390,17 +390,17 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#2bc7a5c13f6ab2b3ee28f772f31eb3414fa2b25b" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#c133c2dbe71b3f1e1142bacef200775ae0c1d22d" [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/ableos/holey-bytes#2bc7a5c13f6ab2b3ee28f772f31eb3414fa2b25b" +source = "git+https://git.ablecorp.us/ableos/holey-bytes#c133c2dbe71b3f1e1142bacef200775ae0c1d22d" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#2bc7a5c13f6ab2b3ee28f772f31eb3414fa2b25b" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#c133c2dbe71b3f1e1142bacef200775ae0c1d22d" dependencies = [ "hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", ] @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#2bc7a5c13f6ab2b3ee28f772f31eb3414fa2b25b" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#c133c2dbe71b3f1e1142bacef200775ae0c1d22d" dependencies = [ "hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", ] @@ -416,7 +416,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/ableos/holey-bytes#2bc7a5c13f6ab2b3ee28f772f31eb3414fa2b25b" +source = "git+https://git.ablecorp.us/ableos/holey-bytes#c133c2dbe71b3f1e1142bacef200775ae0c1d22d" dependencies = [ "hbbytecode 0.1.0 (git+https://git.ablecorp.us/ableos/holey-bytes)", ] @@ -737,9 +737,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "33ea5043e58958ee56f3e15a90aee535795cd7dfd319846288d93c5b57d85cbe" [[package]] name = "paste" diff --git a/dev/src/idl/mod.rs b/dev/src/idl/mod.rs index 69b65238..212416c3 100644 --- a/dev/src/idl/mod.rs +++ b/dev/src/idl/mod.rs @@ -1,20 +1,84 @@ -use logos::Logos; +pub mod protocol; -#[derive(Logos, Debug, PartialEq)] +use std::io::Read; + +use { + logos::{Lexer, Logos}, + protocol::Protocol, +}; + +#[derive(Logos, Debug, PartialEq, Clone)] #[logos(skip r"[ \t\n\f]+")] // Ignore this regex pattern between tokens enum Token { // Tokens can be literal strings, of any length. #[token("protocol")] Protocol, - #[token(".")] - Period, + #[token("{")] + LBrace, - // Or regular expressions. - #[regex("[a-zA-Z]+")] - Text, + #[token("}")] + RBrace, + + #[token("(")] + LParen, + + #[token(")")] + RParen, + + #[token(":")] + Colon, + #[token(";")] + SemiColon, + + #[token(",")] + Comma, + + #[token("=")] + Equal, + + #[token("->")] + RArrow, + + #[regex("[a-zA-Z_]+", |lex|{lex.slice().to_string()})] + Text(String), + + #[regex("[1234567890]+", |lex|{lex.slice().parse::().unwrap()})] + Number(u64), + + #[regex(r"@[a-zA-Z_]+", |lex|{lex.slice().to_string()})] + Decorator(String), + + #[regex(r#"@[a-zA-Z_]+\([a-zA-Z,0-9=]+\)"#, |lex|{lex.slice().to_string()})] + DecoratorOption(String), } -pub fn main() { - let mut lex = Token::lexer("Create ridiculously fast Lexers."); +pub fn build_idl(name: String) { + let contents = open_protocol(name); + let lex = Token::lexer(&contents); + let mut tokens = vec![]; + for x in lex { + match x { + Ok(token) => { + println!("{:?}", token); + tokens.push(token); + } + Err(err) => println!("{:?}", err), + } + } + build(tokens); +} + +fn build(a: Vec) { + for toke in a { + println!("{:?}", toke); + } +} + +fn open_protocol(name: String) -> String { + let path = format!("sysdata/idl/{}/src/protocol.aidl", name); + let mut file = std::fs::File::open(path).unwrap(); + let mut contents = String::new(); + file.read_to_string(&mut contents).unwrap(); + contents } diff --git a/dev/src/idl/protocol.rs b/dev/src/idl/protocol.rs new file mode 100644 index 00000000..623a2f71 --- /dev/null +++ b/dev/src/idl/protocol.rs @@ -0,0 +1,17 @@ +pub enum ProtocolTypes { + Byte, +} + +pub struct Protocol {} +impl Protocol { + pub fn is_empty(&self) -> bool { + true + } + + pub fn validate_data(&self, data: Vec) -> bool { + if !data.is_empty() && self.is_empty() { + return false; + } + true + } +} diff --git a/dev/src/main.rs b/dev/src/main.rs index 8e27d722..42406436 100644 --- a/dev/src/main.rs +++ b/dev/src/main.rs @@ -1,4 +1,6 @@ use std::io::Write; + +use idl::build_idl; pub mod idl; pub enum Options { @@ -7,7 +9,7 @@ pub enum Options { New, Run, } -#[derive(PartialEq)] +#[derive(PartialEq, Debug)] pub enum DevelopmentType { Program, Library, @@ -24,7 +26,7 @@ fn main() { match subcommand { "build" => { - let name = &args[1]; + let name = &args.pop().unwrap(); build(name.to_string()) } "new" => { @@ -103,8 +105,21 @@ fn run() { fn build(name: String) { println!("building {}", name); + let mut a = name.split("/"); + let dev_type = a.next().unwrap(); + let name = a.next().unwrap().to_string(); + match dev_type { + "programs" => build_program(name), + "idl" => build_idl(name), + _ => { + panic!() + } + } } +pub fn build_program(name: String) {} +pub fn build_library(name: String) {} + fn help() { println!( "========== diff --git a/kernel/src/arch/aarch64/logging.rs b/kernel/src/arch/aarch64/logging.rs index 20e73f81..0f968b7e 100644 --- a/kernel/src/arch/aarch64/logging.rs +++ b/kernel/src/arch/aarch64/logging.rs @@ -1,5 +1,5 @@ use {crate::logger::TERMINAL_LOGGER, core::fmt::Write, spin::Mutex}; -static SERIAL_CONSOLE: Mutex = Mutex::new(SerialConsole { +pub static SERIAL_CONSOLE: Mutex = Mutex::new(SerialConsole { uart: 0x09000000 as *mut u8, }); diff --git a/kernel/src/device_tree.rs b/kernel/src/device_tree/mod.rs similarity index 76% rename from kernel/src/device_tree.rs rename to kernel/src/device_tree/mod.rs index 0ec81d11..8d1c64ca 100644 --- a/kernel/src/device_tree.rs +++ b/kernel/src/device_tree/mod.rs @@ -6,6 +6,7 @@ use { core::fmt, hashbrown::HashMap, }; + /// A device object. /// TODO define device pub type Device = xml::XMLElement; @@ -23,27 +24,29 @@ impl DeviceTree { let mut dt = Self { devices: HashMap::new(), }; - device_tree!(dt, [ - "Mice", - "Keyboards", - "Controllers", - "Generic HIDs", - "Disk Drives", - "CD Drives", - "Batteries", - "Monitors", - "GPUs", - "CPUs", - "USB", - "Serial Ports", - "Cameras", - "Biometric Devices", - ]); + device_tree!( + dt, + [ + "Mice", + "Keyboards", + "Controllers", + "Generic HIDs", + "Disk Drives", + "CD Drives", + "Batteries", + "Monitors", + "GPUs", + "CPUs", + "USB", + "Serial Ports", + "Cameras", + "Biometric Devices", + ] + ); dt } } -use crate::{utils::TAB, device_tree}; -use crate::tab; +use crate::{device_tree, tab, utils::TAB}; impl fmt::Display for DeviceTree { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!(f)?; diff --git a/kernel/src/holeybytes/ecah.rs b/kernel/src/holeybytes/ecah.rs index dc4b83c6..b92ed709 100644 --- a/kernel/src/holeybytes/ecah.rs +++ b/kernel/src/holeybytes/ecah.rs @@ -1,11 +1,14 @@ //! Environment call handling routines -use crate::holeybytes::kernel_services::{block_read, service_definition_service::sds_msg_handler}; +use crate::holeybytes::kernel_services::{ + block_read, dt_msg_handler::dt_msg_handler, logging_service::log_msg_handler, + service_definition_service::sds_msg_handler, +}; use { super::Vm, crate::{arch, ipc::buffer::IpcBuffer, kmain::IPC_BUFFERS}, - log::{debug, error, info, trace, warn}, + log::{debug, error, info, trace}, }; pub fn handler(vm: &mut Vm) { @@ -152,46 +155,18 @@ pub fn handler(vm: &mut Vm) { _ => {} } } + #[cfg(not(target_arch = "x86_64"))] + 3 => unimplemented!("TODO: implement whatever buffer 3 does for no x86_64"), // source of rng 4 => { // limit to last 32 bits vm.registers[1] = hbvm::value::Value(crate::arch::hardware_random_u64() & 0xFFFFFFFF); } - // get arch - 5 => { - if cfg!(target_arch = "x86_64") { - vm.registers[1] = hbvm::value::Value(0); - } else if cfg!(target_arch = "aarch64") { - vm.registers[1] = hbvm::value::Value(1); - } else { - vm.registers[1] = hbvm::value::Value(u64::MAX) - } - } - // AbleCodeā„¢ (get fb ptr) - 6 => { - use { - crate::kmain::FB_REQ, - limine::{Framebuffer, NonNullPtr}, - }; - let fb1: &NonNullPtr = - &FB_REQ.get_response().get().unwrap().framebuffers()[0]; - let msg = block_read(mem_addr, length)[0]; - if msg == b'p' { - // ptr - let fb_front = fb1.address.as_ptr().unwrap() as *const u8; - log::info!("Graphics front ptr {:?}", fb_front); - vm.registers[1] = hbvm::value::Value(fb_front as u64); - } else if msg == b'w' { - // width - log::info!("FB Width: {}", fb1.width); - vm.registers[1] = hbvm::value::Value(fb1.width); - } else if msg == b'h' { - // height - log::info!("FB Height: {}", fb1.height); - vm.registers[1] = hbvm::value::Value(fb1.height); - } - } + 5 => match dt_msg_handler(vm, mem_addr, length) { + Ok(()) => {} + Err(_) => log::error!("Improper dt query"), + }, buffer_id => { let mut buffs = IPC_BUFFERS.lock(); match buffs.get_mut(&buffer_id) { @@ -272,34 +247,6 @@ pub fn handler(vm: &mut Vm) { } } -fn log_msg_handler(_vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> { - // let message_length = 8 + 8 + 8; - // log::info!("Mem Addr 0x{:x?} length {}", mem_addr, length); - let msg_vec = block_read(mem_addr, length); - - let log_level = msg_vec.last().unwrap(); - match core::str::from_utf8(&msg_vec[1..]) { - Ok(strr) => { - // use LogLevel::*; - let _ll = match log_level { - 0 | 48 => error!("{}", strr), - 1 | 49 => warn!("{}", strr), - 2 | 50 => info!("{}", strr), - 3 | 51 => debug!("{}", strr), - 4 | 52 => trace!("{}", strr), - _ => { - return Err(LogError::InvalidLogFormat); - } - }; - } - Err(e) => { - error!("{:?}", e); - } - } - - Ok(()) -} - #[derive(Debug)] pub enum LogError { NoMessages, diff --git a/kernel/src/holeybytes/kernel_services/dt_msg_handler.rs b/kernel/src/holeybytes/kernel_services/dt_msg_handler.rs new file mode 100644 index 00000000..876abb89 --- /dev/null +++ b/kernel/src/holeybytes/kernel_services/dt_msg_handler.rs @@ -0,0 +1,87 @@ +use { + crate::holeybytes::{kernel_services::block_read, Vm}, + alloc::{ + string::{String, ToString}, + vec::Vec, + }, +}; +pub enum DtError { + QueryFailure, +} + +pub fn dt_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), DtError> { + let msg_vec = block_read(mem_addr, length); + let mut bytes: Vec = Vec::new(); + for byte in msg_vec { + if *byte == 0 { + break; + } + bytes.push(*byte) + } + let query_string = String::from_utf8(bytes).unwrap(); + log::trace!("Query {}", query_string); + + let ret = query_parse(query_string); + log::trace!("Query response {}", ret); + + vm.registers[1] = hbvm::value::Value(ret); + + Ok(()) +} + +fn query_parse(query_string: String) -> u64 { + let qt_parse_step_one = query_string.split("/"); + let mut qt_parse_step_two: Vec = Vec::new(); + for a in qt_parse_step_one { + qt_parse_step_two.push(a.to_string()); + } + + let first_fragment: &str = &qt_parse_step_two[0]; + let ret = match first_fragment { + "framebuffer" => framebuffer_parse(qt_parse_step_two), + "cpu" => cpu_parse(qt_parse_step_two), + + _ => 0, + }; + + return ret; +} + +fn cpu_parse(qt_parse_step_two: Vec) -> u64 { + let second_fragment: &str = &qt_parse_step_two[1]; + match second_fragment { + // "architecture" => { + // return 0; + // } + _ => { + return 0; + } + }; +} + +fn framebuffer_parse(qt_parse_step_two: Vec) -> u64 { + use crate::kmain::FB_REQ; + let fbs = &FB_REQ.get_response().get().unwrap().framebuffers(); + + let second_fragment: &str = &qt_parse_step_two[1]; + match second_fragment { + "fb0" => { + let fb_front = &fbs[0]; + let third_fragment: &str = &qt_parse_step_two[2]; + let ret = match third_fragment { + "ptr" => { + let ptr = fb_front.address.as_ptr().unwrap(); + ptr as usize as u64 + } + "width" => fb_front.width, + "height" => fb_front.height, + + _ => 0, + }; + return ret; + } + _ => { + return 0; + } + }; +} diff --git a/kernel/src/holeybytes/kernel_services/logging_service.rs b/kernel/src/holeybytes/kernel_services/logging_service.rs new file mode 100644 index 00000000..a0b461f9 --- /dev/null +++ b/kernel/src/holeybytes/kernel_services/logging_service.rs @@ -0,0 +1,49 @@ +use crate::holeybytes::{kernel_services::block_read, Vm}; + +#[derive(Debug)] +pub enum LogError { + InvalidLogFormat, +} +use log::Record; + +pub fn log_msg_handler(_vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> { + let msg_vec = block_read(mem_addr, length); + + let log_level = msg_vec.last().unwrap(); + + let file_name = "None"; + let line_number = 0; + + match core::str::from_utf8(&msg_vec[..msg_vec.len()]) { + Ok(strr) => { + use log::Level::*; + let log_level = match log_level { + 0 | 48 => Error, + 1 | 49 => Warn, + 2 | 50 => Info, + 3 | 51 => Debug, + 4 | 52 => Trace, + _ => { + return Err(LogError::InvalidLogFormat); + } + }; + + log::logger().log( + &Record::builder() + .args(format_args!("{}", strr)) + .level(log_level) + .target("Userspace") + .file(Some(file_name)) + .line(Some(line_number)) + .module_path(Some(&file_name)) + .build(), + ); + } + + Err(e) => { + log::error!("{:?}", e); + } + } + + Ok(()) +} diff --git a/kernel/src/holeybytes/kernel_services/mod.rs b/kernel/src/holeybytes/kernel_services/mod.rs index 8c80f498..1e536a77 100644 --- a/kernel/src/holeybytes/kernel_services/mod.rs +++ b/kernel/src/holeybytes/kernel_services/mod.rs @@ -1,5 +1,7 @@ use core::slice; +pub mod dt_msg_handler; +pub mod logging_service; pub mod mem_serve; pub mod service_definition_service; diff --git a/kernel/src/holeybytes/kernel_services/service_definition_service.rs b/kernel/src/holeybytes/kernel_services/service_definition_service.rs index 3382f1b5..52f37ad6 100644 --- a/kernel/src/holeybytes/kernel_services/service_definition_service.rs +++ b/kernel/src/holeybytes/kernel_services/service_definition_service.rs @@ -1,7 +1,7 @@ use { crate::{ arch::hardware_random_u64, - holeybytes::{ecah::LogError, kernel_services::block_read, Vm}, + holeybytes::{kernel_services::block_read, Vm}, ipc::{buffer::IpcBuffer, protocol::Protocol}, kmain::IPC_BUFFERS, }, @@ -15,12 +15,12 @@ pub static SERVICES: Lazy> = Lazy::new(|| { dt.0.insert(0, Protocol::void()); Mutex::new(dt) }); - -pub fn sds_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> { +#[derive(Debug)] +pub enum ServiceError { + InvalidFormat, +} +pub fn sds_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), ServiceError> { let msg_vec = block_read(mem_addr, length); - if msg_vec.is_empty() { - return Err(LogError::NoMessages); - } let sds_event_type: ServiceEventType = msg_vec[0].into(); // info!("Length {}", msg_vec.len()); diff --git a/sysdata/idl/abc/src/protocol.aidl b/sysdata/idl/abc/src/protocol.aidl deleted file mode 100644 index b08bdcf1..00000000 --- a/sysdata/idl/abc/src/protocol.aidl +++ /dev/null @@ -1,2 +0,0 @@ -protocol abc { - } \ No newline at end of file diff --git a/sysdata/idl/abc/README.md b/sysdata/idl/log/README.md similarity index 100% rename from sysdata/idl/abc/README.md rename to sysdata/idl/log/README.md diff --git a/sysdata/idl/log/src/protocol.aidl b/sysdata/idl/log/src/protocol.aidl new file mode 100644 index 00000000..ec37b5bd --- /dev/null +++ b/sysdata/idl/log/src/protocol.aidl @@ -0,0 +1,24 @@ +@auto_increment +enum LogLevel { + Error = 0, + Warn, + Info, + Debug, + Trace, +} + +@auto_increment +enum LogResult { + Err = 0, + Ok, +} + +struct Log { + log_level: LogLevel, +} + +@visibility(public) +protocol Log { + fn log(Log) -> LogResult; + fn flush() -> LogResult; +} \ No newline at end of file diff --git a/sysdata/libraries/dt_api/README.md b/sysdata/libraries/dt_api/README.md new file mode 100644 index 00000000..61d4547f --- /dev/null +++ b/sysdata/libraries/dt_api/README.md @@ -0,0 +1 @@ +# dt_api \ No newline at end of file diff --git a/sysdata/libraries/dt_api/src/lib.hb b/sysdata/libraries/dt_api/src/lib.hb new file mode 100644 index 00000000..bf3e800b --- /dev/null +++ b/sysdata/libraries/dt_api/src/lib.hb @@ -0,0 +1,8 @@ +stn := @use("rel:../../stn/src/lib.hb"); +.{string, memory, buffer} := stn + +dt_get := fn(query: ^u8): int { + message_length := string.length(query) + + return @eca(int, 3, 5, query, message_length) +} \ No newline at end of file diff --git a/sysdata/libraries/horizon_api/src/element.hb b/sysdata/libraries/horizon_api/src/element.hb deleted file mode 100644 index 76299cce..00000000 --- a/sysdata/libraries/horizon_api/src/element.hb +++ /dev/null @@ -1,14 +0,0 @@ -Element := struct { - width: int, - height: int, - - x: u16, - y: u16, - - id: int, -} - -create_element := fn(): Element { - return Element.(0, 0, 0, 0, 0) -} - diff --git a/sysdata/libraries/horizon_api/src/frame.hb b/sysdata/libraries/horizon_api/src/frame.hb deleted file mode 100644 index 61d80629..00000000 --- a/sysdata/libraries/horizon_api/src/frame.hb +++ /dev/null @@ -1,3 +0,0 @@ -FrameID := struct { - -} \ No newline at end of file diff --git a/sysdata/libraries/horizon_api/src/lib.hb b/sysdata/libraries/horizon_api/src/lib.hb index 81aa0fa4..543bd14a 100644 --- a/sysdata/libraries/horizon_api/src/lib.hb +++ b/sysdata/libraries/horizon_api/src/lib.hb @@ -1,12 +1,24 @@ +stn := @use("rel:../../stn/src/lib.hb"); +.{string, memory, buffer} := stn + WindowID := struct { host_id: int, window_id: int, } -create_window := fn(): WindowID { - return WindowID.(1, 2) -} +create_window := fn(channel: int): void { + // get the horizon buffer + // request a new window and provide the callback buffer + // wait to recieve a message + + windowing_system_buffer := buffer.search("XHorizon\0") + + if windowing_system_buffer == 0 { + } else { + msg := "\{01}\0" + msg_length := 2 + @eca(void, 3, windowing_system_buffer, msg, msg_length) + } -update_ui := fn(window_id: WindowID): void { return } \ No newline at end of file diff --git a/sysdata/libraries/horizon_api/src/text.hb b/sysdata/libraries/horizon_api/src/text.hb deleted file mode 100644 index 22996c3d..00000000 --- a/sysdata/libraries/horizon_api/src/text.hb +++ /dev/null @@ -1,3 +0,0 @@ -ui_lisp_text_example := "(text id_1)\0"; - - diff --git a/sysdata/libraries/ignim/src/application.hb b/sysdata/libraries/ignim/src/application.hb new file mode 100644 index 00000000..61d42c66 --- /dev/null +++ b/sysdata/libraries/ignim/src/application.hb @@ -0,0 +1,21 @@ +structures := @use("rel:structures.hb") +version := @use("rel:version.hb") + +// Refer to here https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkApplicationInfo.html +ApplicationInfo := struct { + sType: int, + pNext: ^int, + application_name: ^u8, + application_version: int, + engine_name: int, + engine_version: int, + api_version: int, +} + +new_application_info := fn(app_name: ^u8, app_version: int, engine_name: ^u8, engine_version: int, api_version: int): ApplicationInfo { + app_info_type := structures.ApplicationInfoType + + app_info := ApplicationInfo.(app_info_type, 0, app_name, app_version, engine_name, engine_version, api_version) + + return app_info +} \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/errors.hb b/sysdata/libraries/ignim/src/errors.hb new file mode 100644 index 00000000..3b9b1ab1 --- /dev/null +++ b/sysdata/libraries/ignim/src/errors.hb @@ -0,0 +1,14 @@ +OutOfHostMemory := -1 +OutOfDeviceMemory := -2 +InitializationFailed := -3 +DeviceLost := -4 +MemoryMapFailed := -5 + +LayerNotPresent := -6 +ExtensionNotPresent := -7 +FeatureNotPresent := -8 +IncompatibleDriver := -9 +TooManyObjects := -10 +FormatNotSupported := -11 +FragmentedPool := -12 +Unknown := -13 \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/extends.hb b/sysdata/libraries/ignim/src/extends.hb new file mode 100644 index 00000000..4600a7e8 --- /dev/null +++ b/sysdata/libraries/ignim/src/extends.hb @@ -0,0 +1,10 @@ +Extent3D := struct { + width: int, + height: int, + depth: int, +} + +Extent2D := struct { + width: int, + height: int, +} \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/instance.hb b/sysdata/libraries/ignim/src/instance.hb new file mode 100644 index 00000000..0841b98e --- /dev/null +++ b/sysdata/libraries/ignim/src/instance.hb @@ -0,0 +1,35 @@ +application := @use("rel:application.hb"); +.{ApplicationInfo} := application + +structures := @use("rel:structures.hb") +errors := @use("rel:errors.hb") + +// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkInstanceCreateInfo.html +InstanceCreateInfo := struct { + sType: int, + pNext: int, + flags: int, + application_info: ^ApplicationInfo, + enabled_layer_count: int, + ppEnabledLayerNames: int, + enabled_extension_count: int, + ppEnabledExtensionNames: int, +} + +new_create_info := fn(application_info: ^ApplicationInfo): InstanceCreateInfo { + create_info_type := structures.InstanceCreateInfoType + enabled_layer_count := 0 + + create_info := InstanceCreateInfo.(create_info_type, 0, 0, application_info, enabled_layer_count, 0, 0, 0) + return create_info +} + +// TODO +Instance := struct {inner: int} +void_instance := fn(): Instance { + return Instance.(0) +} + +create_instance := fn(create_info: ^InstanceCreateInfo, allocator_callback: int, new_obj: ^Instance): int { + return errors.IncompatibleDriver +} \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/lib.hb b/sysdata/libraries/ignim/src/lib.hb index 161d851a..bc9cc123 100644 --- a/sysdata/libraries/ignim/src/lib.hb +++ b/sysdata/libraries/ignim/src/lib.hb @@ -1,7 +1,17 @@ -VK_VERSION_MAJOR := 1; -VK_VERSION_MINOR := 0; +application := @use("rel:application.hb") -init_vulkan := fn(): void { - - return +results := @use("rel:results.hb") +errors := @use("rel:errors.hb") + +offsets := @use("rel:offset.hb") +extends := @use("rel:extends.hb") + +rect := @use("rel:rect.hb") +structures := @use("rel:structures.hb") +instance := @use("rel:instance.hb") + +version := @use("rel:version.hb") + +init_vulkan := fn(): int { + return errors.IncompatibleDriver } \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/offset.hb b/sysdata/libraries/ignim/src/offset.hb new file mode 100644 index 00000000..d12e34f4 --- /dev/null +++ b/sysdata/libraries/ignim/src/offset.hb @@ -0,0 +1,10 @@ +Offset3D := struct { + x: int, + y: int, + z: int, +} + +Offset2D := struct { + x: int, + y: int, +} \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/rect.hb b/sysdata/libraries/ignim/src/rect.hb new file mode 100644 index 00000000..dbc7afd3 --- /dev/null +++ b/sysdata/libraries/ignim/src/rect.hb @@ -0,0 +1,7 @@ +offsets := @use("rel:offset.hb") +extends := @use("rel:extends.hb") + +Rect2D := struct { + offset: offsets.Offset2D, + extent: extends.Extent2D, +} \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/results.hb b/sysdata/libraries/ignim/src/results.hb new file mode 100644 index 00000000..9b009402 --- /dev/null +++ b/sysdata/libraries/ignim/src/results.hb @@ -0,0 +1,7 @@ +// NonErrors +Success := 0 +NotReady := 1 +Timeout := 2 +EventSet := 3 +EventReset := 4 +Incomplete := 5 \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/structures.hb b/sysdata/libraries/ignim/src/structures.hb new file mode 100644 index 00000000..d9eb2b27 --- /dev/null +++ b/sysdata/libraries/ignim/src/structures.hb @@ -0,0 +1,61 @@ +ApplicationInfoType := 0 +InstanceCreateInfoType := 1 +DeviceQueueCreateInfo := 2 +DeviceCreateInfo := 3 +SubmitInfo := 4 +MemoryAllocateInfo := 5 +MappedMemoryRange := 6 +BindSparseInfo := 7 + +FenceCreateInfo := 8 +SemaphoreCreateInfo := 9 +EventCreateInfo := 10 +QueryPoolCreateInfo := 11 + +BufferCreateInfo := 12 +BufferViewCreateInfo := 13 + +ImageCreateInfo := 14 +ImageViewCreateInfo := 15 + +ShaderModuleCreateInfo := 16 + +PipelineCacheCreateInfo := 17 +PipelineShaderStageCreateInfo := 18 +PipelineVertexInputStateCreateInfo := 19 +PipelineInputAssemblyStateCreateInfo := 20 +PipelineTessellationStateCreateInfo := 21 +PipelineViewportStateCreateInfo := 22 +PipelineRasterizationStateCreateInfo := 23 +PipelineMultisampleStateCreateInfo := 24 +PipelineDepthStencilStateCreateInfo := 25 +PipelineColorBlendStateCreateInfo := 26 +PipelineDynamicStateCreateInfo := 27 + +GraphicsPipelineCreateInfo := 28 +ComputePipelineCreateInfo := 29 +PipelineLayoutCreateInfo := 30 +SamplerCreateInfo := 31 + +DescriptorSetLayoutCreateInfo := 32 +DescriptorPoolCreateInfo := 33 + +DescriptorSetAllocateInfo := 34 +WriteDescriptorSet := 35 +CopyDescriptorSet := 36 +FramebufferCreateInfo := 37 + +RenderPassCreateInfo := 38 +CommandPoolCreateInfo := 39 + +CommandBufferAllocateInfo := 40 +CommandBufferInheritanceInfo := 41 +CommandBufferBeginInfo := 42 + +RenderPassBeginInfo := 43 +BufferMemoryBarrier := 44 +ImageMemoryBarrier := 45 +MemoryBarrier := 46 + +LoaderInstanceCreateInfo := 47 +LoaderDeviceCreateInfo := 48 \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/version.hb b/sysdata/libraries/ignim/src/version.hb new file mode 100644 index 00000000..f8f59983 --- /dev/null +++ b/sysdata/libraries/ignim/src/version.hb @@ -0,0 +1,9 @@ +ApiVersion1_0 := make_api_version(0, 1, 0, 0) + +make_version := fn(major: int, minor: int, patch: int): int { + return major << 22 | minor << 12 | patch +} + +make_api_version := fn(variant: int, major: int, minor: int, patch: int): int { + return variant << 29 | major << 22 | minor << 12 | patch +} \ No newline at end of file diff --git a/sysdata/libraries/pci/README.md b/sysdata/libraries/pci/README.md new file mode 100644 index 00000000..fadc21bf --- /dev/null +++ b/sysdata/libraries/pci/README.md @@ -0,0 +1 @@ +# pci \ No newline at end of file diff --git a/sysdata/libraries/pci/src/lib.hb b/sysdata/libraries/pci/src/lib.hb new file mode 100644 index 00000000..54fb294b --- /dev/null +++ b/sysdata/libraries/pci/src/lib.hb @@ -0,0 +1,25 @@ +PCIAddress := struct { + bus: u8, + device: u8, + function: u8, +} + +find_device := fn(vendor_id: int, device_id: int, pci_address: PCIAddress): int { + return 1 +} + +scan_bus := fn(): void { +} + +config_read32 := fn(bus: u32, device: u32, func: u32, offset: u32): u32 { + // construct address param + address := bus << 16 | device << 11 | func << 8 | offset & 0xFC | 0x80000000 + + // write address + //Port::new(0xCF8).write(address); + + // read data + //Port::new(0xCFC).read() + + return +} \ No newline at end of file diff --git a/sysdata/libraries/render/src/software.hb b/sysdata/libraries/render/src/software.hb index d584d44c..117f42f1 100644 --- a/sysdata/libraries/render/src/software.hb +++ b/sysdata/libraries/render/src/software.hb @@ -1,4 +1,5 @@ .{math, memory} := @use("../../stn/src/lib.hb"); +.{dt_get} := @use("../../dt_api/src/lib.hb"); .{IVec2} := @use("rel:lib.hb") Color := struct {b: u8, g: u8, r: u8, a: u8} @@ -19,16 +20,13 @@ light_blue := Color.(255, 0, 0, 255) light_magenta := Color.(255, 0, 255, 255) light_cyan := Color.(255, 255, 0, 255) -// fb_width := 1024 -// fb_height := 768 -// fb_pixels := fb_width * fb_height -// fb_bytes := fb_pixels << 2 +// might not work for some resolutions, but needs to be comptime because... copy_pixels := 0xC000 >> 2 -// partitions := fb_pixels / copy_pixels -// total_pages := 1 + fb_bytes >> 12 ctx := @as(Context, idk) +// some of these are redudant holdovers from fb_driver +// will keep them for future work if necessary Context := struct { fb: ^Color, bb: ^Color, @@ -42,8 +40,8 @@ Context := struct { } init := fn(): void { - width := @eca(int, 3, 6, "w\0", 2) - height := @eca(int, 3, 6, "h\0", 2) + width := dt_get("framebuffer/fb0/width\0") + height := dt_get("framebuffer/fb0/height\0") // width := 1024 // height := 768 pixels := width * height @@ -52,7 +50,7 @@ init := fn(): void { pages := 1 + bytes >> 12 back_buffer := create_back_buffer(pages) ctx = Context.{ - fb: @eca(^Color, 3, 6, "p\0", 2), + fb: dt_get("framebuffer/fb0/ptr\0"), bb: back_buffer, buf: back_buffer, width, @@ -186,8 +184,8 @@ put_line_low := fn(p0: IVec2, p1: IVec2, color: Color): void { dy := p1.y - p0.y yi := 1 if dy < 0 { - yi = 0 - 1 - dy = 0 - dy + yi = -1 + dy = -dy } D := 2 * dy - dx y := p0.y @@ -210,8 +208,8 @@ put_line_high := fn(p0: IVec2, p1: IVec2, color: Color): void { dy := p1.y - p0.y xi := 1 if dy < 0 { - xi = 0 - 1 - dx = 0 - dx + xi = -1 + dx = -dx } D := 2 * dx - dy x := p0.x diff --git a/sysdata/libraries/render/src/svga.hb b/sysdata/libraries/render/src/svga.hb index 8d878c37..eb7027d1 100644 --- a/sysdata/libraries/render/src/svga.hb +++ b/sysdata/libraries/render/src/svga.hb @@ -1,5 +1,5 @@ -.{pci, memory, string, log} := @use("../../stn/src/lib.hb"); .{IVec2} := @use("rel:lib.hb") +// .{pci, memory, string, log} := @use("../../stn/src/lib.hb"); Color := struct {b: u8, g: u8, r: u8, a: u8} white := Color.(255, 255, 255, 255) @@ -76,16 +76,5 @@ sync := fn(): void { } init := fn(): void { - b := memory.request_page(1) - bus := 0 - device := 0 - loop if bus == 256 break else { - loop if device == 32 break else { - a := pci.config_read(0, 0, 0, 0) - log.info(string.display_int(a, b)) - device += 1 - } - bus += 1 - } return } \ No newline at end of file diff --git a/sysdata/programs/dt_buffer_test/README.md b/sysdata/programs/dt_buffer_test/README.md new file mode 100644 index 00000000..c01a7c5e --- /dev/null +++ b/sysdata/programs/dt_buffer_test/README.md @@ -0,0 +1 @@ +# dt_buffer_test \ No newline at end of file diff --git a/sysdata/programs/dt_buffer_test/meta.toml b/sysdata/programs/dt_buffer_test/meta.toml new file mode 100644 index 00000000..f25002e9 --- /dev/null +++ b/sysdata/programs/dt_buffer_test/meta.toml @@ -0,0 +1,11 @@ +[package] +name = "dt_buffer_test" +authors = ["able"] + +[dependants.libraries] + +[dependants.binaries] +hblang.version = "1.0.0" + +[build] +command = "hblang src/main.hb" diff --git a/sysdata/programs/dt_buffer_test/src/main.hb b/sysdata/programs/dt_buffer_test/src/main.hb new file mode 100644 index 00000000..4d4d14c4 --- /dev/null +++ b/sysdata/programs/dt_buffer_test/src/main.hb @@ -0,0 +1,14 @@ +dt_api := @use("../../../libraries/dt_api/src/lib.hb"); +.{dt_get} := dt_api + +main := fn(): int { + dt_api.dt_get("framebuffer/fb0/width\0") + dt_api.dt_get("cpu/cpu0/architecture\0") + + // Checking if the first detected serial port is memory mapped or port mapped + // 0 -> memory mapped + // 1 -> port mapped + dt_get("serial_ports/sp0/mapping\0") + + return 0 +} \ No newline at end of file diff --git a/sysdata/programs/horizon/README.md b/sysdata/programs/horizon/README.md new file mode 100644 index 00000000..7451b8ec --- /dev/null +++ b/sysdata/programs/horizon/README.md @@ -0,0 +1,3 @@ +# Horizon +The Horizon Windowing system server. This is the component that spawns/layouts and renders windows. +For the api look in libraries/horizon_api. diff --git a/sysdata/programs/horizon/meta.toml b/sysdata/programs/horizon/meta.toml new file mode 100644 index 00000000..ccfe1e2a --- /dev/null +++ b/sysdata/programs/horizon/meta.toml @@ -0,0 +1,11 @@ +[package] +name = "horizon" +authors = ["able"] + +[dependants.libraries] + +[dependants.binaries] +hblang.version = "1.0.0" + +[build] +command = "hblang src/main.hb" diff --git a/sysdata/programs/horizon/protocol/lib.idl b/sysdata/programs/horizon/protocol/lib.idl new file mode 100644 index 00000000..92a04820 --- /dev/null +++ b/sysdata/programs/horizon/protocol/lib.idl @@ -0,0 +1,6 @@ +alias HostID = u64; + +struct WindowID { + host_id: HostID, + window_id: u64 +} diff --git a/sysdata/programs/horizon/src/main.hb b/sysdata/programs/horizon/src/main.hb new file mode 100644 index 00000000..3c7c6317 --- /dev/null +++ b/sysdata/programs/horizon/src/main.hb @@ -0,0 +1,12 @@ +stn := @use("../../../libraries/stn/src/lib.hb"); +.{string, memory, buffer} := stn + +horizon_api := @use("../../../libraries/horizon_api/src/lib.hb") + +main := fn(): int { + a := buffer.create("XHorizon\0") + loop { + } + + return 0 +} \ No newline at end of file diff --git a/sysdata/programs/horizon_testing_program/README.md b/sysdata/programs/horizon_testing_program/README.md new file mode 100644 index 00000000..04c8af8f --- /dev/null +++ b/sysdata/programs/horizon_testing_program/README.md @@ -0,0 +1 @@ +# horizon_testing_program \ No newline at end of file diff --git a/sysdata/programs/horizon_testing_program/meta.toml b/sysdata/programs/horizon_testing_program/meta.toml new file mode 100644 index 00000000..7e360c90 --- /dev/null +++ b/sysdata/programs/horizon_testing_program/meta.toml @@ -0,0 +1,11 @@ +[package] +name = "horizon_testing_program" +authors = ["able"] + +[dependants.libraries] + +[dependants.binaries] +hblang.version = "1.0.0" + +[build] +command = "hblang src/main.hb" diff --git a/sysdata/programs/horizon_testing_program/src/main.hb b/sysdata/programs/horizon_testing_program/src/main.hb new file mode 100644 index 00000000..01d57a3c --- /dev/null +++ b/sysdata/programs/horizon_testing_program/src/main.hb @@ -0,0 +1,35 @@ +stn := @use("../../../libraries/stn/src/lib.hb"); +.{string, memory, buffer, log} := stn + +horizon_api := @use("../../../libraries/horizon_api/src/lib.hb"); +.{create_window} := horizon_api + +ignim := @use("../../../libraries/ignim/src/lib.hb"); +.{errors} := ignim + +main := fn(): int { + windowing_system_buffer := buffer.create("XHorizon\0") + + // TODO: get WindowID + create_window(windowing_system_buffer) + + program_name := "Horizon Testing Program\0" + program_version := ignim.version.make_version(0, 1, 0) + engine_name := "None\0" + engine_version := ignim.version.make_version(0, 0, 0) + api_version := ignim.version.make_api_version(0, 1, 0, 0) + + app_info := ignim.application.new_application_info(program_name, program_version, engine_name, engine_version, api_version) + + create_info := ignim.instance.new_create_info(&app_info) + + instance := ignim.instance.void_instance() + + // TODO: recursively follow this https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Instance + ret := ignim.instance.create_instance(&create_info, 0, &instance) + if ret == errors.IncompatibleDriver { + log.error("Driver Incompatible with Vulkan\0") + } + + return 0 +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/examples/colors.hb b/sysdata/programs/render_example/src/examples/colors.hb index 5451d3d7..9f8bbd7d 100644 --- a/sysdata/programs/render_example/src/examples/colors.hb +++ b/sysdata/programs/render_example/src/examples/colors.hb @@ -13,7 +13,7 @@ example := fn(): void { render.clear(color) render.sync() if (color.b & 255) == 255 | (color.b & 255) == 0 { - n = 0 - n + n = -n } color.b += n } diff --git a/sysdata/programs/render_example/src/examples/square.hb b/sysdata/programs/render_example/src/examples/square.hb index def4fea1..55f98055 100644 --- a/sysdata/programs/render_example/src/examples/square.hb +++ b/sysdata/programs/render_example/src/examples/square.hb @@ -15,10 +15,10 @@ example := fn(): void { render.clear(render.black) if pos.x == 0 | pos.x == width - 100 { - vel.x = 0 - vel.x + vel.x = -vel.x } if pos.y == 0 | pos.y == height - 100 { - vel.y = 0 - vel.y + vel.y = -vel.y } pos += vel diff --git a/sysdata/programs/render_example/src/main.hb b/sysdata/programs/render_example/src/main.hb index 35b2706e..4f44fd85 100644 --- a/sysdata/programs/render_example/src/main.hb +++ b/sysdata/programs/render_example/src/main.hb @@ -1,4 +1,4 @@ -.{example} := @use("./examples/amogus.hb") +.{example} := @use("./examples/colors.hb") main := fn(): void { @inline(example) diff --git a/sysdata/programs/svga_driver/README.md b/sysdata/programs/svga_driver/README.md new file mode 100644 index 00000000..0a996d96 --- /dev/null +++ b/sysdata/programs/svga_driver/README.md @@ -0,0 +1 @@ +# svga_driver \ No newline at end of file diff --git a/sysdata/programs/svga_driver/meta.toml b/sysdata/programs/svga_driver/meta.toml new file mode 100644 index 00000000..3748bd50 --- /dev/null +++ b/sysdata/programs/svga_driver/meta.toml @@ -0,0 +1,11 @@ +[package] +name = "svga_driver" +authors = ["able"] + +[dependants.libraries] + +[dependants.binaries] +hblang.version = "1.0.0" + +[build] +command = "hblang src/main.hb" diff --git a/sysdata/programs/svga_driver/src/device.hb b/sysdata/programs/svga_driver/src/device.hb new file mode 100644 index 00000000..dd697e9d --- /dev/null +++ b/sysdata/programs/svga_driver/src/device.hb @@ -0,0 +1,41 @@ +pci := @use("../../../libraries/pci/src/lib.hb"); +.{PCIAddress} := pci + +SVGADevice := struct { + pciAddr: PCIAddress, + ioBase: u32, + fifoMem: ^u32, + fbMem: ^u8, + fifoSize: int, + fbSize: int, + vramSize: int, + deviceVersionId: int, + capabilities: int, + width: int, + height: int, + bpp: int, + pitch: int, +} + +svga_device := fn(): SVGADevice { + pci_addr := PCIAddress.(0, 0, 0) + + return SVGADevice.(pci_addr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +} + +/* + struct { + uint32 reservedSize; + Bool usingBounceBuffer; + uint8 bounceBuffer[1024 * 1024]; + uint32 nextFence; + } fifo; + + volatile struct { + uint32 pending; + uint32 switchContext; + IntrContext oldContext; + IntrContext newContext; + uint32 count; + } irq; +*/ \ No newline at end of file diff --git a/sysdata/programs/svga_driver/src/main.hb b/sysdata/programs/svga_driver/src/main.hb new file mode 100644 index 00000000..dfd1dd24 --- /dev/null +++ b/sysdata/programs/svga_driver/src/main.hb @@ -0,0 +1,33 @@ +device := @use("rel:device.hb") +pci := @use("../../../libraries/pci/src/lib.hb") + +stn := @use("../../../libraries/stn/src/lib.hb"); +.{string, memory, buffer, log} := stn + +reg := @use("rel:reg.hb") + +PCI_VENDOR_ID_VMWARE := 0x15AD +PCI_DEVICE_ID_VMWARE_SVGA2 := 0x405 + +init := fn(): void { + svga_struct := device.svga_device() + + if pci.find_device(PCI_VENDOR_ID_VMWARE, PCI_DEVICE_ID_VMWARE_SVGA2, svga_struct.pciAddr) { + log.error("No VMware SVGA device found.\0") + } + return +} + +write_reg := fn(index: u32, value: u32): void { +} + +SVGA_disable := fn(): void { + write_reg(reg.SVGA_REG_ENABLE, 0) + return +} + +main := fn(): int { + init() + + return 0 +} \ No newline at end of file diff --git a/sysdata/programs/svga_driver/src/reg.hb b/sysdata/programs/svga_driver/src/reg.hb new file mode 100644 index 00000000..c166c261 --- /dev/null +++ b/sysdata/programs/svga_driver/src/reg.hb @@ -0,0 +1,4 @@ +SVGA_REG_ENABLE_DISABLE := 0 +SVGA_REG_ENABLE_ENABLE := 1 +SVGA_REG_ENABLE_HIDE := 2 +SVGA_REG_ENABLE_ENABLE_HIDE := SVGA_REG_ENABLE_ENABLE | SVGA_REG_ENABLE_HIDE \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 98caf84e..28d2c319 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -17,17 +17,29 @@ resolution = "1024x768x24" [boot.limine.ableos.modules] -[boot.limine.ableos.modules.tests] -path = "boot:///tests.hbf" +# [boot.limine.ableos.modules.tests] +# path = "boot:///tests.hbf" -[boot.limine.ableos.modules.0serial_driver] -path = "boot:///serial_driver.hbf" +# [boot.limine.ableos.modules.0serial_driver] +# path = "boot:///serial_driver.hbf" -[boot.limine.ableos.modules.diskio_driver] -path = "boot:///diskio_driver.hbf" +# [boot.limine.ableos.modules.diskio_driver] +# path = "boot:///diskio_driver.hbf" -[boot.limine.ableos.modules.render_example] -path = "boot:///render_example.hbf" +# [boot.limine.ableos.modules.render_example] +# path = "boot:///render_example.hbf" -[boot.limine.ableos.modules.serial_driver_test] -path = "boot:///serial_driver_test.hbf" +# [boot.limine.ableos.modules.serial_driver_test] +# path = "boot:///serial_driver_test.hbf" + +# [boot.limine.ableos.modules.horizon] +# path = "boot:///horizon.hbf" + +# [boot.limine.ableos.modules.horizon_testing_program] +# path = "boot:///horizon_testing_program.hbf" + +# [boot.limine.ableos.modules.dt_buffer_test] +# path = "boot:///dt_buffer_test.hbf" + +[boot.limine.ableos.modules.svga_driver] +path = "boot:///svga_driver.hbf" diff --git a/sysdata/ui_lisp/doc_example.ul b/sysdata/ui_lisp/doc_example.ul deleted file mode 100644 index 6ebdae03..00000000 --- a/sysdata/ui_lisp/doc_example.ul +++ /dev/null @@ -1,4 +0,0 @@ -/// a b c -void main(){} - -// Generated documentation below diff --git a/sysdata/ui_lisp/documentation.ul b/sysdata/ui_lisp/documentation.ul deleted file mode 100644 index fbce2857..00000000 --- a/sysdata/ui_lisp/documentation.ul +++ /dev/null @@ -1,2 +0,0 @@ -(label "Documentation") -(label "") diff --git a/sysdata/ui_lisp/sample.uil b/sysdata/ui_lisp/sample.uil new file mode 100644 index 00000000..c6d2ff0a --- /dev/null +++ b/sysdata/ui_lisp/sample.uil @@ -0,0 +1,27 @@ +/* +the following snippet lays out the following. +10 11 +*/ +(vertical + (label "10") + (label "11")) + + +/* +Each button must have an ID. This ID must be unique per button or the buttons with the same +ID will be treated as the same button. +*/ +(button id:8) + + +/* +This unique ID rull applies to any interactable element. +*/ +(label interactive:true id:9) + + +/* +The ID is used to send a message to the buffer of the process that handles UI. +The following code will handle displaying text locally and also sending the delta change to the buffer. +*/ +(line-edit id:10) \ No newline at end of file diff --git a/sysdata/ui_lisp/ui_lisp.ul b/sysdata/ui_lisp/ui_lisp.ul deleted file mode 100644 index bbff2cd2..00000000 --- a/sysdata/ui_lisp/ui_lisp.ul +++ /dev/null @@ -1,7 +0,0 @@ -(vertical - (horizontal - (label "Function main") - (button "goto declaration" (on_click "src/main.c:2"))) - (label "takes void") - (label "returns void") - (label "a b c")) \ No newline at end of file diff --git a/sysdata/ui_lisp/windowing_system_ui_lang.md b/sysdata/ui_lisp/windowing_system_ui_lang.md deleted file mode 100644 index 8c9bf9bc..00000000 --- a/sysdata/ui_lisp/windowing_system_ui_lang.md +++ /dev/null @@ -1,5 +0,0 @@ -- container - - horizontal - - vertical -- framebuffer -- \ No newline at end of file