remove dummy alloc
This commit is contained in:
@@ -11,7 +11,7 @@ long_mode_start:
|
|||||||
mov fs, ax
|
mov fs, ax
|
||||||
mov gs, ax
|
mov gs, ax
|
||||||
|
|
||||||
extern rust_main ; make the jump to Rust!
|
extern rust_main ; call rust
|
||||||
call rust_main
|
call rust_main
|
||||||
|
|
||||||
mov rax, 0x2f592f412f4b2f4f
|
mov rax, 0x2f592f412f4b2f4f
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
section .multiboot_header
|
section .multiboot_header
|
||||||
header_start:
|
header_start:
|
||||||
dd 0xe85250d6 ; magic number multiboot 2
|
dd 0xe85250d6 ; magic number multiboot
|
||||||
dd 0 ; magic number protected mode i386
|
dd 0 ; magic number protected mode i386
|
||||||
dd header_end - header_start ; header length
|
dd header_end - header_start ; header length
|
||||||
; checksum
|
; checksum
|
||||||
|
@@ -65,6 +65,7 @@ in
|
|||||||
|
|
||||||
mkdir $out/bin -p
|
mkdir $out/bin -p
|
||||||
cp oxidos $out/bin/oxidos
|
cp oxidos $out/bin/oxidos
|
||||||
|
cp kernel.bin $out/kernel.bin
|
||||||
cp os.iso $out/os.iso
|
cp os.iso $out/os.iso
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@@ -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) {}
|
|
||||||
}
|
|
19
src/lib.rs
19
src/lib.rs
@@ -3,28 +3,11 @@
|
|||||||
|
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
use crate::alloc::Allocator;
|
|
||||||
|
|
||||||
mod alloc;
|
|
||||||
mod vga;
|
mod vga;
|
||||||
|
|
||||||
#[global_allocator]
|
|
||||||
static ALLOCATOR: Allocator = Allocator {};
|
|
||||||
|
|
||||||
#[unsafe(no_mangle)]
|
#[unsafe(no_mangle)]
|
||||||
pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
||||||
loop {
|
println!("Hello World!");
|
||||||
println!("this");
|
|
||||||
println!("is");
|
|
||||||
println!("a");
|
|
||||||
println!("multi");
|
|
||||||
println!("line");
|
|
||||||
println!("test");
|
|
||||||
println!("that");
|
|
||||||
println!("goes");
|
|
||||||
println!("on");
|
|
||||||
println!("forever");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
|
Reference in New Issue
Block a user