Fix compilation errors in drivers

Signed-off-by: Harry Chen <i@harrychen.xyz>
master
Harry Chen 6 years ago
parent e8071b5d50
commit 9f7f82a72d

10
kernel/Cargo.lock generated

@ -230,7 +230,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "mips" name = "mips"
version = "0.1.0" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/Harry-Chen/rust-mips#8b8cbacb08aaaef93837d46599ce21759ef481de"
dependencies = [
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "nodrop" name = "nodrop"
@ -322,7 +326,7 @@ dependencies = [
"isomorphic_drivers 0.1.0 (git+https://github.com/rcore-os/isomorphic_drivers)", "isomorphic_drivers 0.1.0 (git+https://github.com/rcore-os/isomorphic_drivers)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mips 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "mips 0.1.0 (git+https://github.com/Harry-Chen/rust-mips)",
"once 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "once 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pc-keyboard 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "pc-keyboard 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pci 0.0.1 (git+https://github.com/rcore-os/pci-rs)", "pci 0.0.1 (git+https://github.com/rcore-os/pci-rs)",
@ -622,7 +626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
"checksum managed 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcec5e97041c7f0f1c5b7d93f12e57293c831c646f4cc7a5db59460c7ea8de6" "checksum managed 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcec5e97041c7f0f1c5b7d93f12e57293c831c646f4cc7a5db59460c7ea8de6"
"checksum mips 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f79c54c0ff7e933ffe5b3ec7c3c05037b654c334b0c98e66536d2d8906435394" "checksum mips 0.1.0 (git+https://github.com/Harry-Chen/rust-mips)" = "<none>"
"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
"checksum once 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "931fb7a4cf34610cf6cbe58d52a8ca5ef4c726d4e2e178abd0dc13a6551c6d73" "checksum once 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "931fb7a4cf34610cf6cbe58d52a8ca5ef4c726d4e2e178abd0dc13a6551c6d73"
"checksum os_bootinfo 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "66481dbeb5e773e7bd85b63cd6042c30786f834338288c5ec4f3742673db360a" "checksum os_bootinfo 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "66481dbeb5e773e7bd85b63cd6042c30786f834338288c5ec4f3742673db360a"

@ -27,9 +27,9 @@ nographic = []
board_raspi3 = ["bcm2837", "link_user"] board_raspi3 = ["bcm2837", "link_user"]
raspi3_use_generic_timer = ["bcm2837/use_generic_timer"] raspi3_use_generic_timer = ["bcm2837/use_generic_timer"]
# for mipsel qemu malta machine # for mipsel qemu malta machine
board_malta = [] board_malta = ["link_user"]
# for thinpad # for thinpad
board_thinpad = [] board_thinpad = ["link_user"]
# Hard link user program # Hard link user program
link_user = [] link_user = []
# Run cmdline instead of user shell, useful for automatic testing # Run cmdline instead of user shell, useful for automatic testing
@ -77,7 +77,7 @@ aarch64 = { git = "https://github.com/rcore-os/aarch64" }
bcm2837 = { git = "https://github.com/rcore-os/bcm2837", optional = true } bcm2837 = { git = "https://github.com/rcore-os/bcm2837", optional = true }
[target.'cfg(target_arch = "mips")'.dependencies] [target.'cfg(target_arch = "mips")'.dependencies]
mips = "^0.1.0" mips = { git = "https://github.com/Harry-Chen/rust-mips" }
[package.metadata.bootimage] [package.metadata.bootimage]
default-target = "targets/x86_64.json" default-target = "targets/x86_64.json"

@ -1,13 +0,0 @@
//! stub frame buffer driver for malta board
use spin::Mutex;
lazy_static! {
pub static ref FRAME_BUFFER: Mutex<Option<Framebuffer>> = Mutex::new(None);
}
pub struct Framebuffer {}
pub struct FramebufferInfo {}
pub enum ColorDepth {}

@ -1,6 +1,8 @@
use once::*; use once::*;
use alloc::string::String;
pub mod serial; pub mod serial;
#[path = "../../../../drivers/gpu/fb.rs"]
pub mod fb; pub mod fb;
#[path = "../../../../drivers/console/mod.rs"] #[path = "../../../../drivers/console/mod.rs"]
pub mod console; pub mod console;
@ -17,3 +19,7 @@ pub fn init_driver() {
// TODO: add possibly more drivers // TODO: add possibly more drivers
// timer::init(); // timer::init();
} }
pub fn probe_fb_info(width: u32, height: u32, depth: u32) -> Result<(fb::FramebufferInfo, usize), String> {
Err(String::from("Framebuffer not usable on malta board"))
}

@ -34,7 +34,7 @@ impl SerialPort {
} }
/// non-blocking version of putchar() /// non-blocking version of putchar()
fn putchar(&mut self, c: u8) { pub fn putchar(&mut self, c: u8) {
write(self.base + COM_TX, c); write(self.base + COM_TX, c);
} }
@ -88,7 +88,7 @@ fn write<T>(addr: usize, content: T) {
fn read<T>(addr: usize) -> T { fn read<T>(addr: usize) -> T {
let cell = (addr) as *const T; let cell = (addr) as *const T;
read_volatile(cell); read_volatile(cell)
} }

@ -19,7 +19,7 @@ pub fn init_driver() {
// timer::init(); // timer::init();
} }
pub fn probe_fb_info(width: u32, height: u32, depth: u32) -> Result<(FramebufferInfo, u32), String> { pub fn probe_fb_info(width: u32, height: u32, depth: u32) -> Result<(FramebufferInfo, usize), String> {
let fb_info = FramebufferInfo { let fb_info = FramebufferInfo {
xres: 800, xres: 800,
yres: 600, yres: 600,

@ -72,7 +72,7 @@ fn others_main() -> ! {
crate::kmain(); crate::kmain();
} }
const BOOT_CPU_ID: usize = 0; const BOOT_CPU_ID: u32 = 0;
global_asm!(include_str!("boot/entry.S")); global_asm!(include_str!("boot/entry.S"));
global_asm!(include_str!("boot/trap.S")); global_asm!(include_str!("boot/trap.S"));

Loading…
Cancel
Save