Page 2 of 2

Posted: Thu Aug 23, 2007 4:06 pm
by pcmattman
JamesM wrote:ELF, because I'm using linux and every tool works with it. And GRUB supports it fully, as opposed to the kludgy-at-best support it has for AOUT. Grub can also load your ELF symbol table for you :) :) ooooh my kernel is backtrace heaven! :)
You could just export debugging information into the final binary and use GDB... Being able to debug my source instead of my disassembly is so much easier.

Posted: Fri Aug 24, 2007 2:16 am
by bluecode
I noticed I forgot to mention that I am using elf (for 32bit protected mode and for 64bit long mode).
But someday I'll try to execute a 32bit Windows executeable on my OS (and therefore support PE). But that will only be a "Hello, World!" and just for fun/out of interest...

Posted: Fri Aug 24, 2007 2:16 am
by JamesM
I really should get round to using GDB with bochs. I never actually have :$

Posted: Fri Aug 24, 2007 6:11 am
by elderK
What I'd be more interested in, would be how many of you using the ELF format completely support dynamic linking?

~Z

Posted: Fri Aug 24, 2007 6:28 am
by bluecode
zeii wrote:What I'd be more interested in, would be how many of you using the ELF format completely support dynamic linking?
Well I do not support it completely. Just to the extend I need it for shared-libraries and normal executables in my OS (both on x86 and x86-64).

Posted: Fri Aug 24, 2007 7:53 am
by JamesM
I support ELF dynamic linking - for my syscalls. I've gone for a break from the norm as far as syscalls are concerned :P

Posted: Fri Aug 24, 2007 5:41 pm
by pcmattman
JamesM wrote:I really should get round to using GDB with bochs. I never actually have :$
It's powerful, I can tell you that now... From the GDB command line I can execute any function in my kernel (in scope, of course). So I can break and then find out what pid is running by typing "currpid()".
What I'd be more interested in, would be how many of you using the ELF format completely support dynamic linking?
No, don't support it at all. Must get around to that later...

Posted: Fri Aug 24, 2007 6:19 pm
by elderK
Dynamic ELF is a doozy :)

~Z

Posted: Sat Aug 25, 2007 11:57 am
by mcheung63
how you guys do the "dynamic linking" of ELF. I searched a few days in google, no good tutorial about that. Introduce one if you have any. many thanks.
from Peter

Posted: Sat Aug 25, 2007 2:03 pm
by Combuster
I suggest you start with the ELF specification. Its not the easiest document but it contains everything you should need. After that, just experiment with it.

As for the original question: I use ELF myself, and especially the relocation info to enable multiple processes to be loaded into the same address space.

Posted: Sat Aug 25, 2007 2:31 pm
by elderK
You do realize that a large number of tutorials on the subject of Operating system design, are buggy, broken and probably not as effective for your learning, than actually struggling through it yourself, with a good spec?

(Am I right or wrong here, people?)
~Z

Posted: Sat Aug 25, 2007 2:34 pm
by JamesM
damn straight. Working it out for yourself is the way to learn. I'm writing tutorials about them anyway :P

Posted: Sun Aug 26, 2007 10:47 am
by calpol
I'm just loading a flat binary image into memory and jumping to it :?.

I should probably learn how to use these formats sometime but for now flat binary images do the job just fine and i don't like to overcomplicate thing's :mrgreen: .

Posted: Sun Aug 26, 2007 11:04 pm
by Dex
I agree with you about the keep it simple, you can easy make a simple relocatable bin file by using ebx as a add on to where you loaded the file to, even linux uses something simular.

You even use code like this

Code: Select all

example_function:

        call    _origin
    _origin:
        pop     ebx

        mov     eax,[ ebx + _const-_origin ]

        ret

_const dd 1234
But having said that, you can code a PE loader in about 20 lines of asm so you can still keep it simple.