OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Jun 01, 2024 10:47 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Loading PE kernel
PostPosted: Tue Mar 24, 2020 10:14 am 
Offline

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

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 86 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group