Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.development > #9580

Re: Questions about the Implementation of the ELF format

Newsgroups alt.os.development
Date 2016-05-28 20:15 -0700
References (2 earlier) <ni5b17$10pn$1@gioia.aioe.org> <d26c82e5-f9db-4247-80a7-97f5157d84e3@googlegroups.com> <20160527025559.72612eda@_> <b0063221-fd4c-4276-9ffa-da12d0bfe821@googlegroups.com> <niaesn$1t8c$1@gioia.aioe.org>
Message-ID <a577f76c-aaad-4a79-930b-ccee99b3f9e2@googlegroups.com> (permalink)
Subject Re: Questions about the Implementation of the ELF format
From "Isaac D. Cohen" <8switchsoftware@gmail.com>

Show all headers | View raw


Mike Gonta wrote:
> "Isaac D. Cohen" wrote:
>> Rod Pemberton wrote:
>>> "Isaac D. Cohen" wrote:
>>>> So how can we create a pure binary kernel?
>>> A more important question might be, "Why do you want
>>> one?" ...
 
>> Well, originally, that's what I wanted to do.
 
> No it's not.

No use arguing over facts.

> "Isaac D. Cohen" wrote:
>>>>> In any case, I'm trying to figure out how to include C/C++
>>>>> in my operating system. So I googled around and found that
>>>>> I have to cross-compile the C/C++ file into some kind of
>>>>> format, for example ELF. So my first question is, why? Why
>>>>> can't the compiler just generate plain binary files?

> The compiler generates object files and the linker produces
> the binary.
 
>> But when I has many questions about ELF Mike suggested
>> that I use plain binary....

> It's simple to link the ELF object file to produce a plain
> binary (and no knowledge of ELF is required).
 
>> ....so that I can simply jump to the address at which I
>> loaded the file rather than having to read all those
>> headers first.

> I thought that others (as well as yourself) might be
> interested in how to do things by "not following the rules".

I tried building a kernel as you say (i.e. compiling into ELFs and then linking
into binary) and jumping to the address at which I loaded the kernel, but it
caused a page fault. I would guess that the reason for this is because the file
has some kind of format or another (not ELF) and just jumping to the beginning of
it is making the CPU execute something that is not code (or the wrong code).

Thank you very much,
Isaac D. Cohen

"Religion is an illusion and it derives its strength from the fact that it falls
in with our instinctual desires." - Sigmund Freud

Back to alt.os.development | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Questions about the Implementation of the ELF format "Isaac D. Cohen" <8switchsoftware@gmail.com> - 2016-05-23 22:07 -0700
  Re: Questions about the Implementation of the ELF format Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-24 03:48 -0400
  Questions about the Implementation of the ELF format Peter Cheung <mcheung63@gmail.com> - 2016-05-24 01:10 -0700
  Re: Questions about the Implementation of the ELF format "Alexei A. Frounze" <alexfrunews@gmail.com> - 2016-05-24 01:18 -0700
  Re: Questions about the Implementation of the ELF format "Mike Gonta" <mikegonta@gmail.com> - 2016-05-24 10:34 -0400
  Re: Questions about the Implementation of the ELF format Herbert Kleebauer <klee@unibwm.de> - 2016-05-24 17:24 +0200
  Re: Questions about the Implementation of the ELF format "Isaac D. Cohen" <8switchsoftware@gmail.com> - 2016-05-24 14:18 -0700
    Re: Questions about the Implementation of the ELF format "Alexei A. Frounze" <alexfrunews@gmail.com> - 2016-05-25 02:21 -0700
  Re: Questions about the Implementation of the ELF format "Isaac D. Cohen" <8switchsoftware@gmail.com> - 2016-05-25 15:02 -0700
    Re: Questions about the Implementation of the ELF format "Mike Gonta" <mikegonta@gmail.com> - 2016-05-25 19:03 -0400
      Re: Questions about the Implementation of the ELF format "Isaac D. Cohen" <8switchsoftware@gmail.com> - 2016-05-26 14:51 -0700
        Re: Questions about the Implementation of the ELF format Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-27 02:55 -0400
          Re: Questions about the Implementation of the ELF format "Isaac D. Cohen" <8switchsoftware@gmail.com> - 2016-05-27 13:43 -0700
            Re: Questions about the Implementation of the ELF format "Mike Gonta" <mikegonta@gmail.com> - 2016-05-27 17:40 -0400
              Re: Questions about the Implementation of the ELF format "Isaac D. Cohen" <8switchsoftware@gmail.com> - 2016-05-28 20:15 -0700
                Re: Questions about the Implementation of the ELF format Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-29 02:35 -0400
                Re: Questions about the Implementation of the ELF format "Isaac D. Cohen" <8switchsoftware@gmail.com> - 2016-06-15 13:51 -0700
        Re: Questions about the Implementation of the ELF format Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-27 03:09 -0400
        Re: Questions about the Implementation of the ELF format "Alexei A. Frounze" <alexfrunews@gmail.com> - 2016-05-27 00:10 -0700
        Re: Questions about the Implementation of the ELF format Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-06-02 16:25 -0400
      Re: Questions about the Implementation of the ELF format Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-27 02:38 -0400
        Re: Questions about the Implementation of the ELF format "Mike Gonta" <mikegonta@gmail.com> - 2016-05-27 04:11 -0400
    Re: Questions about the Implementation of the ELF format "Alexei A. Frounze" <alexfrunews@gmail.com> - 2016-05-25 22:18 -0700

csiph-web