Fix stack trace, WIP usermode

This commit is contained in:
Jeremy Soller 2016-09-02 12:27:45 -06:00
parent eab03299be
commit f45958f449
5 changed files with 59 additions and 10 deletions

View file

@ -137,6 +137,28 @@ pub unsafe extern fn kstart() -> ! {
kmain();
}
unsafe fn usermode(ip: usize, sp: usize) {
// Test usermode
asm!("xchg bx, bx
mov rax, 0x2B
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
push rax
push rbx
pushfq
mov rax, 0x23
push rax
push rcx
iretq"
:
: "{rbx}"(sp), "{rcx}"(ip)
: "rax", "rbx", "rcx", "sp"
: "intel", "volatile");
}
/// Entry to rust for an AP
pub unsafe extern fn kstart_ap(stack_start: usize, stack_end: usize) -> ! {
{