remove dummy alloc

This commit is contained in:
mtgmonkey
2025-08-01 07:24:40 -04:00
parent 147702a8fa
commit 6433bb7c22
5 changed files with 4 additions and 30 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
''; '';

View File

@@ -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) {}
}

View File

@@ -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]