diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..0482535 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,25 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "foundryos_kernel" +version = "0.1.0" +dependencies = [ + "limine", +] + +[[package]] +name = "limine" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca87cab008b8efeebdbe037cd4d1438037d48c5cb6fed939ffa5aa06315a321" +dependencies = [ + "bitflags", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c6aaea1 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[workspace] +members = [ + "kernel" +] +resolver = "2" + +[workspace.package] +version = "0.1.0" +edition = "2021" + diff --git a/config/limine.conf b/config/limine.conf new file mode 100644 index 0000000..4353c88 --- /dev/null +++ b/config/limine.conf @@ -0,0 +1,5 @@ +timeout: 1 + +/foundry-os + protocol: limine + kernel_path: boot()/boot/kernel \ No newline at end of file diff --git a/customos.json b/customos.json new file mode 100644 index 0000000..899a943 --- /dev/null +++ b/customos.json @@ -0,0 +1,30 @@ +{ + "llvm-target": "x86_64-unknown-none", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", + "arch": "x86_64", + "target-endian": "little", + "target-pointer-width": "64", + "target-c-int-width": "32", + "os": "none", + "executables": true, + "linker-flavor": "ld.lld", + "linker": "rust-lld", + "panic-strategy": "abort", + "disable-redzone": true, + "features": "-mmx,-sse,+soft-float", + "relocation-model": "static", + "code-model": "kernel", + "pre-link-args": { + "ld.lld": [ + "--script=linker/linker.ld", + "-nostdlib", + "--no-dynamic-linker", + "-static", + "--no-pie", + "--gc-sections", + "--build-id=none", + "-z", "max-page-size=0x1000" + ] + } + } + \ No newline at end of file diff --git a/kernel/.cargo/config.toml b/kernel/.cargo/config.toml new file mode 100644 index 0000000..907d534 --- /dev/null +++ b/kernel/.cargo/config.toml @@ -0,0 +1,7 @@ +[build] +target = "../customos" +target-dir = "./target" + +[unstable] +build-std = ["core", "compiler_builtins"] +build-std-features = ["compiler-builtins-mem"] \ No newline at end of file diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml new file mode 100644 index 0000000..0fb13a0 --- /dev/null +++ b/kernel/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "foundryos_kernel" +version = "0.1.0" +edition = "2021" + +[dependencies] +limine = "0.3.1" diff --git a/kernel/build.rs b/kernel/build.rs new file mode 100644 index 0000000..31c5210 --- /dev/null +++ b/kernel/build.rs @@ -0,0 +1,7 @@ +fn main() { + let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap(); + // Tell cargo to pass the linker script to the linker.. + println!("cargo:rustc-link-arg=-Tlinker-{arch}.ld"); + // ..and to re-run if it changes. + println!("cargo:rerun-if-changed=linker-{arch}.ld"); +} \ No newline at end of file diff --git a/kernel/customos/CACHEDIR.TAG b/kernel/customos/CACHEDIR.TAG new file mode 100644 index 0000000..20d7c31 --- /dev/null +++ b/kernel/customos/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/kernel/customos/debug/.cargo-lock b/kernel/customos/debug/.cargo-lock new file mode 100644 index 0000000..e69de29 diff --git a/kernel/customos/debug/.fingerprint/compiler_builtins-7ff902764ead3159/run-build-script-build-script-build b/kernel/customos/debug/.fingerprint/compiler_builtins-7ff902764ead3159/run-build-script-build-script-build new file mode 100644 index 0000000..ff9cac7 --- /dev/null +++ b/kernel/customos/debug/.fingerprint/compiler_builtins-7ff902764ead3159/run-build-script-build-script-build @@ -0,0 +1 @@ +2c12b06536f46cd1 \ No newline at end of file diff --git a/kernel/customos/debug/.fingerprint/compiler_builtins-7ff902764ead3159/run-build-script-build-script-build.json b/kernel/customos/debug/.fingerprint/compiler_builtins-7ff902764ead3159/run-build-script-build-script-build.json new file mode 100644 index 0000000..fa31cad --- /dev/null +++ b/kernel/customos/debug/.fingerprint/compiler_builtins-7ff902764ead3159/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":5637828655848808591,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[16831489395241507197,"build_script_build",false,2449660372133931133]],"local":[{"RerunIfChanged":{"output":"../customos/debug/build/compiler_builtins-7ff902764ead3159/output","paths":["build.rs","configure.rs"]}}],"rustflags":[],"config":0,"compile_kind":0} \ No newline at end of file diff --git a/kernel/customos/debug/.fingerprint/core-0a08e04c20f15c0b/invoked.timestamp b/kernel/customos/debug/.fingerprint/core-0a08e04c20f15c0b/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/kernel/customos/debug/.fingerprint/core-0a08e04c20f15c0b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/kernel/customos/debug/.fingerprint/core-0a08e04c20f15c0b/output-lib-core b/kernel/customos/debug/.fingerprint/core-0a08e04c20f15c0b/output-lib-core new file mode 100644 index 0000000..baa2024 --- /dev/null +++ b/kernel/customos/debug/.fingerprint/core-0a08e04c20f15c0b/output-lib-core @@ -0,0 +1 @@ +{"$message_type":"diagnostic","message":"Error loading target specification: Could not find specification for target \"../customos\". Run `rustc --print target-list` for a list of built-in targets","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: Error loading target specification: Could not find specification for target \"../customos\". Run `rustc --print target-list` for a list of built-in targets\u001b[0m\n\n"} diff --git a/kernel/customos/debug/.fingerprint/foundryos_kernel-15da3dc5b1d972d1/run-build-script-build-script-build b/kernel/customos/debug/.fingerprint/foundryos_kernel-15da3dc5b1d972d1/run-build-script-build-script-build new file mode 100644 index 0000000..3b9522a --- /dev/null +++ b/kernel/customos/debug/.fingerprint/foundryos_kernel-15da3dc5b1d972d1/run-build-script-build-script-build @@ -0,0 +1 @@ +85b0379a2e964349 \ No newline at end of file diff --git a/kernel/customos/debug/.fingerprint/foundryos_kernel-15da3dc5b1d972d1/run-build-script-build-script-build.json b/kernel/customos/debug/.fingerprint/foundryos_kernel-15da3dc5b1d972d1/run-build-script-build-script-build.json new file mode 100644 index 0000000..b8a518d --- /dev/null +++ b/kernel/customos/debug/.fingerprint/foundryos_kernel-15da3dc5b1d972d1/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":5637828655848808591,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[16831489395241507197,"build_script_build",false,15090704965883138604],[4566724075159146729,"build_script_build",false,12086878114467551400]],"local":[{"RerunIfChanged":{"output":"../customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/output","paths":["linker-x86_64.ld"]}}],"rustflags":[],"config":0,"compile_kind":0} \ No newline at end of file diff --git a/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/invoked.timestamp b/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/output b/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/output new file mode 100644 index 0000000..1542e0b --- /dev/null +++ b/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/output @@ -0,0 +1,151 @@ +cargo::rerun-if-changed=build.rs +cargo::rerun-if-changed=configure.rs +cargo::rustc-check-cfg=cfg(__ashldi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__ashlsi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__ashrdi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__ashrsi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__bswapsi2, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__bswapdi2, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__bswapti2, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__divdi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__divsi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__divmoddi4, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__divmodsi4, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__divmodsi4, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__divmodti4, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__lshrdi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__lshrsi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__moddi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__modsi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__muldi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__udivdi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__udivmoddi4, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__udivmodsi4, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__udivsi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__umoddi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__umodsi3, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas1_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas1_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas1_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas1_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas2_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas2_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas2_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas2_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas4_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas4_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas4_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas4_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas8_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas8_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas8_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas8_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas16_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas16_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas16_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_cas16_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd1_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd1_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd1_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd1_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd2_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd2_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd2_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd2_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd4_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd4_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd4_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd4_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd8_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd8_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd8_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldadd8_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr1_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr1_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr1_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr1_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr2_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr2_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr2_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr2_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr4_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr4_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr4_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr4_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr8_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr8_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr8_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldclr8_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor1_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor1_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor1_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor1_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor2_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor2_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor2_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor2_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor4_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor4_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor4_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor4_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor8_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor8_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor8_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldeor8_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset1_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset1_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset1_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset1_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset2_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset2_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset2_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset2_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset4_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset4_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset4_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset4_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset8_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset8_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset8_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_ldset8_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp1_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp1_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp1_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp1_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp2_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp2_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp2_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp2_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp4_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp4_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp4_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp4_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp8_relax, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp8_acq, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp8_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(__aarch64_swp8_acq_rel, values("optimized-c")) +cargo::rustc-check-cfg=cfg(target_feature, values("vis3")) +cargo::rustc-check-cfg=cfg(feature, values("checked")) +cargo::rustc-check-cfg=cfg(assert_no_panic) +cargo::rustc-check-cfg=cfg(f16_enabled) +cargo::rustc-check-cfg=cfg(f128_enabled) +cargo::rustc-cfg=f16_enabled +cargo::rustc-cfg=f128_enabled +cargo:rustc-check-cfg=cfg(intrinsics_enabled) +cargo:rustc-check-cfg=cfg(arch_enabled) +cargo:rustc-check-cfg=cfg(optimizations_enabled) +cargo:rustc-check-cfg=cfg(feature, values("unstable-public-internals")) +cargo:rustc-cfg=intrinsics_enabled +cargo:rustc-cfg=arch_enabled +cargo:rustc-check-cfg=cfg(optimizations_enabled) +cargo:rustc-check-cfg=cfg(x86_no_sse) +cargo:rustc-env=CFG_CARGO_FEATURES=["compiler-builtins", "core", "default", "mem", "rustc-dep-of-std"] +cargo:rustc-env=CFG_OPT_LEVEL=0 +cargo:rustc-env=CFG_TARGET_FEATURES=["x87"] +cargo:rustc-cfg=feature="unstable-intrinsics" +cargo:compiler-rt=/home/zxq5/.cargo/bin/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.146/compiler-rt +cargo::rustc-check-cfg=cfg(feature, values("mem-unaligned")) +cargo:rustc-cfg=feature="mem-unaligned" +cargo::rustc-check-cfg=cfg(thumb) +cargo::rustc-check-cfg=cfg(thumb_1) +cargo::rustc-check-cfg=cfg(kernel_user_helpers) diff --git a/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/root-output b/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/root-output new file mode 100644 index 0000000..eab9c50 --- /dev/null +++ b/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/root-output @@ -0,0 +1 @@ +/home/zxq5/Projects/OSDev/FoundryOS/kernel/./target/../customos/debug/build/compiler_builtins-7ff902764ead3159/out \ No newline at end of file diff --git a/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/stderr b/kernel/customos/debug/build/compiler_builtins-7ff902764ead3159/stderr new file mode 100644 index 0000000..e69de29 diff --git a/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/invoked.timestamp b/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/output b/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/output new file mode 100644 index 0000000..8ec9b81 --- /dev/null +++ b/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/output @@ -0,0 +1,2 @@ +cargo:rustc-link-arg=-Tlinker-x86_64.ld +cargo:rerun-if-changed=linker-x86_64.ld diff --git a/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/root-output b/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/root-output new file mode 100644 index 0000000..900d69a --- /dev/null +++ b/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/root-output @@ -0,0 +1 @@ +/home/zxq5/Projects/OSDev/FoundryOS/kernel/./target/../customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/out \ No newline at end of file diff --git a/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/stderr b/kernel/customos/debug/build/foundryos_kernel-15da3dc5b1d972d1/stderr new file mode 100644 index 0000000..e69de29 diff --git a/kernel/rust-toolchain.toml b/kernel/rust-toolchain.toml new file mode 100644 index 0000000..a062f10 --- /dev/null +++ b/kernel/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly" +targets = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy"] +components = [] \ No newline at end of file diff --git a/kernel/src/main.rs b/kernel/src/main.rs new file mode 100644 index 0000000..f909738 --- /dev/null +++ b/kernel/src/main.rs @@ -0,0 +1,67 @@ +#![no_std] +#![no_main] + +use core::arch::asm; + +use limine::request::{FramebufferRequest, RequestsEndMarker, RequestsStartMarker}; +use limine::BaseRevision; + +/// Sets the base revision to the latest revision supported by the crate. +/// See specification for further info. +/// Be sure to mark all limine requests with #[used], otherwise they may be removed by the compiler. +#[used] +// The .requests section allows limine to find the requests faster and more safely. +#[link_section = ".requests"] +static BASE_REVISION: BaseRevision = BaseRevision::new(); + +#[used] +#[link_section = ".requests"] +static FRAMEBUFFER_REQUEST: FramebufferRequest = FramebufferRequest::new(); + +/// Define the stand and end markers for Limine requests. +#[used] +#[link_section = ".requests_start_marker"] +static _START_MARKER: RequestsStartMarker = RequestsStartMarker::new(); +#[used] +#[link_section = ".requests_end_marker"] +static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new(); + +#[no_mangle] +unsafe extern "C" fn kmain() -> ! { + // All limine requests must also be referenced in a called function, otherwise they may be + // removed by the linker. + assert!(BASE_REVISION.is_supported()); + + if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { + if let Some(framebuffer) = framebuffer_response.framebuffers().next() { + for i in 0..100_u64 { + // Calculate the pixel offset using the framebuffer information we obtained above. + // We skip `i` scanlines (pitch is provided in bytes) and add `i * 4` to skip `i` pixels forward. + let pixel_offset = i * framebuffer.pitch() + i * 4; + + // Write 0xFFFFFFFF to the provided pixel offset to fill it white. + *(framebuffer.addr().add(pixel_offset as usize) as *mut u32) = 0xFFFFFFFF; + } + } + } + + hcf(); +} + +#[panic_handler] +fn rust_panic(_info: &core::panic::PanicInfo) -> ! { + hcf(); +} + +fn hcf() -> ! { + loop { + unsafe { + #[cfg(target_arch = "x86_64")] + asm!("hlt"); + #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] + asm!("wfi"); + #[cfg(target_arch = "loongarch64")] + asm!("idle 0"); + } + } +} \ No newline at end of file diff --git a/kernel/target/.rustc_info.json b/kernel/target/.rustc_info.json new file mode 100644 index 0000000..38546aa --- /dev/null +++ b/kernel/target/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":10191676143533991604,"outputs":{"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.87.0-nightly (827a0d638 2025-02-18)\nbinary: rustc\ncommit-hash: 827a0d638dabc9a22c56f9c37a557568f86ac76c\ncommit-date: 2025-02-18\nhost: x86_64-unknown-linux-gnu\nrelease: 1.87.0-nightly\nLLVM version: 20.1.0\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/zxq5/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nub_checks\nunix\n","stderr":""},"16938275954012004043":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.a\n/home/zxq5/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu\noff\n___\ndebug_assertions\nfmt_debug=\"full\"\noverflow_checks\npanic=\"abort\"\nproc_macro\nrelocation_model=\"static\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"none\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nub_checks\n","stderr":"warning: target feature `sse2` must be enabled to ensure that the ABI of the current target can be implemented correctly\n |\n = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n = note: for more information, see issue #116344 \n\nwarning: dropping unsupported crate type `dylib` for target `../customos`\n\nwarning: dropping unsupported crate type `cdylib` for target `../customos`\n\nwarning: dropping unsupported crate type `proc-macro` for target `../customos`\n\nwarning: 4 warnings emitted\n\n"}},"successes":{}} \ No newline at end of file diff --git a/kernel/target/CACHEDIR.TAG b/kernel/target/CACHEDIR.TAG new file mode 100644 index 0000000..20d7c31 --- /dev/null +++ b/kernel/target/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/kernel/target/debug/.cargo-lock b/kernel/target/debug/.cargo-lock new file mode 100644 index 0000000..e69de29 diff --git a/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/build-script-build-script-build b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/build-script-build-script-build new file mode 100644 index 0000000..f17d041 --- /dev/null +++ b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/build-script-build-script-build @@ -0,0 +1 @@ +7de8642d21f1fe21 \ No newline at end of file diff --git a/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/build-script-build-script-build.json b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/build-script-build-script-build.json new file mode 100644 index 0000000..6a03032 --- /dev/null +++ b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":5637828655848808591,"features":"[\"compiler-builtins\", \"core\", \"default\", \"mem\", \"rustc-dep-of-std\"]","declared_features":"[\"c\", \"cc\", \"compiler-builtins\", \"core\", \"default\", \"mangled-names\", \"mem\", \"no-asm\", \"no-f16-f128\", \"public-test-deps\", \"rustc-dep-of-std\"]","target":5408242616063297496,"profile":15657897354478470176,"path":1296201966205883023,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/dep-build-script-build-script-build","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0} \ No newline at end of file diff --git a/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/dep-build-script-build-script-build b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/dep-build-script-build-script-build new file mode 100644 index 0000000..ec3cb8b Binary files /dev/null and b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/dep-build-script-build-script-build differ diff --git a/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/invoked.timestamp b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/kernel/target/debug/.fingerprint/compiler_builtins-96bb72fd3eed954b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/build-script-build-script-build b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/build-script-build-script-build new file mode 100644 index 0000000..b881860 --- /dev/null +++ b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/build-script-build-script-build @@ -0,0 +1 @@ +a81848289b37bda7 \ No newline at end of file diff --git a/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/build-script-build-script-build.json b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/build-script-build-script-build.json new file mode 100644 index 0000000..224327a --- /dev/null +++ b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":5637828655848808591,"features":"[]","declared_features":"[]","target":5408242616063297496,"profile":8731458305071235362,"path":11588123521703303381,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/dep-build-script-build-script-build","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0} \ No newline at end of file diff --git a/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/dep-build-script-build-script-build b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/dep-build-script-build-script-build new file mode 100644 index 0000000..b7bf9e2 Binary files /dev/null and b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/dep-build-script-build-script-build differ diff --git a/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/invoked.timestamp b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/kernel/target/debug/.fingerprint/foundryos_kernel-4c0b4334571dcf0e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build-script-build b/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build-script-build new file mode 100755 index 0000000..338684c Binary files /dev/null and b/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build-script-build differ diff --git a/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b b/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b new file mode 100755 index 0000000..338684c Binary files /dev/null and b/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b differ diff --git a/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b.d b/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b.d new file mode 100644 index 0000000..4f501da --- /dev/null +++ b/kernel/target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b.d @@ -0,0 +1,6 @@ +/home/zxq5/Projects/OSDev/FoundryOS/kernel/./target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b: /home/zxq5/.cargo/bin/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.146/build.rs /home/zxq5/.cargo/bin/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.146/configure.rs + +/home/zxq5/Projects/OSDev/FoundryOS/kernel/./target/debug/build/compiler_builtins-96bb72fd3eed954b/build_script_build-96bb72fd3eed954b.d: /home/zxq5/.cargo/bin/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.146/build.rs /home/zxq5/.cargo/bin/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.146/configure.rs + +/home/zxq5/.cargo/bin/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.146/build.rs: +/home/zxq5/.cargo/bin/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.146/configure.rs: diff --git a/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build-script-build b/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build-script-build new file mode 100755 index 0000000..753d9cc Binary files /dev/null and b/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build-script-build differ diff --git a/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e b/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e new file mode 100755 index 0000000..753d9cc Binary files /dev/null and b/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e differ diff --git a/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e.d b/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e.d new file mode 100644 index 0000000..3837b9b --- /dev/null +++ b/kernel/target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e.d @@ -0,0 +1,5 @@ +/home/zxq5/Projects/OSDev/FoundryOS/kernel/./target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e: kernel/build.rs + +/home/zxq5/Projects/OSDev/FoundryOS/kernel/./target/debug/build/foundryos_kernel-4c0b4334571dcf0e/build_script_build-4c0b4334571dcf0e.d: kernel/build.rs + +kernel/build.rs: diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/1qy380xhrphq531r5ws88j9wo.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/1qy380xhrphq531r5ws88j9wo.o new file mode 100644 index 0000000..72aeef0 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/1qy380xhrphq531r5ws88j9wo.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/2dvdjyy0zhw2hjlkhv96c5cs3.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/2dvdjyy0zhw2hjlkhv96c5cs3.o new file mode 100644 index 0000000..76d92a1 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/2dvdjyy0zhw2hjlkhv96c5cs3.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/5nbffzhjn52imlezqdqfdsnvh.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/5nbffzhjn52imlezqdqfdsnvh.o new file mode 100644 index 0000000..56d9327 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/5nbffzhjn52imlezqdqfdsnvh.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/5yhu9qbjklje8my5z61n13y6f.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/5yhu9qbjklje8my5z61n13y6f.o new file mode 100644 index 0000000..e14a08c Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/5yhu9qbjklje8my5z61n13y6f.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/6jeumh47x828zycjlopnhx5tg.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/6jeumh47x828zycjlopnhx5tg.o new file mode 100644 index 0000000..2483e7c Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/6jeumh47x828zycjlopnhx5tg.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/6y03beg2v4rzs9y0o534u96vi.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/6y03beg2v4rzs9y0o534u96vi.o new file mode 100644 index 0000000..79b65eb Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/6y03beg2v4rzs9y0o534u96vi.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/7bz37n6mgodmczl6cnqb46g2f.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/7bz37n6mgodmczl6cnqb46g2f.o new file mode 100644 index 0000000..176fafd Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/7bz37n6mgodmczl6cnqb46g2f.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/87xms47vdx7b3p46e0179cope.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/87xms47vdx7b3p46e0179cope.o new file mode 100644 index 0000000..c053c3f Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/87xms47vdx7b3p46e0179cope.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/9kcuicz6gf6qfitswpixt0dvp.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/9kcuicz6gf6qfitswpixt0dvp.o new file mode 100644 index 0000000..2c3c34f Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/9kcuicz6gf6qfitswpixt0dvp.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/boohl3ax7ln7xjs5krpuucs6e.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/boohl3ax7ln7xjs5krpuucs6e.o new file mode 100644 index 0000000..fd202d7 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/boohl3ax7ln7xjs5krpuucs6e.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/c68ehm6pci3f08lf0r8jkksvm.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/c68ehm6pci3f08lf0r8jkksvm.o new file mode 100644 index 0000000..3f487b4 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/c68ehm6pci3f08lf0r8jkksvm.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dep-graph.bin b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dep-graph.bin new file mode 100644 index 0000000..cea0254 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dep-graph.bin differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dibtigrdmxtev00agj7kvhw0j.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dibtigrdmxtev00agj7kvhw0j.o new file mode 100644 index 0000000..e280901 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dibtigrdmxtev00agj7kvhw0j.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dwaqkzp5lpo1p4d3ecd5i8yp8.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dwaqkzp5lpo1p4d3ecd5i8yp8.o new file mode 100644 index 0000000..3972030 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/dwaqkzp5lpo1p4d3ecd5i8yp8.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/eu7i4mu7pdvabcdskpzpsxfk5.o b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/eu7i4mu7pdvabcdskpzpsxfk5.o new file mode 100644 index 0000000..eef8087 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/eu7i4mu7pdvabcdskpzpsxfk5.o differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/query-cache.bin b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/query-cache.bin new file mode 100644 index 0000000..58796d6 Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/query-cache.bin differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/work-products.bin b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/work-products.bin new file mode 100644 index 0000000..9363c4d Binary files /dev/null and b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2-d984srxfz1u5ygs8433jsu395/work-products.bin differ diff --git a/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2.lock b/kernel/target/debug/incremental/build_script_build-1zltxl9voyqsj/s-h4rtcz7yy3-1t1aos2.lock new file mode 100644 index 0000000..e69de29 diff --git a/linker/kernel-linker-x86_64.ld b/linker/kernel-linker-x86_64.ld new file mode 100644 index 0000000..4522a7e --- /dev/null +++ b/linker/kernel-linker-x86_64.ld @@ -0,0 +1,63 @@ +/* Tell the linker that we want an x86_64 ELF64 output file */ +OUTPUT_FORMAT(elf64-x86-64) + +/* We want the symbol kmain to be our entry point */ +ENTRY(kmain) + +/* Define the program headers we want so the bootloader gives us the right */ +/* MMU permissions; this also allows us to exert more control over the linking */ +/* process. */ +PHDRS +{ + text PT_LOAD; + rodata PT_LOAD; + data PT_LOAD; +} + +SECTIONS +{ + /* We want to be placed in the topmost 2GiB of the address space, for optimisations */ + /* and because that is what the Limine spec mandates. */ + /* Any address in this region will do, but often 0xffffffff80000000 is chosen as */ + /* that is the beginning of the region. */ + . = 0xffffffff80000000; + + .text : { + *(.text .text.*) + } :text + + /* Move to the next memory page for .rodata */ + . = ALIGN(CONSTANT(MAXPAGESIZE)); + + .rodata : { + *(.rodata .rodata.*) + } :rodata + + /* Move to the next memory page for .data */ + . = ALIGN(CONSTANT(MAXPAGESIZE)); + + .data : { + *(.data .data.*) + + /* Place the sections that contain the Limine requests as part of the .data */ + /* output section. */ + KEEP(*(.requests_start_marker)) + KEEP(*(.requests)) + KEEP(*(.requests_end_marker)) + } :data + + /* NOTE: .bss needs to be the last thing mapped to :data, otherwise lots of */ + /* unnecessary zeros will be written to the binary. */ + /* If you need, for example, .init_array and .fini_array, those should be placed */ + /* above this. */ + .bss : { + *(.bss .bss.*) + *(COMMON) + } :data + + /* Discard .note.* and .eh_frame* since they may cause issues on some hosts. */ + /DISCARD/ : { + *(.eh_frame*) + *(.note .note.*) + } +} \ No newline at end of file