diff --git a/.gitignore b/.gitignore index 7fe889b0b..3a6c2180d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ qprofiler userland/*/target kernel/target userland/root_fs/mnt/* +target/ + !*/.gitkeep diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..a89be69c5 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1065 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ab_glyph" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24606928a235e73cdef55a0c909719cadd72fce573e5713d58cb2952d8f5794c" +dependencies = [ + "ab_glyph_rasterizer", + "libm", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" +dependencies = [ + "libm", +] + +[[package]] +name = "ableos" +version = "0.1.1" +dependencies = [ + "ab_glyph", + "acpi", + "axel", + "bootloader", + "cpuio", + "ext2", + "externc-libm", + "facepalm", + "genfs", + "hashbrown 0.7.2", + "kernel", + "lazy_static", + "libwasm", + "linked_list_allocator", + "lliw", + "log", + "logos", + "pc-beeper", + "pic8259", + "picorand", + "pretty-hex", + "rdrand", + "rhai", + "riscv", + "rkyv", + "serde", + "shadeable", + "spin 0.5.2", + "toml", + "uart_16550", + "unicode-width", + "vga", + "volatile 0.2.7", + "wasmi", + "watson", + "x86_64", + "y-compositor-protocol", +] + +[[package]] +name = "acpi" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55237649c6e747ea67e5ed45125af5e6a35ea1250c5e44995eb6049a955bd004" +dependencies = [ + "bit_field", + "log", + "rsdp", +] + +[[package]] +name = "ahash" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "const-random", + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axel" +version = "0.1.0" +source = "git+https://git.ablecorp.us/able/aos_userland#a9721a7b034ec24c3bc2b6ffe6fa989b47b144ef" +dependencies = [ + "hashbrown 0.7.2", + "log", + "logos", + "versioning", +] + +[[package]] +name = "bare-metal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" + +[[package]] +name = "beef" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed554bd50246729a1ec158d08aa3235d1b69d94ad120ebe187e28894787e736" + +[[package]] +name = "bit_field" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bootloader" +version = "0.9.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de78decc37247c7cfac5dbf3495c7298c6ac97cb355161caa7e15969c6648e6c" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "3.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71c47df61d9e16dc010b55dba1952a57d8c215dbb533fd13cdd13369aac73b1c" +dependencies = [ + "atty", + "bitflags", + "indexmap", + "os_str_bytes", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "conquer-once" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c6d3a9775a69f6d1fe2cc888999b67ed30257d3da4d2af91984e722f2ec918a" +dependencies = [ + "conquer-util", +] + +[[package]] +name = "conquer-util" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e763eef8846b13b380f37dfecda401770b0ca4e56e95170237bd7c25c7db3582" + +[[package]] +name = "const-random" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f590d95d011aa80b063ffe3253422ed5aa462af4e9867d43ce8337562bac77c4" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" +dependencies = [ + "getrandom", + "lazy_static", + "proc-macro-hack", + "tiny-keccak", +] + +[[package]] +name = "core-error" +version = "0.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efcdb2972eb64230b4c50646d8498ff73f5128d196a90c7236eec4cbe8619b8f" +dependencies = [ + "version_check", +] + +[[package]] +name = "cpuio" +version = "0.3.2" +source = "git+https://git.ablecorp.us/ondra05/cpuio.git#093cc103101b4ba4abd02d77c884113a376cdc64" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "ext2" +version = "0.1.1" +source = "git+https://git.ablecorp.us/able/ext2-rs.git#15bcf9f72e2523e7ebe2a8d09c1231ca9139f326" +dependencies = [ + "bitflags", + "genfs", + "rlibc", + "spin 0.9.2", +] + +[[package]] +name = "externc-libm" +version = "0.1.0" +source = "git+https://git.ablecorp.us/able/externc-libm.git#0781df85c094bcd7e5ef7505e9c5cc6317eeda75" +dependencies = [ + "libm", +] + +[[package]] +name = "facepalm" +version = "0.1.0" +dependencies = [ + "log", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "font8x8" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875488b8711a968268c7cf5d139578713097ca4635a76044e8fe8eedf831d07e" + +[[package]] +name = "genfs" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b9e52a0ffd4c2f11f9f84e8885a40cb99f490971eee78bbd7ddffd6ac023d6" + +[[package]] +name = "getrandom" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf" +dependencies = [ + "ahash 0.3.8", + "autocfg", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "hashbrown" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "indexmap" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +dependencies = [ + "autocfg", + "hashbrown 0.11.2", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "kernel" +version = "0.1.2" +dependencies = [ + "lazy_static", + "log", + "versioning", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] + +[[package]] +name = "libc" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec647867e2bf0772e28c8bcde4f0d19a9216916e890543b5a03ed8ef27b8f259" + +[[package]] +name = "libm" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" + +[[package]] +name = "libwasm" +version = "0.1.0" +source = "git+https://git.ablecorp.us/able/libwasm.git#aa1f7d5c0985649b6d73249dcad908272e82d7eb" + +[[package]] +name = "linked_list_allocator" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "549ce1740e46b291953c4340adcd74c59bcf4308f4cac050fd33ba91b7168f4a" +dependencies = [ + "spinning_top", +] + +[[package]] +name = "lliw" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d502c8bcc35a4f7ca9a7ffb7ac27b15ba30b1b92c2d69a1e4437e2635d73af7" + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "logos" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427e2abca5be13136da9afdbf874e6b34ad9001dd70f2b103b083a85daa7b345" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56a7d287fd2ac3f75b11f19a1c8a874a7d55744bd91f7a1b3e7cf87d4343c36d" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax", + "syn", + "utf8-ranges", +] + +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + +[[package]] +name = "memory_units" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" + +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" + +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1e509cfe7a12db2a90bfa057dfcdbc55a347f5da677c506b53dd099cfec9d" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + +[[package]] +name = "pc-beeper" +version = "0.1.0" +source = "git+https://github.com/AbleOS/pc-beeper#9b61a9d60552a9da4285f5ceb39ab2cccbb60b4b" +dependencies = [ + "x86_64", +] + +[[package]] +name = "pic8259" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ec21f514e2e16e94649f1d041ca4a7069b512c037ac156360652a775e6229d" +dependencies = [ + "x86_64", +] + +[[package]] +name = "picorand" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fc30519d2508c7e20e01da371cd27b1d4533fdb98e279955cb636b50210688" + +[[package]] +name = "pretty-hex" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5c99d529f0d30937f6f4b8a86d988047327bb88d04d2c4afc356de74722131" + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro2" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "quote" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" + +[[package]] +name = "rdrand" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e0d5cb05cb40e4e5805399c27b12a064427cf553081ae9b82bc1a88111a576" +dependencies = [ + "rand_core", +] + +[[package]] +name = "regex" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "repbuild" +version = "0.1.1" +dependencies = [ + "anyhow", + "clap", + "xshell", +] + +[[package]] +name = "rhai" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef3d57e55ca044c53ced279d2d3ee9df229b247556b005a23713d5206a2ecfc" +dependencies = [ + "ahash 0.7.6", + "bitflags", + "core-error", + "instant", + "libm", + "no-std-compat", + "num-traits", + "rhai_codegen", + "smallvec", + "smartstring", +] + +[[package]] +name = "rhai_codegen" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faa0ff1c9dc19c9f8bba510a2a75d3f0449f6233570c2672c7e31c692a11a59a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "riscv" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6907ccdd7a31012b70faf2af85cd9e5ba97657cc3987c4f13f8e4d2c2a088aba" +dependencies = [ + "bare-metal", + "bit_field", + "riscv-target", +] + +[[package]] +name = "riscv-target" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88aa938cda42a0cf62a20cfe8d139ff1af20c2e681212b5b34adb5a58333f222" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "rkyv" +version = "0.7.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f08c8062c1fe1253064043b8fc07bfea1b9702b71b4a86c11ea3588183b12e1" +dependencies = [ + "hashbrown 0.12.0", + "ptr_meta", + "rkyv_derive", + "seahash", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e289706df51226e84814bf6ba1a9e1013112ae29bc7a9878f73fce360520c403" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rlibc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" + +[[package]] +name = "rsdp" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d3add2fc55ef37511bcf81a08ee7a09eff07b23aae38b06a29024a38c604b1" +dependencies = [ + "log", +] + +[[package]] +name = "rustversion" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "serde" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shadeable" +version = "0.1.0" +dependencies = [ + "libm", + "log", + "rhai", +] + +[[package]] +name = "smallvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" + +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spinning_top" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75adad84ee84b521fb2cca2d4fd0f1dab1d8d026bda3c5bea4ca63b5f9f9293c" +dependencies = [ + "lock_api", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "toml" +version = "0.5.6" +source = "git+https://github.com/diondokter/toml-rs#c4161aa70202b3992dbec79b76e7a8659713b604" +dependencies = [ + "hashbrown 0.7.2", + "serde", +] + +[[package]] +name = "ttf-parser" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74c96594835e10fa545e2a51e8709f30b173a092bfd6036ef2cec53376244f3" + +[[package]] +name = "uart_16550" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3616395dbb38a9c39a5865b5691c21d9f8369ba876355cfef8ce39d0d4cf3281" +dependencies = [ + "bitflags", + "x86_64", +] + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "utf8-ranges" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "versioning" +version = "0.1.2" +source = "git+https://git.ablecorp.us/able/aos_userland#a9721a7b034ec24c3bc2b6ffe6fa989b47b144ef" +dependencies = [ + "serde", +] + +[[package]] +name = "vga" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cbcb7bfff998d176ffb8f2c3dfd6cb0fe62740e36dee6c64fc3928c01001bf" +dependencies = [ + "bitflags", + "conquer-once", + "font8x8", + "num-traits", + "spinning_top", + "x86_64", +] + +[[package]] +name = "volatile" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b06ad3ed06fef1713569d547cdbdb439eafed76341820fb0e0344f29a41945" + +[[package]] +name = "volatile" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c2dbd44eb8b53973357e6e207e370f0c1059990df850aca1eca8947cf464f0" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasmi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +dependencies = [ + "downcast-rs", + "libm", + "memory_units", + "num-rational", + "num-traits", + "parity-wasm", + "wasmi-validation", +] + +[[package]] +name = "wasmi-validation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "watson" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cea7ead78c402dbf14e7f11911b0b48955ea13d46e012e2d98775e23c65d4ef" +dependencies = [ + "serde", + "webassembly", +] + +[[package]] +name = "webassembly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1a10e1dedffff9cfcbdd33c289c65b87da634259a460a3f23d513649fa7a8c" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "x86_64" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958cd5cb28e720db2f59ee9dc4235b5f82a183d079fb0e6caf43ad074cfdc66a" +dependencies = [ + "bit_field", + "bitflags", + "rustversion", + "volatile 0.4.4", +] + +[[package]] +name = "xshell" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaad2035244c56da05573d4d7fda5f903c60a5f35b9110e157a14a1df45a9f14" +dependencies = [ + "xshell-macros", +] + +[[package]] +name = "xshell-macros" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4916a4a3cad759e499a3620523bf9545cc162d7a06163727dde97ce9aaa4cf39" + +[[package]] +name = "y-compositor-protocol" +version = "0.1.1" +source = "git+https://git.ablecorp.us/able/y-compositor-protocol.git#d3bcd0d41c712bfc4b4f0f9e7b5dd470e00c04a2" +dependencies = [ + "rkyv", + "serde", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..ab539484b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[workspace] + +members = [ + "ableos", + "kernel", + "facepalm", + "shadeable", + "repbuild", + +] \ No newline at end of file diff --git a/ableos/Cargo.lock b/ableos/Cargo.lock index e6982c70f..454df7e22 100644 --- a/ableos/Cargo.lock +++ b/ableos/Cargo.lock @@ -117,7 +117,7 @@ dependencies = [ "hashbrown 0.7.2", "log", "logos", - "versioning 0.1.2 (git+https://git.ablecorp.us/able/aos_userland)", + "versioning", ] [[package]] @@ -308,7 +308,7 @@ version = "0.1.2" dependencies = [ "lazy_static", "log", - "versioning 0.1.2 (git+https://git.ablecorp.us/able/versioning)", + "versioning", ] [[package]] @@ -571,11 +571,12 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rhai" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49c94fda0280985896ed6d8bf0b43bbb5a7f0e39ccc8728ac907ddb4f06dae94" +checksum = "8ef3d57e55ca044c53ced279d2d3ee9df229b247556b005a23713d5206a2ecfc" dependencies = [ "ahash 0.7.6", + "bitflags", "core-error", "instant", "libm", @@ -588,9 +589,9 @@ dependencies = [ [[package]] name = "rhai_codegen" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02d33d76a7aa8ec72ac8298d5b52134fd2dff77445ada0c65f6f8c40d8f2931" +checksum = "faa0ff1c9dc19c9f8bba510a2a75d3f0449f6233570c2672c7e31c692a11a59a" dependencies = [ "proc-macro2", "quote", @@ -705,11 +706,13 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "smartstring" -version = "0.2.10" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e714dff2b33f2321fdcd475b71cec79781a692d846f37f415fb395a1d2bcd48e" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" dependencies = [ + "autocfg", "static_assertions", + "version_check", ] [[package]] @@ -819,11 +822,6 @@ dependencies = [ "serde", ] -[[package]] -name = "versioning" -version = "0.1.2" -source = "git+https://git.ablecorp.us/able/versioning#b86e53ab8461ee4f28807bf2254d543f6d8f4727" - [[package]] name = "vga" version = "0.2.7" diff --git a/ableos/Cargo.toml b/ableos/Cargo.toml index 575986905..51f0dee8e 100644 --- a/ableos/Cargo.toml +++ b/ableos/Cargo.toml @@ -50,10 +50,10 @@ spin = "0.5.2" log = "*" pretty-hex = "0.2.1" unicode-width = "0.1.7" -picorand = "*" +picorand = "0.1.0" watson = "0.4" genfs = "0.1.0" -rhai = "1.5" +rhai = "1.6.0" libwasm = {git="https://git.ablecorp.us:443/able/libwasm.git"} acpi = "4.1.0" diff --git a/ableos/src/arch/x86_64/interrupts.rs b/ableos/src/arch/x86_64/interrupts.rs index f16208aef..b7f647ec3 100644 --- a/ableos/src/arch/x86_64/interrupts.rs +++ b/ableos/src/arch/x86_64/interrupts.rs @@ -56,15 +56,19 @@ lazy_static! { idt }; } + extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) { println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame); } // new extern "x86-interrupt" fn double_fault_handler( stack_frame: InterruptStackFrame, - _error_code: u64, + error_code: u64, ) -> ! { - panic!("EXCEPTION: DOUBLE FAULT\n{:#?}", stack_frame); + panic!( + "EXCEPTION: Error code{}\nDOUBLE FAULT\n{:#?}", + error_code, stack_frame + ); } extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) { kernel::tick(); diff --git a/ableos/src/kmain.rs b/ableos/src/kmain.rs index 95988a1d1..785db52d9 100644 --- a/ableos/src/kmain.rs +++ b/ableos/src/kmain.rs @@ -51,7 +51,7 @@ pub fn cpu_socket_startup() { } pub fn log_version_data() { - info!("{} v{}", RELEASE_TYPE, KERNEL_VERSION); + info!("{} v{:?}", RELEASE_TYPE, KERNEL_VERSION); info!( "Brand String: {}", master().unwrap().brand_string().unwrap() diff --git a/ableos/src/lib.rs b/ableos/src/lib.rs index 048e31318..ff09163c0 100644 --- a/ableos/src/lib.rs +++ b/ableos/src/lib.rs @@ -58,7 +58,6 @@ pub mod kernel_state; pub mod keyboard; pub mod kmain; pub mod logger; -pub mod proto_filetable; pub mod relib; pub mod scheduler; mod unicode_utils; @@ -79,7 +78,6 @@ pub use graphics::*; pub use kernel_state::*; pub use keyboard::*; pub use logger::*; -pub use proto_filetable::*; pub use relib::*; // pub use scheduler::*; pub use utils::*; diff --git a/ableos/src/print.rs b/ableos/src/print.rs index 8d1443d08..c87e7dfe5 100644 --- a/ableos/src/print.rs +++ b/ableos/src/print.rs @@ -46,6 +46,5 @@ macro_rules! print { macro_rules! println { ($($tt:tt)*) => { ::core::writeln!($crate::print::Stdout, $($tt)*) - // panic![]; }; } diff --git a/ableos/src/proto_filetable/contain.rs b/ableos/src/proto_filetable/contain.rs deleted file mode 100644 index d957455bb..000000000 --- a/ableos/src/proto_filetable/contain.rs +++ /dev/null @@ -1,5 +0,0 @@ -use crate::ProtoFileTable; - -lazy_static::lazy_static!( - pub static ref FILE_TABLE: spin::Mutex = spin::Mutex::new(ProtoFileTable::new()); -); diff --git a/ableos/src/proto_filetable/file.rs b/ableos/src/proto_filetable/file.rs deleted file mode 100644 index eb3889ed0..000000000 --- a/ableos/src/proto_filetable/file.rs +++ /dev/null @@ -1,82 +0,0 @@ -use core::fmt; - -#[derive(Debug, PartialEq, Clone)] -pub struct PathRep { - pub location: FileLocations, - pub file_name: String, -} - -#[derive(Debug)] -pub struct FilePermissions { - pub read: bool, - pub write: bool, - pub execute: bool, -} - -#[derive(Debug)] -pub struct FileMetadata { - pub file_type: String, - pub size: usize, - // pub permissions: FilePermissions, -} - -#[derive(Debug, Clone, PartialEq)] -pub enum FileLocations { - Bin, - Config, - Home, -} -impl fmt::Display for FileLocations { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self) - } -} - -#[derive(Debug)] -pub struct File { - pub location: FileLocations, - pub file_name: String, - pub meta_data: FileMetadata, - pub data_pointer: Vec, -} - -impl File { - /// Write the provided bytes to a file - pub fn write_bytes(&mut self, bytes: &[u8]) { - for byte in bytes { - self.data_pointer.push(*byte); - } - - self.meta_data.size = self.data_pointer.len(); - } - - pub fn new(location: FileLocations, file_name: String, file_type: String) -> Self { - let bytes: Vec = vec![]; - let abc123 = bytes; - - Self { - location, - file_name, - meta_data: FileMetadata { file_type, size: 0 }, - data_pointer: abc123, - } - } - - pub fn size(&self) -> usize { - self.meta_data.size.clone() - } - - pub fn read_to_string(&mut self, _string: &mut String) { - todo!(); - } - - pub fn read_and_return(&mut self) -> String { - String::from_utf8(self.data_pointer.clone()).expect("Found invalid UTF-8") - } -} - -impl fmt::Display for File { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}://{}", self.location, self.file_name) - } -} diff --git a/ableos/src/proto_filetable/mod.rs b/ableos/src/proto_filetable/mod.rs deleted file mode 100644 index 030c3a50c..000000000 --- a/ableos/src/proto_filetable/mod.rs +++ /dev/null @@ -1,56 +0,0 @@ -//! A file table module for AbleOS -//! -//! This module provides a file table interface for AbleOS. -//! -//! # Examples -//! ``` -//! use relib::filesystem::ProtoFileTable; -//! let mut file_table = ProtoFileTable::new(); -//! file_table.add_file("test.txt", "Hello, world!".as_bytes()); -//! let file = file_table.get_file("test.txt"); -//! assert_eq!(file.unwrap().as_slice(), "Hello, world!".as_bytes()); -//! ``` -//! # Notes -//! The file table is a simple in-memory hashmap. -//! The file table is not thread safe. -//! The file table is not persistent. - -use hashbrown::HashMap; - -pub mod contain; -pub mod file; -use file::File; -/// A prototype file table for AbleOS -/// -/// This module provides a file table interface for AbleOS. -/// -/// # Examples -/// ``` -/// use crate::filesystem::ProtoFileTable; -/// let mut file_table = ProtoFileTable::new(); -/// file_table.add_file("test.txt", "Hello, world!".as_bytes()); -/// let file = file_table.get_file("test.txt"); -/// assert_eq!(file.unwrap().as_slice(), "Hello, world!".as_bytes()); -/// ``` -pub struct ProtoFileTable { - files: HashMap, -} - -impl ProtoFileTable { - pub fn new() -> ProtoFileTable { - ProtoFileTable { - files: HashMap::new(), - } - } - - pub fn add_file(&mut self, path: &str, contents: File) { - self.files.insert(path.to_string(), contents); - } - - pub fn get_file(&self, path: &str) -> Option<&File> { - self.files.get(path) - } -} - -#[cfg(test)] -mod tests; diff --git a/ableos/src/proto_filetable/tests.rs b/ableos/src/proto_filetable/tests.rs deleted file mode 100644 index 2877b2ebc..000000000 --- a/ableos/src/proto_filetable/tests.rs +++ /dev/null @@ -1,16 +0,0 @@ -use super::file::FileLocations; - -use super::*; - -// #[test] -fn test_add_file() { - let mut file_table = ProtoFileTable::new(); - let file_to_add = File::new(FileLocations::Bin, "test".to_string(), "txt".to_string()); - file_to_add.write_bytes(b"Hello, world!"); - file_table.add_file("test", file_to_add); - let file = file_table.get_file("test.txt"); - assert_eq!( - file.unwrap().data_pointer.as_slice(), - "Hello, world!".as_bytes() - ); -} diff --git a/ableos/src/serial_print.rs b/ableos/src/serial_print.rs index 84d880de5..6b7f7d3f6 100644 --- a/ableos/src/serial_print.rs +++ b/ableos/src/serial_print.rs @@ -43,6 +43,5 @@ macro_rules! serial_print { macro_rules! serial_println { ($($tt:tt)*) => { ::core::writeln!($crate::serial_print::Serialout, $($tt)*) - // panic![]; }; } diff --git a/ableos/src/wasm_jumploader/host_functions.rs b/ableos/src/wasm_jumploader/host_functions.rs index e69da8cb2..9d7d427b2 100644 --- a/ableos/src/wasm_jumploader/host_functions.rs +++ b/ableos/src/wasm_jumploader/host_functions.rs @@ -14,6 +14,8 @@ const GET_RANDOM_INDEX: usize = 3; const GET_INPUT_INDEX: usize = 4; +const PRINT_CLEVER_HACK: usize = 5; + impl Externals for HostExternals { fn invoke_index( &mut self, @@ -25,21 +27,21 @@ impl Externals for HostExternals { let a: u32 = args.nth_checked(0)?; let b: u32 = args.nth_checked(1)?; let result = a + b; - println!("SYSCALL: {} + {} = {}", a, b, result); + trace!("SYSCALL: {} + {} = {}", a, b, result); Ok(Some(RuntimeValue::I32(result as i32))) } SEND_SIGNAL_INDEX => { let pid: u32 = args.nth_checked(0)?; let signal: u32 = args.nth_checked(1)?; - println!("SYSCALL: send signal {} to pid {}", signal, pid); + trace!("SYSCALL: send signal {} to pid {}", signal, pid); let ret = RuntimeValue::I32(0); Ok(Some(ret)) } GET_TIME_INDEX => { use core::sync::atomic::Ordering::*; - println!("SYSCALL: get time"); + trace!("SYSCALL: get time"); x86_64::instructions::interrupts::disable(); let tick_time = kernel::TICK.load(Relaxed); x86_64::instructions::interrupts::enable(); @@ -48,7 +50,7 @@ impl Externals for HostExternals { Ok(Some(ret)) } GET_RANDOM_INDEX => { - println!("SYSCALL: get random"); + trace!("SYSCALL: get random"); let rand = generate_process_pass(); let ret = RuntimeValue::I32(rand as i32); @@ -58,11 +60,10 @@ impl Externals for HostExternals { } GET_INPUT_INDEX => { - // println!("SYSCALL: get input"); let input = x86_64::instructions::interrupts::without_interrupts(|| KEYBUFF.lock().pop()); if let Some(chr) = input { - println!("SYSCALL: input: {}", chr); + trace!("SYSCALL: input: {}", chr); } let ret = RuntimeValue::I32(input.unwrap_or(0x00 as char) as i32); @@ -70,7 +71,24 @@ impl Externals for HostExternals { Ok(Some(ret)) } - _ => panic!("Unimplemented function at {}", index), + PRINT_CLEVER_HACK => { + // println!("SYSCALL: print clever hack"); + + let combinated = args.nth_checked::(0).unwrap().to_le_bytes(); + + for x in combinated.iter() { + let chr = *x as char; + print!("{}", chr); + } + + println!("\n"); + Ok(None) + } + + _ => { + error!("Unimplemented function at {}", index); + Err(Trap::new(wasmi::TrapKind::Unreachable)) + } } } } @@ -129,7 +147,6 @@ impl HostExternals { } return true; } - GET_RANDOM_INDEX => { let (params, ret_ty): (&[ValueType], Option) = (&[], Some(ValueType::I32)); @@ -162,6 +179,22 @@ impl HostExternals { } return true; } + + PRINT_CLEVER_HACK => { + let (params, ret_ty): (&[ValueType], Option) = (&[ValueType::I64], None); + if params.len() != signature.params().len() { + return false; + } + if ret_ty != signature.return_type() { + return false; + } + for (ty, param) in params.iter().zip(signature.params()) { + if *ty != *param { + return false; + } + } + return true; + } _ => false, } } @@ -175,6 +208,7 @@ impl ModuleImportResolver for HostExternals { "get_time" => GET_TIME_INDEX, "get_random" => GET_RANDOM_INDEX, "get_input" => GET_INPUT_INDEX, + "print_clever_hack" => PRINT_CLEVER_HACK, _ => { return Err(Error::Instantiation(format!( "Export {} not found", @@ -192,11 +226,6 @@ impl ModuleImportResolver for HostExternals { trace!("Resolved export {} as func {}", field_name, index); Ok(FuncInstance::alloc_host(signature.clone(), index)) - - /*Ok(FuncInstance::alloc_host( - Signature::new(&[ValueType::I32, ValueType::I32][..], Some(ValueType::I32)), - index, - ))*/ } } use crate::wasm_jumploader::host_functions::ValueType::I32; diff --git a/ableos/src/wasm_jumploader/mod.rs b/ableos/src/wasm_jumploader/mod.rs index 6ce23e2a8..751fffeea 100644 --- a/ableos/src/wasm_jumploader/mod.rs +++ b/ableos/src/wasm_jumploader/mod.rs @@ -32,12 +32,10 @@ pub fn interp() { // Instantiate a module with empty imports and // assert that there is no `start` function. let instance = ModuleInstance::new(&module, &imports); // .expect("failed to instantiate wasm module") - // .assert_no_start(); match instance { Ok(inst) => { let mut instance = inst.assert_no_start(); - // trace!("Instantiated wasm module"); let mut is_driver = false; let mut is_program = false; @@ -54,7 +52,6 @@ pub fn interp() { has_driver_exit = true; } - // trace!("Checking for start function"); match instance.export_by_name("start") { Some(val) => { trace!("Program start function found"); diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 7c1c003dc..d659c110e 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -12,4 +12,4 @@ version = "1.4.0" default-features = false [dependencies.versioning] -git = "https://git.ablecorp.us/able/versioning" \ No newline at end of file +git = "https://git.ablecorp.us/able/aos_userland" \ No newline at end of file diff --git a/kernel/src/panic.rs b/kernel/src/panic.rs index 74602f662..95c9d989f 100644 --- a/kernel/src/panic.rs +++ b/kernel/src/panic.rs @@ -2,11 +2,11 @@ use core::panic::PanicInfo; // #[macro_use] -// use log; +use log::error; #[panic_handler] -fn panic_handler(_info: &PanicInfo) -> ! { - // error!("{}", _info); +fn panic_handler(info: &PanicInfo) -> ! { + error!("{}", info); loop {} } diff --git a/userland/root_fs/ext2.img b/userland/root_fs/ext2.img index a35c7b642..385e50c8d 100644 Binary files a/userland/root_fs/ext2.img and b/userland/root_fs/ext2.img differ