64-bit calls
Posted: Sat Nov 27, 2010 9:51 am
We are experimenting with running an application in the higher half while running the kernel in the lower half.
The begining of the kernel looks like this:
An application just needs to do a 'call 0x00100010' in order to do a print string. This works fine if you are in the first 4GiB of memory. The issue is that the call is relative so calling from the higher half this happens: 'call 0xFFFF800000100010' which doesn't work.
Why isn't there a 'call rel64' function?
Any ideas on how to call kernel functions from the higher half? 'syscall' or 'sysenter'? Everything runs in ring zero.
Thanks,
-Ian
The begining of the kernel looks like this:
Code: Select all
USE64
ORG 0x0000000000100000
%DEFINE BAREMETALOS_VER 'v0.5.0-dev (September 17, 2010)', 13, 'Copyright (C) 2010, Return Infinity', 13, 0
%DEFINE BAREMETALOS_API_VER 1
kernel_start:
jmp start ; Skip over the function call index
align 16 ; 0x0010
jmp os_print_string
align 8 ; 0x0018
jmp os_print_char
align 8 ; 0x0020
jmp os_print_char_hex
Why isn't there a 'call rel64' function?
Any ideas on how to call kernel functions from the higher half? 'syscall' or 'sysenter'? Everything runs in ring zero.
Thanks,
-Ian