OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Sep 26, 2020 10:36 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: linking a pei-i386 kernel file problems
PostPosted: Tue Feb 18, 2020 8:43 am 
Offline

Joined: Tue Feb 18, 2020 8:20 am
Posts: 9
Greetings everyone.
I am trying to compile and test a pm32 bit operating system on VirtualBox. The tutorial I chose is loaded by GRUB in ELF format. My development environment is on Windows7 with the Mingw32-gcc compiler. The format of my OS files is PE.
My adventure has barely started and I already have my head spinning, with the first problem. It seems to me that something is not right with linking the "ld" the data that some fields present does not seem correct, among them AddressEntryPoint, BaseCode, BaseData, SizeImage and VirtualAddress of all sections.
I did two different tests, the first:
After forming an executable file in the PE format I used ("objcopy -O binary krnl32.exe krnl32.sys") in this test everything works fine until an interruption occurs that causes a jump to the address 0xffffff0.
In the second test I use the PEI-i386 format which, in addition to the mentioned defect, now happens even without triggering an interrupt, and the data segment descriptor is pointing to .bss and not to .data,

I attached the memory map of the link, the executable file and the floppy image that can run on VirtualBox or Bochs.
Maybe someone can help me, because I don't know how to explain it better.


Attachments:
ultron.rar [14.04 KiB]
Downloaded 2 times
linker.ld [633 Bytes]
Downloaded 7 times
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: awik and 9 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