Loading PE kernel

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
john12
Posts: 1
Joined: Tue Mar 24, 2020 10:05 am

Loading PE kernel

Post by john12 »

Hi,

I wrote a ASM bootloader with NASM and I want to switch to my C kernel (with PE headers). I searched a lot and I wrote this code

Code: Select all


xor rsi, rsi
xor r8, r8

mov rsi, [0x20000 + kernel + 0x3c] 
add rsi, 0x20000 + kernel 

; RSI has pointer to PE header
; Set r8 to Entry Point Address
lea r8, [rsi + 0x0028]
; Jump to kernel
jmp r8
I load kernel binary after kernel asm point. OS restarts every time and I dont know how to fix it.
Post Reply