From fdf1dfb231f61ac2afe868c4bc65586c0a085275 Mon Sep 17 00:00:00 2001 From: John Hodge <tpg@mutabah.net> Date: Sun, 17 Mar 2019 09:23:00 +0800 Subject: [PATCH] Kernel - Minor tweaks for a potential xargo build --- Kernel/Core/arch/amd64/target.json | 1 + Kernel/Core/arch/mod.rs | 3 ++- Kernel/Core/main.rs | 2 +- Kernel/Modules/virtio/devices/mod.rs | 3 ++- Kernel/main/main.rs | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Kernel/Core/arch/amd64/target.json b/Kernel/Core/arch/amd64/target.json index 516194c9..5a9fed70 100644 --- a/Kernel/Core/arch/amd64/target.json +++ b/Kernel/Core/arch/amd64/target.json @@ -6,6 +6,7 @@ "target-pointer-width": "64", "target-word-size": "64", "target-c-int-width": "32", + "features": "-mmx,-sse,+soft-float", "os": "tifflin", "arch": "x86_64", "linker-flavor": "ld", diff --git a/Kernel/Core/arch/mod.rs b/Kernel/Core/arch/mod.rs index 7df266c7..f213b0a9 100644 --- a/Kernel/Core/arch/mod.rs +++ b/Kernel/Core/arch/mod.rs @@ -5,6 +5,7 @@ #[macro_use] #[cfg_attr(arch="amd64", path="amd64/mod.rs")] +#[cfg_attr(target_arch="x86_64", path="amd64/mod.rs")] #[cfg_attr(arch="armv7", path="armv7/mod.rs")] #[cfg_attr(arch="armv8", path="armv8/mod.rs")] #[cfg_attr(test, path="imp-test.rs")] @@ -13,7 +14,7 @@ pub mod imp; // Needs to be pub for exports to be avaliable // If on x86/amd64, import ACPI -#[cfg(arch="amd64")] +#[cfg(any(arch="amd64", target_arch="x86_64"))] pub use self::imp::acpi; diff --git a/Kernel/Core/main.rs b/Kernel/Core/main.rs index e9fe6db3..ba50f221 100644 --- a/Kernel/Core/main.rs +++ b/Kernel/Core/main.rs @@ -45,7 +45,7 @@ pub use arch::memory::PAGE_SIZE; #[doc(hidden)] #[macro_use] pub mod macros; #[doc(hidden)] -#[macro_use] #[cfg(arch="amd64")] #[path="arch/amd64/mod-macros.rs"] pub mod arch_macros; +#[macro_use] #[cfg(any(arch="amd64", target_arch="x86_64"))] #[path="arch/amd64/mod-macros.rs"] pub mod arch_macros; /// Kernel's version of 'std::prelude' pub mod prelude; diff --git a/Kernel/Modules/virtio/devices/mod.rs b/Kernel/Modules/virtio/devices/mod.rs index 6448f958..a347888e 100644 --- a/Kernel/Modules/virtio/devices/mod.rs +++ b/Kernel/Modules/virtio/devices/mod.rs @@ -22,7 +22,8 @@ pub fn new_boxed<T: Interface+Send+Sync+'static>(dev_id: u32, int: T) -> Box<dev Box::new(NullDevice) } 2 => Box::new( block::BlockDevice::new(int) ), // 2 = Block device - 16 => Box::new( video::VideoDevice::new(int) ), // 16 = Graphics Adapter + // DISABLED: Changing video modes breaks stuff currently... + //16 => Box::new( video::VideoDevice::new(int) ), // 16 = Graphics Adapter dev @ _ => { log_error!("VirtIO device has unknown device ID {:#x}", dev); Box::new(NullDevice) diff --git a/Kernel/main/main.rs b/Kernel/main/main.rs index 9891f709..d3dc9a30 100644 --- a/Kernel/main/main.rs +++ b/Kernel/main/main.rs @@ -317,8 +317,8 @@ enum ArchValues { ARMv7 = 3, ARMv8 = 4, } -#[cfg(arch="amd64")] const ARCH: ArchValues = ArchValues::AMD64; -#[cfg(arch="amd64")] const LOAD_MAX: usize = 1 << 47; +#[cfg(any(arch="amd64",target_arch="x86_64"))] const ARCH: ArchValues = ArchValues::AMD64; +#[cfg(any(arch="amd64",target_arch="x86_64"))] const LOAD_MAX: usize = 1 << 47; #[cfg(arch="armv7")] const ARCH: ArchValues = ArchValues::ARMv7; #[cfg(arch="armv7")] const LOAD_MAX: usize = (1 << 31) - (4 << 20); // Leave 4MB for the kernel to control within the user table #[cfg(arch="armv8")] const ARCH: ArchValues = ArchValues::ARMv8; -- GitLab