Boris wrote:
Was your kernel built with mcmodel kernel ?
Check your OS loader.
Check your app loader..
Check the red zone was disabled ! ( especially in libgcc if you use gcc)
How do you do system calls ? ints ?
Try embedding an small app in the kernel ( in a special section ) and run it
> Was your kernel built with mcmodel kernel ?
no
>Check your OS loader.
>Check your app loader.
os loader is ok to load elf kernel and non-elf kernel, both can run normally, except that elf kernel has problem to run app.
i have tried to bypass app loader. pls see below
> How do you do system calls ? ints ?
actually there is no syscalls, since there is no user space at all, everything is running in kernel mode, so syscall is just implemented using the call instruction
> Try embedding an small app in the kernel ( in a special section ) and run it
below is the code i tried, still have the issue.
vv_dest_addr equ 0x0000000000800000
vv_exec:
mov rsi, vv_machine_code
mov rdi, vv_dest_addr
mov rcx, 8
rep movsq
call vv_dest_addr ; will hang up here with elf kernel, ok with non-elf version
mov rsi, vv_success_msg
call kernel_print_msg
jmp kernel_command_prompt
vv_success_msg dw 'success', 13, 0
vv_machine_code dw 0x486f, .... ; compiled code by nasm, source: mov rax 0x12345
times 64 - ($ - vv_machine_code) db 0