Enable PCI initialization for matal, update mips crate and user app repo

Signed-off-by: Harry Chen <i@harrychen.xyz>
master
Harry Chen 6 years ago
parent 067d4d1193
commit 358e682bad

8
kernel/Cargo.lock generated

@ -229,8 +229,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "mips" name = "mips"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/Harry-Chen/rust-mips#7410a6aa107fce681378e7850c03f9b6befec2d2" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -372,7 +372,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 (git+https://github.com/Harry-Chen/rust-mips)", "mips 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"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)",
"paste 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.5 (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)",
@ -688,7 +688,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 (git+https://github.com/Harry-Chen/rust-mips)" = "<none>" "checksum mips 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4cbf449a63e4db77af9f662d6b42068c0925e779a3a7c70ad02f191cf1e6c802"
"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"

@ -78,7 +78,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 = { git = "https://github.com/Harry-Chen/rust-mips" } mips = "^0.2.0"
paste = "0.1" paste = "0.1"
[package.metadata.bootimage] [package.metadata.bootimage]

@ -33,7 +33,7 @@ pub fn init_serial_early() {
pub fn init_driver() { pub fn init_driver() {
// TODO: add possibly more drivers // TODO: add possibly more drivers
vga::init(0xbbe00000, 0xb2050000, 800, 600); vga::init(0xbbe00000, 0xb2050000, 800, 600);
// pci::init(); pci::init();
fb::init(); fb::init();
} }

@ -19,6 +19,7 @@ const VBE_DISPI_INDEX_VIDEO_MEMORY_64K : u16 = 0xa;
const VGA_AR_PAS : u8 = 0x20; const VGA_AR_PAS : u8 = 0x20;
const VBE_DISPI_ENABLED : u16 = 0x01; const VBE_DISPI_ENABLED : u16 = 0x01;
const VBE_DISPI_8BIT_DAC : u16 = 0x20;
const VBE_DISPI_LFB_ENABLED : u16 = 0x40; const VBE_DISPI_LFB_ENABLED : u16 = 0x40;
const PCI_COMMAND: u8 = 0x04; const PCI_COMMAND: u8 = 0x04;
@ -89,10 +90,11 @@ pub fn init(pci_base: usize, vga_base: usize, x_res: u16, y_res: u16) {
debug!("VGA Endianess: {:x}", read::<u32>(vga_base + 0x604)); debug!("VGA Endianess: {:x}", read::<u32>(vga_base + 0x604));
// unblank vga output // unblank vga output
vga_read_io(0x3DA);
vga_write_io(VGA_AR_ADDR, VGA_AR_PAS); vga_write_io(VGA_AR_ADDR, VGA_AR_PAS);
debug!("VGA AR: {}", vga_read_io(VGA_AR_ADDR)); debug!("VGA AR: {}", vga_read_io(VGA_AR_ADDR));
vga_write_vbe(VBE_DISPI_INDEX_ENABLE, 0);
// set resolution and color depth // set resolution and color depth
vga_write_vbe(VBE_DISPI_INDEX_XRES, x_res); vga_write_vbe(VBE_DISPI_INDEX_XRES, x_res);
vga_write_vbe(VBE_DISPI_INDEX_YRES, y_res); vga_write_vbe(VBE_DISPI_INDEX_YRES, y_res);
@ -106,7 +108,7 @@ pub fn init(pci_base: usize, vga_base: usize, x_res: u16, y_res: u16) {
// enable vbe // enable vbe
let vbe_enable = vga_read_vbe(VBE_DISPI_INDEX_ENABLE); let vbe_enable = vga_read_vbe(VBE_DISPI_INDEX_ENABLE);
vga_write_vbe(VBE_DISPI_INDEX_ENABLE, vbe_enable | VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED); vga_write_vbe(VBE_DISPI_INDEX_ENABLE, vbe_enable | VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED | VBE_DISPI_8BIT_DAC);
debug!("VBE Status: {:04x}", vga_read_vbe(VBE_DISPI_INDEX_ENABLE)); debug!("VBE Status: {:04x}", vga_read_vbe(VBE_DISPI_INDEX_ENABLE));
info!("QEMU STDVGA driver initialized @ {:x}", vga_base); info!("QEMU STDVGA driver initialized @ {:x}", vga_base);

@ -1 +1 @@
Subproject commit 07619a48d4e8051766c294d9d616337869e4c1a0 Subproject commit 2c80f1e46fbd6808b80bee9b7fbbb24c11afd29d
Loading…
Cancel
Save