Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • redox-os/kernel
  • deepaksirone/kernel
  • microcolonel/kernel
  • jD91mZM2/kernel
  • liamnprg/kernel
  • ids1024/kernel
  • luojia/kernel
  • efikarl/kernel
  • jferard/kernel
  • rosehuds/kernel
  • xTibor/kernel
  • Ano-Nymus/kernel
  • carrot93/kernel
  • noam93k/kernel
  • corvus_corax/kernel
  • antares/kernel
  • nrdxp/kernel
  • SoyaOhnishi/kernel
  • potatogim/kernel
  • bsjung/kernel
  • batzor/kernel
  • retrocoder68/kernel
  • kal/kernel
  • jabedude/kernel
  • 4lDO2/kernel
  • cherusk/kernel
  • sudoamin/kernel
  • chetankhilosiya/kernel
  • t-nil/kernel
  • Majoneza/kernel
  • wiredtv/kernel
  • tijlleenders/kernel
  • Mottl/kernel
  • usapmz/kernel
  • kamirr/kernel
  • CodingRays/kernel
  • Ivan/kernel
  • zacklukem/kernel
  • devnexen/kernel
  • uuuvn/kernel
  • rw_van/kernel
  • freewilll/kernel
  • ebalalic/kernel
  • henritel/kernel
  • dahc/kernel
  • Forest0923/kernel
  • andrey.turkin/kernel
  • amidamaru/kernel
  • gmacd/kernel
  • jinb-park/kernel
  • bjorn3/kernel
  • neallred/kernel
  • hmcmillan/kernel
  • jmaine/kernel
  • wt/kernel
  • aaronjanse/kernel
  • Skallwar/kernel
  • NateDogg1232/kernel
  • maxtnuk/kernel
  • Vladimare/kernel
  • ylz0923/kernel
  • wheatfox/kernel
  • mjdr/kernel
  • adi-g15/kernel
  • heghe/kernel
  • enygmator/kernel
  • vincent/kernel
  • StaringAtEditor/redox-os-kernel
  • zhaozhao/kernel
  • arthurpaulino/kernel
  • andypython/kernel
  • LLeny/kernel
  • Seti/kernel
  • darley/kernel
  • Ibuki.O/kernel
