grub.mk mdr
This commit is contained in:
parent
ee5f2780e5
commit
5f40aeeae5
4 changed files with 5 additions and 20 deletions
|
|
@ -6,5 +6,4 @@ $(grub-iso): $(kernel) $(grub-cfg) Makefile
|
||||||
@mkdir -p $(isodir)/boot/grub
|
@mkdir -p $(isodir)/boot/grub
|
||||||
@cp $(grub-cfg) $(isodir)/boot/grub
|
@cp $(grub-cfg) $(isodir)/boot/grub
|
||||||
@cp $(kernel) $(isodir)/boot/$(OS)
|
@cp $(kernel) $(isodir)/boot/$(OS)
|
||||||
@grub-mkrescue -o $@ $(isodir) 2>/dev/null
|
grub-mkrescue -o $@ $(isodir) 2>/dev/null
|
||||||
@printf "\r\033[38;5;117m✓ GRUB ==> $(grub-iso)\033[0m\033[K\n"
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ align 4096
|
||||||
p2_table:
|
p2_table:
|
||||||
resb 4096
|
resb 4096
|
||||||
stack_bottom:
|
stack_bottom:
|
||||||
resb 4096 * 3
|
resb 4096 * 4
|
||||||
stack_top:
|
stack_top:
|
||||||
|
|
||||||
section .gdt
|
section .gdt
|
||||||
|
|
|
||||||
|
|
@ -33,23 +33,10 @@ pub unsafe extern "C" fn x86_rust_start(multiboot_info_addr: usize) {
|
||||||
// set up physical allocator
|
// set up physical allocator
|
||||||
::memory::init(&boot_info);
|
::memory::init(&boot_info);
|
||||||
|
|
||||||
// let memory_map_tag = boot_info.memory_map_tag().expect("Memory map tag required");
|
|
||||||
// println!("memory areas:");
|
|
||||||
// for area in memory_map_tag.memory_areas() {
|
|
||||||
// println!(
|
|
||||||
// " start: {:#x}, end: {:#x} length: {:#x}",
|
|
||||||
// area.start_address(),
|
|
||||||
// area.end_address(),
|
|
||||||
// area.size()
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// flush!();
|
|
||||||
// asm!("hlt");
|
|
||||||
|
|
||||||
// set up virtual addressing (paging)
|
// set up virtual addressing (paging)
|
||||||
let mut active_table = paging::init(&boot_info);
|
let mut active_table = paging::init(&boot_info);
|
||||||
|
|
||||||
// fill and load idt (exceptions + irqs)
|
// load idt (exceptions + irqs)
|
||||||
idt::init();
|
idt::init();
|
||||||
|
|
||||||
// set up heap
|
// set up heap
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,9 @@ pub fn kmain() -> ! {
|
||||||
// *(0xdead as *mut u32) = 42;
|
// *(0xdead as *mut u32) = 42;
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// vga is specific to chipset not cpu
|
// vga is *not* cpu specific, chipset specific?
|
||||||
vga::init();
|
vga::init();
|
||||||
|
|
||||||
// loop { keyboard::kbd_callback(); }
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,7 +80,7 @@ pub extern "C" fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line:
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const HEAP_START: usize = (2 << 22); //third entry of p2
|
pub const HEAP_START: usize = (1 << 22 + 2); //third entry of p2
|
||||||
pub const HEAP_SIZE: usize = 10 * 4096 * 8; //~ 100 KiB
|
pub const HEAP_SIZE: usize = 10 * 4096 * 8; //~ 100 KiB
|
||||||
|
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue