0

I'm competing Brokenthorn Osdev seriese tutorials where I create a stage1.bin (assembled by nasm) and put it to first sector of disk using dd. Its job is to load stage2 bootloader (also assembled by nasm and pasted on disk). Until now I was loading a PE file (the kernel) compiled by Visual Studio and it was working fine but now I've build Kernel using gcc which creates elf file. I got this elf file's entry point address but when I call this address it doesn't execute file. Upon reading it with READELF command I found out and the field ENTRY (which contains entry point address of elf file) was set to 0. How can I load an enter image description hereelf file when its entry address is 0?

Amir Khan
  • 43
  • 5
  • Possible duplicate of https://stackoverflow.com/questions/13908276/loading-elf-file-in-c-in-user-space – xmojmr Nov 26 '18 at 13:22
  • 1
    You are looking at the contents of an ELF object. Did you link your files into an ELF executable? – Michael Petch Nov 26 '18 at 15:39
  • I realy don't know much about ELF files. As you mentioned above, I don't know difference between ELF objects and linking to ELF executable (I'll appreciate if you explain these terms a bit). I created a .c file and compiled it using gcc cross compiler which generates ELF output file. – Amir Khan Nov 26 '18 at 16:40

0 Answers0