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.
I am not there with the implementation yet, but am thinking about the design of the second-stage boot loader for my 64 bit OS. This is probably a simple yes/no answer, but can I do the following from 64-bit compatiblity mode:
AJ wrote:I am not there with the implementation yet, but am thinking about the design of the second-stage boot loader for my 64 bit OS. This is probably a simple yes/no answer, but can I do the following from 64-bit compatiblity mode:
Simple answer is "no" - a (32-bit or 16-bit) compatability code segment in long mode can't use REX prefixes, and therefore can't use 64-bit addressing.
The more complex answer would be that you might be able to fake it by doing a SYSCALL (without any SYSRET) or a software interrupt (without any IRET), where the target code removes anything the CPU pushed on the stack. This is probably more hassle than it's worth though...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
As I hadn't used syscall/sysret before, I was a little unsure about what to do here. For anyone else trying the same thing, I have just implemented the syscall mechanism to call my kernel which is at 0xF000000000 from 32 bit code and it works very nicely.