mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Run rustfmt
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
|
use lazy_static::lazy_static;
|
||||||
use x86_64::structures::gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector};
|
use x86_64::structures::gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector};
|
||||||
use x86_64::structures::tss::TaskStateSegment;
|
use x86_64::structures::tss::TaskStateSegment;
|
||||||
use x86_64::VirtAddr;
|
use x86_64::VirtAddr;
|
||||||
use lazy_static::lazy_static;
|
|
||||||
|
|
||||||
pub const DOUBLE_FAULT_IST_INDEX: u16 = 0;
|
pub const DOUBLE_FAULT_IST_INDEX: u16 = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#![cfg(not(windows))]
|
#![cfg(not(windows))]
|
||||||
|
|
||||||
use crate::{gdt, print, println};
|
use crate::{gdt, print, println};
|
||||||
|
use lazy_static::lazy_static;
|
||||||
use pic8259_simple::ChainedPics;
|
use pic8259_simple::ChainedPics;
|
||||||
use spin;
|
use spin;
|
||||||
use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable, PageFaultErrorCode};
|
use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable, PageFaultErrorCode};
|
||||||
use lazy_static::lazy_static;
|
|
||||||
|
|
||||||
pub const PIC_1_OFFSET: u8 = 32;
|
pub const PIC_1_OFFSET: u8 = 32;
|
||||||
pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8;
|
pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8;
|
||||||
@@ -74,9 +74,9 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: &mut ExceptionSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut ExceptionStackFrame) {
|
extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut ExceptionStackFrame) {
|
||||||
use x86_64::instructions::port::Port;
|
use pc_keyboard::{layouts, DecodedKey, Keyboard, ScancodeSet1};
|
||||||
use pc_keyboard::{Keyboard, ScancodeSet1, DecodedKey, layouts};
|
|
||||||
use spin::Mutex;
|
use spin::Mutex;
|
||||||
|
use x86_64::instructions::port::Port;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref KEYBOARD: Mutex<Keyboard<layouts::Us104Key, ScancodeSet1>> =
|
static ref KEYBOARD: Mutex<Keyboard<layouts::Us104Key, ScancodeSet1>> =
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#![cfg_attr(not(test), no_std)] // don't link the Rust standard library
|
#![cfg_attr(not(test), no_std)] // don't link the Rust standard library
|
||||||
#![feature(abi_x86_interrupt)]
|
#![feature(abi_x86_interrupt)]
|
||||||
|
|
||||||
pub mod vga_buffer;
|
|
||||||
pub mod gdt;
|
pub mod gdt;
|
||||||
pub mod interrupts;
|
pub mod interrupts;
|
||||||
pub mod serial;
|
pub mod serial;
|
||||||
|
pub mod vga_buffer;
|
||||||
|
|
||||||
pub unsafe fn exit_qemu() {
|
pub unsafe fn exit_qemu() {
|
||||||
use x86_64::instructions::port::Port;
|
use x86_64::instructions::port::Port;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ pub extern "C" fn _start() -> ! {
|
|||||||
println!("Hello World{}", "!");
|
println!("Hello World{}", "!");
|
||||||
|
|
||||||
let level_4_table_ptr = 0xffff_ffff_ffff_f000 as *const PageTable;
|
let level_4_table_ptr = 0xffff_ffff_ffff_f000 as *const PageTable;
|
||||||
let level_4_table = unsafe {&*level_4_table_ptr};
|
let level_4_table = unsafe { &*level_4_table_ptr };
|
||||||
for i in 0..10 {
|
for i in 0..10 {
|
||||||
println!("Entry {}: {:?}", i, level_4_table[i]);
|
println!("Entry {}: {:?}", i, level_4_table[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
use lazy_static::lazy_static;
|
||||||
use spin::Mutex;
|
use spin::Mutex;
|
||||||
use uart_16550::SerialPort;
|
use uart_16550::SerialPort;
|
||||||
use lazy_static::lazy_static;
|
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref SERIAL1: Mutex<SerialPort> = {
|
pub static ref SERIAL1: Mutex<SerialPort> = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
use lazy_static::lazy_static;
|
||||||
use spin::Mutex;
|
use spin::Mutex;
|
||||||
use volatile::Volatile;
|
use volatile::Volatile;
|
||||||
use lazy_static::lazy_static;
|
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
/// A global `Writer` instance that can be used for printing to the VGA text buffer.
|
/// A global `Writer` instance that can be used for printing to the VGA text buffer.
|
||||||
|
|||||||
Reference in New Issue
Block a user