mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Use new hole_list_allocator instead of bump_allocator
This commit is contained in:
@@ -10,12 +10,14 @@ crate-type = ["staticlib"]
|
|||||||
once = "0.2.1"
|
once = "0.2.1"
|
||||||
rlibc = "0.1.4"
|
rlibc = "0.1.4"
|
||||||
spin = "0.3.4"
|
spin = "0.3.4"
|
||||||
bump_allocator = {path="libs/bump_allocator"}
|
|
||||||
|
|
||||||
[dependencies.x86]
|
[dependencies.x86]
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
||||||
|
[dependencies.hole_list_allocator]
|
||||||
|
path = "libs/hole_list_allocator"
|
||||||
|
|
||||||
[dependencies.multiboot2]
|
[dependencies.multiboot2]
|
||||||
git = "https://github.com/phil-opp/multiboot2-elf64"
|
git = "https://github.com/phil-opp/multiboot2-elf64"
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ extern crate x86;
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate once;
|
extern crate once;
|
||||||
|
|
||||||
extern crate bump_allocator;
|
extern crate hole_list_allocator;
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate collections;
|
extern crate collections;
|
||||||
@@ -46,6 +46,10 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
|||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
let heap_test = Box::new(42);
|
let heap_test = Box::new(42);
|
||||||
|
|
||||||
|
for i in 0..10000 {
|
||||||
|
format!("Some String");
|
||||||
|
}
|
||||||
|
|
||||||
println!("It did not crash!");
|
println!("It did not crash!");
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ pub fn init(boot_info: &BootInformation) {
|
|||||||
let mut active_table = paging::remap_the_kernel(&mut frame_allocator,
|
let mut active_table = paging::remap_the_kernel(&mut frame_allocator,
|
||||||
boot_info);
|
boot_info);
|
||||||
|
|
||||||
use self::paging::{Page, WRITABLE};
|
use self::paging::Page;
|
||||||
use bump_allocator::{HEAP_START, HEAP_SIZE};
|
use hole_list_allocator::{HEAP_START, HEAP_SIZE};
|
||||||
|
|
||||||
let heap_start_page = Page::containing_address(HEAP_START);
|
let heap_start_page = Page::containing_address(HEAP_START);
|
||||||
let heap_end_page = Page::containing_address(HEAP_START + HEAP_SIZE-1);
|
let heap_end_page = Page::containing_address(HEAP_START + HEAP_SIZE-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user