From 2c1d24ab37f13802dd00a09ab3ee8999fe3c2b97 Mon Sep 17 00:00:00 2001 From: Erin Date: Sat, 11 Nov 2023 15:45:45 +0100 Subject: [PATCH] Little reorg --- README.md | 46 ++--------- arm.sh | 11 --- system.toml => concepts/system.toml | 0 .../DriverDepGraph.dot | 0 .../DriverDepGraph.svg | 0 CONTRIBUTING.md => contrib/README.md | 0 contrib/TODO.md | 32 ++++++++ design.dot => contrib/design.dot | 0 repbuild/src/main.rs | 72 ++++++++---------- rust-toolchain.toml | 2 +- rustfmt.toml | 4 +- {repbuild => sysdata}/background.bmp | Bin {repbuild => sysdata}/limine.cfg | 0 .../test-programs}/ecall.rhai | 0 .../test-programs}/failure.rhai | 0 .../test-programs/hblib/README.md | 0 .../test-programs}/hblib/std.rhai | 0 .../limine_framebuffer_driver.rhai | 2 +- .../test-programs}/main.rhai | 2 +- .../test-programs}/vfs.rhai | 3 +- .../test-programs}/vfs_test.rhai | 2 +- 21 files changed, 78 insertions(+), 98 deletions(-) delete mode 100755 arm.sh rename system.toml => concepts/system.toml (100%) rename DriverDepGraph.dot => contrib/DriverDepGraph.dot (100%) rename DriverDepGraph.svg => contrib/DriverDepGraph.svg (100%) rename CONTRIBUTING.md => contrib/README.md (100%) create mode 100644 contrib/TODO.md rename design.dot => contrib/design.dot (100%) rename {repbuild => sysdata}/background.bmp (100%) rename {repbuild => sysdata}/limine.cfg (100%) rename {repbuild/holeybytes => sysdata/test-programs}/ecall.rhai (100%) rename {repbuild/holeybytes => sysdata/test-programs}/failure.rhai (100%) rename repbuild/hblib/readme.md => sysdata/test-programs/hblib/README.md (100%) rename {repbuild => sysdata/test-programs}/hblib/std.rhai (100%) rename {repbuild/holeybytes => sysdata/test-programs}/limine_framebuffer_driver.rhai (92%) rename {repbuild/holeybytes => sysdata/test-programs}/main.rhai (81%) rename {repbuild/holeybytes => sysdata/test-programs}/vfs.rhai (73%) rename {repbuild/holeybytes => sysdata/test-programs}/vfs_test.rhai (87%) diff --git a/README.md b/README.md index 935103a..7a61641 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,15 @@ -``` -TODO - - Build out the object system - - Build or Find an acceptable IDL - Short List of potentials - - [comline](https://git.ablecorp.us/DOOME1M8Cover/comline) - - Work on a styleguide for commits - Maybe something allong the lines of - [relevant shorthand note] Explination - - Language support on HBVM - - HBVM assembler (with IDL support) - - HBVM Lisp/s-expr Compiler (Also (with (IDL (support)))) - - Documentation - - Drivers - - serial driver - - PS/2 mouse driver - - PS/2 Keyboard driver - - VGA driver - - SVGA driver - - File system - - Depends on Disk driver - - TarFS - Pass in a tar file as an initrd and parse it with TarFS - - VFS - Being (written)[https://git.ablecorp.us/bee/ableos-vfs] by Bee - - Disk driver - - IDE Driver - - ATA Driver - - Floppy Driver - - A ton more - - Port (Slint)[https://slint.dev] - - Depends on - - Graphics Driver -``` +# AbleOS +An UNIX-unlike micro-kernel written in rust with an embedded bytecode virtual machine. # Community [Discord](https://discord.gg/JrKVukDtgs) - - # Compiling -Firstly, I would like to apologize. I am not capable of supporting building on any random machine with any random operating system. +AbleOS should be able to be built on any platform which is supported by +[Rustc Tier 1 platform support](https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-1-with-host-tools). -AbleOS very likely builds with `nix-shell` on your operating system. +For running AbleOS, `repbuild` uses QEMU. +## Steps 1. `git submodule update --init` -1. `cargo repbuild` +2. `cargo repbuild` diff --git a/arm.sh b/arm.sh deleted file mode 100755 index addf7e5..0000000 --- a/arm.sh +++ /dev/null @@ -1,11 +0,0 @@ -qemu-system-aarch64 -m 1024 -cpu cortex-a57 \ --M virt -pflash "AAVMF_CODE.fd" \ --device virtio-gpu-pci \ --device virtio-mouse-device \ --device virtio-keyboard-device \ --kernel limine/BOOTX64.EFI -# -device virtio-serial-pci \ -# -drive if=none,file=target/disk.img,id=hd0 \ -# -device virtio-blk-device,drive=hd0 - -# -kernel target/aarch64-virt-ableos/debug/kernel diff --git a/system.toml b/concepts/system.toml similarity index 100% rename from system.toml rename to concepts/system.toml diff --git a/DriverDepGraph.dot b/contrib/DriverDepGraph.dot similarity index 100% rename from DriverDepGraph.dot rename to contrib/DriverDepGraph.dot diff --git a/DriverDepGraph.svg b/contrib/DriverDepGraph.svg similarity index 100% rename from DriverDepGraph.svg rename to contrib/DriverDepGraph.svg diff --git a/CONTRIBUTING.md b/contrib/README.md similarity index 100% rename from CONTRIBUTING.md rename to contrib/README.md diff --git a/contrib/TODO.md b/contrib/TODO.md new file mode 100644 index 0000000..1d13b9f --- /dev/null +++ b/contrib/TODO.md @@ -0,0 +1,32 @@ +# TODO +- Build out the object system +- Build or Find an acceptable IDL + Short List of potentials + - [comline](https://git.ablecorp.us/DOOME1M8Cover/comline) +- Work on a styleguide for commits + Maybe something allong the lines of + [relevant shorthand note] Explination +- Language support on HBVM + - HBVM assembler (with IDL support) + - HBVM Lisp/s-expr Compiler (Also (with (IDL (support)))) +- Documentation +- Drivers + - serial driver + - PS/2 mouse driver + - PS/2 Keyboard driver + - VGA driver + - SVGA driver + - File system + - Depends on Disk driver + - TarFS + Pass in a tar file as an initrd and parse it with TarFS + - VFS + Being (written)[https://git.ablecorp.us/bee/ableos-vfs] by Bee + - Disk driver + - IDE Driver + - ATA Driver + - Floppy Driver + - A ton more +- Port (Slint)[https://slint.dev] + - Depends on + - Graphics Driver diff --git a/design.dot b/contrib/design.dot similarity index 100% rename from design.dot rename to contrib/design.dot diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index b0b61d6..a0e6caf 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -1,8 +1,6 @@ -use error_stack::Report; - use { derive_more::Display, - error_stack::{bail, report, Context, Result, ResultExt}, + error_stack::{bail, report, Context, Report, Result, ResultExt}, fatfs::{FileSystem, FormatVolumeOptions, FsOptions, ReadWriteSeek}, std::{fmt::Display, fs::File, io, path::Path, process::Command}, }; @@ -75,17 +73,26 @@ fn main() -> Result<(), Error> { } fn assemble() -> Result<(), Error> { - match std::fs::create_dir("target/holeybytes") { + match std::fs::create_dir("target/test-programs") { Ok(_) => (), Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => (), Err(e) => return Err(Report::new(e).change_context(Error::Io)), } - for entry in std::fs::read_dir("repbuild/holeybytes") + for entry in std::fs::read_dir("sysdata/test-programs") .map_err(Report::from) .change_context(Error::Io)? { let entry = entry.map_err(Report::from).change_context(Error::Io)?; + if !entry + .file_type() + .map_err(Report::from) + .change_context(Error::Io)? + .is_file() + { + continue; + } + let name = entry.file_name(); let name = name.to_string_lossy(); let name = name.trim_end_matches(".rhai"); @@ -93,7 +100,7 @@ fn assemble() -> Result<(), Error> { let mut out = File::options() .write(true) .create(true) - .open(Path::new("target/holeybytes").join(format!("{name}.hbf"))) + .open(Path::new("target/test-programs").join(format!("{name}.hbf"))) .map_err(Report::from) .change_context(Error::Io)?; @@ -125,7 +132,7 @@ fn get_fs() -> Result, io::Error> { io::copy( &mut File::open("limine/BOOTX64.EFI") .map_err(Report::from) - .attach_printable("copying Limine bootloader (have you pulled the submodule?)")?, + .attach_printable("Copying Limine (x86_64): have you pulled the submodule?")?, &mut bootdir.create_file("bootx64.efi")?, )?; @@ -133,43 +140,28 @@ fn get_fs() -> Result, io::Error> { &mut File::open("limine/BOOTAA64.EFI") .map_err(Report::from) .attach_printable( - "copying Limine bootloader arm version (have you pulled the submodule?)", + "Copying Limine (ARM): have you pulled the submodule?", )?, &mut bootdir.create_file("bootaa64.efi")?, )?; - io::copy( - &mut File::open("repbuild/limine.cfg")?, - &mut fs.root_dir().create_file("limine.cfg")?, - )?; - - io::copy( - &mut File::open("repbuild/background.bmp")?, - &mut fs.root_dir().create_file("background.bmp")?, - )?; - io::copy( - &mut File::open("target/holeybytes/failure.hbf")?, - &mut fs.root_dir().create_file("failure.hbf")?, - )?; - - io::copy( - &mut File::open("target/holeybytes/ecall.hbf")?, - &mut fs.root_dir().create_file("ecall.hbf")?, - )?; - - io::copy( - &mut File::open("target/holeybytes/main.hbf")?, - &mut fs.root_dir().create_file("main.hbf")?, - )?; - - io::copy( - &mut File::open("target/holeybytes/vfs_test.hbf")?, - &mut fs.root_dir().create_file("vfs_test.hbf")?, - )?; - io::copy( - &mut File::open("target/holeybytes/limine_framebuffer_driver.hbf")?, - &mut fs.root_dir().create_file("limine_framebuffer_driver.hbf")?, - )?; + for fpath in [ + "sysdata/limine.cfg", + "sysdata/background.bmp", + "target/test-programs/failure.hbf", + "target/test-programs/ecall.hbf", + "target/test-programs/main.hbf", + "target/test-programs/vfs_test.hbf", + "target/test-programs/limine_framebuffer_driver.hbf", + ] { + let path = Path::new(fpath); + io::copy( + &mut File::open(path)?, + &mut fs + .root_dir() + .create_file(&path.file_name().unwrap().to_string_lossy())?, + )?; + } drop(bootdir); Ok(fs) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ecc21cc..9434ac3 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly" +channel = "nightly" components = ["rust-src", "llvm-tools"] diff --git a/rustfmt.toml b/rustfmt.toml index 3807d4c..5606249 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1,3 @@ -hex_literal_case = "Upper" -imports_granularity = "One" +hex_literal_case = "Upper" +imports_granularity = "One" struct_field_align_threshold = 5 diff --git a/repbuild/background.bmp b/sysdata/background.bmp similarity index 100% rename from repbuild/background.bmp rename to sysdata/background.bmp diff --git a/repbuild/limine.cfg b/sysdata/limine.cfg similarity index 100% rename from repbuild/limine.cfg rename to sysdata/limine.cfg diff --git a/repbuild/holeybytes/ecall.rhai b/sysdata/test-programs/ecall.rhai similarity index 100% rename from repbuild/holeybytes/ecall.rhai rename to sysdata/test-programs/ecall.rhai diff --git a/repbuild/holeybytes/failure.rhai b/sysdata/test-programs/failure.rhai similarity index 100% rename from repbuild/holeybytes/failure.rhai rename to sysdata/test-programs/failure.rhai diff --git a/repbuild/hblib/readme.md b/sysdata/test-programs/hblib/README.md similarity index 100% rename from repbuild/hblib/readme.md rename to sysdata/test-programs/hblib/README.md diff --git a/repbuild/hblib/std.rhai b/sysdata/test-programs/hblib/std.rhai similarity index 100% rename from repbuild/hblib/std.rhai rename to sysdata/test-programs/hblib/std.rhai diff --git a/repbuild/holeybytes/limine_framebuffer_driver.rhai b/sysdata/test-programs/limine_framebuffer_driver.rhai similarity index 92% rename from repbuild/holeybytes/limine_framebuffer_driver.rhai rename to sysdata/test-programs/limine_framebuffer_driver.rhai index 040aab2..10e2214 100644 --- a/repbuild/holeybytes/limine_framebuffer_driver.rhai +++ b/sysdata/test-programs/limine_framebuffer_driver.rhai @@ -2,7 +2,7 @@ // The STD and even syscalls are still in flux. // Do your best to avoid adding bad design. // Use std abstractions if they exist like logging functionality -import "repbuild/hblib/std" as std; +import "sysdata/test-programs/hblib/std" as std; // Define main fn main(){ diff --git a/repbuild/holeybytes/main.rhai b/sysdata/test-programs/main.rhai similarity index 81% rename from repbuild/holeybytes/main.rhai rename to sysdata/test-programs/main.rhai index d4e258a..4b7c5cf 100644 --- a/repbuild/holeybytes/main.rhai +++ b/sysdata/test-programs/main.rhai @@ -1,4 +1,4 @@ -import "repbuild/hblib/std" as std; +import "sysdata/test-programs/hblib/std" as std; fn main(){ std::Error(":+)"); diff --git a/repbuild/holeybytes/vfs.rhai b/sysdata/test-programs/vfs.rhai similarity index 73% rename from repbuild/holeybytes/vfs.rhai rename to sysdata/test-programs/vfs.rhai index 71a5d21..0d91943 100644 --- a/repbuild/holeybytes/vfs.rhai +++ b/sysdata/test-programs/vfs.rhai @@ -1,6 +1,5 @@ /// Act as a shim of a virtual file system that recieves one message from buffer 2 -import "repbuild/hblib/std" as std; - +import "sysdata/test-programs/hblib/std" as std; fn main() { diff --git a/repbuild/holeybytes/vfs_test.rhai b/sysdata/test-programs/vfs_test.rhai similarity index 87% rename from repbuild/holeybytes/vfs_test.rhai rename to sysdata/test-programs/vfs_test.rhai index 22663bf..1ff3285 100644 --- a/repbuild/holeybytes/vfs_test.rhai +++ b/sysdata/test-programs/vfs_test.rhai @@ -1,4 +1,4 @@ -import "repbuild/hblib/std" as std; +import "sysdata/test-programs/hblib/std" as std; fn main(){ std::Info("Trying to open a file.");