forked from AbleOS/ableos
Compare commits
62 commits
Author | SHA1 | Date | |
---|---|---|---|
Erin | 23b02b7284 | ||
Erin | e3ab94be87 | ||
Erin | cef19a8fe4 | ||
Erin | e3ce700295 | ||
Erin | 70601eb0c5 | ||
Erin | f8630f6471 | ||
Erin | ea7bbacc56 | ||
Erin | eb93deae25 | ||
Erin | 84d6cc49a1 | ||
Erin | fed31617a8 | ||
Erin | ebd3fe2248 | ||
Erin | 72c4aabbcc | ||
Erin | 6d2a9c74d4 | ||
Erin | 816204cd5b | ||
Erin | b5f75a13f4 | ||
Erin | c241d839f2 | ||
Erin | 7ac54e5ec8 | ||
Erin | d3d52c974a | ||
Erin | 7d21956b0a | ||
Erin | b802732acf | ||
Erin | 8d640b6a9b | ||
Erin | e33014d000 | ||
Erin | ec5b21292e | ||
Erin | eae5979921 | ||
Erin | 3414b40da8 | ||
Asya | 80fd1aaa41 | ||
Asya | 78a5422924 | ||
Asya | 558fc6da59 | ||
Erin | e796a05ddf | ||
Erin | 4c28bfd4d2 | ||
Erin | 0249353a6b | ||
Erin | b68984dc7f | ||
Erin | 58046c3c7b | ||
Erin | e85e5f2ed8 | ||
Erin | 51b084a176 | ||
Erin | 11b492d6ce | ||
Erin | cc714be94e | ||
Erin | 118c3bb3f0 | ||
Erin | a9aa31f087 | ||
Erin | b3954e3533 | ||
Erin | 8fbf7b5a5a | ||
Erin | 7652bbf402 | ||
Erin | eae4891071 | ||
Erin | fa82e49dc3 | ||
Erin | 87fdb2e0bf | ||
Erin | aaf840c5b4 | ||
Erin | 9c2b8573d9 | ||
Erin | b2cf3621b5 | ||
Able | 82a48f5c98 | ||
Erin | 403e410797 | ||
Able | 78a52f7102 | ||
Able | d94e50be39 | ||
Able | e8712d7c39 | ||
Able | 65bb92e02b | ||
Erin | 2114b9a346 | ||
Able | a2d6d7245a | ||
Able | 1e1d004240 | ||
Able | 6e20d33817 | ||
TheOddGarlic | 23c355762c | ||
TheOddGarlic | fe69e31b91 | ||
TheOddGarlic | 346d3a9166 | ||
TheOddGarlic | 643db212ef |
4
.gdbinit
Normal file
4
.gdbinit
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
set history save on
|
||||||
|
file target/x86_64-ableos/debug/ableos
|
||||||
|
target remote localhost:9000
|
||||||
|
tui enable
|
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
"rust-analyzer.checkOnSave.allTargets": false,
|
"files.associations": {
|
||||||
"rust-analyzer.showUnlinkedFileNotification": false
|
"stddef.h": "c"
|
||||||
|
},
|
||||||
|
"rust-analyzer.checkOnSave.allTargets": false
|
||||||
}
|
}
|
534
Cargo.lock
generated
534
Cargo.lock
generated
|
@ -2,32 +2,6 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ablewasi"
|
|
||||||
version = "0.1.0"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ahash"
|
|
||||||
version = "0.7.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
|
|
||||||
dependencies = [
|
|
||||||
"getrandom",
|
|
||||||
"once_cell",
|
|
||||||
"version_check",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ahash"
|
|
||||||
version = "0.8.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"once_cell",
|
|
||||||
"version_check",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "0.7.20"
|
version = "0.7.20"
|
||||||
|
@ -48,9 +22,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.70"
|
version = "1.0.68"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4"
|
checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "atty"
|
||||||
|
@ -77,9 +51,9 @@ checksum = "2b645c5c09a7d4035949cfce1a915785aaad6f17800c35fda8a8c311c491f284"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bit_field"
|
name = "bit_field"
|
||||||
version = "0.10.2"
|
version = "0.10.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
|
checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
|
@ -101,9 +75,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.79"
|
version = "1.0.78"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
|
checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
|
@ -113,9 +87,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.24"
|
version = "0.4.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b"
|
checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
|
@ -126,16 +100,6 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "clparse"
|
|
||||||
version = "0.1.0"
|
|
||||||
source = "git+https://git.ablecorp.us/ableos/ableos_userland#8fa6c705f23ae310e3c4395a61823449ed5a1d02"
|
|
||||||
dependencies = [
|
|
||||||
"hashbrown 0.13.2",
|
|
||||||
"log",
|
|
||||||
"toml",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "codespan-reporting"
|
name = "codespan-reporting"
|
||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
|
@ -148,9 +112,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation-sys"
|
name = "core-foundation-sys"
|
||||||
version = "0.8.4"
|
version = "0.8.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-queue"
|
name = "crossbeam-queue"
|
||||||
|
@ -164,18 +128,18 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-utils"
|
name = "crossbeam-utils"
|
||||||
version = "0.8.15"
|
version = "0.8.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b"
|
checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxx"
|
name = "cxx"
|
||||||
version = "1.0.94"
|
version = "1.0.86"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93"
|
checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"cxxbridge-flags",
|
"cxxbridge-flags",
|
||||||
|
@ -185,9 +149,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxx-build"
|
name = "cxx-build"
|
||||||
version = "1.0.94"
|
version = "1.0.86"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b"
|
checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"codespan-reporting",
|
"codespan-reporting",
|
||||||
|
@ -195,24 +159,24 @@ dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"scratch",
|
"scratch",
|
||||||
"syn 2.0.13",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxxbridge-flags"
|
name = "cxxbridge-flags"
|
||||||
version = "1.0.94"
|
version = "1.0.86"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb"
|
checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxxbridge-macro"
|
name = "cxxbridge-macro"
|
||||||
version = "1.0.94"
|
version = "1.0.86"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
|
checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.13",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -223,14 +187,19 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.109",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "downcast-rs"
|
name = "elfloader"
|
||||||
version = "1.2.0"
|
version = "0.16.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
|
checksum = "6a7b18d35bf8ec3bac59c3ec29cf1f1b46e764e00b42a9c0c754d06e38e78f3b"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"log",
|
||||||
|
"xmas-elf",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "env_logger"
|
name = "env_logger"
|
||||||
|
@ -247,13 +216,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "errno"
|
name = "errno"
|
||||||
version = "0.3.0"
|
version = "0.2.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0"
|
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"errno-dragonfly",
|
"errno-dragonfly",
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.45.0",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -298,35 +267,6 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "getrandom"
|
|
||||||
version = "0.2.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hashbrown"
|
|
||||||
version = "0.12.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
|
||||||
dependencies = [
|
|
||||||
"ahash 0.7.6",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hashbrown"
|
|
||||||
version = "0.13.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
|
|
||||||
dependencies = [
|
|
||||||
"ahash 0.8.3",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.1.19"
|
version = "0.1.19"
|
||||||
|
@ -338,9 +278,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.3.1"
|
version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
|
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "humantime"
|
name = "humantime"
|
||||||
|
@ -350,16 +293,16 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iana-time-zone"
|
name = "iana-time-zone"
|
||||||
version = "0.1.56"
|
version = "0.1.53"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c"
|
checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_system_properties",
|
"android_system_properties",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
"iana-time-zone-haiku",
|
"iana-time-zone-haiku",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"windows",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -372,33 +315,26 @@ dependencies = [
|
||||||
"cxx-build",
|
"cxx-build",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "indexmap-nostd"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "io-lifetimes"
|
name = "io-lifetimes"
|
||||||
version = "1.0.10"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
|
checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi 0.3.1",
|
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "is-terminal"
|
name = "is-terminal"
|
||||||
version = "0.4.6"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "256017f749ab3117e93acb91063009e1f1bb56d03965b14c2c8df4eb02c524d8"
|
checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi 0.3.1",
|
"hermit-abi 0.2.6",
|
||||||
"io-lifetimes",
|
"io-lifetimes",
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys 0.45.0",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -409,9 +345,9 @@ checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.61"
|
version = "0.3.60"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"
|
checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
@ -420,41 +356,31 @@ dependencies = [
|
||||||
name = "kernel"
|
name = "kernel"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clparse",
|
|
||||||
"crossbeam-queue",
|
"crossbeam-queue",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
|
"elfloader",
|
||||||
"error-stack 0.3.1",
|
"error-stack 0.3.1",
|
||||||
"hashbrown 0.13.2",
|
|
||||||
"limine",
|
"limine",
|
||||||
"log",
|
"log",
|
||||||
"rdrand",
|
|
||||||
"sbi",
|
"sbi",
|
||||||
"slab",
|
"slab",
|
||||||
"spin",
|
"spin",
|
||||||
"uart_16550",
|
"uart_16550",
|
||||||
"versioning",
|
"versioning",
|
||||||
"wasmi",
|
|
||||||
"x2apic",
|
"x2apic",
|
||||||
"x86_64",
|
"x86_64",
|
||||||
"xml",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.141"
|
version = "0.2.139"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
|
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libm"
|
|
||||||
version = "0.2.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "limine"
|
name = "limine"
|
||||||
version = "0.1.10"
|
version = "0.1.9"
|
||||||
source = "git+https://github.com/limine-bootloader/limine-rs#d34b1863a0355e8606a0090663a9f4749c02f838"
|
source = "git+https://github.com/limine-bootloader/limine-rs#c2fbc349419d4330b80e053019ad2fe504a61764"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "link-cplusplus"
|
name = "link-cplusplus"
|
||||||
|
@ -467,9 +393,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.3.1"
|
version = "0.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f"
|
checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
|
@ -517,9 +443,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.17.1"
|
version = "1.17.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
|
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "owo-colors"
|
name = "owo-colors"
|
||||||
|
@ -532,57 +458,42 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "paste"
|
name = "paste"
|
||||||
version = "1.0.12"
|
version = "1.0.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
|
checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.56"
|
version = "1.0.50"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
|
checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.26"
|
version = "1.0.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
|
checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rand_core"
|
|
||||||
version = "0.6.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "raw-cpuid"
|
name = "raw-cpuid"
|
||||||
version = "10.7.0"
|
version = "10.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332"
|
checksum = "a6823ea29436221176fe662da99998ad3b4db2c7f31e7b6f5fe43adccd6320bb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rdrand"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e233b642160555c1aa1ff7a78443c6139342f411b6fa6602af2ebbfee9e166bb"
|
|
||||||
dependencies = [
|
|
||||||
"rand_core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.7.3"
|
version = "1.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
|
checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
@ -591,9 +502,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.29"
|
version = "0.6.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
|
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "repbuild"
|
name = "repbuild"
|
||||||
|
@ -616,23 +527,23 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.37.7"
|
version = "0.36.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d"
|
checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"errno",
|
"errno",
|
||||||
"io-lifetimes",
|
"io-lifetimes",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.45.0",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustversion"
|
name = "rustversion"
|
||||||
version = "1.0.12"
|
version = "1.0.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
|
checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sbi"
|
name = "sbi"
|
||||||
|
@ -648,56 +559,50 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scratch"
|
name = "scratch"
|
||||||
version = "1.0.5"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1"
|
checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.17"
|
version = "1.0.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
|
checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.159"
|
version = "1.0.152"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065"
|
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.159"
|
version = "1.0.152"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585"
|
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.13",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.8"
|
version = "0.4.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
|
checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "smallvec"
|
|
||||||
version = "1.10.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spin"
|
name = "spin"
|
||||||
version = "0.9.8"
|
version = "0.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
|
checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lock_api",
|
"lock_api",
|
||||||
]
|
]
|
||||||
|
@ -714,20 +619,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.109"
|
version = "1.0.107"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"unicode-ident",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "syn"
|
|
||||||
version = "2.0.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -750,19 +644,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
|
checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"wasi 0.10.0+wasi-snapshot-preview1",
|
"wasi",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "toml"
|
|
||||||
version = "0.5.9"
|
|
||||||
source = "git+https://git.ablecorp.us/theoddgarlic/toml-rs#34db433429f3ad38921d13ac9aba74c8a706f376"
|
|
||||||
dependencies = [
|
|
||||||
"hashbrown 0.12.3",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uart_16550"
|
name = "uart_16550"
|
||||||
version = "0.2.18"
|
version = "0.2.18"
|
||||||
|
@ -776,9 +661,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.8"
|
version = "1.0.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
|
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
|
@ -786,16 +671,10 @@ version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "version_check"
|
|
||||||
version = "0.9.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "versioning"
|
name = "versioning"
|
||||||
version = "0.1.3"
|
version = "0.1.2"
|
||||||
source = "git+https://git.ablecorp.us/ableos/ableos_userland#8fa6c705f23ae310e3c4395a61823449ed5a1d02"
|
source = "git+https://git.ablecorp.us/able/aos_userland#a9a2514de31c10c1f02956f3513a636e2c5190ff"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
@ -812,17 +691,11 @@ version = "0.10.0+wasi-snapshot-preview1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasi"
|
|
||||||
version = "0.11.0+wasi-snapshot-preview1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.84"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"
|
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"wasm-bindgen-macro",
|
"wasm-bindgen-macro",
|
||||||
|
@ -830,24 +703,24 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-backend"
|
name = "wasm-bindgen-backend"
|
||||||
version = "0.2.84"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"
|
checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.109",
|
"syn",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.84"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"
|
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
|
@ -855,62 +728,22 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.84"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
|
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.109",
|
"syn",
|
||||||
"wasm-bindgen-backend",
|
"wasm-bindgen-backend",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.84"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
|
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmi"
|
|
||||||
version = "0.29.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "677160b1166881badada1137afc6457777126f328ae63a18058b504f546f0828"
|
|
||||||
dependencies = [
|
|
||||||
"smallvec",
|
|
||||||
"spin",
|
|
||||||
"wasmi_arena",
|
|
||||||
"wasmi_core",
|
|
||||||
"wasmparser-nostd",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmi_arena"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmi_core"
|
|
||||||
version = "0.12.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7"
|
|
||||||
dependencies = [
|
|
||||||
"downcast-rs",
|
|
||||||
"libm",
|
|
||||||
"num-traits",
|
|
||||||
"paste",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmparser-nostd"
|
|
||||||
version = "0.100.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724"
|
|
||||||
dependencies = [
|
|
||||||
"indexmap-nostd",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
|
@ -943,152 +776,68 @@ version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
|
|
||||||
dependencies = [
|
|
||||||
"windows-targets 0.48.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.45.0"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
|
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-targets 0.42.2",
|
"windows_aarch64_gnullvm",
|
||||||
]
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
[[package]]
|
"windows_i686_msvc",
|
||||||
name = "windows-sys"
|
"windows_x86_64_gnu",
|
||||||
version = "0.48.0"
|
"windows_x86_64_gnullvm",
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
"windows_x86_64_msvc",
|
||||||
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
|
||||||
dependencies = [
|
|
||||||
"windows-targets 0.48.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-targets"
|
|
||||||
version = "0.42.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
|
|
||||||
dependencies = [
|
|
||||||
"windows_aarch64_gnullvm 0.42.2",
|
|
||||||
"windows_aarch64_msvc 0.42.2",
|
|
||||||
"windows_i686_gnu 0.42.2",
|
|
||||||
"windows_i686_msvc 0.42.2",
|
|
||||||
"windows_x86_64_gnu 0.42.2",
|
|
||||||
"windows_x86_64_gnullvm 0.42.2",
|
|
||||||
"windows_x86_64_msvc 0.42.2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-targets"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
|
|
||||||
dependencies = [
|
|
||||||
"windows_aarch64_gnullvm 0.48.0",
|
|
||||||
"windows_aarch64_msvc 0.48.0",
|
|
||||||
"windows_i686_gnu 0.48.0",
|
|
||||||
"windows_i686_msvc 0.48.0",
|
|
||||||
"windows_x86_64_gnu 0.48.0",
|
|
||||||
"windows_x86_64_gnullvm 0.48.0",
|
|
||||||
"windows_x86_64_msvc 0.48.0",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_gnullvm"
|
name = "windows_aarch64_gnullvm"
|
||||||
version = "0.42.2"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
|
checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_gnullvm"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.42.2"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
|
checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_msvc"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.42.2"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
|
checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_gnu"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.42.2"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
|
checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_msvc"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.42.2"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
|
checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnu"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
version = "0.42.2"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
|
checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnullvm"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.42.2"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
|
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_msvc"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "x2apic"
|
name = "x2apic"
|
||||||
version = "0.4.2"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "547152b57dd1ae0ce7a4ef1c6470f6039aa7ed22e2179d5bc4f3eda1304e0db3"
|
checksum = "32b6a3e030cfc71d614954e1de6dcb09e40bf1437f620c27b4526f978bee912e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit",
|
"bit",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -1110,9 +859,16 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xml"
|
name = "xmas-elf"
|
||||||
version = "0.1.0"
|
version = "0.8.0"
|
||||||
source = "git+https://git.ablecorp.us/ableos/ableos_userland#8fa6c705f23ae310e3c4395a61823449ed5a1d02"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8d29b4d8e7beaceb4e77447ba941a7600d23d0319ab52da0461abea214832d5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"zero",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zero"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2fe21bcc34ca7fe6dd56cc2cb1261ea59d6b93620215aefb5ea6032265527784"
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
resolver = "2"
|
|
||||||
|
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["kernel", "repbuild", "user/ablewasi"]
|
members = ["kernel", "repbuild"]
|
||||||
|
|
|
@ -2,20 +2,15 @@
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
name = "kernel"
|
name = "kernel"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
resolver = "2"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
elfloader = "0.16"
|
||||||
error-stack = { version = "0.3", default-features = false}
|
error-stack = { version = "0.3", default-features = false}
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
spin = "0.9"
|
spin = "0.9"
|
||||||
uart_16550 = "0.2"
|
uart_16550 = "0.2"
|
||||||
slab = { version = "0.4", default-features = false }
|
slab = { version = "0.4", default-features = false }
|
||||||
xml = { git = "https://git.ablecorp.us/ableos/ableos_userland" }
|
versioning = { git = "https://git.ablecorp.us/able/aos_userland" }
|
||||||
|
|
||||||
clparse = { git = "https://git.ablecorp.us/ableos/ableos_userland", default-features = false }
|
|
||||||
versioning = { git = "https://git.ablecorp.us/ableos/ableos_userland" }
|
|
||||||
wasmi = { version = "0.29.0", default-features = false }
|
|
||||||
hashbrown = "*"
|
|
||||||
|
|
||||||
[dependencies.crossbeam-queue]
|
[dependencies.crossbeam-queue]
|
||||||
version = "0.3"
|
version = "0.3"
|
||||||
|
@ -38,14 +33,10 @@ features = [
|
||||||
"sum",
|
"sum",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
[target.'cfg(target_arch = "x86_64")'.dependencies]
|
[target.'cfg(target_arch = "x86_64")'.dependencies]
|
||||||
limine = { version = "0.1", git = "https://github.com/limine-bootloader/limine-rs" }
|
limine = { version = "0.1", git = "https://github.com/limine-bootloader/limine-rs" }
|
||||||
x86_64 = "0.14"
|
x86_64 = "0.14"
|
||||||
x2apic = "0.4"
|
x2apic = "0.4"
|
||||||
# rdrand = "*"
|
|
||||||
rdrand = { version = "0.8", default-features = false }
|
|
||||||
|
|
||||||
|
|
||||||
[target.'cfg(target_arch = "riscv64")'.dependencies]
|
[target.'cfg(target_arch = "riscv64")'.dependencies]
|
||||||
sbi = "0.2.0"
|
sbi = "0.2.0"
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
(module
|
|
||||||
(data "mouse")
|
|
||||||
(data "x")
|
|
||||||
(data "y")
|
|
||||||
(func $rma (import "host" "read_mem_addr")(param i32)(result i32))
|
|
||||||
(func $co (import "host" "create_object")(param i32 i32)(result i64))
|
|
||||||
(func $roa (import "host" "read_object_attribute")(param i64 i32 i32)(result i32 i32))
|
|
||||||
(memory (export "memory") 1)
|
|
||||||
|
|
||||||
(func
|
|
||||||
(export "start")(result i64)
|
|
||||||
;; Copy into memory the object name
|
|
||||||
(memory.init 0
|
|
||||||
(i32.const 0) ;; target offset
|
|
||||||
(i32.const 0) ;; source offset
|
|
||||||
(i32.const 5))
|
|
||||||
(memory.init 1
|
|
||||||
(i32.const 6) ;; target offset
|
|
||||||
(i32.const 0) ;; source offset
|
|
||||||
(i32.const 1))
|
|
||||||
(memory.init 2
|
|
||||||
(i32.const 7) ;; target offset
|
|
||||||
(i32.const 0) ;; source offset
|
|
||||||
(i32.const 1))
|
|
||||||
|
|
||||||
i32.const 0
|
|
||||||
i32.const 5
|
|
||||||
call $co
|
|
||||||
|
|
||||||
;; i32.const 6
|
|
||||||
;; i32.const 1
|
|
||||||
|
|
||||||
;; call $roa
|
|
||||||
|
|
||||||
)
|
|
||||||
)
|
|
|
@ -10,20 +10,25 @@ use x86_64::{
|
||||||
pub const DOUBLE_FAULT_IX: u16 = 0;
|
pub const DOUBLE_FAULT_IX: u16 = 0;
|
||||||
|
|
||||||
pub unsafe fn init() {
|
pub unsafe fn init() {
|
||||||
use x86_64::instructions::segmentation::{Segment, CS, SS};
|
use x86_64::instructions::segmentation::{Segment, CS, DS, ES, SS};
|
||||||
use x86_64::instructions::tables::load_tss;
|
use x86_64::instructions::tables::load_tss;
|
||||||
|
|
||||||
log::info!("Initialising GDT");
|
log::info!("Initialising GDT");
|
||||||
GDT.0.load();
|
GDT.0.load();
|
||||||
CS::set_reg(GDT.1.kcode);
|
CS::set_reg(GDT.1.kcode);
|
||||||
|
DS::set_reg(GDT.1.kdata);
|
||||||
|
ES::set_reg(GDT.1.kdata);
|
||||||
SS::set_reg(GDT.1.kdata);
|
SS::set_reg(GDT.1.kdata);
|
||||||
load_tss(GDT.1.tss);
|
load_tss(GDT.1.tss);
|
||||||
|
init_syscalls(&GDT.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Selectors {
|
struct Selectors {
|
||||||
kcode: SegmentSelector,
|
kcode: SegmentSelector,
|
||||||
kdata: SegmentSelector,
|
kdata: SegmentSelector,
|
||||||
tss: SegmentSelector,
|
tss: SegmentSelector,
|
||||||
|
udata: SegmentSelector,
|
||||||
|
ucode: SegmentSelector,
|
||||||
}
|
}
|
||||||
|
|
||||||
static TSS: Lazy<TaskStateSegment> = Lazy::new(|| {
|
static TSS: Lazy<TaskStateSegment> = Lazy::new(|| {
|
||||||
|
@ -46,6 +51,26 @@ static GDT: Lazy<(GlobalDescriptorTable, Selectors)> = Lazy::new(|| {
|
||||||
kcode: gdt.add_entry(Descriptor::kernel_code_segment()),
|
kcode: gdt.add_entry(Descriptor::kernel_code_segment()),
|
||||||
kdata: gdt.add_entry(Descriptor::kernel_data_segment()),
|
kdata: gdt.add_entry(Descriptor::kernel_data_segment()),
|
||||||
tss: gdt.add_entry(Descriptor::tss_segment(&TSS)),
|
tss: gdt.add_entry(Descriptor::tss_segment(&TSS)),
|
||||||
|
udata: gdt.add_entry(Descriptor::user_data_segment()),
|
||||||
|
ucode: gdt.add_entry(Descriptor::user_code_segment()),
|
||||||
};
|
};
|
||||||
(gdt, sels)
|
(gdt, sels)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/// Initialize syscalls
|
||||||
|
unsafe fn init_syscalls(sls: &Selectors) {
|
||||||
|
use x86_64::registers::{
|
||||||
|
model_specific::{Efer, EferFlags, LStar, SFMask, Star},
|
||||||
|
rflags::RFlags,
|
||||||
|
};
|
||||||
|
|
||||||
|
Star::write(sls.ucode, sls.udata, sls.kcode, sls.kdata);
|
||||||
|
SFMask::write(RFlags::from_bits(0x200).expect("Invalid RFlags for SFMask"));
|
||||||
|
LStar::write(VirtAddr::from_ptr(handle_syscall as *const ()));
|
||||||
|
Efer::update(|x| *x |= EferFlags::SYSTEM_CALL_EXTENSIONS);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" fn handle_syscall(a: u64) -> ! {
|
||||||
|
log::info!("called syscall {a}");
|
||||||
|
todo!("Return from syscall");
|
||||||
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@ use spin::{Lazy, Mutex};
|
||||||
use x2apic::lapic::{LocalApic, LocalApicBuilder};
|
use x2apic::lapic::{LocalApic, LocalApicBuilder};
|
||||||
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame, PageFaultErrorCode};
|
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame, PageFaultErrorCode};
|
||||||
|
|
||||||
use crate::interp::wasm;
|
|
||||||
|
|
||||||
pub unsafe fn init() {
|
pub unsafe fn init() {
|
||||||
log::info!("Initialising IDT");
|
log::info!("Initialising IDT");
|
||||||
IDT.load();
|
IDT.load();
|
||||||
|
@ -18,7 +16,7 @@ enum Interrupt {
|
||||||
Spurious = u8::MAX,
|
Spurious = u8::MAX,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) static LAPIC: Lazy<Mutex<LocalApic>> = Lazy::new(|| {
|
static LAPIC: Lazy<Mutex<LocalApic>> = Lazy::new(|| {
|
||||||
let mut lapic = LocalApicBuilder::new()
|
let mut lapic = LocalApicBuilder::new()
|
||||||
.timer_vector(Interrupt::Timer as usize)
|
.timer_vector(Interrupt::Timer as usize)
|
||||||
.error_vector(Interrupt::ApicErr as usize)
|
.error_vector(Interrupt::ApicErr as usize)
|
||||||
|
@ -41,10 +39,6 @@ static IDT: Lazy<InterruptDescriptorTable> = Lazy::new(|| {
|
||||||
.set_stack_index(super::gdt::DOUBLE_FAULT_IX);
|
.set_stack_index(super::gdt::DOUBLE_FAULT_IX);
|
||||||
}
|
}
|
||||||
idt.page_fault.set_handler_fn(page_fault);
|
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::Timer as usize].set_handler_fn(timer);
|
||||||
idt
|
idt
|
||||||
});
|
});
|
||||||
|
@ -60,7 +54,7 @@ extern "x86-interrupt" fn page_fault(
|
||||||
panic!("Page fault ({error_code:?}): {stack_frame:?}")
|
panic!("Page fault ({error_code:?}): {stack_frame:?}")
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "x86-interrupt" fn timer(isf: InterruptStackFrame) {
|
extern "x86-interrupt" fn timer(_: InterruptStackFrame) {
|
||||||
unsafe { LAPIC.lock().end_of_interrupt() };
|
unsafe { LAPIC.lock().end_of_interrupt() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Logging (as in terms of console / serial output)
|
//! Logging (as in terms of console / serial output)
|
||||||
|
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
use limine::{TerminalRequest, TerminalResponse};
|
use limine::{LimineTerminalRequest, LimineTerminalResponse};
|
||||||
use spin::{Lazy, Mutex};
|
use spin::{Lazy, Mutex};
|
||||||
use uart_16550::SerialPort;
|
use uart_16550::SerialPort;
|
||||||
|
|
||||||
|
@ -20,11 +20,11 @@ pub fn log(args: core::fmt::Arguments<'_>) -> core::fmt::Result {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TermLogger(&'static TerminalResponse);
|
struct TermLogger(&'static LimineTerminalResponse);
|
||||||
unsafe impl Send for TermLogger {}
|
unsafe impl Send for TermLogger {}
|
||||||
impl TermLogger {
|
impl TermLogger {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
static TERM_REQ: TerminalRequest = TerminalRequest::new(0);
|
static TERM_REQ: LimineTerminalRequest = LimineTerminalRequest::new(0);
|
||||||
Self(
|
Self(
|
||||||
TERM_REQ
|
TERM_REQ
|
||||||
.get_response()
|
.get_response()
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::memory::{MemoryManager, MAX_ORDER};
|
|
||||||
use core::sync::atomic::AtomicU64;
|
use core::sync::atomic::AtomicU64;
|
||||||
use limine::{MemmapEntry, MemoryMapEntryType, NonNullPtr};
|
use limine::{LimineMemmapEntry, LimineMemoryMapEntryType, NonNullPtr};
|
||||||
use spin::{Mutex, Once};
|
use spin::{Mutex, Once};
|
||||||
use x86_64::{structures::paging::OffsetPageTable, VirtAddr};
|
use x86_64::{structures::paging::OffsetPageTable, VirtAddr};
|
||||||
|
use crate::memory::{MemoryManager, MAX_ORDER};
|
||||||
|
|
||||||
pub const PAGE_SIZE: usize = 4096;
|
pub const PAGE_SIZE: usize = 4096;
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ pub unsafe fn init_pt(phys_base: VirtAddr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initialise memory manager
|
/// Initialise memory manager
|
||||||
pub fn initialize(mmap: &'static [NonNullPtr<MemmapEntry>]) {
|
pub fn initialize(mmap: &'static [NonNullPtr<LimineMemmapEntry>]) {
|
||||||
let mut memory_manager = MemoryManager::new();
|
let mut memory_manager = MemoryManager::new();
|
||||||
|
|
||||||
for entry in mmap {
|
for entry in mmap {
|
||||||
if entry.typ != MemoryMapEntryType::Usable {
|
if entry.typ != LimineMemoryMapEntryType::Usable {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
pub mod memory;
|
pub mod memory;
|
||||||
|
|
||||||
mod gdt;
|
mod gdt;
|
||||||
pub(crate) mod interrupts;
|
mod interrupts;
|
||||||
mod logging;
|
mod logging;
|
||||||
|
|
||||||
pub use logging::log;
|
pub use logging::log;
|
||||||
pub use memory::PAGE_SIZE;
|
pub use memory::PAGE_SIZE;
|
||||||
|
|
||||||
use crate::allocator;
|
use crate::allocator;
|
||||||
use limine::{HhdmRequest, KernelFileRequest, MemmapRequest, ModuleRequest};
|
use memory::MEMORY_MANAGER;
|
||||||
|
use limine::{
|
||||||
|
LimineHhdmRequest, LimineKernelFileRequest, LimineMemmapRequest, LimineModuleRequest,
|
||||||
|
};
|
||||||
use x86_64::VirtAddr;
|
use x86_64::VirtAddr;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -25,7 +27,7 @@ unsafe extern "C" fn _kernel_start() -> ! {
|
||||||
crate::logger::init().expect("failed to set logger");
|
crate::logger::init().expect("failed to set logger");
|
||||||
log::info!("Initialising AKern {}", crate::VERSION);
|
log::info!("Initialising AKern {}", crate::VERSION);
|
||||||
|
|
||||||
static HDHM_REQ: HhdmRequest = HhdmRequest::new(0);
|
static HDHM_REQ: LimineHhdmRequest = LimineHhdmRequest::new(0);
|
||||||
memory::init_pt(VirtAddr::new(
|
memory::init_pt(VirtAddr::new(
|
||||||
HDHM_REQ
|
HDHM_REQ
|
||||||
.get_response()
|
.get_response()
|
||||||
|
@ -36,7 +38,7 @@ unsafe extern "C" fn _kernel_start() -> ! {
|
||||||
|
|
||||||
allocator::init(INITIAL_KERNEL_HEAP_START, INITIAL_KERNEL_HEAP_SIZE as _);
|
allocator::init(INITIAL_KERNEL_HEAP_START, INITIAL_KERNEL_HEAP_SIZE as _);
|
||||||
|
|
||||||
static MMAP_REQ: MemmapRequest = MemmapRequest::new(0);
|
static MMAP_REQ: LimineMemmapRequest = LimineMemmapRequest::new(0);
|
||||||
memory::initialize(
|
memory::initialize(
|
||||||
MMAP_REQ
|
MMAP_REQ
|
||||||
.get_response()
|
.get_response()
|
||||||
|
@ -48,9 +50,24 @@ unsafe extern "C" fn _kernel_start() -> ! {
|
||||||
gdt::init();
|
gdt::init();
|
||||||
interrupts::init();
|
interrupts::init();
|
||||||
|
|
||||||
static KFILE_REQ: KernelFileRequest = KernelFileRequest::new(0);
|
{
|
||||||
static MOD_REQ: ModuleRequest = ModuleRequest::new(0);
|
let mut mm = MEMORY_MANAGER.get().unwrap().lock();
|
||||||
|
let alloc_0 = mm.allocate_pages(0).unwrap();
|
||||||
|
log::debug!("Addr: {alloc_0}");
|
||||||
|
let alloc_1 = mm.allocate_pages(0).unwrap();
|
||||||
|
log::debug!("Addr: {alloc_1}");
|
||||||
|
mm.deallocate_pages(alloc_0, 0);
|
||||||
|
let alloc_2 = mm.allocate_pages(1).unwrap();
|
||||||
|
log::debug!("Addr: {alloc_2}");
|
||||||
|
mm.deallocate_pages(alloc_1, 0);
|
||||||
|
mm.deallocate_pages(alloc_2, 1);
|
||||||
|
let alloc_3 = mm.allocate_pages(1).unwrap();
|
||||||
|
log::debug!("Addr: {alloc_3}");
|
||||||
|
mm.deallocate_pages(alloc_3, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static KFILE_REQ: LimineKernelFileRequest = LimineKernelFileRequest::new(0);
|
||||||
|
static MOD_REQ: LimineModuleRequest = LimineModuleRequest::new(0);
|
||||||
crate::kmain::kmain(
|
crate::kmain::kmain(
|
||||||
KFILE_REQ
|
KFILE_REQ
|
||||||
.get_response()
|
.get_response()
|
||||||
|
@ -82,13 +99,3 @@ pub fn sloop() -> ! {
|
||||||
x86_64::instructions::hlt();
|
x86_64::instructions::hlt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hardware_random_u64() -> u64 {
|
|
||||||
use log::trace;
|
|
||||||
use rdrand::RdRand;
|
|
||||||
let gen = RdRand::new().unwrap();
|
|
||||||
let ret = gen.try_next_u64().unwrap();
|
|
||||||
trace!("Random {}", ret);
|
|
||||||
|
|
||||||
ret
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
use spin::Lazy;
|
|
||||||
|
|
||||||
use spin::{Mutex};
|
|
||||||
|
|
||||||
use crate::interp::objects::{Object,HandleTarget, TARGETS};
|
|
||||||
|
|
||||||
use {
|
|
||||||
crate::arch::hardware_random_u64,
|
|
||||||
alloc::vec::Vec,
|
|
||||||
core::fmt::{self, Formatter},
|
|
||||||
};
|
|
||||||
|
|
||||||
use alloc::{
|
|
||||||
collections::BTreeMap,
|
|
||||||
};
|
|
||||||
#[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)]
|
|
||||||
pub struct OSHandle {
|
|
||||||
pub id: u64,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl OSHandle {
|
|
||||||
pub fn new_from_u64(id: u64) -> Self {
|
|
||||||
Self { id }
|
|
||||||
}
|
|
||||||
pub fn random_new() -> Self {
|
|
||||||
Self {
|
|
||||||
id: hardware_random_u64(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)]
|
|
||||||
pub struct Handle {
|
|
||||||
pub id: OSHandle,
|
|
||||||
pub perms: Permissions,
|
|
||||||
pub r#ref: usize,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Handle {
|
|
||||||
pub fn new(r#ref: usize) -> Handle {
|
|
||||||
Handle {
|
|
||||||
id: OSHandle::random_new(),
|
|
||||||
perms: Permissions::new(),
|
|
||||||
r#ref,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn as_u64(&self) -> u64 {
|
|
||||||
self.id.id
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get<R, F: for<'a> FnOnce(Option<&'a mut HandleTarget>) -> R>(&self, f: F) -> R {
|
|
||||||
let l = TARGETS;
|
|
||||||
let mut olock = l.lock();
|
|
||||||
let a = olock.get_mut(self.r#ref).and_then(|a| a.as_mut());
|
|
||||||
return f(a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Display for Handle {
|
|
||||||
fn fmt(&self, w: &mut Formatter<'_>) -> Result<(), core::fmt::Error> {
|
|
||||||
write!(w, "{:?}", self.id);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(PartialEq, Hash, Eq, Debug, Clone, Copy)]
|
|
||||||
|
|
||||||
pub struct Permissions {
|
|
||||||
edit_children: bool,
|
|
||||||
edit_attributes: bool,
|
|
||||||
}
|
|
||||||
impl Permissions {
|
|
||||||
pub fn new() -> Self {
|
|
||||||
Self {
|
|
||||||
edit_children: true,
|
|
||||||
edit_attributes: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const GLOBALS: Lazy<Mutex<BTreeMap<[u64; 4], Handle>>> = Lazy::new(|| {
|
|
||||||
let mut globals = BTreeMap::new();
|
|
||||||
Mutex::new(globals)
|
|
||||||
});
|
|
|
@ -1,109 +0,0 @@
|
||||||
use {
|
|
||||||
crate::interp::{HFIDT, TARGETS},
|
|
||||||
alloc::string::String,
|
|
||||||
log::trace,
|
|
||||||
wasmi::{Caller, TypedFunc},
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::{HostState, WasmContext};
|
|
||||||
|
|
||||||
pub fn host_register_idt_handler(
|
|
||||||
caller: Caller<'_, HostState>,
|
|
||||||
interupt_number: i32,
|
|
||||||
address_start: i32,
|
|
||||||
length_of_string: i32,
|
|
||||||
) -> i32 {
|
|
||||||
// TODO: get the proc_id to address which function it is
|
|
||||||
// TODO: Register the function name and proc_id into the idt handler
|
|
||||||
|
|
||||||
let mem = caller.get_export("memory").unwrap().into_memory().unwrap();
|
|
||||||
let mem_array = mem.data(&caller);
|
|
||||||
let mut name = String::new();
|
|
||||||
for i in address_start..(address_start + length_of_string) {
|
|
||||||
let ch = mem_array[i as usize] as char;
|
|
||||||
name.push(ch);
|
|
||||||
}
|
|
||||||
|
|
||||||
let index = interupt_number as usize;
|
|
||||||
|
|
||||||
let hf = HFIDT.lock();
|
|
||||||
|
|
||||||
// hf.insert(index);
|
|
||||||
|
|
||||||
trace!("{}", name);
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
arch::hardware_random_u64,
|
|
||||||
handle::GLOBALS,
|
|
||||||
interp::{
|
|
||||||
objects::{HandleTarget, Object},
|
|
||||||
Handle,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
pub fn host_make_object(
|
|
||||||
mut caller: Caller<'_, HostState>,
|
|
||||||
address_start: i32,
|
|
||||||
length_of_string: i32,
|
|
||||||
) -> i64 {
|
|
||||||
trace!(
|
|
||||||
"Called with addr {{ start {} length {} }}",
|
|
||||||
address_start,
|
|
||||||
length_of_string
|
|
||||||
);
|
|
||||||
let mem = caller.get_export("memory").unwrap().into_memory().unwrap();
|
|
||||||
let mem_array = mem.data(&caller);
|
|
||||||
let mut name = String::new();
|
|
||||||
for i in address_start..(address_start + length_of_string) {
|
|
||||||
let ch = mem_array[i as usize] as char;
|
|
||||||
name.push(ch);
|
|
||||||
}
|
|
||||||
trace!("Object Name {}", name);
|
|
||||||
let binding = TARGETS;
|
|
||||||
let mut olock = binding.lock();
|
|
||||||
let hand = Handle::new(olock.len());
|
|
||||||
let obj = xml::XMLElement::new(name);
|
|
||||||
|
|
||||||
olock.push(Some(HandleTarget::Object(Object { xml: obj })));
|
|
||||||
caller.data_mut().add_handle(hand).try_into().unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type WFIDT = TypedFunc<(), ()>;
|
|
||||||
|
|
||||||
fn get_fn_from_wc(wc: WasmContext, function_name: String) -> WFIDT {
|
|
||||||
wc.instance
|
|
||||||
.get_typed_func(wc.store, &function_name)
|
|
||||||
.unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn host_make_global(mut caller: Caller<'_, HostState>, h: i64) -> (u64, u64, u64, u64) {
|
|
||||||
let binding = GLOBALS;
|
|
||||||
let Some(hand): Option<&mut Option<Handle>> = caller.data_mut().handles.get_mut(h as usize) else {
|
|
||||||
return (0,0,0,0);
|
|
||||||
};
|
|
||||||
let Some(t) = hand.take() else {
|
|
||||||
return (0,0,0,0);
|
|
||||||
};
|
|
||||||
let a = [hardware_random_u64(); 4];
|
|
||||||
let mut l = binding.lock();
|
|
||||||
l.insert(a, t);
|
|
||||||
return (a[0], a[1], a[2], a[3]);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn host_take_global(mut caller: Caller<'_, HostState>, a: u64, b: u64, c: u64, d: u64) -> i64 {
|
|
||||||
let binding = GLOBALS;
|
|
||||||
let mut l = binding.lock();
|
|
||||||
let mut j: [u64; 4] = [0u64; 4];
|
|
||||||
j[0] = a;
|
|
||||||
j[1] = b;
|
|
||||||
j[2] = c;
|
|
||||||
j[3] = d;
|
|
||||||
let Some(m) = l.remove::<[u64; 4]>({
|
|
||||||
&j
|
|
||||||
}) else{
|
|
||||||
return -1;
|
|
||||||
};
|
|
||||||
caller.data_mut().add_handle(m) as i64
|
|
||||||
}
|
|
|
@ -1,251 +0,0 @@
|
||||||
mod host_functions;
|
|
||||||
pub mod objects;
|
|
||||||
use {
|
|
||||||
crate::{
|
|
||||||
handle::{self, Handle},
|
|
||||||
interp::{host_functions::host_make_object, objects::TARGETS},
|
|
||||||
},
|
|
||||||
alloc::{string::String, vec::Vec},
|
|
||||||
hashbrown::HashMap,
|
|
||||||
log::trace,
|
|
||||||
spin::{Lazy, Mutex},
|
|
||||||
wasmi::{Caller, Error, Func, Instance, Linker, Module, Store, TypedFunc},
|
|
||||||
xml::XMLElement,
|
|
||||||
};
|
|
||||||
// Seperate use statement
|
|
||||||
use {
|
|
||||||
alloc::{fmt::format, format, vec},
|
|
||||||
wasmi::Value,
|
|
||||||
};
|
|
||||||
|
|
||||||
use self::objects::HandleTarget;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
|
|
||||||
pub struct WasmContext {
|
|
||||||
pub proc_id: Option<u64>,
|
|
||||||
pub instance: Instance,
|
|
||||||
pub store: Store<HostState>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn wasm() -> Result<(), wasmi::Error> {
|
|
||||||
use wasmi::{Config, Engine};
|
|
||||||
let mut conf = Config::default();
|
|
||||||
conf.wasm_bulk_memory(true);
|
|
||||||
// conf.,
|
|
||||||
let engine = Engine::new(&conf);
|
|
||||||
// trace!("Engine constructed");
|
|
||||||
|
|
||||||
// let wasm = include_bytes!("../../wasm_syscall_test.wasm");
|
|
||||||
let wasm = include_bytes!("../../../test.wasm");
|
|
||||||
|
|
||||||
// trace!("Loading WASM binary");
|
|
||||||
let module = Module::new(&engine, &wasm[..]).unwrap();
|
|
||||||
// trace!("Constructing wasm module");
|
|
||||||
let hs = HostState { handles: vec![] };
|
|
||||||
let mut store = Store::new(&engine, hs);
|
|
||||||
// trace!("constructing host store");
|
|
||||||
|
|
||||||
let read_mem_addr = Func::wrap(
|
|
||||||
&mut store,
|
|
||||||
|caller: Caller<'_, HostState>, param: i32| -> i32 { read_memory_address(caller, param) },
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut linker = <Linker<HostState>>::new(&engine);
|
|
||||||
|
|
||||||
linker.define(
|
|
||||||
"host",
|
|
||||||
"read_mem_addr",
|
|
||||||
Func::wrap(
|
|
||||||
&mut store,
|
|
||||||
|caller: Caller<'_, HostState>, param: i32| -> i32 {
|
|
||||||
read_memory_address(caller, param)
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
linker.define(
|
|
||||||
"host",
|
|
||||||
"register_idt_handler",
|
|
||||||
Func::wrap(&mut store, host_functions::host_register_idt_handler),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
linker.define(
|
|
||||||
"host",
|
|
||||||
"read_object_attribute",
|
|
||||||
Func::wrap(&mut store, host_read_object_attribute),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
linker.define(
|
|
||||||
"host",
|
|
||||||
"create_object",
|
|
||||||
Func::wrap(&mut store, host_make_object),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
let instance = linker
|
|
||||||
.instantiate(&mut store, &module)?
|
|
||||||
.ensure_no_start(&mut store)?;
|
|
||||||
|
|
||||||
let version = instance.get_global(&store, "VERSION");
|
|
||||||
|
|
||||||
// trace!("Version: {:?}", version);
|
|
||||||
let hello = instance.get_typed_func::<(), i64>(&store, "start")?;
|
|
||||||
|
|
||||||
let ret = hello.call(&mut store, ())?;
|
|
||||||
trace!("Called start got return of {:?}", ret);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
|
||||||
pub struct HostState {
|
|
||||||
handles: Vec<Option<Handle>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl HostState {
|
|
||||||
pub fn add_handle(&mut self, hand: Handle) -> usize {
|
|
||||||
for (i, h) in self.handles.iter_mut().enumerate() {
|
|
||||||
if let None = h {
|
|
||||||
*h = Some(hand);
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
self.handles.push(Some(hand));
|
|
||||||
return (self.handles.len() - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn read_memory_address(caller: Caller<'_, HostState>, address: i32) -> i32 {
|
|
||||||
trace!("Address: {}", address);
|
|
||||||
// let obj = host_make_object(caller, 16, 23);
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn host_read_object_attribute(
|
|
||||||
mut caller: Caller<'_, HostState>,
|
|
||||||
handle: i64,
|
|
||||||
address_start: i32,
|
|
||||||
length_of_string: i32,
|
|
||||||
) -> (i32, i32) {
|
|
||||||
let binding = TARGETS;
|
|
||||||
let mut olock = binding.lock();
|
|
||||||
|
|
||||||
// olock.get(&handle);
|
|
||||||
|
|
||||||
let mem = caller.get_export("memory").unwrap().into_memory().unwrap();
|
|
||||||
let mem_array = mem.data_mut(&mut caller);
|
|
||||||
let mut name = String::new();
|
|
||||||
for i in address_start..(address_start + length_of_string) {
|
|
||||||
let ch = mem_array[i as usize] as char;
|
|
||||||
name.push(ch);
|
|
||||||
}
|
|
||||||
let Some(Some(a)) = caller.data().handles.get(handle as usize) else {
|
|
||||||
return (0,0);
|
|
||||||
};
|
|
||||||
let Some(Some(HandleTarget::Object(o))) = olock.get(a.r#ref) else{
|
|
||||||
return (0,0);
|
|
||||||
};
|
|
||||||
let Some(r) = o.xml.attributes.iter().find(|a|{
|
|
||||||
let f = format!("{:?}",a);
|
|
||||||
f.contains(&format!("Attribute{{ name: \"{}",name))
|
|
||||||
})else{
|
|
||||||
return (0,0);
|
|
||||||
};
|
|
||||||
let f = format!("{:?}", r);
|
|
||||||
let p = format!("Attribute{{ name: \"{}\", value: \"", name);
|
|
||||||
let s = format!("\" }}");
|
|
||||||
let h = f.replace(&p, "").replace(&s, "");
|
|
||||||
|
|
||||||
let i = vec![Value::I32(h.len().try_into().unwrap())];
|
|
||||||
let mut o = vec![Value::I32(0)];
|
|
||||||
|
|
||||||
let a = caller
|
|
||||||
.get_export("malloc")
|
|
||||||
.unwrap()
|
|
||||||
.into_func()
|
|
||||||
.unwrap()
|
|
||||||
.call(&mut caller, &i, &mut o);
|
|
||||||
let mem_array = mem.data_mut(&mut caller);
|
|
||||||
|
|
||||||
let Value::I32(a) = o[0] else{
|
|
||||||
panic!("invalid malloc");
|
|
||||||
};
|
|
||||||
|
|
||||||
for (s, b) in h.clone().into_bytes().iter().enumerate() {
|
|
||||||
mem_array[(a as usize) + s] = *b;
|
|
||||||
}
|
|
||||||
|
|
||||||
(a, h.len().try_into().unwrap())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn build_wasm_context(bytes: Vec<u8>) -> Result<WasmContext, wasmi::Error> {
|
|
||||||
use wasmi::{Config, Engine};
|
|
||||||
let mut conf = Config::default();
|
|
||||||
conf.wasm_bulk_memory(true);
|
|
||||||
// conf.,
|
|
||||||
let engine = Engine::new(&conf);
|
|
||||||
// trace!("Engine constructed");
|
|
||||||
|
|
||||||
// let wasm = include_bytes!("../../wasm_syscall_test.wasm");
|
|
||||||
let wasm = include_bytes!("../../../test.wasm");
|
|
||||||
|
|
||||||
// trace!("Loading WASM binary");
|
|
||||||
let module = Module::new(&engine, &wasm[..]).unwrap();
|
|
||||||
// trace!("Constructing wasm module");
|
|
||||||
let hs = HostState { handles: vec![] };
|
|
||||||
let mut store = Store::new(&engine, hs);
|
|
||||||
// trace!("constructing host store");
|
|
||||||
|
|
||||||
let read_mem_addr = Func::wrap(
|
|
||||||
&mut store,
|
|
||||||
|caller: Caller<'_, HostState>, param: i32| -> i32 { read_memory_address(caller, param) },
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut linker = <Linker<HostState>>::new(&engine);
|
|
||||||
linker.define(
|
|
||||||
"host",
|
|
||||||
"read_mem_addr",
|
|
||||||
Func::wrap(
|
|
||||||
&mut store,
|
|
||||||
|caller: Caller<'_, HostState>, param: i32| -> i32 {
|
|
||||||
read_memory_address(caller, param)
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
linker.define(
|
|
||||||
"host",
|
|
||||||
"read_object_attribute",
|
|
||||||
Func::wrap(&mut store, host_read_object_attribute),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
linker.define(
|
|
||||||
"host",
|
|
||||||
"create_object",
|
|
||||||
Func::wrap(&mut store, host_make_object),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
let instance = linker
|
|
||||||
.instantiate(&mut store, &module)?
|
|
||||||
.ensure_no_start(&mut store)?;
|
|
||||||
|
|
||||||
let wc = WasmContext {
|
|
||||||
instance,
|
|
||||||
store,
|
|
||||||
proc_id: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(wc)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type HostFunctionIDT = HashMap<usize, WCFunction>;
|
|
||||||
pub struct WCFunction {
|
|
||||||
wc: WasmContext,
|
|
||||||
function: TypedFunc<(), ()>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub static HFIDT: Lazy<Mutex<HostFunctionIDT>> = Lazy::new(|| {
|
|
||||||
let mut hfidt = HashMap::new();
|
|
||||||
|
|
||||||
Mutex::new(hfidt)
|
|
||||||
});
|
|
|
@ -1,19 +0,0 @@
|
||||||
use alloc::{vec, vec::Vec, collections::BTreeMap};
|
|
||||||
|
|
||||||
use spin::{Lazy, Mutex};
|
|
||||||
|
|
||||||
use crate::handle::Handle;
|
|
||||||
|
|
||||||
pub struct Object{
|
|
||||||
pub xml: xml::XMLElement
|
|
||||||
}
|
|
||||||
pub enum HandleTarget{
|
|
||||||
Object(Object)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type HostTargets = Vec<Option<HandleTarget>>;
|
|
||||||
|
|
||||||
pub const TARGETS: Lazy<Mutex<HostTargets>> = Lazy::new(|| {
|
|
||||||
let mut obj = vec![];
|
|
||||||
Mutex::new(obj)
|
|
||||||
});
|
|
|
@ -1,65 +1,15 @@
|
||||||
//! AbleOS Kernel Entrypoint
|
//! AbleOS Kernel Entrypoint
|
||||||
|
|
||||||
// use std::collections::HashMap;
|
|
||||||
|
|
||||||
use alloc::vec::Vec;
|
|
||||||
use log::{info, trace};
|
|
||||||
use spin::{Lazy, Mutex};
|
|
||||||
|
|
||||||
use crate::arch::{hardware_random_u64, sloop};
|
|
||||||
use crate::handle::Handle;
|
|
||||||
use crate::schedule::Scheduler;
|
|
||||||
use crate::{interp, task};
|
|
||||||
|
|
||||||
use crate::alloc::string::ToString;
|
|
||||||
|
|
||||||
pub fn kmain(cmdline: &str, bootstrap: Option<&'static [u8]>) -> ! {
|
pub fn kmain(cmdline: &str, bootstrap: Option<&'static [u8]>) -> ! {
|
||||||
log::debug!("Entered kmain");
|
log::debug!("Entered kmain");
|
||||||
|
|
||||||
let mut cmdline = cmdline.to_string();
|
// TODO: Actual cmdline parsing (Serde?)
|
||||||
cmdline.pop();
|
if cmdline.contains("baka=9") {
|
||||||
cmdline.remove(0);
|
let _ = crate::arch::log(format_args!(include_str!("../data/⑨. バカ")));
|
||||||
|
|
||||||
let kcmd = clparse::Arguments::parse(cmdline.to_string()).unwrap();
|
|
||||||
log::info!("Cmdline: {kcmd:?}");
|
|
||||||
|
|
||||||
// if kcmd.arguments.get("baka") == Some(&"true".to_string()) {
|
|
||||||
// let _ = crate::arch::log(format_args!(include_str!("../data/⑨. バカ")));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if kcmd.arguments.get("foobles") == Some(&"true".to_string()) {
|
|
||||||
// let _ = crate::arch::log(format_args!("foobles\n"));
|
|
||||||
// }
|
|
||||||
|
|
||||||
let bootstrap = bootstrap/*.expect("no bootstrap found")*/;
|
|
||||||
match bootstrap {
|
|
||||||
Some(bootstrap_mod) => {}
|
|
||||||
None => {
|
|
||||||
info!("No bootstrap module loaded.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// use xml::XMLElement;
|
log::info!("Cmdline: \"{cmdline}\"");
|
||||||
// let kcmd = XMLElement::new("cmdline");
|
let bootstrap = bootstrap.expect("no bootstrap found");
|
||||||
// let hnd = Handle::new();
|
|
||||||
// kcmd.set_attribute("")
|
|
||||||
// OBJECTS.lock().insert(hnd, kcmd);
|
|
||||||
|
|
||||||
let abc = interp::wasm();
|
|
||||||
|
|
||||||
trace!("{:?}", abc);
|
|
||||||
|
|
||||||
// let sch = SCHEDULER;
|
|
||||||
// let mut sch = sch.lock();
|
|
||||||
// let wc = interp::build_wasm_context(alloc::vec::Vec::new()).unwrap();
|
|
||||||
// sch.schedule(wc, crate::schedule::ContextWake::None);
|
|
||||||
|
|
||||||
// sch.run();
|
|
||||||
|
|
||||||
crate::arch::sloop()
|
crate::arch::sloop()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const SCHEDULER: Lazy<Mutex<Scheduler>> = Lazy::new(|| {
|
|
||||||
let mut sch = Scheduler::new();
|
|
||||||
Mutex::new(sch)
|
|
||||||
});
|
|
||||||
|
|
|
@ -10,19 +10,16 @@
|
||||||
ptr_sub_ptr
|
ptr_sub_ptr
|
||||||
)]
|
)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
// #![deny(missing_docs)]
|
|
||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
mod allocator;
|
mod allocator;
|
||||||
mod arch;
|
mod arch;
|
||||||
pub mod handle;
|
|
||||||
pub mod interp;
|
|
||||||
mod kmain;
|
mod kmain;
|
||||||
mod logger;
|
mod logger;
|
||||||
mod memory;
|
mod memory;
|
||||||
mod schedule;
|
|
||||||
mod task;
|
mod task;
|
||||||
|
mod ubloader;
|
||||||
|
|
||||||
use versioning::Version;
|
use versioning::Version;
|
||||||
|
|
||||||
|
|
|
@ -1,104 +0,0 @@
|
||||||
use core::arch;
|
|
||||||
|
|
||||||
// WasmContext
|
|
||||||
use crate::{arch::sloop, interp::WasmContext};
|
|
||||||
use alloc::vec::Vec;
|
|
||||||
use log::trace;
|
|
||||||
|
|
||||||
pub type ProcId = u64;
|
|
||||||
|
|
||||||
pub struct Scheduler {
|
|
||||||
running: Vec<WasmContext>,
|
|
||||||
halted: Vec<(ContextWake, WasmContext)>,
|
|
||||||
// time_halt: Vec<(ContextWake, WasmContext)>,
|
|
||||||
next_proc_id: ProcId,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Scheduler {
|
|
||||||
pub fn new() -> Scheduler {
|
|
||||||
Self {
|
|
||||||
running: Vec::new(),
|
|
||||||
halted: Vec::new(),
|
|
||||||
// time_halt: Vec::new(),
|
|
||||||
next_proc_id: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn run(&mut self) -> ! {
|
|
||||||
loop {
|
|
||||||
let proc = self.running.pop();
|
|
||||||
|
|
||||||
// self.time_halt.sort();
|
|
||||||
|
|
||||||
match proc {
|
|
||||||
Some(proc) => {
|
|
||||||
// trace!("SWAP WasmContext");
|
|
||||||
self.running.push(proc);
|
|
||||||
}
|
|
||||||
|
|
||||||
None => {
|
|
||||||
panic!("nothing scheduled.");
|
|
||||||
sloop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fn sleep_inner(&self, id: ProcId) -> Result<usize, SchedulerError> {
|
|
||||||
let proc_len = self.running.len();
|
|
||||||
let mut proc_found = true;
|
|
||||||
let mut sleep_index = 0;
|
|
||||||
let mut i = 0;
|
|
||||||
for wc in &self.running {
|
|
||||||
if wc.proc_id == Some(id) {
|
|
||||||
sleep_index = i;
|
|
||||||
proc_found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if i == proc_len {
|
|
||||||
proc_found = false;
|
|
||||||
trace!("no process with ID {} found", id);
|
|
||||||
return Err(SchedulerError::ProcessIDNotFound(id));
|
|
||||||
}
|
|
||||||
i += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(sleep_index)
|
|
||||||
}
|
|
||||||
pub fn sleep(&mut self, id: ProcId, time: u64) -> Result<(), SchedulerError> {
|
|
||||||
match self.sleep_inner(id) {
|
|
||||||
Ok(sid) => self
|
|
||||||
.halted
|
|
||||||
.push((ContextWake::Time(time), self.running.remove(sid))),
|
|
||||||
Err(error) => return Err(error),
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn schedule(&mut self, wc: WasmContext, cw: ContextWake) -> Result<(), SchedulerError> {
|
|
||||||
if wc.proc_id != None {
|
|
||||||
panic!("Already Scheduled with PROC_ID {}", wc.proc_id.unwrap());
|
|
||||||
}
|
|
||||||
trace!("Scheduling WC with ProcID {}", self.next_proc_id);
|
|
||||||
|
|
||||||
if cw == ContextWake::None {
|
|
||||||
self.running.push(wc)
|
|
||||||
} else {
|
|
||||||
self.halted.push((cw, wc));
|
|
||||||
}
|
|
||||||
|
|
||||||
self.next_proc_id += 1;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[derive(PartialEq)]
|
|
||||||
pub enum ContextWake {
|
|
||||||
/// Used when spawning a new process to have it instantly start
|
|
||||||
None,
|
|
||||||
Time(u64),
|
|
||||||
ObjectEvent,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum SchedulerError {
|
|
||||||
ProcessIDNotFound(ProcId),
|
|
||||||
AlreadyScheduled(),
|
|
||||||
}
|
|
0
kernel/src/ubloader.rs
Normal file
0
kernel/src/ubloader.rs
Normal file
|
@ -1,24 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`create_object`
|
|
||||||
```
|
|
||||||
params
|
|
||||||
i32
|
|
||||||
start address of the string to use as the object name
|
|
||||||
i32
|
|
||||||
length of string
|
|
||||||
returns
|
|
||||||
i64 Handle to the object
|
|
||||||
```
|
|
||||||
|
|
||||||
`read_object_attribute`
|
|
||||||
```
|
|
||||||
params
|
|
||||||
i64 Handle to the object
|
|
||||||
i32
|
|
||||||
start address of the string to use as the attribute name
|
|
||||||
i32
|
|
||||||
end address of the string to use as the attribute name
|
|
||||||
returns
|
|
||||||
```
|
|
2
limine
2
limine
|
@ -1 +1 @@
|
||||||
Subproject commit 751e802e173392e8637759e2b3c96bbf59456f87
|
Subproject commit 83779119f658c8ce337c33492266ecf8300db429
|
51
meta.md
51
meta.md
|
@ -1,51 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ARI AbleOS Remote Install
|
|
||||||
|
|
||||||
Server
|
|
||||||
/boot/server_kernel_x86_64.bin
|
|
||||||
/boot/kernel_x86_64.bin
|
|
||||||
/boot/kernel_aarch64.bin
|
|
||||||
|
|
||||||
/home/projects/askl.askl - aksldfhlkasjdhflkajshdflkj
|
|
||||||
|
|
||||||
|
|
||||||
ARI_SERVER.wasm
|
|
||||||
NAS 10.1.10.10
|
|
||||||
|
|
||||||
ARI 10.1.10.10
|
|
||||||
/boot/limine.cfg
|
|
||||||
/boot/kernel_x86_64.bin
|
|
||||||
/boot/kernel.toml
|
|
||||||
/home/projects/askl.askl
|
|
||||||
aksldfhlkasjdhflkajshdflkj
|
|
||||||
|
|
||||||
|
|
||||||
ARI 10.1.10.10
|
|
||||||
/boot/limine.cfg
|
|
||||||
/boot/kernel_aarch64.bin
|
|
||||||
/boot/kernel.toml
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/system/
|
|
||||||
/shared/
|
|
||||||
/home/programs/
|
|
||||||
project_name/
|
|
||||||
project_name.wasm
|
|
||||||
project_name.toml
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/system/pkgman.toml
|
|
||||||
|
|
||||||
//////
|
|
||||||
[repositories]
|
|
||||||
PUR = "https://git.ablecorp.us/ableos/pur"
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ ${ABLEOS_KERNEL}=boot:///kernel
|
||||||
# TODO: Make a boot background image for ableOS
|
# TODO: Make a boot background image for ableOS
|
||||||
|
|
||||||
DEFAULT_ENTRY=1
|
DEFAULT_ENTRY=1
|
||||||
TIMEOUT=0
|
TIMEOUT=3
|
||||||
VERBOSE=yes
|
VERBOSE=yes
|
||||||
INTERFACE_RESOLUTION=1024x768
|
INTERFACE_RESOLUTION=1024x768
|
||||||
# Terminal related settings
|
# Terminal related settings
|
||||||
|
@ -13,10 +13,9 @@ TERM_BACKDROP=008080
|
||||||
COMMENT=Default AbleOS boot entry.
|
COMMENT=Default AbleOS boot entry.
|
||||||
PROTOCOL=limine
|
PROTOCOL=limine
|
||||||
KERNEL_PATH=${ABLEOS_KERNEL}
|
KERNEL_PATH=${ABLEOS_KERNEL}
|
||||||
KERNEL_CMDLINE="baka=false foobles=true"
|
KERNEL_CMDLINE=
|
||||||
# KERNEL_CMDLINE=""
|
|
||||||
# Setting a default resolution for the framebuffer
|
# Setting a default resolution for the framebuffer
|
||||||
RESOLUTION=1024x768x24
|
RESOLUTION=1024x768x24
|
||||||
|
|
||||||
# MODULE_PATH=boot:///boot/fs.wasm
|
# MODULE_PATH=boot:///boot/initrd.tar
|
||||||
# MODULE_CMDLINE=This is the first module.
|
# MODULE_CMDLINE=This is the first module.
|
||||||
|
|
|
@ -156,7 +156,7 @@ fn run(release: bool, target: Target) -> Result<(), Error> {
|
||||||
"-bios",
|
"-bios",
|
||||||
std::env::var("REPBUILD_QEMU_FIRMWARE_PATH")
|
std::env::var("REPBUILD_QEMU_FIRMWARE_PATH")
|
||||||
.as_deref()
|
.as_deref()
|
||||||
.unwrap_or("/usr/share/ovmf/x64/OVMF_CODE.fd"),
|
.unwrap_or("/usr/share/OVMF/OVMF_CODE.fd"),
|
||||||
"-drive", "file=target/disk.img,format=raw",
|
"-drive", "file=target/disk.img,format=raw",
|
||||||
"-m", "4G",
|
"-m", "4G",
|
||||||
"-serial", "stdio",
|
"-serial", "stdio",
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
hex_literal_case = "Upper"
|
|
||||||
imports_granularity = "One"
|
|
|
@ -1,8 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "ablewasi"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
|
@ -1,36 +0,0 @@
|
||||||
use crate::sys;
|
|
||||||
|
|
||||||
pub struct Object{
|
|
||||||
pub id: i64
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Drop for Object{
|
|
||||||
fn drop(&mut self) {
|
|
||||||
unsafe{
|
|
||||||
sys::drop_object(self.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Object{
|
|
||||||
pub fn to_global(self) -> [u64; 4]{
|
|
||||||
let b = unsafe {
|
|
||||||
sys::make_global(self.id).into()
|
|
||||||
};
|
|
||||||
core::mem::forget(self);
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn from_global(a: [u64; 4]) -> Object{
|
|
||||||
return Object{id: unsafe {
|
|
||||||
sys::take_global(a.into())
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new(name: &str) -> Object{
|
|
||||||
return Object{id: unsafe {
|
|
||||||
let a = name.as_ptr();
|
|
||||||
sys::create_object(a, name.len() as i32)
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
pub mod sys;
|
|
||||||
pub mod api;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
#[repr(C)]
|
|
||||||
pub struct ROAResult(*const u8,i32);
|
|
||||||
|
|
||||||
pub type LocalObject = i64;
|
|
||||||
|
|
||||||
|
|
||||||
#[repr(C)]
|
|
||||||
pub struct GlobalObject(u64,u64,u64,u64);
|
|
||||||
|
|
||||||
impl From<[u64;4]> for GlobalObject {
|
|
||||||
fn from(value: [u64;4]) -> Self {
|
|
||||||
GlobalObject(value[0], value[1], value[2], value[3])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<GlobalObject> for [u64; 4]{
|
|
||||||
fn from(value: GlobalObject) -> Self {
|
|
||||||
let GlobalObject(a,b,c,d) = value;
|
|
||||||
[a,b,c,d]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C"{
|
|
||||||
pub fn create_object(a: *const u8, b: i32) -> LocalObject;
|
|
||||||
pub fn read_object_attribute(a: LocalObject, b: *const i8, c: i32) -> ROAResult;
|
|
||||||
pub fn take_global(a: GlobalObject) -> LocalObject;
|
|
||||||
pub fn make_global(a: LocalObject) -> GlobalObject;
|
|
||||||
pub fn drop_object(a: LocalObject);
|
|
||||||
}
|
|
Loading…
Reference in a new issue