Implementing Reboot System call for Long mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
rchandel
Posts: 3
Joined: Thu Apr 14, 2011 12:13 pm

Implementing Reboot System call for Long mode

Post by rchandel »

I am implementing Reboot System call, kernel is in Long mode(x86_64).

Code: Select all

Reboot:
    in   $0x64, %al
    test $0x2, %al
    jne Reboot
    mov  $0xFE, %al
    out %al, $0x64
    jmp Reboot
    sysretq
On calling reboot following error is occurring:
09 General Page fault: Coprocessor Segment Overrun exception;

what I am doing wrong here?

This method is suggested here at http://wiki.osdev.org/Reboot

Any suggestions?
rchandel
Posts: 3
Joined: Thu Apr 14, 2011 12:13 pm

Re: Implementing Reboot System call for Long mode

Post by rchandel »

Above Reboot code is working fine on AMD SimNow Emulator.
But it is not working on QEMU emulator; I am not able to figure it out yet.
Post Reply