Commit e952096e authored by Stefan Lankes's avatar Stefan Lankes
Browse files

convert loader to Rust ediotion 2018

parent 2c18bb1a
......@@ -4,6 +4,7 @@ version = "0.2.5"
authors = ["Stefan Lankes <slankes@eonerc.rwth-aachen.de>", "Colin Finck <colin.finck@rwth-aachen.de>"]
license = "MIT/Apache-2.0"
readme = "README.md"
edition = "2018"
[dependencies]
bitflags = "1.2.*"
......
......@@ -6,7 +6,7 @@
// copied, modified, or distributed except according to those terms.
#[cfg(target_arch = "x86_64")]
pub use arch::x86_64::*;
pub use crate::arch::x86_64::*;
#[cfg(target_arch = "x86_64")]
pub mod x86_64;
......@@ -5,7 +5,7 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use arch::x86_64::SERIAL_PORT_ADDRESS;
use crate::arch::x86_64::SERIAL_PORT_ADDRESS;
use core::fmt;
#[repr(C)]
......
......@@ -11,12 +11,12 @@ pub mod processor;
pub mod serial;
pub use self::bootinfo::*;
use arch::x86_64::paging::{BasePageSize, LargePageSize, PageSize, PageTableEntryFlags};
use arch::x86_64::serial::SerialPort;
use crate::arch::x86_64::paging::{BasePageSize, LargePageSize, PageSize, PageTableEntryFlags};
use crate::arch::x86_64::serial::SerialPort;
use crate::elf::*;
use crate::physicalmem;
use core::{mem, slice};
use elf::*;
use multiboot::Multiboot;
use physicalmem;
extern "C" {
static mb_info: usize;
......
......@@ -5,8 +5,8 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::physicalmem;
use core::marker::PhantomData;
use physicalmem;
/// Pointer to the root page table (PML4)
const PML4_ADDRESS: *mut PageTable<PML4> = 0xFFFF_FFFF_FFFF_F000 as *mut PageTable<PML4>;
......
......@@ -5,7 +5,7 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use arch;
use crate::arch;
use core::fmt;
pub struct Console;
......
......@@ -37,10 +37,10 @@ mod rlib;
mod runtime_glue;
// IMPORTS
use arch::paging::{BasePageSize, LargePageSize, PageSize};
use arch::BOOT_INFO;
use crate::arch::paging::{BasePageSize, LargePageSize, PageSize};
use crate::arch::{BOOT_INFO, ELF_ARCH};
use crate::elf::*;
use core::ptr;
use elf::*;
extern "C" {
static bss_end: u8;
......@@ -65,7 +65,7 @@ pub unsafe fn check_kernel_elf_file(start_address: usize) -> (usize, usize, usiz
assert!(header.ident.data == ELF_DATA_2LSB);
assert!(header.ident.pad[0] == ELF_PAD_HERMIT);
assert!(header.ty == ELF_ET_EXEC);
assert!(header.machine == arch::ELF_ARCH);
assert!(header.machine == ELF_ARCH);
loaderlog!("This is a supported HermitCore Application");
// Get all necessary information about the ELF executable.
......
......@@ -5,7 +5,7 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use arch::paging::{BasePageSize, PageSize};
use crate::arch::paging::{BasePageSize, PageSize};
static mut CURRENT_ADDRESS: usize = 0;
......
......@@ -8,7 +8,7 @@
//! Minor functions that Rust really expects to be defined by the compiler,
//! but which we need to provide manually because we're on bare metal.
use arch;
use crate::arch;
use core::panic::PanicInfo;
#[panic_handler]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment