fix warnings

This commit is contained in:
Cadey Ratio 2019-10-24 10:02:28 -04:00
parent ea8f2106b6
commit 74b603eb6c
6 changed files with 37 additions and 29 deletions

View File

@ -1,20 +0,0 @@
#[no_mangle]
extern "C" fn fmod(x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmodf(x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmin(x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fminf(x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmax(x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmaxf(x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn __truncdfsf2(x: f64) -> f32 { unimplemented!(); }

View File

@ -30,11 +30,13 @@ use core::panic::PanicInfo;
use bootloader::BootInfo;
pub fn init(boot_info: &'static BootInfo) {
println!("XeOS booting");
gdt::init();
interrupts::init_idt();
unsafe { interrupts::PICS.lock().initialize() };
x86_64::instructions::interrupts::enable();
allocator::init(&boot_info);
println!("XeOS booted");
}
pub fn hlt_loop() -> ! {

View File

@ -5,18 +5,16 @@
#![reexport_test_harness_main = "test_main"]
extern crate alloc;
mod hack;
use bootloader::{entry_point, BootInfo};
use core::panic::PanicInfo;
use xe_os::{print, println};
use xe_os::println;
entry_point!(kernel_main);
fn kernel_main(boot_info: &'static BootInfo) -> ! {
println!("booted");
xe_os::init(&boot_info);
println!("Hello World{}", "!");
#[cfg(test)]
test_main();

20
src/wasm/hack.rs Normal file
View File

@ -0,0 +1,20 @@
#[no_mangle]
extern "C" fn fmod(_x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmodf(_x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmin(_x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fminf(_x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmax(_x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmaxf(_x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn __truncdfsf2(_x: f64) -> f32 { unimplemented!(); }

View File

@ -1,10 +1,15 @@
use wasmi::{
Error as InterpreterError, Externals, FuncInstance, FuncRef, HostError, ImportsBuilder,
ModuleImportResolver, ModuleInstance, ModuleRef, RuntimeArgs, RuntimeValue, Signature, Trap,
Error as InterpreterError, Externals, FuncInstance, FuncRef, ImportsBuilder,
ModuleImportResolver, ModuleInstance, RuntimeArgs, RuntimeValue, Signature, Trap,
ValueType,
};
use crate::{print, println};
#[cfg(test)]
use crate::{serial_print, serial_println};
mod hack;
pub fn run() {
use alloc::vec::Vec;
@ -24,6 +29,13 @@ pub fn run() {
let _ = instance.invoke_export("h", &[], &mut H);
}
#[test_case]
fn test_wasm() {
serial_print!("running h example... ");
run();
serial_println!("[ok]");
}
struct H;
const H_FUNC: usize = 0;

View File

@ -12,10 +12,6 @@ use core::panic::PanicInfo;
entry_point!(main);
fn main(boot_info: &'static BootInfo) -> ! {
use xe_os::allocator;
use xe_os::memory::{self, BootInfoFrameAllocator};
use x86_64::VirtAddr;
xe_os::init(boot_info);
test_main();