mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Compare commits
23 Commits
2a0126b9d2
...
e9e75e759e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9e75e759e | ||
|
|
c6c0e1a7f0 | ||
|
|
c407c26224 | ||
|
|
3e814722d0 | ||
|
|
5b088bffeb | ||
|
|
e9ca6b83c4 | ||
|
|
62b2c8a0b5 | ||
|
|
1d0aa17531 | ||
|
|
08831b4ba1 | ||
|
|
3d94346f43 | ||
|
|
f19372d58a | ||
|
|
e4b3ed6d42 | ||
|
|
b1aec7eb66 | ||
|
|
e2a3e76a32 | ||
|
|
16bbb8f972 | ||
|
|
430e2143f8 | ||
|
|
86ffa24e8e | ||
|
|
d83ab74e53 | ||
|
|
caa829db01 | ||
|
|
168dc5c2be | ||
|
|
a6141e8d2e | ||
|
|
df0c0b5783 | ||
|
|
c27eb1da9c |
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -30,9 +30,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bootloader"
|
name = "bootloader"
|
||||||
version = "0.9.30"
|
version = "0.9.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8a9c8b93781debeb5bc44a12adc4be812aa9feb659d60eeafcd7e9bedb549561"
|
checksum = "974e79cf1b0b737839f01330fb5393095daf1124d52693696494e32523ae9ef5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = "blog_os"
|
name = "blog_os"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
|
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
|
||||||
edition = "2018"
|
edition = "2024"
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "should_panic"
|
name = "should_panic"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
use x86_64::VirtAddr;
|
||||||
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;
|
|
||||||
|
|
||||||
pub const DOUBLE_FAULT_IST_INDEX: u16 = 0;
|
pub const DOUBLE_FAULT_IST_INDEX: u16 = 0;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ struct Selectors {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
use x86_64::instructions::segmentation::{Segment, CS};
|
use x86_64::instructions::segmentation::{CS, Segment};
|
||||||
use x86_64::instructions::tables::load_tss;
|
use x86_64::instructions::tables::load_tss;
|
||||||
|
|
||||||
GDT.0.load();
|
GDT.0.load();
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFr
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStackFrame) {
|
extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStackFrame) {
|
||||||
use pc_keyboard::{layouts, DecodedKey, HandleControl, Keyboard, ScancodeSet1};
|
use pc_keyboard::{DecodedKey, HandleControl, Keyboard, ScancodeSet1, layouts};
|
||||||
use spin::Mutex;
|
use spin::Mutex;
|
||||||
use x86_64::instructions::port::Port;
|
use x86_64::instructions::port::Port;
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ pub fn hlt_loop() -> ! {
|
|||||||
|
|
||||||
/// Entry point for `cargo xtest`
|
/// Entry point for `cargo xtest`
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[no_mangle]
|
#[unsafe(no_mangle)]
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
init();
|
init();
|
||||||
test_main();
|
test_main();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
use blog_os::println;
|
use blog_os::println;
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
#[no_mangle]
|
#[unsafe(no_mangle)]
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
println!("Hello World{}", "!");
|
println!("Hello World{}", "!");
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
use blog_os::println;
|
use blog_os::println;
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
#[no_mangle] // don't mangle the name of this function
|
#[unsafe(no_mangle)] // don't mangle the name of this function
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
test_main();
|
test_main();
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
use blog_os::{exit_qemu, serial_print, serial_println, QemuExitCode};
|
use blog_os::{QemuExitCode, exit_qemu, serial_print, serial_println};
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
#[no_mangle]
|
#[unsafe(no_mangle)]
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
should_fail();
|
should_fail();
|
||||||
serial_println!("[test did not panic]");
|
serial_println!("[test did not panic]");
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(abi_x86_interrupt)]
|
#![feature(abi_x86_interrupt)]
|
||||||
|
|
||||||
use blog_os::{exit_qemu, serial_print, serial_println, QemuExitCode};
|
use blog_os::{QemuExitCode, exit_qemu, serial_print, serial_println};
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
|
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
|
||||||
|
|
||||||
#[no_mangle]
|
#[unsafe(no_mangle)]
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
serial_print!("stack_overflow::stack_overflow...\t");
|
serial_print!("stack_overflow::stack_overflow...\t");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user