75 results
Show changes
Commits on Source (1094)
[build]
rustflags = [
# Kernel should preserve floating-point registers
"-Csoft-float",
]
target target
/config.toml
.gitlab-ci-local/
image: "redoxos/redoxer:latest"
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- host
- build
- test
# TODO: benchmarks and profiling (maybe manually enabled for relevant MRs)?
build:
stage: build
script:
- mkdir -p target/${ARCH}
- TARGET=${ARCH}-unknown-redox redoxer env make BUILD=target/${ARCH}
parallel:
matrix:
- ARCH: [x86_64, i686, aarch64, riscv64gc]
fmt:
stage: host
script:
- rustup component add rustfmt-preview
- cargo fmt -- --check
unit_test:
stage: test
script:
- TARGET=x86_64-unknown-redox redoxer test
[submodule "syscall"]
path = syscall
url = https://gitlab.redox-os.org/redox-os/syscall.git
[submodule "slab_allocator"] [submodule "slab_allocator"]
path = slab_allocator path = slab_allocator
url = https://gitlab.redox-os.org/redox-os/slab_allocator url = https://gitlab.redox-os.org/redox-os/slab_allocator
[submodule "rmm"]
path = rmm
url = https://gitlab.redox-os.org/redox-os/rmm.git
branch = master
[submodule "redox-path"]
path = redox-path
url = https://gitlab.redox-os.org/redox-os/redox-path.git
branch = main
[editor]
auto-format = false
[[language]]
name = "rust"
[[language-server.rust-analyzer.config.cargo]]
extraEnv = ["RUST_TARGET_PATH=targets"]
# Select one of targets to make lsp work for your confguration
# Do not commit this change
# TODO: find a better way to do this
# target = "aarch64-unknown-kernel"
[[language-server.rust-analyzer.config.check]]
targets = ["x86_64-unknown-kernel", "i686-unknown-kernel", "aarch64-unknown-kernel"]
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 4
[[package]]
name = "ahash"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
dependencies = [
"cfg-if",
"once_cell",
"version_check",
"zerocopy",
]
[[package]]
name = "arrayvec"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]] [[package]]
name = "bit_field" name = "bit_field"
version = "0.10.0" version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
[[package]]
name = "bitfield"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.2.1" version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.52" version = "1.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c"
dependencies = [
"shlex",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "fdt"
version = "0.2.0-alpha1"
source = "git+https://github.com/repnop/fdt.git?rev=2fb1409edd1877c714a0aa36b6a7c5351004be54#2fb1409edd1877c714a0aa36b6a7c5351004be54"
[[package]] [[package]]
name = "goblin" name = "goblin"
version = "0.2.1" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d20fd25aa456527ce4f544271ae4fea65d2eda4a6561ea56f39fb3ee4f7e3884"
dependencies = [
"plain",
"scroll",
]
[[package]]
name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
dependencies = [
"ahash",
]
[[package]]
name = "hashbrown"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
[[package]]
name = "indexmap"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
dependencies = [ dependencies = [
"plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "equivalent",
"scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.15.2",
] ]
[[package]] [[package]]
name = "kernel" name = "kernel"
version = "0.1.54" version = "0.4.1"
dependencies = [ dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec",
"goblin 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitfield",
"linked_list_allocator 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 2.9.0",
"paste 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder",
"raw-cpuid 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "cc",
"redox_syscall 0.2.0", "fdt",
"rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "goblin",
"slab_allocator 0.3.1", "hashbrown 0.14.5",
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap",
"x86 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "linked_list_allocator 0.9.1",
"log",
"raw-cpuid",
"redox-path",
"redox_syscall",
"rmm",
"rustc-cfg",
"rustc-demangle",
"sbi-rt",
"slab",
"slab_allocator",
"spin 0.9.8",
"spinning_top 0.3.0",
"toml",
"x86",
] ]
[[package]] [[package]]
name = "linked_list_allocator" name = "linked_list_allocator"
version = "0.6.6" version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47de1a43fad0250ee197e9e124e5b5deab3d7b39d4428ae8a6d741ceb340c362"
dependencies = [ dependencies = [
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2",
] ]
[[package]] [[package]]
name = "linked_list_allocator" name = "linked_list_allocator"
version = "0.8.4" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "549ce1740e46b291953c4340adcd74c59bcf4308f4cac050fd33ba91b7168f4a"
dependencies = [ dependencies = [
"spinning_top 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "spinning_top 0.2.5",
] ]
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.3.4" version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
dependencies = [ dependencies = [
"scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
"scopeguard",
] ]
[[package]] [[package]]
name = "paste" name = "log"
version = "0.1.18" version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
"paste-impl 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro-hack 0.5.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "paste-impl" name = "memchr"
version = "0.1.18" version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
"proc-macro-hack 0.5.16 (registry+https://github.com/rust-lang/crates.io-index)",
] [[package]]
name = "once_cell"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]] [[package]]
name = "plain" name = "plain"
version = "0.2.3" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
[[package]] [[package]]
name = "proc-macro-hack" name = "proc-macro2"
version = "0.5.16" version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
dependencies = [
"unicode-ident",
]
[[package]] [[package]]
name = "raw-cpuid" name = "quote"
version = "7.0.3" version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
dependencies = [ dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2",
"cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "raw-cpuid" name = "raw-cpuid"
version = "8.0.0" version = "10.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332"
dependencies = [ dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.3.2",
"cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "redox_syscall" name = "redox-path"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64072665120942deff5fd5425d6c1811b854f4939e7f1c01ce755f64432bbea7"
[[package]]
name = "redox_syscall"
version = "0.5.11"
source = "git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=master#080f2003cd065bcc9a290230ede06da0a1ea0502"
dependencies = [
"bitflags 2.9.0",
]
[[package]]
name = "rmm"
version = "0.1.0"
[[package]]
name = "rustc-cfg"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ddf7a5e441e8003a5a88aab97f1c6113043ddde252d789ef9dea3871b78633a"
dependencies = [ dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror",
] ]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.16" version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]] [[package]]
name = "rustc_version" name = "sbi-rt"
version = "0.2.3" version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fbaa69be1eedc61c426e6d489b2260482e928b465360576900d52d496a58bd0"
dependencies = [ dependencies = [
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sbi-spec",
] ]
[[package]]
name = "sbi-spec"
version = "0.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e36312fb5ddc10d08ecdc65187402baba4ac34585cb9d1b78522ae2358d890"
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.1.0" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]] [[package]]
name = "scroll" name = "scroll"
version = "0.10.1" version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec"
[[package]] [[package]]
name = "semver" name = "serde"
version = "0.9.0" version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
dependencies = [ dependencies = [
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive",
] ]
[[package]] [[package]]
name = "semver-parser" name = "serde_derive"
version = "0.7.0" version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_spanned"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1"
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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
dependencies = [
"autocfg",
]
[[package]] [[package]]
name = "slab_allocator" name = "slab_allocator"
version = "0.3.1" version = "0.3.1"
dependencies = [ dependencies = [
"linked_list_allocator 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "linked_list_allocator 0.6.6",
"spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.4.10",
] ]
[[package]] [[package]]
name = "spin" name = "spin"
version = "0.4.10" version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ceac490aa12c567115b40b7b7fceca03a6c9d53d5defea066123debc83c5dc1f"
[[package]] [[package]]
name = "spin" name = "spin"
version = "0.5.2" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "spin"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
dependencies = [
"lock_api",
]
[[package]] [[package]]
name = "spinning_top" name = "spinning_top"
version = "0.1.0" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0"
dependencies = [ dependencies = [
"lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "lock_api",
]
[[package]]
name = "spinning_top"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300"
dependencies = [
"lock_api",
]
[[package]]
name = "syn"
version = "2.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "toml"
version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148"
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.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]
[[package]]
name = "unicode-ident"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
[[package]]
name = "version_check"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "winnow"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36"
dependencies = [
"memchr",
] ]
[[package]] [[package]]
name = "x86" name = "x86"
version = "0.32.0" version = "0.47.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ checksum = "55b5be8cc34d017d8aabec95bc45a43d0f20e8b2a31a453cabc804fe996f8dca"
"bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bit_field",
"raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.3.2",
] "raw-cpuid",
]
[metadata]
"checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0" [[package]]
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" name = "zerocopy"
"checksum cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)" = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" version = "0.7.35"
"checksum goblin 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ddd5e3132801a1ac34ac53b97acde50c4685414dd2f291b9ea52afa6f07468c8" source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum linked_list_allocator 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "47de1a43fad0250ee197e9e124e5b5deab3d7b39d4428ae8a6d741ceb340c362" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
"checksum linked_list_allocator 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e70e46c13c0e8374c26cec5752e3347ca1087d9711de8f45aa513a7700efd73d" dependencies = [
"checksum lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" "zerocopy-derive",
"checksum paste 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" ]
"checksum paste-impl 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
"checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]]
"checksum proc-macro-hack 0.5.16 (registry+https://github.com/rust-lang/crates.io-index)" = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" name = "zerocopy-derive"
"checksum raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" version = "0.7.35"
"checksum raw-cpuid 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9e9c0f2091b865a94bc3c9d34896cc4bbda04453453c391f7eb224491be9ae1d" source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [
"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" "proc-macro2",
"checksum scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" "quote",
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "syn",
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" ]
"checksum spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ceac490aa12c567115b40b7b7fceca03a6c9d53d5defea066123debc83c5dc1f"
"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
"checksum spinning_top 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32d801a3a53bcf5071f85fef8d5cab9e5f638fc5580a37e6eb7aba4b37438d24"
"checksum x86 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8cc872a9a776500ccc6f49799729858738c946b8865fa7e3d6b47cc5dc3a8a7"
[package] [package]
name = "kernel" name = "kernel"
version = "0.1.54" version = "0.4.1"
build = "build.rs" build = "build.rs"
edition = "2018" edition = "2021"
[lib] [build-dependencies]
name = "kernel" cc = "1.0"
path = "src/lib.rs" rustc-cfg = "0.5"
crate-type = ["staticlib"] toml = "0.8"
[dependencies] [dependencies]
bitflags = "1.2.1" bitflags = "2"
linked_list_allocator = "0.8.4" bitfield = "0.13.2"
raw-cpuid = "8.0.0" hashbrown = { version = "0.14.3", default-features = false, features = ["ahash", "inline-more"] }
redox_syscall = { path = "syscall" } linked_list_allocator = "0.9.0"
log = "0.4"
redox-path = "0.2.0"
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall.git", branch = "master", default-features = false }
slab_allocator = { path = "slab_allocator", optional = true } slab_allocator = { path = "slab_allocator", optional = true }
spin = "0.5.2" spin = "0.9.8"
paste = "0.1.18" spinning_top = { version = "0.3", features = ["arc_lock"] }
rmm = { path = "rmm", default-features = false }
arrayvec = { version = "0.7.4", default-features = false }
slab = { version = "0.4", default-features = false }
# TODO: Remove
indexmap = { version = "2.5.0", default-features = false }
[dependencies.goblin] [dependencies.goblin]
version = "0.2.1" version = "0.2.1"
...@@ -27,30 +35,57 @@ features = ["elf32", "elf64"] ...@@ -27,30 +35,57 @@ features = ["elf32", "elf64"]
version = "0.1.16" version = "0.1.16"
default-features = false default-features = false
[dependencies.x86] [target.'cfg(any(target_arch = "aarch64", target_arch = "riscv64"))'.dependencies]
version = "0.32.0" byteorder = { version = "1", default-features = false }
default-features = false fdt = { git = "https://github.com/repnop/fdt.git", rev = "2fb1409edd1877c714a0aa36b6a7c5351004be54" }
[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies]
raw-cpuid = "10.2.0"
x86 = { version = "0.47.0", default-features = false }
[target.'cfg(any(target_arch = "riscv64", target_arch = "riscv32"))'.dependencies]
sbi-rt = "0.0.3"
[features] [features]
default = ["acpi", "multi_core", "serial_debug"] default = [
"acpi",
#TODO: issues with Alder Lake and newer CPUs: "multi_core",
"graphical_debug",
"serial_debug",
"self_modifying",
"x86_kvm_pv",
]
# Activates some limited code-overwriting optimizations, based on CPU features.
self_modifying = []
acpi = [] acpi = []
doc = []
graphical_debug = [] graphical_debug = []
live = []
lpss_debug = [] lpss_debug = []
multi_core = ["acpi"] multi_core = ["acpi"]
profiling = []
#TODO: remove when threading issues are fixed
pti = [] pti = []
qemu_debug = [] qemu_debug = []
serial_debug = [] serial_debug = []
system76_ec_debug = [] system76_ec_debug = []
slab = ["slab_allocator"] slab = ["slab_allocator"]
sys_stat = []
x86_kvm_pv = []
[profile.dev] debugger = ["syscall_debug"]
# Kernel doesn't yet work great with debug mode :( syscall_debug = []
opt-level = 3
# LTO fixes some duplicate symbols of memcpy/memmove/etc sys_fdstat = []
lto = true
[profile.dev]
# Avoids having to define the eh_personality lang item and reduces kernel size
panic = "abort"
[profile.release] [profile.release]
# Avoids having to define the eh_personality lang item and reduces kernel size
panic = "abort"
lto = true lto = true
debug = "full"
SOURCE:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
BUILD?=$(CURDIR)
export RUST_TARGET_PATH=$(SOURCE)/targets
ifeq ($(TARGET),)
ARCH?=$(shell uname -m)
else
ARCH?=$(shell echo "$(TARGET)" | cut -d - -f1)
endif
ifeq ($(ARCH),riscv64gc)
override ARCH:=riscv64
endif
GNU_TARGET=$(ARCH)-unknown-redox
all: $(BUILD)/kernel $(BUILD)/kernel.sym
LD_SCRIPT=$(SOURCE)/linkers/$(ARCH).ld
TARGET_SPEC=$(RUST_TARGET_PATH)/$(ARCH)-unknown-kernel.json
$(BUILD)/kernel.all: $(LD_SCRIPT) $(TARGET_SPEC) $(shell find $(SOURCE) -name "*.rs" -type f)
cargo rustc \
--bin kernel \
--manifest-path "$(SOURCE)/Cargo.toml" \
--target "$(TARGET_SPEC)" \
--release \
-Z build-std=core,alloc \
-- \
-C link-arg=-T -Clink-arg="$(LD_SCRIPT)" \
-C link-arg=-z -Clink-arg=max-page-size=0x1000 \
--emit link="$(BUILD)/kernel.all"
$(BUILD)/kernel.sym: $(BUILD)/kernel.all
$(GNU_TARGET)-objcopy \
--only-keep-debug \
"$(BUILD)/kernel.all" \
"$(BUILD)/kernel.sym"
$(BUILD)/kernel: $(BUILD)/kernel.all
$(GNU_TARGET)-objcopy \
--strip-debug \
"$(BUILD)/kernel.all" \
"$(BUILD)/kernel"
# kernel # Kernel
Redox OS Microkernel Redox OS Microkernel
[![docs](https://img.shields.io/badge/docs-master-blue.svg)](https://docs.rs/redox_syscall/latest/syscall/)
[![SLOCs counter](https://tokei.rs/b1/github/redox-os/kernel?category=code)](https://github.com/XAMPPRocky/tokei)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![docs](https://img.shields.io/badge/docs-master-blue.svg)](https://doc.redox-os.org/kernel/kernel/)
[![](https://tokei.rs/b1/github/redox-os/kernel?category=code)](https://github.com/Aaronepower/tokei)
## Debugging the redox kernel ## Requirements
Running [qemu] with the `-s` flag will set up [qemu] to listen on port 1234 for * [`nasm`](https://nasm.us/) needs to be available on the PATH at build time.
a [gdb] client to connect to it. To debug the redox kernel run.
## Building The Documentation
Use this command:
```sh
cargo doc --open --target x86_64-unknown-none
``` ```
## Debugging
### QEMU
Running [QEMU](https://www.qemu.org) with the `-s` flag will set up QEMU to listen on port `1234` for a GDB client to connect to it. To debug the redox kernel run.
```sh
make qemu gdb=yes make qemu gdb=yes
``` ```
This will start a VM with and listen on port 1234 for a [gdb] or [lldb] client. This will start a virtual machine with and listen on port `1234` for a GDB or LLDB client.
## [gdb] ### GDB
If you are going to use [gdb], run the following to load debug symbols and connect If you are going to use [GDB](https://www.gnu.org/software/gdb/), run these commands to load debug symbols and connect to your running kernel:
to your running kernel.
``` ```
(gdb) symbol-file build/kernel.sym (gdb) symbol-file build/kernel.sym
(gdb) target remote localhost:1234 (gdb) target remote localhost:1234
``` ```
## [lldb] ### LLDB
If you are going to use [lldb], run the following to start debugging. If you are going to use [LLDB](https://lldb.llvm.org/), run these commands to start debugging:
``` ```
(lldb) target create -s build/kernel.sym build/kernel (lldb) target create -s build/kernel.sym build/kernel
(lldb) gdb-remote localhost:1234 (lldb) gdb-remote localhost:1234
``` ```
## Debugging
After connecting to your kernel you can set some interesting breakpoints and `continue` After connecting to your kernel you can set some interesting breakpoints and `continue`
the process. See your debuggers man page for more information on useful commands to run. the process. See your debuggers man page for more information on useful commands to run.
[qemu]: https://www.qemu.org ## Notes
[gdb]: https://www.gnu.org/software/gdb/
[lldb]: https://lldb.llvm.org/ - Always use `foo.get(n)` instead of `foo[n]` and try to cover for the possibility of `Option::None`. Doing the regular way may work fine for applications, but never in the kernel. No possible panics should ever exist in kernel space, because then the whole OS would just stop working.
- If you receive a kernel panic in QEMU, use `pkill qemu-system` to kill the frozen QEMU process.
## How To Contribute
To learn how to contribute to this system component you need to read the following document:
- [CONTRIBUTING.md](https://gitlab.redox-os.org/redox-os/redox/-/blob/master/CONTRIBUTING.md)
## Development
To learn how to do development with this system component inside the Redox build system you need to read the [Build System](https://doc.redox-os.org/book/build-system-reference.html) and [Coding and Building](https://doc.redox-os.org/book/coding-and-building.html) pages.
### How To Build
To build this system component you need to download the Redox build system, you can learn how to do it on the [Building Redox](https://doc.redox-os.org/book/podman-build.html) page.
This is necessary because they only work with cross-compilation to a Redox virtual machine, but you can do some testing from Linux.
[dependencies.alloc]
use std::collections::HashMap; use rustc_cfg::Cfg;
use std::env; use std::{env, path::Path, process::Command};
use std::fs; use toml::Table;
use std::io::{Error, Write};
use std::path::Path;
// View loc folder with subfolders, get listings fn parse_kconfig(arch: &str) -> Option<()> {
// Returns touple (folder_map, file_list) println!("cargo:rerun-if-changed=config.toml");
// folder_map keys are folders, and values are lists of direct childs
// file_list is a vector of all detected files with full path
fn scan_folder(loc: &Path) -> (HashMap<String, Vec<String>>, Vec<String>) {
let mut folders: HashMap<String, Vec<String>> = HashMap::new();
let mut files: Vec<String> = Vec::new();
let mut current = Vec::new();
if loc.is_dir() { assert!(Path::new("config.toml.example").try_exists().unwrap());
for entry in fs::read_dir(loc).unwrap() { if !Path::new("config.toml").try_exists().unwrap() {
let entry = entry.unwrap(); std::fs::copy("config.toml.example", "config.toml").unwrap();
let path = entry.path();
let path_str = String::from(path.to_str().unwrap()).replace("\\", "/");
current.push(path_str.clone());
// if folder then scan recursively
if path.is_dir() {
let (d, mut f) = scan_folder(&path);
for (key, value) in d.into_iter() {
folders.insert(key, value);
}
files.append(&mut f);
} else {
files.push(path_str);
}
}
current.sort();
folders
.entry(String::from(loc.to_str().unwrap()).replace("\\", "/"))
.or_insert(current);
} else {
panic!("{:?} is not a folder!", loc);
} }
let config_str = std::fs::read_to_string("config.toml").unwrap();
(folders, files) let root: Table = toml::from_str(&config_str).unwrap();
}
let altfeatures = root
// Write folder/file information to output file .get("arch")?
fn fill_from_location(f: &mut fs::File, loc: &Path) -> Result<(), Error> { .as_table()
let (folders, mut files) = scan_folder(loc); .unwrap()
let mut folder_it: Vec<_> = folders.keys().collect(); .get(arch)?
.as_table()
let loc_str = loc.to_str().unwrap(); .unwrap()
let mut idx = loc_str.len(); .get("features")?
.as_table()
if !loc_str.ends_with("/") { .unwrap();
idx += 1;
} let self_modifying = env::var("CARGO_FEATURE_SELF_MODIFYING").is_ok();
folder_it.sort(); for (name, value) in altfeatures {
files.sort(); let mut choice = value.as_str().unwrap();
for dir in folder_it.iter() { assert!(matches!(choice, "always" | "never" | "auto"));
let strip: String = dir.chars().skip(idx).collect();
write!(f, " files.insert(b\"{}\", (b\"", strip)?; if !self_modifying && choice == "auto" {
choice = "never";
// Write child elements separated with \n
let sub = folders.get(*dir).unwrap();
let mut first = true;
for child in sub.iter() {
let idx = child.rfind('/').unwrap() + 1;
let (_, c) = child.split_at(idx);
if first {
write!(f, "{}", c)?;
first = false;
} else {
write!(f, "\\n{}", c)?;
}
} }
write!(f, "\", true));\n")?;
}
for name in files.iter() { println!("cargo:rustc-cfg=cpu_feature_{choice}=\"{name}\"");
let (_, strip) = name.split_at(idx);
write!(
f,
" files.insert(b\"{}\", (include_bytes!(\"{}\"), false));\n",
strip, name
)?;
} }
Ok(()) Some(())
}
#[cfg(not(target_arch = "x86_64"))]
fn asm(_out_dir: &str) {}
#[cfg(target_arch = "x86_64")]
fn asm(out_dir: &str) {
use std::process::Command;
println!("cargo:rerun-if-changed=src/asm/x86_64/trampoline.asm");
let status = Command::new("nasm")
.arg("-f").arg("bin")
.arg("-o").arg(format!("{}/trampoline", out_dir))
.arg("src/asm/x86_64/trampoline.asm")
.status()
.expect("failed to run nasm");
if ! status.success() {
panic!("nasm failed with exit status {}", status);
}
} }
fn main() { fn main() {
println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap()); println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap());
println!("cargo:rerun-if-env-changed=INITFS_FOLDER");
let out_dir = env::var("OUT_DIR").unwrap(); let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("gen.rs"); let cfg = Cfg::of(env::var("TARGET").unwrap().as_str()).unwrap();
let mut f = fs::File::create(&dest_path).unwrap(); let arch_str = cfg.target_arch.as_str();
let src = env::var("INITFS_FOLDER");
asm(&out_dir);
// Write header match arch_str {
f.write_all( "aarch64" => {
b" println!("cargo:rustc-cfg=dtb");
mod gen { }
use alloc::collections::BTreeMap; "x86" => {
pub fn gen() -> BTreeMap<&'static [u8], (&'static [u8], bool)> { println!("cargo:rerun-if-changed=src/asm/x86/trampoline.asm");
let mut files: BTreeMap<&'static [u8], (&'static [u8], bool)> = BTreeMap::new();
", let status = Command::new("nasm")
) .arg("-f")
.unwrap(); .arg("bin")
.arg("-o")
match src { .arg(format!("{}/trampoline", out_dir))
Ok(v) => { .arg("src/asm/x86/trampoline.asm")
println!("cargo:rerun-if-changed={}", v); .status()
fill_from_location(&mut f, Path::new(&v)).unwrap() .expect("failed to run nasm");
if !status.success() {
panic!("nasm failed with exit status {}", status);
}
} }
Err(e) => { "x86_64" => {
f.write_all( println!("cargo:rerun-if-changed=src/asm/x86_64/trampoline.asm");
b" files.clear();", // Silence mutability warning
) let status = Command::new("nasm")
.unwrap(); .arg("-f")
println!( .arg("bin")
"cargo:warning=location not found: {}, please set proper INITFS_FOLDER.", .arg("-o")
e .arg(format!("{}/trampoline", out_dir))
); .arg("src/asm/x86_64/trampoline.asm")
.status()
.expect("failed to run nasm");
if !status.success() {
panic!("nasm failed with exit status {}", status);
}
} }
"riscv64" => {
println!("cargo:rustc-cfg=dtb");
}
_ => (),
} }
f.write_all( let _ = parse_kconfig(arch_str);
b"
files
}
}
",
)
.unwrap();
} }
...@@ -2,15 +2,6 @@ ...@@ -2,15 +2,6 @@
set -e set -e
# https://github.com/rust-lang/rust-clippy/issues/4579
export RUSTUP_TOOLCHAIN="nightly-2019-07-19"
rustup update "${RUSTUP_TOOLCHAIN}"
rustup component add clippy --toolchain "${RUSTUP_TOOLCHAIN}"
rustup component add rust-src --toolchain "${RUSTUP_TOOLCHAIN}"
# Cause recompilation
touch src/lib.rs
export RUST_TARGET_PATH="${PWD}/targets" export RUST_TARGET_PATH="${PWD}/targets"
export RUSTFLAGS="-C soft-float -C debuginfo=2" export RUSTFLAGS="-C soft-float -C debuginfo=2"
xargo clippy --lib --release --target x86_64-unknown-none cargo clippy --lib --release --target x86_64-unknown-none "$@"
[arch.x86_64.features]
smap = "auto"
fsgsbase = "auto"
xsave = "auto"
xsaveopt = "auto"
# vim: ft=toml
ENTRY(kstart)
OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
KERNEL_OFFSET = 0xFFFFFF0000000000;
SECTIONS {
. = KERNEL_OFFSET;
. += SIZEOF_HEADERS;
/* Force the zero page to be part of a segment by creating a
* dummy section in the zero page.
* Limine will map the segment with the lowest vaddr value at
* 0xFFFFFFFF80000000 even if the segment has a higher vaddr.
* As such without the zero page being part of a segment, the
* kernel would be loaded at an offset from the expected
* location. As the redox kernel is not currently relocatable,
* this would result in a crash. A similar issue likely exists
* with multiboot/multiboot2 and the paddr of the segment.
*/
.dummy ALIGN(8) : AT(ADDR(.dummy) - KERNEL_OFFSET) {}
. = ALIGN(4096);
.text : AT(ADDR(.text) - KERNEL_OFFSET) {
__text_start = .;
*(.text*)
__usercopy_start = .;
*(.usercopy-fns)
__usercopy_end = .;
. = ALIGN(4096);
__text_end = .;
}
.rodata : AT(ADDR(.rodata) - KERNEL_OFFSET) {
__rodata_start = .;
*(.rodata*)
. = ALIGN(4096);
__rodata_end = .;
}
.data : AT(ADDR(.data) - KERNEL_OFFSET) {
__data_start = .;
*(.data*)
. = ALIGN(4096);
__data_end = .;
__bss_start = .;
*(.bss*)
. = ALIGN(4096);
__bss_end = .;
}
__end = .;
/DISCARD/ : {
*(.comment*)
*(.eh_frame*)
*(.gcc_except_table*)
*(.note*)
*(.rel.eh_frame*)
}
}
ENTRY(kstart)
OUTPUT_FORMAT(elf32-i386)
KERNEL_OFFSET = 0xC0000000;
SECTIONS {
. = KERNEL_OFFSET;
. += SIZEOF_HEADERS;
/* Force the zero page to be part of a segment by creating a
* dummy section in the zero page.
* Limine will map the segment with the lowest vaddr value at
* 0xFFFFFFFF80000000 even if the segment has a higher vaddr.
* As such without the zero page being part of a segment, the
* kernel would be loaded at an offset from the expected
* location. As the redox kernel is not currently relocatable,
* this would result in a crash. A similar issue likely exists
* with multiboot/multiboot2 and the paddr of the segment.
*/
.dummy : AT(ADDR(.dummy) - KERNEL_OFFSET) {}
.text ALIGN(4K) : AT(ADDR(.text) - KERNEL_OFFSET) {
__text_start = .;
*(.text*)
__usercopy_start = .;
*(.usercopy-fns)
__usercopy_end = .;
}
.rodata ALIGN(4K) : AT(ADDR(.rodata) - KERNEL_OFFSET) {
__text_end = .;
__rodata_start = .;
*(.rodata*)
}
.data ALIGN(4K) : AT(ADDR(.data) - KERNEL_OFFSET) {
__rodata_end = .;
__data_start = .;
*(.data*)
. = ALIGN(4K);
__data_end = .;
__bss_start = .;
*(.bss*)
. = ALIGN(4K);
}
__end = .;
/DISCARD/ : {
*(.comment*)
*(.eh_frame*)
*(.gcc_except_table*)
*(.note*)
*(.rel.eh_frame*)
}
}
ENTRY(kstart)
OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv" )
KERNEL_OFFSET = 0xFFFFFF0000000000;
SECTIONS {
. = KERNEL_OFFSET;
. += SIZEOF_HEADERS;
/* Force the zero page to be part of a segment by creating a
* dummy section in the zero page.
* Linker will map the segment with the lowest vaddr value at
* 0xFFFFFF0000000000 even if the segment has a higher vaddr.
* As such without the zero page being part of a segment, the
* kernel would be loaded at an offset from the expected
* location. As the redox kernel is not currently relocatable,
* this would result in a crash. A similar issue likely exists
* with multiboot/multiboot2 and the paddr of the segment.
*/
.dummy ALIGN(8) : AT(ADDR(.dummy) - KERNEL_OFFSET) {}
. = ALIGN(4096);
.text : AT(ADDR(.text) - KERNEL_OFFSET) {
__text_start = .;
*(.early_init.text*)
. = ALIGN(4096);
*(.text*)
__usercopy_start = .;
*(.usercopy-fns)
__usercopy_end = .;
. = ALIGN(4096);
__text_end = .;
}
.rodata : AT(ADDR(.rodata) - KERNEL_OFFSET) {
__rodata_start = .;
*(.rodata*)
. = ALIGN(4096);
__rodata_end = .;
}
.data : AT(ADDR(.data) - KERNEL_OFFSET) {
__data_start = .;
*(.data*)
*(.sdata*)
. = ALIGN(4096);
__data_end = .;
*(.got*)
. = ALIGN(4096);
__bss_start = .;
*(.bss*)
*(.sbss*)
. = ALIGN(4096);
__bss_end = .;
}
__end = .;
/DISCARD/ : {
*(.comment*)
*(.eh_frame*)
*(.gcc_except_table*)
*(.note*)
*(.rel.eh_frame*)
}
}
ENTRY(kstart) ENTRY(kstart)
OUTPUT_FORMAT(elf64-x86-64) OUTPUT_FORMAT(elf64-x86-64)
KERNEL_OFFSET = 0xffffff0000100000; KERNEL_OFFSET = 0xFFFFFFFF80000000;
SECTIONS { SECTIONS {
. = KERNEL_OFFSET; . = KERNEL_OFFSET;
. += SIZEOF_HEADERS; . += SIZEOF_HEADERS;
. = ALIGN(4096);
.text : AT(ADDR(.text) - KERNEL_OFFSET) { /* Force the zero page to be part of a segment by creating a
* dummy section in the zero page.
* Limine will map the segment with the lowest vaddr value at
* 0xFFFFFFFF80000000 even if the segment has a higher vaddr.
* As such without the zero page being part of a segment, the
* kernel would be loaded at an offset from the expected
* location. As the redox kernel is not currently relocatable,
* this would result in a crash. A similar issue likely exists
* with multiboot/multiboot2 and the paddr of the segment.
*/
.dummy : AT(ADDR(.dummy) - KERNEL_OFFSET) {}
.text ALIGN(4K) : AT(ADDR(.text) - KERNEL_OFFSET) {
__text_start = .; __text_start = .;
*(.text*) *(.text*)
. = ALIGN(4096); __usercopy_start = .;
__text_end = .; *(.usercopy-fns)
__usercopy_end = .;
} }
.rodata : AT(ADDR(.rodata) - KERNEL_OFFSET) { .rodata ALIGN(4K) : AT(ADDR(.rodata) - KERNEL_OFFSET) {
__text_end = .;
__rodata_start = .; __rodata_start = .;
*(.rodata*) *(.rodata*)
. = ALIGN(4096); __altcode_start = .;
__rodata_end = .; KEEP(*(.altcode*))
__altcode_end = .;
. = ALIGN(8);
__altrelocs_start = .;
KEEP(*(.altrelocs*))
__altrelocs_end = .;
__altfeatures_start = .;
KEEP(*(.altfeatures*))
__altfeatures_end = .;
} }
.data : AT(ADDR(.data) - KERNEL_OFFSET) { .data ALIGN(4K) : AT(ADDR(.data) - KERNEL_OFFSET) {
__rodata_end = .;
__data_start = .; __data_start = .;
*(.data*) *(.data*)
. = ALIGN(4096); . = ALIGN(4K);
__data_end = .; __data_end = .;
__bss_start = .; __bss_start = .;
*(.bss*) *(.bss*)
. = ALIGN(4096);
__bss_end = .;
}
.tdata : AT(ADDR(.tdata) - KERNEL_OFFSET) {
__tdata_start = .;
*(.tdata*)
. = ALIGN(4096);
__tdata_end = .;
__tbss_start = .;
*(.tbss*)
. += 8;
. = ALIGN(4096);
__tbss_end = .;
} }
__end = .; __end = .;
......
Subproject commit 63669069f4eb2e3bf04c0399d28fb2e3e3c58166
blank_lines_lower_bound = 0 # default
blank_lines_upper_bound = 1 # default
brace_style = "SameLineWhere" # default
disable_all_formatting = false # default
edition = "2021"
empty_item_single_line = true # default
fn_single_line = false # default
force_explicit_abi = true # default
format_strings = false # default
hard_tabs = false # default
show_parse_errors = true # default
imports_granularity = "Crate" # default = Preserve
imports_indent = "Block" # default
imports_layout = "Mixed" # default
indent_style = "Block" # default
max_width = 100 # default
newline_style = "Unix" # default = Auto
skip_children = false # default
tab_spaces = 4 # default
trailing_comma = "Vertical" # default
where_single_line = false # default