Draw on VESA for console using ransid

This commit is contained in:
Jeremy Soller 2016-09-01 11:51:33 -06:00
parent 53c71d9183
commit d7d61f82af
10 changed files with 87 additions and 52 deletions

View file

@ -92,17 +92,11 @@ pub unsafe extern fn kstart() -> ! {
assert_eq!(TDATA_TEST_NONZERO, 0xFFFFFFFFFFFFFFFE);
}
// Initialize devices
device::init(&mut active_table);
// Reset AP variables
AP_COUNT.store(0, Ordering::SeqCst);
BSP_READY.store(false, Ordering::SeqCst);
HEAP_FRAME.store(0, Ordering::SeqCst);
// Read ACPI tables, starts APs
acpi::init(&mut active_table);
// Map heap
{
let heap_start_page = Page::containing_address(VirtualAddress::new(HEAP_START));
@ -129,6 +123,12 @@ pub unsafe extern fn kstart() -> ! {
}
}
// Initialize devices
device::init(&mut active_table);
// Read ACPI tables, starts APs
acpi::init(&mut active_table);
BSP_READY.store(true, Ordering::SeqCst);
}
@ -165,9 +165,6 @@ pub unsafe extern fn kstart_ap(stack_start: usize, stack_end: usize) -> ! {
assert_eq!(TDATA_TEST_NONZERO, 0xFFFFFFFFFFFFFFFE);
}
// Init devices for AP
device::init_ap(&mut active_table);
// Map heap
{
let heap_start_page = Page::containing_address(VirtualAddress::new(HEAP_START));
@ -187,6 +184,9 @@ pub unsafe extern fn kstart_ap(stack_start: usize, stack_end: usize) -> ! {
entry.set(frame, entry::PRESENT | entry::WRITABLE);
}
}
// Init devices for AP
device::init_ap(&mut active_table);
}
let ap_number = AP_COUNT.fetch_add(1, Ordering::SeqCst);
@ -195,9 +195,5 @@ pub unsafe extern fn kstart_ap(stack_start: usize, stack_end: usize) -> ! {
interrupt::pause();
}
if let Some(ref mut display) = *device::display::DISPLAY.lock() {
display.char(0, ap_number * 16, (ap_number as u8 + b'0') as char, 0xFF00);
}
kmain_ap(ap_number);
}