diff --git a/Cargo.lock b/Cargo.lock index 6cb6c3a97..d042e5c8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,40 +3,28 @@ version = 3 [[package]] -name = "able_graphics_library" -version = "0.1.2" -source = "git+https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2f1f7f04b43a8def709de1da98cb5fba1" +name = "aarch64-cpu" +version = "9.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac42a04a61c19fc8196dd728022a784baecc5d63d7e256c01ad1b3fbfab26287" dependencies = [ - "embedded-graphics", - "log", - "versioning", + "tock-registers", ] [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -47,14 +35,14 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.7.34", + "zerocopy", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -73,15 +61,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "az" @@ -91,24 +79,24 @@ checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] name = "base64" -version = "0.21.5" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "beef" @@ -136,15 +124,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -154,17 +142,17 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.83" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ - "libc", + "shlex", ] [[package]] @@ -175,9 +163,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -187,68 +175,46 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "clparse" -version = "0.1.0" -source = "git+https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2f1f7f04b43a8def709de1da98cb5fba1" -dependencies = [ - "hashbrown 0.14.2", - "log", - "toml 0.5.9", -] - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "derive_more" -version = "0.99.17" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", - "syn 1.0.109", + "syn", + "unicode-xid", ] [[package]] @@ -260,9 +226,9 @@ dependencies = [ [[package]] name = "embedded-graphics" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "750082c65094fbcc4baf9ba31583ce9a8bb7f52cadfb96f6164b1bc7f922f32b" +checksum = "0649998afacf6d575d126d83e68b78c0ab0e00ca2ac7e9b3db11b4cbe8274ef0" dependencies = [ "az", "byteorder", @@ -273,28 +239,36 @@ dependencies = [ [[package]] name = "embedded-graphics-core" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b1239db5f3eeb7e33e35bd10bd014e7b2537b17e071f726a09351431337cfa" +checksum = "ba9ecd261f991856250d2207f6d8376946cd9f412a2165d3b75bc87a0bc7a044" dependencies = [ "az", "byteorder", ] [[package]] -name = "encoding_rs" -version = "0.8.33" +name = "enumn" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "error-stack" -version = "0.4.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27a72baa257b5e0e2de241967bc5ee8f855d6072351042688621081d66b2a76b" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "error-stack" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe413319145d1063f080f27556fd30b1d70b01e2ba10c2a6e40d4be982ffc5d1" dependencies = [ "anyhow", "rustc_version", @@ -314,9 +288,9 @@ dependencies = [ [[package]] name = "float-cmp" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" dependencies = [ "num-traits", ] @@ -329,54 +303,56 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", + "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", + "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -386,9 +362,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -397,62 +373,34 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - -[[package]] -name = "h2" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.7.8", -] - -[[package]] -name = "hashbrown" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" -dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", ] [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#dc418bd5e0b962ec9413af72e5d624e17febcbf2" +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#dc418bd5e0b962ec9413af72e5d624e17febcbf2" +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#dc418bd5e0b962ec9413af72e5d624e17febcbf2" +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)", ] @@ -460,7 +408,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#dc418bd5e0b962ec9413af72e5d624e17febcbf2" +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)", ] @@ -468,22 +416,22 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/ableos/holey-bytes#dc418bd5e0b962ec9413af72e5d624e17febcbf2" +source = "git+https://git.ablecorp.us/ableos/holey-bytes#c133c2dbe71b3f1e1142bacef200775ae0c1d22d" dependencies = [ "hbbytecode 0.1.0 (git+https://git.ablecorp.us/ableos/holey-bytes)", ] [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "http" -version = "0.2.9" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -492,70 +440,95 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "hyper" -version = "0.14.27" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", "hyper", + "hyper-util", "rustls", + "rustls-pki-types", "tokio", "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -576,9 +549,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -586,31 +559,31 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "equivalent", + "hashbrown", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -619,17 +592,14 @@ dependencies = [ name = "kernel" version = "0.2.0" dependencies = [ - "able_graphics_library", - "clparse", + "aarch64-cpu", "crossbeam-queue", "derive_more", "embedded-graphics", - "hashbrown 0.14.2", + "hashbrown", "hbvm 0.1.0 (git+https://git.ablecorp.us/ableos/holey-bytes)", - "kiam", "limine", "log", - "rdrand", "sbi", "slab", "spin", @@ -637,16 +607,10 @@ dependencies = [ "versioning", "virtio-drivers", "x2apic", - "x86_64", + "x86_64 0.15.1", "xml", ] -[[package]] -name = "kiam" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0fc32485e41ae5e9dedd1442f36dec998431adc9f321224c2c5d645f38fdcb" - [[package]] name = "lazy_static" version = "1.5.0" @@ -655,20 +619,21 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "limine" -version = "0.1.11" -source = "git+https://github.com/limine-bootloader/limine-rs#4394419fe347901a9308a8956df16454a4b87b02" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02034f8f6b3e7bf050f310fbaf6db0018b8e54b75598d0a4c97172054752fede" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -676,9 +641,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" @@ -701,7 +666,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax", - "syn 2.0.38", + "syn", ] [[package]] @@ -715,15 +680,15 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "micromath" -version = "1.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc4010833aea396656c2f91ee704d51a6f1329ec2ab56ffd00bfd56f7481ea94" +checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815" [[package]] name = "mime" @@ -733,75 +698,86 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.9" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.32.1" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "33ea5043e58958ee56f3e15a90aee535795cd7dfd319846288d93c5b57d85cbe" [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -810,28 +786,109 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "proc-macro2" -version = "1.0.69" +name = "ppv-lite86" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] -name = "quote" -version = "1.0.33" +name = "quinn" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] [[package]] name = "raw-cpuid" @@ -842,15 +899,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "rdrand" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e233b642160555c1aa1ff7a78443c6139342f411b6fa6602af2ebbfee9e166bb" -dependencies = [ - "rand_core", -] - [[package]] name = "regex-syntax" version = "0.8.4" @@ -867,25 +915,26 @@ dependencies = [ "hblang", "reqwest", "str-reader", - "toml 0.5.11", + "toml", ] [[package]] name = "reqwest" -version = "0.11.22" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", + "futures-channel", "futures-core", "futures-util", - "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-rustls", + "hyper-util", "ipnet", "js-sys", "log", @@ -893,12 +942,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "system-configuration", + "sync_wrapper", "tokio", "tokio-rustls", "tower-service", @@ -907,80 +958,97 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg", + "windows-registry", ] [[package]] name = "ring" -version = "0.17.5" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ - "log", + "once_cell", "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64", + "rustls-pki-types", ] [[package]] -name = "rustls-webpki" -version = "0.101.7" +name = "rustls-pki-types" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sbi" @@ -994,53 +1062,53 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "semver" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1053,6 +1121,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "slab" version = "0.4.9" @@ -1063,23 +1137,19 @@ dependencies = [ ] [[package]] -name = "socket2" -version = "0.4.10" +name = "smallvec" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1098,10 +1168,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6aa20b89aec46e0bffbb8756e089beb4c43bbec53d0667de34212f048bdab10" [[package]] -name = "syn" -version = "1.0.109" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -1109,42 +1185,39 @@ dependencies = [ ] [[package]] -name = "syn" -version = "2.0.38" +name = "sync_wrapper" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "unicode-ident", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", + "syn", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -1156,68 +1229,97 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] -name = "tokio" -version = "1.33.0" +name = "tock-registers" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "696941a0aee7e276a165a978b37918fd5d22c55c3d6bda197813070ca9c0f21c" + +[[package]] +name = "tokio" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", - "socket2 0.5.5", - "windows-sys", + "socket2", + "windows-sys 0.52.0", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", + "rustls-pki-types", "tokio", ] [[package]] -name = "tokio-util" -version = "0.7.10" +name = "toml" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "bytes", "futures-core", - "futures-sink", + "futures-util", + "pin-project", "pin-project-lite", "tokio", - "tracing", + "tower-layer", + "tower-service", ] [[package]] -name = "toml" -version = "0.5.9" -source = "git+https://git.ablecorp.us/asya/toml-rs#4379150168e87103739a196566a7ce17ff245f01" -dependencies = [ - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "toml" -version = "0.5.11" +name = "tower-layer" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -1240,42 +1342,48 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "uart_16550" -version = "0.2.19" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614ff2a87880d4bd4374722268598a970bbad05ced8bf630439417347254ab2e" +checksum = "4922792855b1bce30997fbaa5418597902c278a92d20dfe348e6f062c3bd861d" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "rustversion", - "x86_64", + "x86", ] [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-xid" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + [[package]] name = "untrusted" version = "0.9.0" @@ -1284,9 +1392,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -1295,9 +1403,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "versioning" @@ -1309,13 +1417,14 @@ dependencies = [ [[package]] name = "virtio-drivers" -version = "0.4.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42299957c6f61af586fe3eae398c16ec07f33a02579fa1d41ae96156ce437029" +checksum = "d6a39747311dabb3d37807037ed1c3c38d39f99198d091b5b79ecd5c8d82f799" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", + "enumn", "log", - "zerocopy 0.6.5", + "zerocopy", ] [[package]] @@ -1341,34 +1450,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -1378,9 +1488,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1388,28 +1498,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -1417,59 +1527,80 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "rustls-pki-types", ] -[[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-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -1478,54 +1609,59 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "winreg" -version = "0.50.0" +name = "winnow" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ - "cfg-if", - "windows-sys", + "memchr", ] [[package]] @@ -1538,17 +1674,40 @@ dependencies = [ "bitflags 1.3.2", "paste", "raw-cpuid", - "x86_64", + "x86_64 0.14.12", +] + +[[package]] +name = "x86" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2781db97787217ad2a2845c396a5efe286f87467a5810836db6d74926e94a385" +dependencies = [ + "bit_field", + "bitflags 1.3.2", + "raw-cpuid", ] [[package]] name = "x86_64" -version = "0.14.11" +version = "0.14.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b835097a84e4457323331ec5d6eb23d096066cbfb215d54096dcb4b2e85f500" +checksum = "96cb6fd45bfeab6a5055c5bffdb08768bd0c069f1d946debe585bbb380a7c062" dependencies = [ "bit_field", - "bitflags 2.4.1", + "bitflags 2.6.0", + "rustversion", + "volatile", +] + +[[package]] +name = "x86_64" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc79523af8abf92fb1a970c3e086c5a343f6bcc1a0eb890f575cbb3b45743df" +dependencies = [ + "bit_field", + "bitflags 2.6.0", "rustversion", "volatile", ] @@ -1563,41 +1722,27 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.6.5" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96f8f25c15a0edc9b07eb66e7e6e97d124c0505435c382fde1ab7ceb188aa956" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", - "zerocopy-derive 0.6.5", -] - -[[package]] -name = "zerocopy" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive 0.7.34", + "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.6.5" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "855e0f6af9cd72b87d8a6c586f3cb583f5cdcc62c2c80869d8cd7e96fdf7ee20" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn", ] [[package]] -name = "zerocopy-derive" -version = "0.7.34" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.38", -] +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index 85e0ede68..38799da3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,9 @@ [workspace] resolver = "2" -members = [ "dev","kernel", "repbuild"] +members = ["dev", "kernel", "repbuild"] + +# [profile.release] +# strip = "symbols" +# codegen-units = 1 +# lto = true +# panic = "abort" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index d1beff862..d1764db2d 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -5,33 +5,32 @@ version = "0.2.0" [dependencies] -embedded-graphics = "0.7" +embedded-graphics = "0.8" hbvm.git = "https://git.ablecorp.us/ableos/holey-bytes" log = "0.4" spin = "0.9" -uart_16550 = "0.2" slab = { version = "0.4", default-features = false } +uart_16550 = { version = "0.3", features = ["nightly"] } xml.git = "https://git.ablecorp.us/ableos/ableos_userland" versioning.git = "https://git.ablecorp.us/ableos/ableos_userland" -able_graphics_library.git = "https://git.ablecorp.us/ableos/ableos_userland" -hashbrown = "*" -kiam = "0.1.1" +# able_graphics_library.git = "https://git.ablecorp.us/ableos/ableos_userland" +hashbrown = { version = "0.14", features = ["nightly"] } [dependencies.limine] version = "0.1" -git = "https://github.com/limine-bootloader/limine-rs" +#git = "https://github.com/limine-bootloader/limine-rs" [dependencies.crossbeam-queue] version = "0.3" default-features = false -features = ["alloc"] +features = ["alloc", "nightly"] -[dependencies.clparse] -git = "https://git.ablecorp.us/ableos/ableos_userland" -default-features = false +# [dependencies.clparse] +# git = "https://git.ablecorp.us/ableos/ableos_userland" +# default-features = false [dependencies.derive_more] -version = "0.99" +version = "1" default-features = false features = [ "add", @@ -48,12 +47,12 @@ features = [ [target.'cfg(target_arch = "x86_64")'.dependencies] -x86_64 = "0.14" +x86_64 = "0.15" x2apic = "0.4" -virtio-drivers = "0.4.0" -# rdrand = "*" -rdrand = { version = "0.8", default-features = false } - +virtio-drivers = "0.7" [target.'cfg(target_arch = "riscv64")'.dependencies] sbi = "0.2.0" + +[target.'cfg(target_arch = "aarch64")'.dependencies] +aarch64-cpu = "9" diff --git a/kernel/src/arch/aarch64/device_info_collector.rs b/kernel/src/arch/aarch64/device_info_collector.rs index dd200d3e0..c17d5d13f 100644 --- a/kernel/src/arch/aarch64/device_info_collector.rs +++ b/kernel/src/arch/aarch64/device_info_collector.rs @@ -29,7 +29,7 @@ fn collect_cpu_info(device_tree: &mut DeviceTree) { } fn cpu_id() -> (String, u64) { - let mut cpu_id: u64 = 0; + let mut cpu_id: u64; unsafe { asm!("mrs {cpu_id}, MIDR_EL1", cpu_id = out(reg) cpu_id, @@ -41,6 +41,8 @@ fn cpu_id() -> (String, u64) { // https://raspberrypi.stackexchange.com/questions/117175/how-do-i-read-the-cpuid-in-aarch64-asm 0x410FD034 => "Cortex-A53".to_string(), 0x410FD083 => "Cortex-A72".to_string(), + // the source of this one was checking the cpu id :thinking: + 0x410FD493 => "Neoverse N2".to_string(), _ => "Unknown".to_string(), }; log::trace!("CPU Name: {cpu_name} - CPU ID: 0x{:X}", cpu_id); diff --git a/kernel/src/arch/aarch64/mod.rs b/kernel/src/arch/aarch64/mod.rs index 793288ab1..a69e1ee40 100644 --- a/kernel/src/arch/aarch64/mod.rs +++ b/kernel/src/arch/aarch64/mod.rs @@ -1,6 +1,7 @@ pub use logging::log; use { crate::{allocator, bootmodules::BootModule, kmain::kmain}, + alloc::vec::Vec, core::arch::asm, limine::FramebufferRequest, }; @@ -41,7 +42,7 @@ unsafe extern "C" fn _kernel_start() -> ! { static KFILE_REQ: KernelFileRequest = KernelFileRequest::new(0); static MOD_REQ: ModuleRequest = ModuleRequest::new(0); - let mut bootmodules = alloc::vec::Vec::new(); + let mut bootmodules = Vec::new(); if bm.is_some() { let bm = bm.unwrap(); @@ -52,18 +53,13 @@ unsafe extern "C" fn _kernel_start() -> ! { let raw_bytes = core::slice::from_raw_parts( file.base.as_ptr().expect("invalid initrd"), file.length as usize, - ) - .to_vec(); - - let file_path = alloc::string::String::from_utf8( - file.path.to_str().unwrap().to_bytes().to_vec(), ); + + let file_path = file.path.to_str().unwrap().to_str(); if file_path.is_err() { panic!("invalid file path: {:?}", file_path); } - let file_cmd = alloc::string::String::from_utf8( - file.cmdline.to_str().unwrap().to_bytes().to_vec(), - ); + let file_cmd = file.cmdline.to_str().unwrap().to_str(); if file_cmd.is_err() { panic!("invalid module cmd: {:?}", file_cmd); } @@ -85,7 +81,7 @@ unsafe extern "C" fn _kernel_start() -> ! { assert_eq!(bm.module_count, bootmodules.len() as u64); } - crate::kmain::kmain( + kmain( KFILE_REQ .get_response() .get() @@ -99,8 +95,6 @@ unsafe extern "C" fn _kernel_start() -> ! { .unwrap_or_default(), bootmodules, ); - - spin_loop(); } pub fn spin_loop() -> ! { @@ -109,8 +103,19 @@ pub fn spin_loop() -> ! { } } +/// I am sorry. +static mut A_REAL_RANDOM_U64_I_PROMISE: u64 = 0; + pub fn hardware_random_u64() -> u64 { - 0 + if let Some(rng) = aarch64_cpu::asm::random::ArmRng::new() { + if let Some(rnd) = rng.rndr() { + return rnd; + } + } + unsafe { + A_REAL_RANDOM_U64_I_PROMISE += 1; + A_REAL_RANDOM_U64_I_PROMISE + } } pub fn register_dump() {} diff --git a/kernel/src/arch/riscv64/memory.rs b/kernel/src/arch/riscv64/memory.rs index b6411d737..a4859aeca 100644 --- a/kernel/src/arch/riscv64/memory.rs +++ b/kernel/src/arch/riscv64/memory.rs @@ -1,8 +1,10 @@ use core::num; -use alloc::boxed::Box; -use spin::{Mutex, Once}; -use crate::memory::{MemoryManager, PhysicalAddress, VirtualAddress}; +use { + crate::memory::{MemoryManager, PhysicalAddress, VirtualAddress}, + alloc::boxed::Box, + spin::{Mutex, Once}, +}; use super::PAGE_SIZE; @@ -28,7 +30,7 @@ impl PageSize { } pub struct PageTable { - entries: [PageEntry; 512] + entries: [PageEntry; 512], } impl PageTable { @@ -72,8 +74,14 @@ impl PageTable { /// flags MUST include one or more of the following: /// Read, Write, Execute /// The valid bit automatically gets added - pub fn map(&mut self, vaddr: VirtualAddress, paddr: PhysicalAddress, flags: PageEntryFlags, page_size: PageSize) { - assert!(flags as usize & 0xe != 0); + pub fn map( + &mut self, + vaddr: VirtualAddress, + paddr: PhysicalAddress, + flags: PageEntryFlags, + page_size: PageSize, + ) { + assert!(flags as usize & 0xE != 0); let vpn = vaddr.vpns(); let ppn = paddr.ppns(); @@ -91,7 +99,7 @@ impl PageTable { } let entry = v.addr().as_mut_ptr::(); - v = unsafe { entry.add(vpn[i]).as_mut().unwrap() }; + v = unsafe { entry.add(vpn[i]).as_mut().unwrap() }; } // When we get here, we should be at VPN[0] and v should be pointing to our entry. @@ -105,14 +113,24 @@ impl PageTable { } /// Identity maps a page of memory - pub fn identity_map(&mut self, addr: PhysicalAddress, flags: PageEntryFlags, page_size: PageSize) { + pub fn identity_map( + &mut self, + addr: PhysicalAddress, + flags: PageEntryFlags, + page_size: PageSize, + ) { // log::debug!("identity mapped {addr}"); self.map(addr.as_addr().into(), addr, flags, page_size); } /// Identity maps a range of contiguous memory /// This assumes that start <= end - pub fn identity_map_range(&mut self, start: PhysicalAddress, end: PhysicalAddress, flags: PageEntryFlags) { + pub fn identity_map_range( + &mut self, + start: PhysicalAddress, + end: PhysicalAddress, + flags: PageEntryFlags, + ) { log::debug!("start: {start}, end: {end}"); let mut mem_addr = start.as_addr() & !(PAGE_SIZE - 1); let num_pages = (align_val(end.as_addr(), 12) - mem_addr - 1) / PAGE_SIZE + 1; @@ -142,7 +160,7 @@ impl PageTable { } let entry = v.addr().as_mut_ptr::(); - v = unsafe { entry.add(vpn[i]).as_mut().unwrap() }; + v = unsafe { entry.add(vpn[i]).as_mut().unwrap() }; } // If we're here this is an unmapped page @@ -182,7 +200,7 @@ pub enum PageEntryFlags { Global = 1 << 5, Access = 1 << 6, Dirty = 1 << 7, - + // for convenience ReadWrite = Self::Read as usize | Self::Write as usize, ReadExecute = Self::Read as usize | Self::Execute as usize, @@ -228,7 +246,7 @@ impl PageEntry { } fn addr(&self) -> PhysicalAddress { - ((self.entry() as usize & !0x3ff) << 2).into() + ((self.entry() as usize & !0x3FF) << 2).into() } fn destroy(&mut self) { diff --git a/kernel/src/arch/riscv64/mod.rs b/kernel/src/arch/riscv64/mod.rs index b78a0e20e..c1a85198e 100644 --- a/kernel/src/arch/riscv64/mod.rs +++ b/kernel/src/arch/riscv64/mod.rs @@ -1,7 +1,7 @@ mod memory; use { - alloc::boxed::Box, + alloc::{boxed::Box, vec::Vec}, core::{ arch::{asm, global_asm}, fmt::Write, @@ -95,7 +95,7 @@ unsafe extern "C" fn _kernel_start() -> ! { in(reg) satp_value, ); - crate::kmain::kmain("baka=9", None); + crate::kmain::kmain("baka=9", Vec::new()); } /// Spin loop @@ -105,6 +105,12 @@ pub fn spin_loop() -> ! { } } +pub fn hardware_random_u64() -> u64 { + 0 +} + +pub fn register_dump() {} + pub fn log(args: core::fmt::Arguments<'_>) -> core::fmt::Result { SERIAL_CONSOLE.get().unwrap().lock().write_fmt(args) } diff --git a/kernel/src/arch/x86_64/gdt.rs b/kernel/src/arch/x86_64/gdt.rs index 4bc32b21f..a1e77591f 100644 --- a/kernel/src/arch/x86_64/gdt.rs +++ b/kernel/src/arch/x86_64/gdt.rs @@ -11,6 +11,9 @@ use { pub const DOUBLE_FAULT_IX: u16 = 0; +const STACK_SIZE: usize = 5 * 1024; +const STACK_ALIGNMENT: usize = 4096; + pub unsafe fn init() { use x86_64::instructions::{ segmentation::{Segment, CS, SS}, @@ -32,24 +35,24 @@ struct Selectors { static TSS: Lazy = Lazy::new(|| { let mut tss = TaskStateSegment::new(); - tss.interrupt_stack_table[usize::from(DOUBLE_FAULT_IX)] = { - const SIZE: usize = 5 * 1024; - let stack = unsafe { - alloc::alloc::alloc_zeroed( - alloc::alloc::Layout::from_size_align(SIZE, 1).expect("stack pointer"), - ) - }; - VirtAddr::from_ptr(stack) + SIZE + + let stack_ptr = unsafe { + let layout = alloc::alloc::Layout::from_size_align(STACK_SIZE, STACK_ALIGNMENT) + .expect("Failed to create stack layout"); + let stack = alloc::alloc::alloc_zeroed(layout); + VirtAddr::from_ptr(stack) + STACK_SIZE as u64 }; + + tss.interrupt_stack_table[usize::from(DOUBLE_FAULT_IX)] = stack_ptr; tss }); static GDT: Lazy<(GlobalDescriptorTable, Selectors)> = Lazy::new(|| { let mut gdt = GlobalDescriptorTable::new(); let sels = Selectors { - kcode: gdt.add_entry(Descriptor::kernel_code_segment()), - kdata: gdt.add_entry(Descriptor::kernel_data_segment()), - tss: gdt.add_entry(Descriptor::tss_segment(&TSS)), + kcode: gdt.append(Descriptor::kernel_code_segment()), + kdata: gdt.append(Descriptor::kernel_data_segment()), + tss: gdt.append(Descriptor::tss_segment(&TSS)), }; (gdt, sels) }); diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs index bc7ea2ff7..08e7aa0d8 100644 --- a/kernel/src/arch/x86_64/interrupts.rs +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -45,9 +45,9 @@ static IDT: Lazy = Lazy::new(|| { } idt.page_fault.set_handler_fn(page_fault); - idt[Interrupt::ApicErr as usize].set_handler_fn(apic_err); - idt[Interrupt::Spurious as usize].set_handler_fn(spurious); - idt[Interrupt::Timer as usize].set_handler_fn(timer); + idt[Interrupt::ApicErr as u8].set_handler_fn(apic_err); + idt[Interrupt::Spurious as u8].set_handler_fn(spurious); + idt[Interrupt::Timer as u8].set_handler_fn(timer); idt }); diff --git a/kernel/src/arch/x86_64/logging.rs b/kernel/src/arch/x86_64/logging.rs index 5652b255f..13fd49e6b 100644 --- a/kernel/src/arch/x86_64/logging.rs +++ b/kernel/src/arch/x86_64/logging.rs @@ -1,11 +1,6 @@ //! Logging (as in terms of console / serial output) #![allow(deprecated)] -use { - core::fmt::Write, - limine::{TerminalRequest, TerminalResponse}, - spin::{Lazy, Mutex}, - uart_16550::SerialPort, -}; +use {core::fmt::Write, spin::Mutex, uart_16550::SerialPort}; pub static SERIAL_CONSOLE: Mutex = Mutex::new(unsafe { SerialPort::new(0x3F8) }); diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs index a67a7ed0d..51dd9ee55 100644 --- a/kernel/src/arch/x86_64/mod.rs +++ b/kernel/src/arch/x86_64/mod.rs @@ -1,7 +1,6 @@ -use { - crate::bootmodules::BootModule, core::arch::asm, embedded_graphics::pixelcolor::Rgb888, - log::warn, rdrand::RdSeed, -}; +use core::arch::x86_64::{_rdrand64_step, _rdseed64_step}; + +use {crate::bootmodules::BootModule, core::arch::asm, log::warn}; pub mod memory; mod cpuid; @@ -143,18 +142,13 @@ unsafe extern "C" fn start() -> ! { let raw_bytes = core::slice::from_raw_parts( file.base.as_ptr().expect("invalid initrd"), file.length as usize, - ) - .to_vec(); - - let file_path = alloc::string::String::from_utf8( - file.path.to_str().unwrap().to_bytes().to_vec(), ); + + let file_path = file.path.to_str().unwrap().to_str(); if file_path.is_err() { panic!("invalid file path: {:?}", file_path); } - let file_cmd = alloc::string::String::from_utf8( - file.cmdline.to_str().unwrap().to_bytes().to_vec(), - ); + let file_cmd = file.cmdline.to_str().unwrap().to_str(); if file_cmd.is_err() { panic!("invalid module cmd: {:?}", file_cmd); } @@ -195,32 +189,20 @@ unsafe extern "C" fn start() -> ! { /// Spin loop pub fn spin_loop() -> ! { loop { - x86_64::instructions::hlt(); + x86_64::instructions::hlt() } } pub fn hardware_random_u64() -> u64 { - use {log::trace, rdrand::RdRand}; - let gen = RdRand::new(); - match gen { - Ok(gen) => { - let ret = gen.try_next_u64().unwrap(); - trace!("Random {}", ret); - return ret; - } - Err(err) => { + let mut out: u64 = 0; + match unsafe { _rdrand64_step(&mut out) } { + 1 => out, + _ => { warn!("RDRand not supported."); // Try rdseed - let gen = RdSeed::new(); - match gen { - Ok(gen) => { - let ret = gen.try_next_u64().unwrap(); - trace!("Random {}", ret); - return ret; - } - Err(err) => { - panic!("Neither RDRand or RDSeed are supported") - } + match unsafe { _rdseed64_step(&mut out) } { + 1 => out, + _ => panic!("Neither RDRand or RDSeed are supported"), } } } @@ -228,6 +210,7 @@ pub fn hardware_random_u64() -> u64 { pub fn get_edid() {} +#[allow(unused)] pub fn register_dump() { let rax: u64; let rbx: u64 = 0; diff --git a/kernel/src/arch/x86_64/pci/mod.rs b/kernel/src/arch/x86_64/pci/mod.rs index 5e2bbe7b2..b02c1834e 100644 --- a/kernel/src/arch/x86_64/pci/mod.rs +++ b/kernel/src/arch/x86_64/pci/mod.rs @@ -12,7 +12,8 @@ use crate::alloc::string::ToString; /// Enumerate PCI devices and run initialisation routines on ones we support pub fn init(device_tree: &mut DeviceTree) { - device_tree.devices + device_tree + .devices .insert("Unidentified PCI".to_string(), alloc::vec![]); let mut devices = alloc::vec![]; @@ -23,6 +24,7 @@ pub fn init(device_tree: &mut DeviceTree) { let id = device_info.device_id.id; use Vendor::*; let (dev_type, dev_name) = match (vendor, id) { + (VMWareInc, 1029) => ("GPUs", "SVGAII PCI GPU"), (Qemu, 4369) => ("GPUs", "QEMU VGA"), (VirtIO, 4176) => ("GPUs", "VirtIO PCI GPU"), (CirrusLogic, 184) => ("GPUs", "Cirrus SVGA"), //GD 5446? @@ -269,8 +271,7 @@ impl Display for Vendor { use core::fmt::Display; -use x86_64::instructions::port::Port; -use crate::device_tree::DeviceTree; +use {crate::device_tree::DeviceTree, x86_64::instructions::port::Port}; #[allow(non_camel_case_types, dead_code)] #[derive(Debug, Clone, Copy, PartialEq)] diff --git a/kernel/src/bootmodules.rs b/kernel/src/bootmodules.rs index 729bd926d..81d15b482 100644 --- a/kernel/src/bootmodules.rs +++ b/kernel/src/bootmodules.rs @@ -1,36 +1,36 @@ use { - crate::alloc::string::ToString, - alloc::{string::String, vec::Vec}, - clparse::Arguments, - core::fmt::{Debug, Display}, - log::trace, - xml::XMLElement, + // crate::alloc::string::ToString, + alloc::vec::Vec, + // clparse::Arguments, + // core::fmt::{Debug, Display}, + // log::trace, + // xml::XMLElement, }; -pub type BootModules = Vec; +pub type BootModules<'a> = Vec>; -pub struct BootModule { - pub path: String, - pub bytes: Vec, - pub cmd: String, +pub struct BootModule<'a> { + pub path: &'a str, + pub bytes: &'a [u8], + pub cmd: &'a str, } -impl BootModule { - pub fn new(path: String, bytes: Vec, cmd: String) -> Self { +impl<'a> BootModule<'a> { + pub fn new(path: &'a str, bytes: &'a [u8], cmd: &'a str) -> Self { Self { path, bytes, cmd } } } -pub fn build_cmd(name: T, cmdline: T) -> XMLElement { - let mut cmdline = cmdline.to_string(); - cmdline.pop(); - cmdline.remove(0); +// pub fn build_cmd(name: T, cmdline: T) -> XMLElement { +// let mut cmdline = cmdline.to_string(); +// cmdline.pop(); +// cmdline.remove(0); - let cmd = Arguments::parse(cmdline.to_string()).unwrap(); - trace!("Cmdline: {cmd:?}"); +// let cmd = Arguments::parse(cmdline.to_string()).unwrap(); +// trace!("Cmdline: {cmd:?}"); - let mut clo = XMLElement::new(name); - for (key, value) in cmd.arguments { - clo.set_attribute(key, value); - } - trace!("command line object: {:?}", clo); - clo -} +// let mut clo = XMLElement::new(name); +// for (key, value) in cmd.arguments { +// clo.set_attribute(key, value); +// } +// trace!("command line object: {:?}", clo); +// clo +// } diff --git a/kernel/src/holeybytes/ecah.rs b/kernel/src/holeybytes/ecah.rs index aca8153dd..b92ed7096 100644 --- a/kernel/src/holeybytes/ecah.rs +++ b/kernel/src/holeybytes/ecah.rs @@ -1,22 +1,14 @@ //! Environment call handling routines -use core::borrow::Borrow; - -use crate::{ - allocator, - holeybytes::kernel_services::{ - block_read, - dt_msg_handler::dt_msg_handler, - logging_service::log_msg_handler, - service_definition_service::{sds_msg_handler, SERVICES}, - }, +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::{mem::Memory, Vm}, - crate::{arch, holeybytes::mem, ipc::buffer::IpcBuffer, kmain::IPC_BUFFERS}, - alloc::string::String, - log::{debug, error, info, trace, warn}, + super::Vm, + crate::{arch, ipc::buffer::IpcBuffer, kmain::IPC_BUFFERS}, + log::{debug, error, info, trace}, }; pub fn handler(vm: &mut Vm) { @@ -76,11 +68,11 @@ pub fn handler(vm: &mut Vm) { match buffer_id { 0 => match sds_msg_handler(vm, mem_addr, length) { Ok(()) => {} - Err(err) => log::error!("Improper sds format"), + Err(err) => log::error!("Improper sds format: {err:?}"), }, 1 => match log_msg_handler(vm, mem_addr, length) { Ok(()) => {} - Err(err) => log::error!("Improper log format"), + Err(_) => log::error!("Improper log format"), }, 2 => { use crate::holeybytes::kernel_services::mem_serve::memory_msg_handler; @@ -88,77 +80,109 @@ pub fn handler(vm: &mut Vm) { Ok(_) => {} Err(_) => {} } - // } + #[cfg(not(target_arch = "x86_64"))] + 3 => info!("TODO: implement whatever buffer 3 does for no x86_64"), #[cfg(target_arch = "x86_64")] 3 => { - unsafe fn x86_in(address: u16) -> u8 { - x86_64::instructions::port::Port::new(address).read() - } - unsafe fn x86_out(address: u16, value: u8) { + unsafe fn x86_out( + address: u16, + value: T, + ) { x86_64::instructions::port::Port::new(address).write(value); } - - let mut msg_vec = block_read(mem_addr, length); + unsafe fn x86_in(address: u16) -> T { + x86_64::instructions::port::Port::new(address).read() + } + let msg_vec = block_read(mem_addr, length); let msg_type = msg_vec[0]; - msg_vec.remove(0); match msg_type { - 0 => { - let mut addr = msg_vec[0] as u16; - msg_vec.remove(0); - - let addr2 = msg_vec[0] as u16; - msg_vec.remove(0); - - addr = ((addr) << 8) | addr2; - - let value = unsafe { x86_in(addr) }; - + 0 => 'wow: { + let size = match msg_vec[0] { + 0 => 1, + 1 => 2, + 2 => 4, + _ => { + error!("Tried to write more than 32 bits"); + break 'wow; + } + }; + let addr = u16::from_le_bytes(msg_vec[1..3].try_into().unwrap()); + let value = unsafe { + match size { + 1 => x86_in::(addr) as u64, + 2 => x86_in::(addr) as u64, + 4 => x86_in::(addr) as u64, + _ => panic!("how?"), + } + }; trace!("Read the value {} from address {}", value, addr); - vm.registers[1] = hbvm::value::Value(value as u64); + vm.registers[1] = hbvm::value::Value(value); } - 1 => { - let mut addr = msg_vec[0] as u16; - msg_vec.remove(0); - - let addr2 = msg_vec[0] as u16; - msg_vec.remove(0); - - addr = ((addr) << 8) | addr2; - - let value = msg_vec[0]; - msg_vec.remove(0); - trace!("Setting the address {} to {}", addr, value); - unsafe { x86_out(addr, value) }; + 1 => 'wow: { + let size = match msg_vec[1] { + 0 => 1, + 1 => 2, + 2 => 4, + _ => { + error!("Tried to write more than 32 bits"); + break 'wow; + } + }; + let addr = unsafe { + u16::from_le_bytes(msg_vec[1..3].try_into().unwrap_unchecked()) + }; + trace!("Setting address {}", addr); + unsafe { + match size { + 1 => x86_out(addr, msg_vec[3]), + 2 => x86_out( + addr, + u16::from_le_bytes( + msg_vec[3..5].try_into().unwrap_unchecked(), + ), + ), + 4 => x86_out( + addr, + u32::from_le_bytes( + msg_vec[3..7].try_into().unwrap_unchecked(), + ), + ), + _ => panic!("How?"), + } + } } _ => {} } } #[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); + } 5 => match dt_msg_handler(vm, mem_addr, length) { Ok(()) => {} - Err(err) => log::error!("Improper dt query"), + Err(_) => log::error!("Improper dt query"), }, - buffer_id => { let mut buffs = IPC_BUFFERS.lock(); match buffs.get_mut(&buffer_id) { Some(buff) => { - use alloc::vec; - let mut msg_vec = vec![]; + let mut msg_vec = Vec::with_capacity(length); for x in 0..(length as isize) { let xyz = mem_addr as *const u8; let value = unsafe { xyz.offset(x).read() }; msg_vec.push(value); } - buff.push(msg_vec.clone()); - info!( + debug!( "Message {:?} has been sent to Buffer({})", msg_vec, buffer_id ); + buff.push(msg_vec); } None => { log::error!("Access of non-existent buffer {}", buffer_id) @@ -174,12 +198,12 @@ pub fn handler(vm: &mut Vm) { let max_length = vm.registers[5].cast::(); let mut buffs = IPC_BUFFERS.lock(); - let mut buff: &mut IpcBuffer; + let buff: &mut IpcBuffer; if buffs.get_mut(&buffer_id).is_some() { buff = buffs.get_mut(&buffer_id).unwrap(); } else { - info!("AHHH"); + // info!("AHHH"); vm.registers[1] = hbvm::value::Value(0); return; } @@ -199,7 +223,7 @@ pub fn handler(vm: &mut Vm) { } } - info!("Recieve {:?} from Buffer({})", msg, buffer_id); + debug!("Recieve {:?} from Buffer({})", msg, buffer_id); } } 5 => { @@ -217,13 +241,19 @@ pub fn handler(vm: &mut Vm) { vm.registers[3] = x } } - // 5 _ => { log::error!("Syscall unknown {:?}{:?}", ecall_number, vm.registers); } } } +#[derive(Debug)] +pub enum LogError { + NoMessages, + InvalidLogFormat, +} + +// use {alloc::vec, log::Record}; // fn memory_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> { // let mut val = alloc::vec::Vec::new(); // for _ in 0..4096 { diff --git a/kernel/src/holeybytes/kernel_services/dt_msg_handler.rs b/kernel/src/holeybytes/kernel_services/dt_msg_handler.rs index bcd34e0b3..876abb896 100644 --- a/kernel/src/holeybytes/kernel_services/dt_msg_handler.rs +++ b/kernel/src/holeybytes/kernel_services/dt_msg_handler.rs @@ -1,24 +1,22 @@ use { crate::holeybytes::{kernel_services::block_read, Vm}, alloc::{ - borrow::ToOwned, string::{String, ToString}, vec::Vec, }, - log::debug, }; pub enum DtError { QueryFailure, } pub fn dt_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), DtError> { - let mut msg_vec = block_read(mem_addr, length); + let msg_vec = block_read(mem_addr, length); let mut bytes: Vec = Vec::new(); for byte in msg_vec { - if byte == 0 { + if *byte == 0 { break; } - bytes.push(byte) + bytes.push(*byte) } let query_string = String::from_utf8(bytes).unwrap(); log::trace!("Query {}", query_string); @@ -62,10 +60,7 @@ fn cpu_parse(qt_parse_step_two: Vec) -> u64 { } fn framebuffer_parse(qt_parse_step_two: Vec) -> u64 { - use { - crate::kmain::FB_REQ, - limine::{Framebuffer, NonNullPtr}, - }; + use crate::kmain::FB_REQ; let fbs = &FB_REQ.get_response().get().unwrap().framebuffers(); let second_fragment: &str = &qt_parse_step_two[1]; diff --git a/kernel/src/holeybytes/kernel_services/logging_service.rs b/kernel/src/holeybytes/kernel_services/logging_service.rs index 27392dfa6..a0b461f91 100644 --- a/kernel/src/holeybytes/kernel_services/logging_service.rs +++ b/kernel/src/holeybytes/kernel_services/logging_service.rs @@ -1,25 +1,20 @@ -use crate::logger::TermLogger; - -use { - crate::holeybytes::{kernel_services::block_read, Vm}, - alloc::string::String, -}; +use crate::holeybytes::{kernel_services::block_read, Vm}; #[derive(Debug)] pub enum LogError { InvalidLogFormat, } -use {alloc::vec, log::Record}; +use log::Record; -pub fn log_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> { - let mut msg_vec = block_read(mem_addr, length); +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.pop().unwrap(); + let log_level = msg_vec.last().unwrap(); let file_name = "None"; let line_number = 0; - match String::from_utf8(msg_vec) { + match core::str::from_utf8(&msg_vec[..msg_vec.len()]) { Ok(strr) => { use log::Level::*; let log_level = match log_level { diff --git a/kernel/src/holeybytes/kernel_services/mem_serve.rs b/kernel/src/holeybytes/kernel_services/mem_serve.rs index d83322250..feeba2e7f 100644 --- a/kernel/src/holeybytes/kernel_services/mem_serve.rs +++ b/kernel/src/holeybytes/kernel_services/mem_serve.rs @@ -1,9 +1,7 @@ use { - crate::holeybytes::{ - kernel_services::{block_read, mem_serve}, - Vm, - }, - alloc::alloc::alloc_zeroed, + crate::holeybytes::{kernel_services::block_read, Vm}, + alloc::alloc::{alloc_zeroed, dealloc}, + core::alloc::Layout, log::{debug, info}, }; @@ -18,13 +16,10 @@ pub enum MemoryQuotaType { KillQuota = 3, } -fn alloc_page(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), MemoryServiceError> { - let mut val = alloc::vec::Vec::new(); - for _ in 0..4096 { - val.push(0); - } - info!("Block address: {:?}", val.as_ptr()); - vm.registers[1] = hbvm::value::Value(val.as_ptr() as u64); +fn alloc_page(vm: &mut Vm, _mem_addr: u64, _length: usize) -> Result<(), MemoryServiceError> { + let ptr = unsafe { alloc_zeroed(Layout::new::<[u8; 4096]>()) }; + info!("Block address: {:?}", ptr); + vm.registers[1] = hbvm::value::Value(ptr as u64); vm.registers[2] = hbvm::value::Value(4096); Ok(()) } @@ -34,34 +29,39 @@ pub fn memory_msg_handler( mem_addr: u64, length: usize, ) -> Result<(), MemoryServiceError> { - let mut msg_vec = block_read(mem_addr, length); + let msg_vec = block_read(mem_addr, length); let msg_type = msg_vec[0]; - - msg_vec.remove(0); match msg_type { 0 => { - let page_count = msg_vec[0]; - msg_vec.remove(0); - - let mptr_raw: [u8; 8] = msg_vec[0..8].try_into().unwrap(); + let page_count = msg_vec[1]; + let mptr_raw: [u8; 8] = msg_vec[2..10].try_into().unwrap(); let mptr: u64 = u64::from_le_bytes(mptr_raw); log::debug!("Allocating {} pages @ {:x}", page_count, mptr); - let mut val = alloc::vec::Vec::new(); - for _ in 0..(page_count as isize * 4096) { - val.push(0); - } - vm.registers[1] = hbvm::value::Value(val.as_ptr() as u64); - log::debug!("Kernel ptr: {:x}", val.as_ptr() as u64); - } - 1 => { - let page_count = msg_vec[0]; - msg_vec.remove(0); + let ptr = unsafe { + alloc_zeroed(Layout::from_size_align_unchecked( + page_count as usize * 4096, + 1, + )) + }; - let mptr_raw: [u8; 8] = msg_vec[0..8].try_into().unwrap(); + vm.registers[1] = hbvm::value::Value(ptr as u64); + log::debug!("Kernel ptr: {:x}", ptr as u64); + } + + 1 => { + let page_count = msg_vec[1]; + + let mptr_raw: [u8; 8] = msg_vec[2..10].try_into().unwrap(); let mptr: u64 = u64::from_le_bytes(mptr_raw); log::debug!("Deallocating {} pages @ {:x}", page_count, mptr); + unsafe { + dealloc( + mptr as *mut u8, + Layout::from_size_align_unchecked(page_count as usize * 4096, 1), + ) + } } 2 => { use MemoryQuotaType::*; @@ -72,19 +72,10 @@ pub fn memory_msg_handler( 3 => KillQuota, _ => NoQuota, }; - msg_vec.remove(0); - let hid_raw: [u8; 8] = msg_vec[0..8].try_into().unwrap(); + let hid_raw: [u8; 8] = msg_vec[2..10].try_into().unwrap(); let hid: u64 = u64::from_le_bytes(hid_raw); - for _ in 0..8 { - msg_vec.remove(0); - } - - let pid_raw: [u8; 8] = msg_vec[0..8].try_into().unwrap(); - let pid: u64 = u64::from_le_bytes(hid_raw); - for _ in 0..8 { - msg_vec.remove(0); - } - + let pid_raw: [u8; 8] = msg_vec[10..18].try_into().unwrap(); + let pid: u64 = u64::from_le_bytes(pid_raw); debug!( "Setting HID-{:x}:PID-{:x}'s quota type to {:?}", hid, pid, quota_type @@ -93,7 +84,6 @@ pub fn memory_msg_handler( 3 => { let page_count = msg_vec[0]; log::debug!(" {} pages", page_count); - msg_vec.remove(0); } _ => { diff --git a/kernel/src/holeybytes/kernel_services/mod.rs b/kernel/src/holeybytes/kernel_services/mod.rs index 58eef2d14..1e536a772 100644 --- a/kernel/src/holeybytes/kernel_services/mod.rs +++ b/kernel/src/holeybytes/kernel_services/mod.rs @@ -1,17 +1,11 @@ -use alloc::{vec, vec::Vec}; +use core::slice; pub mod dt_msg_handler; pub mod logging_service; pub mod mem_serve; pub mod service_definition_service; -pub fn block_read(mem_addr: u64, length: usize) -> Vec { - let mut msg_vec = vec![]; - - for x in 0..(length as isize) { - let xyz = mem_addr as *const u8; - let value = unsafe { xyz.offset(x).read() }; - msg_vec.push(value); - } - msg_vec +#[inline(always)] +pub fn block_read<'a>(mem_addr: u64, length: usize) -> &'a [u8] { + unsafe { slice::from_raw_parts(mem_addr as *const u8, length) } } diff --git a/kernel/src/holeybytes/kernel_services/service_definition_service.rs b/kernel/src/holeybytes/kernel_services/service_definition_service.rs index 0f26960fb..52f37ad69 100644 --- a/kernel/src/holeybytes/kernel_services/service_definition_service.rs +++ b/kernel/src/holeybytes/kernel_services/service_definition_service.rs @@ -1,45 +1,42 @@ use { crate::{ - alloc::string::ToString, arch::hardware_random_u64, holeybytes::{kernel_services::block_read, Vm}, - ipc::{ - buffer::IpcBuffer, - protocol::{self, Protocol}, - }, + ipc::{buffer::IpcBuffer, protocol::Protocol}, kmain::IPC_BUFFERS, }, - alloc::string::String, hashbrown::HashMap, log::{info, trace}, spin::{lazy::Lazy, Mutex}, }; -pub struct Services(HashMap); +pub struct Services<'a>(HashMap>); pub static SERVICES: Lazy> = Lazy::new(|| { let mut dt = Services(HashMap::new()); dt.0.insert(0, Protocol::void()); Mutex::new(dt) }); +#[derive(Debug)] pub enum ServiceError { InvalidFormat, } pub fn sds_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), ServiceError> { - let mut msg_vec = block_read(mem_addr, length); + let msg_vec = block_read(mem_addr, length); let sds_event_type: ServiceEventType = msg_vec[0].into(); - msg_vec.remove(0); // info!("Length {}", msg_vec.len()); use ServiceEventType::*; match sds_event_type { CreateService => { - let string = String::from_utf8(msg_vec).expect("Our bytes should be valid utf8"); + let string = + core::str::from_utf8(&msg_vec[1..]).expect("Our bytes should be valid utf8"); let ret = sds_create_service(string); vm.registers[1] = hbvm::value::Value(ret as u64); } DeleteService => todo!(), SearchServices => { - let string = String::from_utf8(msg_vec).expect("Our bytes should be valid utf8"); + let string = + core::str::from_utf8(&msg_vec[1..]).expect("Our bytes should be valid utf8"); let ret = sds_search_service(string); vm.registers[1] = hbvm::value::Value(ret as u64); } @@ -81,16 +78,16 @@ impl From for ServiceEventType { } } -fn sds_create_service(protocol: String) -> u64 { +fn sds_create_service(protocol: &'static str) -> u64 { let buff_id = hardware_random_u64(); let mut services = SERVICES.lock(); let mut buffers = IPC_BUFFERS.lock(); - let protocol_ = Protocol::from(protocol.clone()); + let protocol_ = Protocol::from(protocol); let mut buff = IpcBuffer::new(false, 0); services.0.insert(buff_id, protocol_.clone()); - buff.protocol = protocol_.clone(); + buff.protocol = protocol_; buffers.insert(buff_id, buff); trace!("BufferID({}) => {}", buff_id, protocol); @@ -98,13 +95,13 @@ fn sds_create_service(protocol: String) -> u64 { buff_id } -fn sds_search_service(protocol: String) -> u64 { - let mut services = SERVICES.lock(); - let compare = Protocol::from(protocol.clone()); +fn sds_search_service(protocol: &str) -> u64 { + let services = SERVICES.lock(); + let compare = Protocol::from(protocol); for (bid, protocol_canidate) in &services.0 { trace!("BID-{bid} protocol_canidate {:?}", protocol_canidate); if protocol_canidate == &compare { - trace!("BufferID({}) => {}", bid, protocol.clone()); + trace!("BufferID({}) => {}", bid, protocol); return *bid; } } diff --git a/kernel/src/holeybytes/mem.rs b/kernel/src/holeybytes/mem.rs index e9024c578..35a423baf 100644 --- a/kernel/src/holeybytes/mem.rs +++ b/kernel/src/holeybytes/mem.rs @@ -7,7 +7,7 @@ use hbvm::mem::Address; fn calc_start_of_page(ptr: u64) -> u64 { - let mut page_aligned = false; + let _page_aligned = false; if ptr % 4096 == 0 { // page_aligned = true; return ptr / 4096; @@ -21,11 +21,11 @@ pub struct Memory { impl Memory { #[cfg(target_arch = "x86_64")] - fn read_device(addr: Address) { - unsafe { - // - // x86_64::instructions::port::Port::new(addr.get()).read() - } + fn read_device(_addr: Address) { + //unsafe { + // + // x86_64::instructions::port::Port::new(addr.get()).read() + //} } } @@ -37,7 +37,6 @@ impl hbvm::mem::Memory for Memory { target: *mut u8, count: usize, ) -> Result<(), hbvm::mem::LoadError> { - use log::{error, info}; if addr.get() % 4096 == 0 {} core::ptr::copy(addr.get() as *const u8, target, count); Ok(()) @@ -56,6 +55,6 @@ impl hbvm::mem::Memory for Memory { #[inline] unsafe fn prog_read(&mut self, addr: Address) -> T { - (addr.get() as *const T).read_unaligned() + (addr.get() as *const T).read() } } diff --git a/kernel/src/holeybytes/mod.rs b/kernel/src/holeybytes/mod.rs index 6ae91ca7b..aecadd3c1 100644 --- a/kernel/src/holeybytes/mod.rs +++ b/kernel/src/holeybytes/mod.rs @@ -3,86 +3,86 @@ mod kernel_services; mod mem; use { - crate::{arch, ipc::buffer::IpcBuffer, kmain::IPC_BUFFERS}, - alloc::boxed::Box, - core::{default, future::Future, marker::PhantomData, ptr::NonNull, task::Poll}, + alloc::alloc::{alloc_zeroed, dealloc}, + core::{ + alloc::Layout, + future::Future, + pin::Pin, + task::{Context, Poll}, + }, hbvm::{ - mem::{ - softpaging::{icache::ICache, HandlePageFault, SoftPagedMem}, - Address, Memory, - }, + mem::{softpaging::HandlePageFault, Address}, VmRunError, VmRunOk, }, - log::{debug, error, info, trace, warn}, + log::error, }; const STACK_SIZE: usize = 1024 * 1024; -const TIMER_QUOTIENT: usize = 100; +const TIMER_QUOTIENT: usize = 1000; type Vm = hbvm::Vm; -pub struct ExecThread<'p> { +pub struct ExecThread { vm: Vm, stack_bottom: *mut u8, - _phantom: PhantomData<&'p [u8]>, } -unsafe impl<'p> Send for ExecThread<'p> {} -impl<'p> ExecThread<'p> { +unsafe impl Send for ExecThread {} + +impl ExecThread { pub fn set_arguments(&mut self, ptr: u64, length: u64) { self.vm.registers[1] = hbvm::value::Value(ptr); self.vm.registers[2] = hbvm::value::Value(length); } - pub unsafe fn new(program: &'p [u8], entrypoint: Address) -> Self { - let mut vm = unsafe { - Vm::new( - mem::Memory {}, - Address::new(program.as_ptr() as u64 + entrypoint.get()), - ) - }; + pub unsafe fn new(program: &[u8], entrypoint: Address) -> Self { + let mut vm = Vm::new( + mem::Memory {}, + Address::new(program.as_ptr() as u64 + entrypoint.get()), + ); + + let stack_bottom = allocate_stack(); - let stack_bottom = unsafe { allocate_stack().as_ptr() }; vm.write_reg(254, (stack_bottom as usize + STACK_SIZE - 1) as u64); - ExecThread { - vm, - stack_bottom, - _phantom: Default::default(), - } + ExecThread { vm, stack_bottom } } } -impl<'p> Drop for ExecThread<'p> { +impl<'p> Drop for ExecThread { fn drop(&mut self) { - unsafe { alloc::alloc::dealloc(self.stack_bottom, stack_layout()) }; + unsafe { dealloc(self.stack_bottom, stack_layout()) }; } } -impl<'p> Future for ExecThread<'p> { +impl<'p> Future for ExecThread { type Output = Result<(), VmRunError>; - fn poll( - mut self: core::pin::Pin<&mut Self>, - cx: &mut core::task::Context<'_>, - ) -> Poll { + #[inline(always)] + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match self.vm.run() { Err(err) => { - log::error!("HBVM Error\r\nRegister dump: {:?}", self.vm.registers,); - return Poll::Ready(Err(err)); + error!("HBVM Error\r\nRegister dump: {:?}", self.vm.registers); + Poll::Ready(Err(err)) + } + Ok(VmRunOk::End) => Poll::Ready(Ok(())), + Ok(VmRunOk::Ecall) => { + ecah::handler(&mut self.vm); + cx.waker().wake_by_ref(); + Poll::Pending + } + Ok(VmRunOk::Timer) => { + cx.waker().wake_by_ref(); + Poll::Pending } - Ok(VmRunOk::End) => return Poll::Ready(Ok(())), - Ok(VmRunOk::Ecall) => ecah::handler(&mut self.vm), - Ok(VmRunOk::Timer) => (), Ok(VmRunOk::Breakpoint) => { - log::error!( + error!( "HBVM Debug breakpoint\r\nRegister dump: {:?}", - self.vm.registers, + self.vm.registers ); + cx.waker().wake_by_ref(); + Poll::Pending } } - - cx.waker().wake_by_ref(); - Poll::Pending } } @@ -91,33 +91,22 @@ impl HandlePageFault for PageFaultHandler { fn page_fault( &mut self, reason: hbvm::mem::MemoryAccessReason, - pagetable: &mut hbvm::mem::softpaging::paging::PageTable, + _pagetable: &mut hbvm::mem::softpaging::paging::PageTable, vaddr: hbvm::mem::Address, size: hbvm::mem::softpaging::PageSize, dataptr: *mut u8, - ) -> bool - where - Self: Sized, - { - log::error!( - "REASON: {reason} \ - vaddr: {vaddr} \ - size: {size:?} \ - Dataptr {dataptr:p}", - ); - + ) -> bool { + error!("REASON: {reason} vaddr: {vaddr} size: {size:?} Dataptr {dataptr:p}"); false } } -const fn stack_layout() -> core::alloc::Layout { - unsafe { alloc::alloc::Layout::from_size_align_unchecked(STACK_SIZE, 4096) } +#[inline(always)] +const fn stack_layout() -> Layout { + unsafe { Layout::from_size_align_unchecked(STACK_SIZE, 4096) } } -fn allocate_stack() -> NonNull { - let layout = stack_layout(); - match NonNull::new(unsafe { alloc::alloc::alloc_zeroed(layout) }) { - Some(ptr) => ptr, - None => alloc::alloc::handle_alloc_error(layout), - } +#[inline(always)] +fn allocate_stack() -> *mut u8 { + unsafe { alloc_zeroed(stack_layout()) } } diff --git a/kernel/src/ipc/buffer.rs b/kernel/src/ipc/buffer.rs index 71756bb7a..a7c192044 100644 --- a/kernel/src/ipc/buffer.rs +++ b/kernel/src/ipc/buffer.rs @@ -9,12 +9,12 @@ pub enum BufferTypes { Bound(ArrayQueue), } /// Interproccess buffer -pub struct IpcBuffer { - pub protocol: Protocol, +pub struct IpcBuffer<'a> { + pub protocol: Protocol<'a>, pub buffer: BufferTypes, } -impl IpcBuffer { +impl<'a> IpcBuffer<'a> { pub fn new(bounded: bool, length: u64) -> Self { log::debug!( "New IPCBuffer\r @@ -24,7 +24,7 @@ impl IpcBuffer { length ); match (bounded, length) { - (false, a) => { + (false, ..) => { let buftype = BufferTypes::Unbound(SegQueue::new()); Self { @@ -48,9 +48,9 @@ impl IpcBuffer { } pub fn push(&mut self, msg: Message) { match &self.buffer { - BufferTypes::Unbound(buff) => buff.push(msg.clone()), + BufferTypes::Unbound(buff) => buff.push(msg), BufferTypes::Bound(buff) => { - let _ = buff.push(msg.clone()); + let _ = buff.push(msg); } }; } diff --git a/kernel/src/ipc/protocol.rs b/kernel/src/ipc/protocol.rs index e8cead341..0e8427ed2 100644 --- a/kernel/src/ipc/protocol.rs +++ b/kernel/src/ipc/protocol.rs @@ -1,7 +1,6 @@ use { alloc::{string::String, vec::Vec}, hashbrown::HashMap, - log::info, }; #[derive(Debug, PartialEq, Clone)] pub struct Type {} @@ -11,11 +10,11 @@ pub struct Funct { gives: Vec, } #[derive(Debug, PartialEq, Clone)] -pub struct Protocol { - types: HashMap, - fns: HashMap, +pub struct Protocol<'a> { + types: HashMap<&'a str, Type>, + fns: HashMap<&'a str, Funct>, } -impl Protocol { +impl<'a> Protocol<'a> { pub fn void() -> Self { Self { types: HashMap::new(), @@ -28,8 +27,8 @@ impl Protocol { } } -impl From for Protocol { - fn from(value: alloc::string::String) -> Self { +impl<'a> From<&'a str> for Protocol<'a> { + fn from(value: &'a str) -> Self { let mut hm_t = HashMap::new(); hm_t.insert(value, Type {}); Self { diff --git a/kernel/src/kmain.rs b/kernel/src/kmain.rs index 0c6790c0c..dcd2ad802 100644 --- a/kernel/src/kmain.rs +++ b/kernel/src/kmain.rs @@ -2,27 +2,25 @@ use { crate::{ - arch::{hardware_random_u64, logging::SERIAL_CONSOLE}, - bootmodules::{build_cmd, BootModules}, - capabilities, + arch::hardware_random_u64, + bootmodules::BootModules, + //bootmodules::build_cmd, device_tree::DeviceTree, holeybytes::ExecThread, - ipc::buffer::{self, IpcBuffer}, + ipc::buffer::IpcBuffer, }, - alloc::format, hashbrown::HashMap, hbvm::mem::Address, limine::{Framebuffer, FramebufferRequest, NonNullPtr}, - log::{debug, info, trace}, + log::{debug, info}, spin::{Lazy, Mutex}, - xml::XMLElement, }; -pub fn kmain(cmdline: &str, boot_modules: BootModules) -> ! { +pub fn kmain(_cmdline: &str, boot_modules: BootModules) -> ! { debug!("Entered kmain"); - let kcmd = build_cmd("Kernel Command Line", cmdline); - trace!("Cmdline: {kcmd:?}"); + // let kcmd = build_cmd("Kernel Command Line", cmdline); + // trace!("Cmdline: {kcmd:?}"); // for (i, bm) in boot_modules.iter().enumerate() { // let name = format!("module-{}", i); @@ -68,17 +66,18 @@ pub fn kmain(cmdline: &str, boot_modules: BootModules) -> ! { fb1.address.as_ptr().unwrap() as *const u8 ); - let mut executor = crate::task::Executor::default(); + let mut executor = crate::task::Executor::new(256); let bm_take = boot_modules.len(); unsafe { for module in boot_modules.into_iter().take(bm_take) { let mut cmd = module.cmd; if cmd.len() > 2 { - // Remove the quotes - cmd.remove(0); - cmd.pop(); + // // Remove the quotes + // cmd.remove(0); + // cmd.pop(); + cmd = &cmd[1..cmd.len()] } - let cmd_len = cmd.as_bytes().len() as u64; + let cmd_len = cmd.len() as u64; log::info!("Spawning {} with arguments \"{}\"", module.path, cmd); @@ -87,11 +86,10 @@ pub fn kmain(cmdline: &str, boot_modules: BootModules) -> ! { if cmd_len > 0 { thr.set_arguments(cmd.as_bytes().as_ptr() as u64, cmd_len); } - if let Err(e) = thr.await { log::error!("{e:?}"); } - }); + }) } info!("Random number: {}", hardware_random_u64()); @@ -108,8 +106,7 @@ pub static DEVICE_TREE: Lazy> = Lazy::new(|| { }); pub static FB_REQ: FramebufferRequest = FramebufferRequest::new(0); -use alloc::vec::Vec; -pub type IpcBuffers = HashMap; +pub type IpcBuffers<'a> = HashMap>; pub static IPC_BUFFERS: Lazy> = Lazy::new(|| { let mut bufs = HashMap::new(); let log_buffer = IpcBuffer::new(false, 0); diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index 26c3270e3..194b150df 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,21 +1,19 @@ //! The ableOS kernel. //! Named akern. //! Akern is woefully undersupported at the moment but we are looking to add support improve hardware discovery and make our lives as kernel and operating system developers easier and better - #![no_std] +#![feature(new_uninit)] #![feature( abi_x86_interrupt, alloc_error_handler, - inline_const, - panic_info_message, - pointer_is_aligned, ptr_sub_ptr, custom_test_frameworks, naked_functions, pointer_is_aligned_to )] -#![allow(dead_code)] #![test_runner(crate::test_runner)] +#![cfg_attr(not(debug_assertions), allow(unused, deprecated))] +#![allow(dead_code)] extern crate alloc; mod allocator; @@ -42,6 +40,7 @@ pub const VERSION: Version = Version { }; #[panic_handler] +#[cfg(target_os = "none")] fn panic(info: &core::panic::PanicInfo) -> ! { arch::register_dump(); @@ -54,10 +53,8 @@ fn panic(info: &core::panic::PanicInfo) -> ! { )); } - if let Some(msg) = info.message() { - let _ = crate::arch::log(format_args!("{msg}\r\n")); - } - + let msg = info.message(); + let _ = crate::arch::log(format_args!("{msg}\r\n")); loop {} } diff --git a/kernel/src/logger.rs b/kernel/src/logger.rs index 3431775fe..fd9cc4a5c 100644 --- a/kernel/src/logger.rs +++ b/kernel/src/logger.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] // TODO: Add a logger api with logger levels and various outputs pub static TERMINAL_LOGGER: Lazy> = Lazy::new(|| Mutex::new(TermLogger::new())); @@ -9,7 +10,11 @@ use { pub fn init() -> Result<(), SetLoggerError> { log::set_logger(&crate::logger::Logger)?; - log::set_max_level(log::LevelFilter::Debug); + if cfg!(debug_assertions) { + log::set_max_level(log::LevelFilter::Debug); + } else { + log::set_max_level(log::LevelFilter::Info); + } Lazy::force(&TERMINAL_LOGGER); diff --git a/kernel/src/memory.rs b/kernel/src/memory.rs index 15b5db1c8..1f0a2fca1 100644 --- a/kernel/src/memory.rs +++ b/kernel/src/memory.rs @@ -1,7 +1,6 @@ //! The Memory Manager -use alloc::collections::VecDeque; -use derive_more::*; +use {alloc::collections::VecDeque, derive_more::*}; pub use crate::arch::PAGE_SIZE; pub const MAX_ORDER: usize = 10; @@ -44,7 +43,7 @@ pub const MAX_ORDER: usize = 10; Sum, UpperHex, )] -#[display(fmt = "0x{:x}", _0)] +#[display("0x{:x}", _0)] #[from(forward)] pub struct VirtualAddress(usize); @@ -55,11 +54,11 @@ impl VirtualAddress { pub fn vpns(&self) -> [usize; 3] { [ // [20:12] - (self.0 >> 12) & 0x1ff, + (self.0 >> 12) & 0x1FF, // [29:21] - (self.0 >> 21) & 0x1ff, + (self.0 >> 21) & 0x1FF, // [38:30] - (self.0 >> 30) & 0x1ff, + (self.0 >> 30) & 0x1FF, ] } @@ -114,7 +113,7 @@ impl VirtualAddress { Sum, UpperHex, )] -#[display(fmt = "0x{:x}", _0)] +#[display("0x{:x}", _0)] #[from(forward)] pub struct PhysicalAddress(usize); @@ -125,11 +124,11 @@ impl PhysicalAddress { pub fn ppns(&self) -> [usize; 3] { [ // [20:12] - (self.0 >> 12) & 0x1ff, + (self.0 >> 12) & 0x1FF, // [29:21] - (self.0 >> 21) & 0x1ff, + (self.0 >> 21) & 0x1FF, // [55:30] - (self.0 >> 30) & 0x3ffffff, + (self.0 >> 30) & 0x3FFFFFF, ] } diff --git a/kernel/src/task.rs b/kernel/src/task.rs index 4c603e165..241f64c58 100644 --- a/kernel/src/task.rs +++ b/kernel/src/task.rs @@ -1,31 +1,20 @@ -#![allow(unused)] - use { - alloc::{boxed::Box, collections::BTreeMap, sync::Arc, task::Wake}, + alloc::{boxed::Box, sync::Arc}, core::{ future::Future, pin::Pin, - task::{Context, Poll, Waker}, + task::{Context, Poll, RawWaker, RawWakerVTable, Waker}, }, crossbeam_queue::SegQueue, - kiam::when, slab::Slab, - spin::RwLock, }; -static SPAWN_QUEUE: RwLock> = RwLock::new(None); -pub fn spawn(future: impl Future + Send + 'static) { - match &*SPAWN_QUEUE.read() { - Some(s) => s.push(Task::new(future)), - None => panic!("no task executor is running"), - } -} - pub fn yield_now() -> impl Future { struct YieldNow(bool); impl Future for YieldNow { type Output = (); + #[inline(always)] fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { if self.0 { Poll::Ready(()) @@ -40,101 +29,150 @@ pub fn yield_now() -> impl Future { YieldNow(false) } -#[derive(Default)] -pub struct Executor { - tasks: Slab, - queue: TaskQueue, - to_spawn: SpawnQueue, - wakers: BTreeMap, +pub struct Executor + Send> { + tasks: Slab>, + task_queue: Arc, } -impl Executor { - pub fn spawn(&mut self, future: impl Future + Send + 'static) { - self.queue - .push(TaskId(self.tasks.insert(Task::new(future)))); +impl + Send> Executor { + pub fn new(size: usize) -> Self { + Self { + tasks: Slab::with_capacity(size), + task_queue: Arc::new(TaskQueue::new()), + } + } + + #[inline] + pub fn spawn(&mut self, future: F) { + self.task_queue + .queue + .push(self.tasks.insert(Task::new(future))); } pub fn run(&mut self) { - { - let mut global_spawner = SPAWN_QUEUE.write(); - if global_spawner.is_some() { - panic!("Task executor is already running"); - } - - *global_spawner = Some(Arc::clone(&self.to_spawn)); - } + let mut task_batch = [0; 32]; + let mut batch_len = 0; loop { - when! { - let Some(id) = self - .to_spawn - .pop() - .map(|t| TaskId(self.tasks.insert(t))) - .or_else(|| self.queue.pop()) - => { - let Some(task) = self.tasks.get_mut(id.0) else { - panic!("Attempted to get task from empty slot: {}", id.0); - }; + self.task_queue.batch_pop(&mut task_batch, &mut batch_len); - let mut cx = Context::from_waker(self.wakers.entry(id).or_insert_with(|| { - Waker::from(Arc::new(TaskWaker { - id, - queue: Arc::clone(&self.queue), - })) - })); + if batch_len == 0 { + if self.task_queue.is_empty() { + break; + } else { + continue; + } + } - match task.poll(&mut cx) { - Poll::Ready(()) => { - self.tasks.remove(id.0); - self.wakers.remove(&id); - } - Poll::Pending => (), + for &id in &task_batch[..batch_len] { + if let Some(task) = self.tasks.get_mut(id) { + let waker = task + .waker + .get_or_insert_with(|| TaskWaker::new(id, Arc::clone(&self.task_queue))); + + let waker = unsafe { Waker::from_raw(TaskWaker::into_raw_waker(waker)) }; + let mut cx = Context::from_waker(&waker); + + if let Poll::Ready(()) = task.poll(&mut cx) { + self.tasks.remove(id); + self.task_queue.free_tasks.push(id); } - }, - self.tasks.is_empty() => break, - _ => (), + } } } - - *SPAWN_QUEUE.write() = None; } } -struct Task { - future: Pin + Send>>, +struct Task + Send> { + future: Pin>, + waker: Option, } -impl Task { - pub fn new(future: impl Future + Send + 'static) -> Self { - log::trace!("New task scheduled"); +impl + Send> Task { + #[inline(always)] + pub fn new(future: F) -> Self { Self { future: Box::pin(future), + waker: None, } } + #[inline(always)] fn poll(&mut self, cx: &mut Context) -> Poll<()> { self.future.as_mut().poll(cx) } } -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] -struct TaskId(usize); - -type TaskQueue = Arc>; -type SpawnQueue = Arc>; - struct TaskWaker { - id: TaskId, - queue: TaskQueue, + id: usize, + task_queue: Arc, } -impl Wake for TaskWaker { - fn wake(self: Arc) { - log::trace!("Woke Task-{:?}", self.id); - self.wake_by_ref(); +impl TaskWaker { + #[inline(always)] + fn new(id: usize, task_queue: Arc) -> Self { + Self { id, task_queue } } - fn wake_by_ref(self: &Arc) { - self.queue.push(self.id); + #[inline(always)] + fn wake(&self) { + self.task_queue.queue.push(self.id); + } + + fn into_raw_waker(waker: &TaskWaker) -> RawWaker { + let ptr = waker as *const TaskWaker; + RawWaker::new(ptr.cast(), &VTABLE) + } +} + +const VTABLE: RawWakerVTable = RawWakerVTable::new(clone_raw, wake_raw, wake_by_ref_raw, drop_raw); + +unsafe fn clone_raw(ptr: *const ()) -> RawWaker { + let waker = &*(ptr as *const TaskWaker); + TaskWaker::into_raw_waker(waker) +} + +unsafe fn wake_raw(ptr: *const ()) { + let waker = &*(ptr as *const TaskWaker); + waker.wake(); +} + +unsafe fn wake_by_ref_raw(ptr: *const ()) { + let waker = &*(ptr as *const TaskWaker); + waker.wake(); +} + +unsafe fn drop_raw(_: *const ()) {} + +struct TaskQueue { + queue: SegQueue, + next_task: usize, + free_tasks: SegQueue, +} + +impl TaskQueue { + fn new() -> Self { + Self { + queue: SegQueue::new(), + next_task: 0, + free_tasks: SegQueue::new(), + } + } + + #[inline(always)] + fn batch_pop(&self, output: &mut [usize], len: &mut usize) { + *len = 0; + while let Some(id) = self.queue.pop() { + output[*len] = id; + *len += 1; + if *len == output.len() { + break; + } + } + } + + #[inline(always)] + fn is_empty(&self) -> bool { + self.queue.is_empty() } } diff --git a/repbuild/Cargo.toml b/repbuild/Cargo.toml index c9c209ba5..a082573af 100644 --- a/repbuild/Cargo.toml +++ b/repbuild/Cargo.toml @@ -4,15 +4,26 @@ version = "0.2.0" edition = "2021" [dependencies] -str-reader = "0.1.2" -derive_more = "0.99" -error-stack = "0.4" +str-reader = "0.1" +derive_more = { version = "1", default-features = false, features = [ + "add", + "add_assign", + "constructor", + "display", + "from", + "into", + "mul", + "mul_assign", + "not", + "sum", +] } +error-stack = "0.5" fatfs = "0.3" -toml = "0.5.2" +toml = "0.8" # hbasm.git = "https://git.ablecorp.us/AbleOS/holey-bytes.git" hblang.git = "https://git.ablecorp.us/AbleOS/holey-bytes.git" [dependencies.reqwest] -version = "0.11" +version = "0.12" default-features = false features = ["rustls-tls", "blocking"] diff --git a/repbuild/src/dev.rs b/repbuild/src/dev.rs index 5c92480ec..2e8122889 100644 --- a/repbuild/src/dev.rs +++ b/repbuild/src/dev.rs @@ -1,3 +1,4 @@ +#![allow(unused)] use std::{ fmt::format, fs::{read_to_string, File}, @@ -85,9 +86,17 @@ impl Package { Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => (), Err(e) => panic!("{}", e), } - let path = format!("target/programs/{}.hbf", self.name); - let mut file = File::create(path).unwrap(); - file.write_all(&bytes).unwrap(); + std::fs::write(format!("target/programs/{}.hbf", self.name), &bytes).unwrap(); + bytes.clear(); + let _ = hblang::run_compiler( + &path, + Options { + dump_asm: true, + ..Default::default() + }, + &mut bytes, + ); + std::fs::write(format!("target/programs/{}.hba", self.name), &bytes).unwrap(); } } } diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index af09c6d5f..eede3ed3e 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -1,3 +1,5 @@ +// #![allow(unused)] + mod dev; use { @@ -6,7 +8,7 @@ use { error_stack::{bail, report, Context, Report, Result, ResultExt}, fatfs::{FileSystem, FormatVolumeOptions, FsOptions, ReadWriteSeek}, std::{ - fmt::Display, + // fmt::Display, fs::{self, File}, io::{self, Write}, path::Path, @@ -22,10 +24,13 @@ fn main() -> Result<(), Error> { match args.next().as_deref() { Some("build" | "b") => { let mut release = false; + let mut debuginfo = false; let mut target = Target::X86_64; for arg in args { if arg == "-r" || arg == "--release" { release = true; + } else if arg == "-d" || arg == "--debuginfo" { + debuginfo = true; } else if arg == "rv64" || arg == "riscv64" || arg == "riscv64-virt" { target = Target::Riscv64Virt; } else if arg == "arm64" || arg == "aarch64" || arg == "aarch64-virt" { @@ -35,14 +40,17 @@ fn main() -> Result<(), Error> { } } - build(release, target).change_context(Error::Build) + build(release, target, debuginfo).change_context(Error::Build) } Some("run" | "r") => { let mut release = false; + let mut debuginfo = false; let mut target = Target::X86_64; for arg in args { if arg == "-r" || arg == "--release" { release = true; + } else if arg == "-d" || arg == "--debuginfo" { + debuginfo = true; } else if arg == "rv64" || arg == "riscv64" || arg == "riscv64-virt" { target = Target::Riscv64Virt; } else if arg == "arm64" || arg == "aarch64" || arg == "aarch64-virt" { @@ -52,7 +60,7 @@ fn main() -> Result<(), Error> { } } - build(release, target)?; + build(release, target, debuginfo)?; run(release, target) } Some("help" | "h") => { @@ -187,7 +195,7 @@ TERM_BACKDROP={} let modules = value.get_mut("modules").unwrap().as_table_mut().unwrap(); // let mut real_modules = modules.clone(); - modules.into_iter().for_each(|(key, value)| { + modules.into_iter().for_each(|(_, value)| { if value.is_table() { let path = get_path_without_boot_prefix( value.get("path").expect("You must have `path` as a value"), @@ -236,7 +244,7 @@ TERM_BACKDROP={} let bootdir = fs.root_dir().create_dir("efi")?.create_dir("boot")?; let mut f = fs.root_dir().create_file("limine.cfg")?; - let a = f.write(limine_str.as_bytes())?; + let _ = f.write(limine_str.as_bytes())?; drop(f); io::copy( @@ -270,7 +278,7 @@ fn copy_file_to_img(fpath: &str, fs: &FileSystem) { .expect("Copy failed"); } -fn build(release: bool, target: Target) -> Result<(), Error> { +fn build(release: bool, target: Target, debuginfo: bool) -> Result<(), Error> { let fs = get_fs().change_context(Error::Io)?; let mut com = Command::new("cargo"); com.current_dir("kernel"); @@ -278,6 +286,9 @@ fn build(release: bool, target: Target) -> Result<(), Error> { if release { com.arg("-r"); } + if debuginfo { + com.env("RUSTFLAGS", "-Cdebug-assertions=true"); + } if target == Target::Riscv64Virt { com.args(["--target", "targets/riscv64-virt-ableos.json"]); @@ -359,7 +370,7 @@ fn run(release: bool, target: Target) -> Result<(), Error> { #[rustfmt::skip] com.args([ "-M", "virt", - "-cpu", "cortex-a72", + "-cpu", "neoverse-n2", "-device", "ramfb", "-device", "qemu-xhci", "-device", "usb-kbd", @@ -418,11 +429,11 @@ fn fetch_ovmf(target: Target) -> Result { #[derive(Debug, Display)] enum OvmfFetchError { - #[display(fmt = "Failed to fetch OVMF package")] + #[display("Failed to fetch OVMF package")] Fetch, - #[display(fmt = "No OVMF package available")] + #[display("No OVMF package available")] Empty, - #[display(fmt = "IO Error")] + #[display("IO Error")] Io, } @@ -435,26 +446,28 @@ enum Target { Aarch64, } +#[allow(unused)] #[derive(Debug, Display)] enum Error { - #[display(fmt = "Failed to build the kernel")] + #[display("Failed to build the kernel")] Build, - #[display(fmt = "Missing or invalid subcommand (available: build, run)")] + #[display("Missing or invalid subcommand (available: build, run)")] InvalidSubCom, - #[display(fmt = "IO Error")] + #[display("IO Error")] Io, - #[display(fmt = "Failed to spawn a process")] + #[display("Failed to spawn a process")] ProcessSpawn, - #[display(fmt = "Failed to fetch UEFI firmware")] + #[display("Failed to fetch UEFI firmware")] OvmfFetch, - #[display(fmt = "Failed to assemble Holey Bytes code")] + #[display("Failed to assemble Holey Bytes code")] Assembler, - #[display(fmt = "QEMU Error: {}", "fmt_qemu_err(*_0)")] + #[display("QEMU Error: {}", "fmt_qemu_err(*_0)")] Qemu(Option), } impl Context for Error {} +#[allow(dead_code)] fn fmt_qemu_err(e: Option) -> impl Display { struct W(Option); impl Display for W { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b9ef17ea9..9353a5446 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-17" +channel = "nightly-2024-07-27" components = ["rust-src", "llvm-tools"] diff --git a/sysdata/libraries/ignim/src/errors.hb b/sysdata/libraries/ignim/src/errors.hb index 57ef5e9b2..3b9b1ab10 100644 --- a/sysdata/libraries/ignim/src/errors.hb +++ b/sysdata/libraries/ignim/src/errors.hb @@ -1,16 +1,14 @@ -// the 0- thing is scuffed +OutOfHostMemory := -1 +OutOfDeviceMemory := -2 +InitializationFailed := -3 +DeviceLost := -4 +MemoryMapFailed := -5 -OutOfHostMemory := 0 - 1 -OutOfDeviceMemory := 0 - 2 -InitializationFailed := 0 - 3 -DeviceLost := 0 - 4 -MemoryMapFailed := 0 - 5 - -LayerNotPresent := 0 - 6 -ExtensionNotPresent := 0 - 7 -FeatureNotPresent := 0 - 8 -IncompatibleDriver := 0 - 9 -TooManyObjects := 0 - 10 -FormatNotSupported := 0 - 11 -FragmentedPool := 0 - 12 -Unknown := 0 - 13 \ No newline at end of file +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/render/README.md b/sysdata/libraries/render/README.md new file mode 100644 index 000000000..ac765ebf3 --- /dev/null +++ b/sysdata/libraries/render/README.md @@ -0,0 +1,9 @@ +Rendering interface for SVGA and Software renderers + +# TODO: + +- SVGA Driver + - needs pci driver + - needs init (requiring program) +- Double Buffer mode for Software renderer + - needs init (requiring program) \ No newline at end of file diff --git a/sysdata/libraries/render/src/lib.hb b/sysdata/libraries/render/src/lib.hb new file mode 100644 index 000000000..6cf0ccd59 --- /dev/null +++ b/sysdata/libraries/render/src/lib.hb @@ -0,0 +1,47 @@ +svga := @use("rel:svga.hb") +software := @use("rel:software.hb") + +// default mode +mode := software + +init := mode.init +doublebuffer := mode.doublebuffer + +// Colours +Color := mode.Color +white := mode.white +black := mode.black +gray := mode.gray +red := mode.red +green := mode.green +yellow := mode.yellow +blue := mode.blue +magenta := mode.magenta +cyan := mode.cyan +light_gray := mode.light_gray +light_red := mode.light_red +light_green := mode.light_green +light_yellow := mode.light_yellow +light_blue := mode.light_blue +light_magenta := mode.light_magenta +light_cyan := mode.light_cyan + +// Drawing +put_pixel := mode.put_pixel +put_rect := mode.put_rect +put_filled_rect := mode.put_filled_rect +put_line := mode.put_line +clear := mode.clear + +// Display +width := mode.width +height := mode.height +dimensions := mode.dimensions +set_height := mode.set_height +set_width := mode.set_width +set_dimensions := mode.set_dimensions +sync := mode.sync + +// Math +UVec2 := struct {x: uint, y: uint} +IVec2 := struct {x: int, y: int} \ No newline at end of file diff --git a/sysdata/libraries/render/src/software.hb b/sysdata/libraries/render/src/software.hb new file mode 100644 index 000000000..117f42f17 --- /dev/null +++ b/sysdata/libraries/render/src/software.hb @@ -0,0 +1,261 @@ +.{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} +white := Color.(255, 255, 255, 255) +black := Color.(0, 0, 0, 255) +gray := Color.(127, 127, 127, 255) +red := Color.(0, 0, 205, 255) +green := Color.(0, 205, 0, 255) +yellow := Color.(0, 205, 205, 255) +blue := Color.(205, 0, 0, 255) +magenta := Color.(205, 0, 205, 255) +cyan := Color.(205, 205, 0, 255) +light_gray := Color.(229, 229, 229, 255) +light_red := Color.(0, 0, 255, 255) +light_green := Color.(0, 255, 0, 255) +light_yellow := Color.(0, 255, 255, 255) +light_blue := Color.(255, 0, 0, 255) +light_magenta := Color.(255, 0, 255, 255) +light_cyan := Color.(255, 255, 0, 255) + +// might not work for some resolutions, but needs to be comptime because... +copy_pixels := 0xC000 >> 2 + +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, + buf: ^Color, + width: int, + height: int, + partitions: int, + pixels: int, + bb_pages: int, + double_buffer: bool, +} + +init := fn(): void { + width := dt_get("framebuffer/fb0/width\0") + height := dt_get("framebuffer/fb0/height\0") + // width := 1024 + // height := 768 + pixels := width * height + bytes := pixels << 2 + partitions := pixels / copy_pixels + pages := 1 + bytes >> 12 + back_buffer := create_back_buffer(pages) + ctx = Context.{ + fb: dt_get("framebuffer/fb0/ptr\0"), + bb: back_buffer, + buf: back_buffer, + width, + height, + partitions, + pixels, + bb_pages: pages, + double_buffer: true, + } + return +} + +doublebuffer := fn(enable: bool): void { + if enable { + ctx.buf = ctx.bb + } else { + ctx.buf = ctx.fb + } + ctx.double_buffer = enable + return +} + +create_back_buffer := fn(pages: int): ^Color { + if pages <= 0xFF { + return @bitcast(@inline(memory.request_page, pages)) + } + ptr := @inline(memory.request_page, 255) + remaining := pages - 0xFF + loop if remaining <= 0 break else { + if remaining < 0xFF { + memory.request_page(remaining) + } else { + memory.request_page(0xFF) + } + remaining -= 0xFF + } + return @bitcast(ptr) +} + +clear := fn(color: Color): void { + cursor := ctx.buf + boundary := cursor + 512 + loop if cursor == boundary break else { + *cursor = color + cursor += 1 + } + boundary += 512 * 7 + loop if cursor == boundary break else { + *@as(^[Color; 512], @bitcast(cursor)) = *@as(^[Color; 512], @bitcast(ctx.buf)) + cursor += 512 + } + boundary += copy_pixels - 4096 + loop if cursor == boundary break else { + *@as(^[Color; 4096], @bitcast(cursor)) = *@as(^[Color; 4096], @bitcast(ctx.buf)) + cursor += 4096 + } + boundary += (ctx.partitions - 1) * copy_pixels + loop if cursor == boundary break else { + *@as(^[Color; copy_pixels], @bitcast(cursor)) = *@as(^[Color; copy_pixels], @bitcast(ctx.buf)) + cursor += @sizeof([u8; copy_pixels]) + } + return +} + +sync := fn(): void { + if ctx.double_buffer { + bb := ctx.buf + fb := ctx.fb + boundary := bb + ctx.pixels + loop if bb == boundary break else { + *@as(^[Color; copy_pixels], @bitcast(fb)) = *@as(^[Color; copy_pixels], @bitcast(bb)) + bb += copy_pixels + fb += copy_pixels + } + } + return +} + +width := fn(): int { + return ctx.width +} + +height := fn(): int { + return ctx.height +} + +screenidx := fn(x: int, y: int): int { + return x + ctx.width * y +} + +put_pixel := fn(pos: IVec2, color: Color): void { + *(ctx.buf + @inline(screenidx, pos.x, pos.y)) = color + return +} + +put_filled_rect := fn(pos: IVec2, tr: IVec2, color: Color): void { + x := pos.x + y := pos.y + end := pos + tr + loop if x == end.x break else { + loop if y == end.y break else { + *(ctx.buf + @inline(screenidx, x, y)) = color + y += 1 + } + x += 1 + y = pos.y + } + return +} + +put_rect := fn(pos: IVec2, tr: IVec2, color: Color): void { + x := pos.x + y := pos.y + end := pos + tr + loop if y == end.y break else { + *(ctx.buf + @inline(screenidx, x, y)) = color; + *(ctx.buf + @inline(screenidx, x + tr.x, y)) = color + y += 1 + } + y = pos.y + loop if x == end.x break else { + *(ctx.buf + @inline(screenidx, x, y)) = color; + *(ctx.buf + @inline(screenidx, x, y + tr.y)) = color + x += 1 + } + return +} + +put_line_low := fn(p0: IVec2, p1: IVec2, color: Color): void { + dx := p1.x - p0.x + dy := p1.y - p0.y + yi := 1 + if dy < 0 { + yi = -1 + dy = -dy + } + D := 2 * dy - dx + y := p0.y + x := p0.x + loop if x == p1.x break else { + *(ctx.buf + @inline(screenidx, x, y)) = color + if D > 0 { + y += yi + D += 2 * (dy - dx) + } else { + D += 2 * dy + } + x += 1 + } + return +} + +put_line_high := fn(p0: IVec2, p1: IVec2, color: Color): void { + dx := p1.x - p0.x + dy := p1.y - p0.y + xi := 1 + if dy < 0 { + xi = -1 + dx = -dx + } + D := 2 * dx - dy + x := p0.x + y := p0.y + loop if y == p1.y break else { + *(ctx.buf + @inline(screenidx, x, y)) = color + if D > 0 { + x += xi + D += 2 * (dx - dy) + } else { + D += 2 * dx + } + y += 1 + } + return +} + +put_line := fn(p0: IVec2, p1: IVec2, color: Color): void { + if @inline(math.abs, p1.y - p0.y) < @inline(math.abs, p1.x - p0.x) { + if p0.x > p1.x { + @inline(put_line_low, p1, p0, color) + } else { + @inline(put_line_low, p0, p1, color) + } + } else { + if p0.y > p1.y { + @inline(put_line_high, p1, p0, color) + } else { + @inline(put_line_high, p0, p1, color) + } + } + return +} + +set_height := fn(new: int): void { + return +} + +set_width := fn(new: int): void { + return +} + +dimensions := fn(): IVec2 { + return .(ctx.width, ctx.height) +} + +set_dimensions := fn(new: IVec2): void { + return +} \ No newline at end of file diff --git a/sysdata/libraries/render/src/svga.hb b/sysdata/libraries/render/src/svga.hb new file mode 100644 index 000000000..eb7027d15 --- /dev/null +++ b/sysdata/libraries/render/src/svga.hb @@ -0,0 +1,80 @@ +.{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) +black := Color.(0, 0, 0, 255) +gray := Color.(127, 127, 127, 255) +red := Color.(0, 0, 205, 255) +green := Color.(0, 205, 0, 255) +yellow := Color.(0, 205, 205, 255) +blue := Color.(205, 0, 0, 255) +magenta := Color.(205, 0, 205, 255) +cyan := Color.(205, 205, 0, 255) +light_gray := Color.(229, 229, 229, 255) +light_red := Color.(0, 0, 255, 255) +light_green := Color.(0, 255, 0, 255) +light_yellow := Color.(0, 255, 255, 255) +light_blue := Color.(255, 0, 0, 255) +light_magenta := Color.(255, 0, 255, 255) +light_cyan := Color.(255, 255, 0, 255) + +clear := fn(color: Color): void { + return +} + +width := fn(): int { + return 0 +} + +height := fn(): int { + return 0 +} + +dimensions := fn(): IVec2 { + return .(0, 0) +} + +put_pixel := fn(position: IVec2, color: Color): void { + return +} + +put_filled_rect := fn(pos: IVec2, tr: IVec2, color: Color): void { + return +} + +put_rect := fn(pos: IVec2, tr: IVec2, color: Color): void { + return +} + +put_line_low := fn(p0: IVec2, p1: IVec2, color: Color): void { + return +} +// do not use, use line() instead +put_line_high := fn(p0: IVec2, p1: IVec2, color: Color): void { + return +} + +put_line := fn(p0: IVec2, p1: IVec2, color: Color): void { + return +} + +set_height := fn(new: int): void { + return +} + +set_width := fn(new: int): void { + return +} + +set_dimensions := fn(new: IVec2): void { + return +} + +sync := fn(): void { + return +} + +init := fn(): void { + return +} \ No newline at end of file diff --git a/sysdata/libraries/stn/src/buffer.hb b/sysdata/libraries/stn/src/buffer.hb index 1f5bb1734..ef5bf7155 100644 --- a/sysdata/libraries/stn/src/buffer.hb +++ b/sysdata/libraries/stn/src/buffer.hb @@ -4,21 +4,20 @@ receive_message := fn(buffer_id: int, memory_map_location: ^u8, length: int): ^u return @eca(^u8, 4, buffer_id, memory_map_location, length) } -send_message := fn(buffer_id: int): void { - message := "Hello there\0" - message_length := string.length(message) - @eca(i32, 3, buffer_id, message, message_length) +send_message := fn(msg: ^u8, buffer_id: int): void { + msg_length := @inline(string.length, msg) + @eca(i32, 3, buffer_id, msg, msg_length) return } create := fn(msg: ^u8): int { - msg_length := string.length(msg); + msg_length := @inline(string.length, msg); *msg = 0 return @eca(int, 3, 0, msg, msg_length) } search := fn(msg: ^u8): int { - msg_length := string.length(msg); + msg_length := @inline(string.length, msg); *msg = 3 return @eca(int, 3, 0, msg, msg_length) diff --git a/sysdata/libraries/stn/src/lib.hb b/sysdata/libraries/stn/src/lib.hb index ff45c3b29..be4dac204 100644 --- a/sysdata/libraries/stn/src/lib.hb +++ b/sysdata/libraries/stn/src/lib.hb @@ -2,4 +2,6 @@ string := @use("rel:string.hb") log := @use("rel:log.hb") memory := @use("rel:memory.hb") buffer := @use("rel:buffer.hb") -math := @use("rel:math.hb") \ No newline at end of file +math := @use("rel:math.hb") +random := @use("rel:random.hb") +pci := @use("rel:pci.hb") \ No newline at end of file diff --git a/sysdata/libraries/stn/src/log.hb b/sysdata/libraries/stn/src/log.hb index 42cf4a666..d643d766f 100644 --- a/sysdata/libraries/stn/src/log.hb +++ b/sysdata/libraries/stn/src/log.hb @@ -2,7 +2,7 @@ string := @use("rel:string.hb") buffer := @use("rel:buffer.hb") log := fn(message: ^u8, level: u8): void { - message_length := string.length(message); + message_length := @inline(string.length, message); *(message + message_length) = level @eca(i32, 3, 1, message, message_length + 1) return diff --git a/sysdata/libraries/stn/src/math.hb b/sysdata/libraries/stn/src/math.hb index 2fd1d0207..4c4f87e5b 100644 --- a/sysdata/libraries/stn/src/math.hb +++ b/sysdata/libraries/stn/src/math.hb @@ -1,7 +1,15 @@ +shift := 31 + +// following only work for: int abs := fn(x: int): int { - mask := x >> 31 + mask := x >> shift return (x ^ mask) - mask } min := fn(a: int, b: int): int { - return b + (a - b & a - b >> 31) + c := a - b + return b + (c & c >> shift) +} +max := fn(a: int, b: uint): int { + c := a - b + return a - (c & c >> shift) } \ No newline at end of file diff --git a/sysdata/libraries/stn/src/memory.hb b/sysdata/libraries/stn/src/memory.hb index fbbe80cbf..7d4e71f04 100644 --- a/sysdata/libraries/stn/src/memory.hb +++ b/sysdata/libraries/stn/src/memory.hb @@ -17,19 +17,38 @@ release_page := fn(ptr: ^u8, page_count: u8): void { return @eca(void, 3, 2, msg, 12) } -outb := fn(addr_high: u8, addr_low: u8, value: u8): void { - msg := "\0\0\0\0"; - *msg = 1; - *(msg + 1) = addr_high; - *(msg + 2) = addr_low; - *(msg + 3) = value - @eca(void, 3, 3, msg, 4) +outb := fn(addr: u16, value: u8): void { + msg := "\0\0\0\0\0"; + *@as(^u8, msg) = @as(u8, 1); + *@as(^u8, msg + 1) = @as(u8, 0); + *@as(^u16, @bitcast(msg + 2)) = addr; + *@as(^u8, msg + 4) = value + @eca(void, 3, 3, msg, 5) return } -inb := fn(addr_high: u8, addr_low: u8): u8 { +inb := fn(addr: u16): u8 { msg := "\0\0\0\0"; - *(msg + 1) = addr_high; - *(msg + 2) = addr_low - return @eca(u8, 3, 3, msg, 3) + *@as(^u8, msg) = @as(u8, 0); + *@as(^u8, msg + 1) = @as(u8, 0); + *@as(^u16, @bitcast(msg + 2)) = addr + return @eca(u8, 3, 3, msg, 4) +} + +outl := fn(addr: u16, value: u32): void { + msg := "\0\0\0\0\0\0\0\0"; + *@as(^u8, msg) = @as(u8, 1); + *@as(^u8, msg + 1) = @as(u8, 2); + *@as(^u16, @bitcast(msg + 2)) = addr; + *@as(^u32, @bitcast(msg + 4)) = value + @eca(void, 3, 3, msg, 8) + return +} + +inl := fn(addr: u16): u32 { + msg := "\0\0\0\0"; + *@as(^u8, msg) = @as(u8, 0); + *@as(^u8, msg + 1) = @as(u8, 2); + *@as(^u16, @bitcast(msg + 2)) = addr + return @eca(u32, 3, 3, msg, 4) } \ No newline at end of file diff --git a/sysdata/libraries/stn/src/pci.hb b/sysdata/libraries/stn/src/pci.hb new file mode 100644 index 000000000..c07b518f5 --- /dev/null +++ b/sysdata/libraries/stn/src/pci.hb @@ -0,0 +1,50 @@ +.{inl, outl} := @use("rel:memory.hb") + +config_read := fn(bus: u8, device: u8, func: u8, offset: u8): u32 { + lbus := @as(u32, bus) + ldevice := @as(u32, device) + lfunc := @as(u32, func) + loffset := @as(u32, offset) + + address := lbus << 16 | ldevice << 11 | lfunc << 8 | loffset & 0xFC | @as(u32, 0x80000000) + + outl(0xCF8, address) + return inl(0xCFC) +} + +config_write := fn(bus: u8, device: u8, func: u8, offset: u8, value: u32): void { + lbus := @as(u32, bus) + ldevice := @as(u32, device) + lfunc := @as(u32, func) + loffset := @as(u32, offset) + + address := lbus << 16 | ldevice << 11 | lfunc << 8 | loffset & 0xFC | @as(u32, 0x80000000) + + outl(0xCF8, address) + outl(0xCFC, value) +} + +get_header_type := fn(bus: u8, device: u8, func: u8): u8 { + return @as(u8, config_read(bus, device, func, 0xC) >> 16 & 0xFF) +} + +Ids := struct {vendor: u16, device: u16} + +get_ids := fn(bus: u8, device: u8, func: u8): Ids { + res := config_read(bus, device, func, 0) + return .(@as(u16, res >> 16 & 0xFFFF), @as(u16, res & 0xFFFF)) +} + +PciDeviceInfo := struct {header_type: u8, device: u8, bus: u8, device_id: Ids, full_class: u16, rev_id: u8} + +check_device := fn(bus: u8, device: u8): PciDeviceInfo { + ids := get_ids(bus, device, 0) + if ids.vendor == 0xFFFF { + return .(0, 0, 0, .(0, 0), 0, 0) + } + reg2 := config_read(bus, device, 0, 0x8) + class := @as(u16, reg2 >> 16 & 0xFFFF) + header_type := get_header_type(bus, device, 0) + + return .(header_type, device, bus, ids, class, @as(u8, reg2 & 0xFF)) +} \ No newline at end of file diff --git a/sysdata/libraries/stn/src/random.hb b/sysdata/libraries/stn/src/random.hb new file mode 100644 index 000000000..b515d1ca9 --- /dev/null +++ b/sysdata/libraries/stn/src/random.hb @@ -0,0 +1,7 @@ +integer := fn(): int { + return @eca(int, 3, 4) +} + +integer_range := fn(min: int, max: int): int { + return @eca(int, 3, 4) % (max - min + 1) + min +} \ No newline at end of file diff --git a/sysdata/libraries/stn/src/string.hb b/sysdata/libraries/stn/src/string.hb index 260b03a77..e4ba668f6 100644 --- a/sysdata/libraries/stn/src/string.hb +++ b/sysdata/libraries/stn/src/string.hb @@ -1,51 +1,38 @@ length := fn(ptr: ^u8): int { len := 0 - loop if *ptr == 0 break else { - len += 1 - ptr += 1 - } + loop if *(ptr + len) == 0 break else len += 1 return len } display_int := fn(num: int, p: ^u8): ^u8 { i := 0 if num == 0 { - set(p, 48) + *p = 48 return p } - loop { - if num == 0 break - set(p + i, num % 10 + 48) + loop if num == 0 break else { + *(p + i) = num % 10 + 48 num /= 10 i += 1 } - reverse(p) - //null terminate - set(p + i, 0) + @inline(reverse, p); + *(p + i) = 0 return p } reverse := fn(s: ^u8): void { //reverse a string, don't remove digits len := 0 - loop { - if *(s + len) == 0 break - len += 1 - } + loop if *(s + len) == 0 break else len += 1 i := 0 j := len - 1 - loop { - if i >= j break - temp := *(s + i); + temp := 0 + loop if i >= j break else { + temp = *(s + i); *(s + i) = *(s + j); *(s + j) = temp i += 1 j -= 1 } return -} - -set := fn(change: ^u8, new: int): void { - *change = new - return } \ No newline at end of file diff --git a/sysdata/programs/diskio_driver/src/main.hb b/sysdata/programs/diskio_driver/src/main.hb index f8c3517d6..e5edf8414 100644 --- a/sysdata/programs/diskio_driver/src/main.hb +++ b/sysdata/programs/diskio_driver/src/main.hb @@ -1,12 +1,11 @@ -stn := @use("../../../libraries/stn/src/lib.hb"); -.{log, string, memory, buffer} := stn +.{memory, buffer} := @use("../../../libraries/stn/src/lib.hb") main := fn(): int { // shuts down ableOS - //memory.outb(0, 244, 0) + // memory.outb(0xF400, 0) - a := memory.inb(0, 70) - b := memory.inb(0, 71) + a := memory.inb(0x4600) + b := memory.inb(0x4700) c := buffer.search("XNumber\0") diff --git a/sysdata/programs/fb_driver/README.md b/sysdata/programs/fb_driver/README.md deleted file mode 100644 index b354f04d6..000000000 --- a/sysdata/programs/fb_driver/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Framebuffer Driver -A simple framebuffer driver. \ No newline at end of file diff --git a/sysdata/programs/fb_driver/UNTESTED_FUNCTIONS b/sysdata/programs/fb_driver/UNTESTED_FUNCTIONS deleted file mode 100644 index 7c7d0f5e0..000000000 --- a/sysdata/programs/fb_driver/UNTESTED_FUNCTIONS +++ /dev/null @@ -1,7 +0,0 @@ -color.blend - -lib.composite -lib.screen2rect -lib.rect2screen - -draw.tri_line \ No newline at end of file diff --git a/sysdata/programs/fb_driver/meta.toml b/sysdata/programs/fb_driver/meta.toml deleted file mode 100644 index c2659bca9..000000000 --- a/sysdata/programs/fb_driver/meta.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "fb_driver" -authors = ["able", "aurlex"] - -[dependants.libraries] - -[dependants.binaries] -hblang.version = "1.0.0" - -[build] -command = "hblang src/main.hb" diff --git a/sysdata/programs/fb_driver/src/color.hb b/sysdata/programs/fb_driver/src/color.hb deleted file mode 100644 index 51bbf14ec..000000000 --- a/sysdata/programs/fb_driver/src/color.hb +++ /dev/null @@ -1,27 +0,0 @@ -ColorBGRA := struct {b: u8, g: u8, r: u8, a: u8} - -/* ALL the colo(u)rs you will ever need. - they dont work though, cause hblang bug (reg id leaked, again) */ -WHITE := ColorBGRA.{b: 255, g: 255, r: 255, a: 255} -BLACK := ColorBGRA.{b: 0, g: 0, r: 0, a: 255} -GRAY := ColorBGRA.{b: 127, g: 127, r: 127, a: 255} -RED := ColorBGRA.{b: 0, g: 0, r: 205, a: 255} -GREEN := ColorBGRA.{b: 0, g: 205, r: 0, a: 255} -YELLOW := ColorBGRA.{b: 0, g: 205, r: 205, a: 255} -BLUE := ColorBGRA.{b: 205, g: 0, r: 0, a: 255} -MAGENTA := ColorBGRA.{b: 205, g: 0, r: 205, a: 255} -CYAN := ColorBGRA.{b: 205, g: 205, r: 0, a: 255} -LIGHTGRAY := ColorBGRA.{b: 229, g: 229, r: 229, a: 255} -LIGHTRED := ColorBGRA.{b: 0, g: 0, r: 255, a: 255} -LIGHTGREEN := ColorBGRA.{b: 0, g: 255, r: 0, a: 255} -LIGHTYELLOW := ColorBGRA.{b: 0, g: 255, r: 255, a: 255} -LIGHTBLUE := ColorBGRA.{b: 255, g: 0, r: 0, a: 255} -LIGHTMAGENTA := ColorBGRA.{b: 255, g: 0, r: 255, a: 255} -LIGHTCYAN := ColorBGRA.{b: 255, g: 255, r: 0, a: 255} - -// i have no clue if this works. please don't me ask how it works. -aurlex -blend := fn(fg: ColorBGRA, bg: ColorBGRA): ColorBGRA { - s := fg + bg - m := s - ((fg ^ bg) & 16843008) & 16843008 - return (m >> 8 | 16777216 * (s < fg)) * 255 | s - m -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/draw.hb b/sysdata/programs/fb_driver/src/draw.hb deleted file mode 100644 index 9faf24a24..000000000 --- a/sysdata/programs/fb_driver/src/draw.hb +++ /dev/null @@ -1,113 +0,0 @@ -.{draw_pixel, screenidx, Transform, Point, Rect, Buffer, FB_WIDTH} := @use("rel:lib.hb") -ColorBGRA := @use("rel:color.hb").ColorBGRA -math := @use("../../../libraries/stn/src/lib.hb").math - -/* draws a filled rectangle to the screen - will be optimised later */ -rect_fill := fn(buffer: Buffer, pos: Point, tr: Transform, color: ColorBGRA): void { - n := 0 - loop if n == tr.height * tr.width break else { - *(buffer.write + screenidx(.(n % tr.width + pos.x, n / tr.width + pos.y))) = color - n += 1 - } - return -} -/* draws a wireframe rectangle to the screen - will also be optimised later */ -rect_line := fn(buffer: Buffer, pos: Point, tr: Transform, color: ColorBGRA, thickness: int): void { - t := 0 - y := 0 - x := 0 - loop if t == thickness break else { - y = pos.y - x = pos.x - loop if y == pos.y + tr.height break else { - *(buffer.write + pos.x + t + FB_WIDTH * y) = color; - *(buffer.write + pos.x + tr.width - t + FB_WIDTH * y) = color - y += 1 - } - loop if x == pos.x + tr.width break else { - *(buffer.write + x + (pos.y + t) * FB_WIDTH) = color; - *(buffer.write + x + (pos.y + tr.height - t) * FB_WIDTH) = color - x += 1 - } - t += 1 - } - return -} - -// do not use, use line() instead -line_low := fn(buffer: Buffer, p0: Point, p1: Point, color: ColorBGRA): void { - dx := p1.x - p0.x - dy := p1.y - p0.y - yi := 1 - if dy < 0 { - yi = 0 - 1 - dy = 0 - dy - } - D := 2 * dy - dx - y := p0.y - x := p0.x - loop if x == p1.x break else { - *(buffer.write + x + y * FB_WIDTH) = color - if D > 0 { - y += yi - D += 2 * (dy - dx) - } else { - D += 2 * dy - } - x += 1 - } - return -} -// do not use, use line() instead -line_high := fn(buffer: Buffer, p0: Point, p1: Point, color: ColorBGRA): void { - dx := p1.x - p0.x - dy := p1.y - p0.y - xi := 1 - if dy < 0 { - xi = 0 - 1 - dx = 0 - dx - } - D := 2 * dx - dy - x := p0.x - y := p0.y - loop if y == p1.y break else { - *(buffer.write + x + y * FB_WIDTH) = color - if D > 0 { - x += xi - D += 2 * (dx - dy) - } else { - D += 2 * dx - } - y += 1 - } - return -} - -/* implementation of Bresenham's line algorithm - TODO: thickness, might need better math library */ -line := fn(buffer: Buffer, p0: Point, p1: Point, color: ColorBGRA, thickness: int): void { - if math.abs(p1.y - p0.y) < math.abs(p1.x - p0.x) { - if p0.x > p1.x { - line_low(buffer, p1, p0, color) - } else { - line_low(buffer, p0, p1, color) - } - } else { - if p0.y > p1.y { - line_high(buffer, p1, p0, color) - } else { - line_high(buffer, p0, p1, color) - } - } - return -} - -// theoretically draws a wireframe polygon to the screen. untested. -tri_line := fn(buffer: Buffer, p0: Point, p1: Point, p2: Point, color: ColorBGRA, thickness: int): void { - line(buffer, p0, p1, color, thickness) - line(buffer, p1, p2, color, thickness) - line(buffer, p2, p0, color, thickness) - return -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/examples/amogus.hb b/sysdata/programs/fb_driver/src/examples/amogus.hb deleted file mode 100644 index b045f471d..000000000 --- a/sysdata/programs/fb_driver/src/examples/amogus.hb +++ /dev/null @@ -1,26 +0,0 @@ -.{rect_line} := @use("../draw.hb"); -.{present, create_buffer, clear} := @use("../lib.hb") - -/* expected result: - the impostor travels left and loops around the screen */ - -example := fn(): void { - // Creates a back buffer, which we write to, to avoid screen flickering - buffer := create_buffer() - x := 0 - loop { - // draw all our shapes to the back buffer - rect_line(buffer, .(200 - x, 80), .(430, 380), .(0, 0, 255, 0), 1) - rect_line(buffer, .(630 - x, 120), .(120, 300), .(0, 0, 255, 0), 1) - rect_line(buffer, .(200 - x, 460), .(160, 270), .(0, 0, 255, 0), 1) - rect_line(buffer, .(470 - x, 460), .(160, 270), .(0, 0, 255, 0), 1) - rect_line(buffer, .(140 - x, 140), .(340, 250), .(255, 255, 0, 0), 1) - /* push the back buffer to the front buffer - this displays our image to the screen */ - present(buffer) - // erase our old image - clear(buffer, .(0, 0, 0, 0)) - x += 1 - } - return -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/examples/colors.hb b/sysdata/programs/fb_driver/src/examples/colors.hb deleted file mode 100644 index a20f5ff54..000000000 --- a/sysdata/programs/fb_driver/src/examples/colors.hb +++ /dev/null @@ -1,27 +0,0 @@ -.{clear, create_buffer, present} := @use("../lib.hb"); -.{ColorBGRA} := @use("../color.hb") - -/* expected result: - the screen fades from green to cyan - then wraps back to green - note that this may happen too fast for you to notice... */ - -example := fn(): void { - // creates a back buffer, which we write to, to avoid screen flickering - buffer := create_buffer() - color := ColorBGRA.(0, 255, 0, 255) - /* have to explicitly say 0 is a u8, or we do something crazy to the colors. - looks like a compiler bug */ - n := @as(i8, @as(u8, 0)) - 1 - loop { - clear(buffer, color) - present(buffer) - /* because for some reason just comparing doesnt work. - also looks like a compiler bug */ - if (color.b & 255) == 255 | (color.b & 255) == 0 { - n = 0 - n - } - color.b += n - } - return -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/examples/front_buffer.hb b/sysdata/programs/fb_driver/src/examples/front_buffer.hb deleted file mode 100644 index 8c1bf5a6b..000000000 --- a/sysdata/programs/fb_driver/src/examples/front_buffer.hb +++ /dev/null @@ -1,19 +0,0 @@ -.{front_buffer_ptr, front_buffer_copy, get_front_buffer, Buffer} := @use("../lib.hb"); - -example := fn(): void { - // you can get the raw frontbuffer pointer using - raw_buffer := front_buffer_ptr - // this buffer is the one that you write individual pixels to - - // you can gete the copy frontbuffer pointer using - copy_buffer := copy_buffer_ptr - /* this buffer is used for massive writing - operations by taking advantage of - static copying */ - - // you can construct a buffer like so - buffer := Buffer.{write: raw_buffer, copy: copy_buffer} - // this is the operation that get_front_buffer does - same_buffer := get_front_buffer() - return -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/examples/lines.hb b/sysdata/programs/fb_driver/src/examples/lines.hb deleted file mode 100644 index 11adde784..000000000 --- a/sysdata/programs/fb_driver/src/examples/lines.hb +++ /dev/null @@ -1,25 +0,0 @@ -.{line} := @use("../draw.hb"); -.{clear, create_buffer, present, FB_WIDTH, FB_HEIGHT, Point} := @use("../lib.hb") - -/* expected result: - a 3d-looking blue set of lines - created on a blue background */ - -example := fn(): void { - // creates a back buffer, which we write to, to avoid screen flickering - buffer := create_buffer() - // fill the screen in blue - clear(buffer, .(100, 50, 0, 255)) - p0 := Point.(0, 0 - 1) - p1 := Point.(0, FB_HEIGHT - 1) - loop if p0.y >= FB_HEIGHT break else { - // draw a line between p0 and p1 - line(buffer, p0, p1, .(255, 180, 100, 255), 3) - p0.y += FB_HEIGHT >> 6 - p1.x += FB_WIDTH >> 6 - } - /* push the back buffer to the front buffer - this displays our image to the screen */ - present(buffer) - return -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/examples/square.hb b/sysdata/programs/fb_driver/src/examples/square.hb deleted file mode 100644 index 84b399489..000000000 --- a/sysdata/programs/fb_driver/src/examples/square.hb +++ /dev/null @@ -1,32 +0,0 @@ -.{rect_line} := @use("../draw.hb"); -.{clear, create_buffer, present, Point, FB_HEIGHT, FB_WIDTH} := @use("../lib.hb") - -/* expected result: - the white outline of a square bounces around the screen */ - -example := fn(): void { - // creates a back buffer, which we write to, to avoid screen flickering - buffer := create_buffer() - vel := Point.{x: 1, y: 1} - pos := Point.{x: 100, y: 100} - loop { - // draw the square at our current position - rect_line(buffer, pos, .(100, 100), .(255, 255, 255, 255), 3) - /* push the back buffer to the front buffer - this displays our image to the screen */ - present(buffer) - // erase our old image - clear(buffer, .(0, 0, 0, 0)) - - // bounce the square if it touches the screen edges - if pos.x == 0 | pos.x == FB_WIDTH - 100 { - vel.x = 0 - vel.x - } - if pos.y == 0 | pos.y == FB_HEIGHT - 100 { - vel.y = 0 - vel.y - } - - pos += vel - } - return -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/examples/strobe.hb b/sysdata/programs/fb_driver/src/examples/strobe.hb deleted file mode 100644 index e46653c60..000000000 --- a/sysdata/programs/fb_driver/src/examples/strobe.hb +++ /dev/null @@ -1,20 +0,0 @@ -.{clear, create_buffer, present} := @use("../lib.hb") - -/* expected result: (EPILEPSY WARNING) - the screen rapidly flashes red then black */ - -example := fn(): void { - // creates a back buffer, which we write to, to avoid screen flickering - buffer := create_buffer() - loop { - // screen go red - clear(buffer, .(0, 0, 255, 0)) - // show the red - present(buffer) - // screen go black - clear(buffer, .(0, 255, 255, 0)) - // show the black - present(buffer) - } - return -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/lib.hb b/sysdata/programs/fb_driver/src/lib.hb deleted file mode 100644 index 8b6addb0c..000000000 --- a/sysdata/programs/fb_driver/src/lib.hb +++ /dev/null @@ -1,100 +0,0 @@ -.{memory, log, math} := @use("../../../libraries/stn/src/lib.hb"); -.{ColorBGRA, blend} := @use("rel:color.hb") - -FB_WIDTH := 1024 -FB_HEIGHT := 768 -FB_PIXELS := FB_WIDTH * FB_HEIGHT -FB_BYTES := FB_PIXELS << 2 -// actual enforced max copy size is (1 << 16) - 1, but this was faster -MAX_COPY_SIZE := 6144 -// see stn.math.min, cant use here due to compiler bug (reg id leaked) -COPY_PIXELS := MAX_COPY_SIZE + (FB_BYTES - MAX_COPY_SIZE & FB_BYTES - MAX_COPY_SIZE >> 31) >> 2 -PARTITIONS := FB_PIXELS / COPY_PIXELS -TOTAL_PAGES := 1 + FB_BYTES >> 12 - -Buffer := struct {write: ^ColorBGRA, copy: ^[ColorBGRA; COPY_PIXELS]} -Point := struct {x: int, y: int} -Transform := struct {width: int, height: int} -Rect := struct {p1: Point, p2: Point} - -front_buffer_ptr := @as(^ColorBGRA, @bitcast(0 - 140734267129856)) -front_buffer_copy := @as(^[ColorBGRA; COPY_PIXELS], @bitcast(front_buffer_ptr)) - -get_front_buffer := fn(): Buffer { - // trying to return front_buffer_ptr or front_buffer_copy causes reg id leak - return Buffer.{write: @as(^ColorBGRA, @bitcast(0 - 140734267129856)), copy: @as(^[ColorBGRA; COPY_PIXELS], @bitcast(0 - 140734267129856))} -} -/* this is separate to create_raw_buffer because returning a Buffer from - create_raw_buffer causes reg id leak */ -create_buffer := fn(): Buffer { - ptr := create_raw_buffer() - ptr_copy := @as(^[ColorBGRA; COPY_PIXELS], @bitcast(ptr)) - // same here, bitcasting inside the struct literal causes reg id leak - buffer := Buffer.{write: ptr, copy: ptr_copy} - return buffer -} -create_raw_buffer := fn(): ^ColorBGRA { - // helps to trace allocation bugs - log.info("Creating buffer. This will allocate.\0") - if TOTAL_PAGES <= 255 { - return @bitcast(memory.request_page(TOTAL_PAGES)) - } - ptr := memory.request_page(255) - remaining := TOTAL_PAGES - 255 - loop if remaining <= 0 break else { - if remaining < 255 { - memory.request_page(remaining) - } else { - memory.request_page(255) - } - remaining -= 255 - } - return @bitcast(ptr) -} -// sets the buffer to the color. very fast. -clear := fn(buffer: Buffer, color: ColorBGRA): void { - n := 0 - // write the first pixel chunk - loop if n >= COPY_PIXELS break else { - *(buffer.write + n) = color - n += 1 - } - n = 1 - // copy that pixel chunk through the buffer, taking advantage of memory copying - loop if n >= PARTITIONS break else { - *(buffer.copy + n) = *buffer.copy - n += 1 - } - return -} -// only required to be called when using a back buffer. if using single-buffered rendering, do not call this. -present := fn(buffer: Buffer): void { - offset := 0 - // copy chunks of the read buffer to the front buffer - loop if offset >= PARTITIONS break else { - *(front_buffer_copy + offset) = *(buffer.copy + offset) - offset += 1 - } - return -} -// composites the contents of buffer1 into buffer2, accounting for alpha transparency -// i dont know if it works. i have not tested it. it probably doesnt work -composite := fn(buffer1: Buffer, buffer2: Buffer): void { - n := 0 - loop if n == FB_PIXELS break else { - bg := *(buffer2.write + n); - *(buffer2.write + n) = blend(*(buffer1.write + n), bg) - n += 1 - } - return -} -// really need to be able to inline this please - aurlex -screenidx := fn(pos: Point): int { - return pos.x + FB_WIDTH * pos.y -} -point2rect := fn(pos: Point, tr: Transform): Rect { - return .(pos, .(pos.x + tr.x, pos.y + tr.y)) -} -rect2point := fn(rect: Rect): struct {point: Point, transform: Transform} { - return .(.(0, 0), .(0, 0)) -} \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/main.hb b/sysdata/programs/fb_driver/src/main.hb deleted file mode 100644 index defb90cf4..000000000 --- a/sysdata/programs/fb_driver/src/main.hb +++ /dev/null @@ -1,7 +0,0 @@ -// change "lines.hb" to another example to see it onscreen -example := @use("examples/square.hb").example - -main := fn(): int { - example() - return 0 -} \ No newline at end of file diff --git a/sysdata/programs/time_driver/meta.toml b/sysdata/programs/render_example/meta.toml similarity index 72% rename from sysdata/programs/time_driver/meta.toml rename to sysdata/programs/render_example/meta.toml index 84cc97e6e..4712b537e 100644 --- a/sysdata/programs/time_driver/meta.toml +++ b/sysdata/programs/render_example/meta.toml @@ -1,6 +1,6 @@ [package] -name = "time_driver" -authors = ["SamBuckley"] +name = "render_example" +authors = ["koniifer"] [dependants.libraries] diff --git a/sysdata/programs/render_example/src/examples/amogus.hb b/sysdata/programs/render_example/src/examples/amogus.hb new file mode 100644 index 000000000..eca4e4858 --- /dev/null +++ b/sysdata/programs/render_example/src/examples/amogus.hb @@ -0,0 +1,20 @@ +render := @use("../../../../libraries/render/src/lib.hb") + +/* expected result: + the impostor travels left and loops around the screen */ + +example := fn(): void { + render.init() + x := 0 + loop { + render.put_rect(.(200 - x, 80), .(430, 380), render.red) + render.put_rect(.(630 - x, 120), .(120, 300), render.red) + render.put_rect(.(200 - x, 460), .(160, 270), render.red) + render.put_rect(.(470 - x, 460), .(160, 270), render.red) + render.put_rect(.(140 - x, 140), .(340, 250), render.cyan) + render.sync() + render.clear(render.black) + x += 1 + } + return +} \ 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 new file mode 100644 index 000000000..9f8bbd7db --- /dev/null +++ b/sysdata/programs/render_example/src/examples/colors.hb @@ -0,0 +1,21 @@ +render := @use("../../../../libraries/render/src/lib.hb") + +/* expected result: + the screen fades from cyan to green + then wraps back to cyan + note that this may happen too fast for you to notice... */ + +example := fn(): void { + render.init() + color := render.light_cyan + n := @as(u8, 1) + loop { + render.clear(color) + render.sync() + if (color.b & 255) == 255 | (color.b & 255) == 0 { + n = -n + } + color.b += n + } + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/examples/lines.hb b/sysdata/programs/render_example/src/examples/lines.hb new file mode 100644 index 000000000..5a416096f --- /dev/null +++ b/sysdata/programs/render_example/src/examples/lines.hb @@ -0,0 +1,22 @@ +render := @use("../../../../libraries/render/src/lib.hb") + +/* expected result: + a 3d-looking set of blue lines + created on a blue background */ + +example := fn(): void { + render.init() + render.clear(.(100, 50, 0, 255)) + width := render.width() + height := render.height() + p0 := render.IVec2.(0, 0) + p1 := render.IVec2.(0, height) + loop if p0.y >= height break else { + render.put_line(p0, p1, .(255, 180, 100, 255)) + render.put_line(.(width, height) - p0, .(width, height) - p1, .(255, 180, 100, 255)) + p0.y += height >> 6 + p1.x += width >> 6 + } + render.sync() + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/examples/random.hb b/sysdata/programs/render_example/src/examples/random.hb new file mode 100644 index 000000000..7b0fbbb4b --- /dev/null +++ b/sysdata/programs/render_example/src/examples/random.hb @@ -0,0 +1,17 @@ +.{random} := @use("../../../../libraries/stn/src/lib.hb") +render := @use("../../../../libraries/render/src/lib.hb") + +example := fn(): void { + render.init() + render.doublebuffer(false) + render.clear(render.black) + loop { + x := random.integer_range(0, 1024) + y := random.integer_range(0, 768) + r := random.integer_range(0, 255) + g := random.integer_range(0, 75) + b := random.integer_range(0, 155) + render.put_pixel(.(x, y), .(b, g, r, 255)) + } + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/examples/square.hb b/sysdata/programs/render_example/src/examples/square.hb new file mode 100644 index 000000000..55f980559 --- /dev/null +++ b/sysdata/programs/render_example/src/examples/square.hb @@ -0,0 +1,27 @@ +render := @use("../../../../libraries/render/src/lib.hb") + +/* expected result: + the white outline of a square bounces around the screen */ + +example := fn(): void { + render.init() + vel := render.IVec2.(1, 1) + pos := render.IVec2.(100, 100) + width := render.width() + height := render.height() + loop { + render.put_rect(pos, .(100, 100), render.white) + render.sync() + render.clear(render.black) + + if pos.x == 0 | pos.x == width - 100 { + vel.x = -vel.x + } + if pos.y == 0 | pos.y == height - 100 { + vel.y = -vel.y + } + + pos += vel + } + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/examples/strobe.hb b/sysdata/programs/render_example/src/examples/strobe.hb new file mode 100644 index 000000000..4681cc5e1 --- /dev/null +++ b/sysdata/programs/render_example/src/examples/strobe.hb @@ -0,0 +1,15 @@ +render := @use("../../../../libraries/render/src/lib.hb") + +/* expected result: (EPILEPSY WARNING) + the screen rapidly flashes red then black */ + +example := fn(): void { + render.init() + loop { + render.clear(render.red) + render.sync() + render.clear(render.yellow) + render.sync() + } + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/examples/svga.hb b/sysdata/programs/render_example/src/examples/svga.hb new file mode 100644 index 000000000..101aa6fb5 --- /dev/null +++ b/sysdata/programs/render_example/src/examples/svga.hb @@ -0,0 +1,8 @@ +render := @use("../../../../libraries/render/src/lib.hb") + +render.mode = render.svga + +example := fn(): void { + render.init() + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/main.hb b/sysdata/programs/render_example/src/main.hb new file mode 100644 index 000000000..4f44fd854 --- /dev/null +++ b/sysdata/programs/render_example/src/main.hb @@ -0,0 +1,6 @@ +.{example} := @use("./examples/colors.hb") + +main := fn(): void { + @inline(example) + return +} \ No newline at end of file diff --git a/sysdata/programs/a_serial_driver/README.md b/sysdata/programs/serial_driver/README.md similarity index 100% rename from sysdata/programs/a_serial_driver/README.md rename to sysdata/programs/serial_driver/README.md diff --git a/sysdata/programs/a_serial_driver/meta.toml b/sysdata/programs/serial_driver/meta.toml similarity index 84% rename from sysdata/programs/a_serial_driver/meta.toml rename to sysdata/programs/serial_driver/meta.toml index 812e29722..33de70598 100644 --- a/sysdata/programs/a_serial_driver/meta.toml +++ b/sysdata/programs/serial_driver/meta.toml @@ -1,5 +1,5 @@ [package] -name = "a_serial_driver" +name = "serial_driver" authors = ["Able"] [dependants.libraries] diff --git a/sysdata/programs/a_serial_driver/src/main.hb b/sysdata/programs/serial_driver/src/main.hb similarity index 77% rename from sysdata/programs/a_serial_driver/src/main.hb rename to sysdata/programs/serial_driver/src/main.hb index 6ec614e19..4cb3f11f2 100644 --- a/sysdata/programs/a_serial_driver/src/main.hb +++ b/sysdata/programs/serial_driver/src/main.hb @@ -1,11 +1,10 @@ -stn := @use("../../../libraries/stn/src/lib.hb"); -.{log, string, memory, buffer} := stn +.{memory, buffer} := @use("../../../libraries/stn/src/lib.hb") serial_print := fn(ptr: ^u8): void { letter := 0 loop if *ptr == 0 break else { letter = *ptr - memory.outb(3, 248, letter) + memory.outb(0xF803, letter) ptr += 1 } return @@ -13,8 +12,8 @@ serial_print := fn(ptr: ^u8): void { serial_println := fn(ptr: ^u8): void { serial_print(ptr) - memory.outb(3, 248, 12) - memory.outb(3, 248, 13) + memory.outb(0xF803, 12) + memory.outb(0xF803, 13) return } @@ -26,7 +25,7 @@ main := fn(): int { mem := memory.request_page(1) loop { - ptr := @eca(int, 4, a, mem, 4096) + ptr := @eca(int, 4, a, mem, 0x1000) if ptr == 0 { serial_println("No message\0") } diff --git a/sysdata/programs/serial_driver_test/src/main.hb b/sysdata/programs/serial_driver_test/src/main.hb index 6a22fbd99..6893bc20d 100644 --- a/sysdata/programs/serial_driver_test/src/main.hb +++ b/sysdata/programs/serial_driver_test/src/main.hb @@ -1,14 +1,11 @@ -stn := @use("../../../libraries/stn/src/lib.hb"); -.{string, memory, buffer} := stn - -frame_buffer := @as(^u8, @bitcast(0 - 140734267129856)) +.{string, buffer} := @use("../../../libraries/stn/src/lib.hb") log_info := fn(): void { a := buffer.search("XNumber\0") if a == 0 { } else { msg := "XABC\0" - msg_length := string.length(msg) + msg_length := @inline(string.length, msg) @eca(void, 3, a, msg, msg_length) } diff --git a/sysdata/programs/tests/src/main.hb b/sysdata/programs/tests/src/main.hb index a8dbc78ef..bf0789949 100644 --- a/sysdata/programs/tests/src/main.hb +++ b/sysdata/programs/tests/src/main.hb @@ -1,5 +1,4 @@ -stn := @use("../../../libraries/stn/src/lib.hb"); -.{log, string, memory, buffer} := stn +.{log, string, memory, buffer} := @use("../../../libraries/stn/src/lib.hb") service_search := fn(): void { a := "\{01}\0" diff --git a/sysdata/programs/time_driver/src/main.hb b/sysdata/programs/time_driver/src/main.hb deleted file mode 100644 index 45e752bca..000000000 --- a/sysdata/programs/time_driver/src/main.hb +++ /dev/null @@ -1,22 +0,0 @@ -stn := @use("../../../libraries/stn/src/lib.hb") -log := stn.log -mem := stn.memory -s := stn.string -page := 0 - -main := fn(): void { - page += mem.request_page(1) - port_str := "\0\0\{47}\0" - a := @eca(u8, 3, 3, port_str, 4) - - n := 5000000 - loop { - if n == 0 break - n -= 1 - stack_reclamation_edge_case := 0 - } - td := s.display_int(a, page) - log.debug(td) - - return -} \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index cee2db581..28d2c3199 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -19,31 +19,27 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.tests] # path = "boot:///tests.hbf" -# [boot.limine.ableos.modules.a_serial_driver] -# path = "boot:///a_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.fb_driver] -# path = "boot:///fb_driver.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.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"