diff --git a/asm/long_mode_init.asm b/asm/long_mode_init.asm index 1b5b95a..2ef3f98 100644 --- a/asm/long_mode_init.asm +++ b/asm/long_mode_init.asm @@ -11,7 +11,7 @@ long_mode_start: mov fs, ax mov gs, ax - extern rust_main ; make the jump to Rust! + extern rust_main ; call rust call rust_main mov rax, 0x2f592f412f4b2f4f diff --git a/asm/multiboot_header.asm b/asm/multiboot_header.asm index 8fb6a00..6421a5c 100644 --- a/asm/multiboot_header.asm +++ b/asm/multiboot_header.asm @@ -1,6 +1,6 @@ section .multiboot_header header_start: - dd 0xe85250d6 ; magic number multiboot 2 + dd 0xe85250d6 ; magic number multiboot dd 0 ; magic number protected mode i386 dd header_end - header_start ; header length ; checksum diff --git a/package.nix b/package.nix index 61d7d5b..dabec5b 100644 --- a/package.nix +++ b/package.nix @@ -65,6 +65,7 @@ in mkdir $out/bin -p cp oxidos $out/bin/oxidos + cp kernel.bin $out/kernel.bin cp os.iso $out/os.iso ''; diff --git a/src/alloc/mod.rs b/src/alloc/mod.rs deleted file mode 100644 index 12b01fe..0000000 --- a/src/alloc/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -use core::alloc::{GlobalAlloc, Layout}; -use core::ptr::null_mut; - -pub struct Allocator; -unsafe impl GlobalAlloc for Allocator { - unsafe fn alloc(&self, _layout: Layout) -> *mut u8 { - return null_mut(); - } - unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {} -} diff --git a/src/lib.rs b/src/lib.rs index 5e293d5..e8577a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,28 +3,11 @@ use core::panic::PanicInfo; -use crate::alloc::Allocator; - -mod alloc; mod vga; -#[global_allocator] -static ALLOCATOR: Allocator = Allocator {}; - #[unsafe(no_mangle)] pub extern "C" fn rust_main(multiboot_information_address: usize) { - loop { - println!("this"); - println!("is"); - println!("a"); - println!("multi"); - println!("line"); - println!("test"); - println!("that"); - println!("goes"); - println!("on"); - println!("forever"); - } + println!("Hello World!"); } #[panic_handler]