PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|LinuxGazette|issue104.txt =

page 10 of 69



     enter PMODE.....
      ended up having to use Grub, but handed up my effort to the
     examiners, they were impressed i got it to ge tthat faer. 

      So... in a ROM, it'd go from the beginning of memory, otherwise
     it's relative to where it loaded
      If the ROM is loaded at 0

      .text is actually the code by the way, not the strings.
      and yes, but all programs see their address as 0, but the OS
     handles their requests for memory locations and adds their offset in the
     memory manager 

      The strings go in .data

      yes
      the code is put in a large offset to avoid overflows causing
     mistooks in the code. 

      So it's not necessary to specify the location, unless you have
     some weird backwards compatibility problem, or are writing an OS?

      but the OS can preempt this and actually fool the program by
     pretending it loaded the code at that offset and translating the
     addresses on the fly
      well, it is also to specify locations in writing an OS or other
     "pure application" 

      So, in short, you can't just put code wherever the heck you
     want in a modern OS?

      but a decent OS will just ignore the offsets and pretend instead
      no, the OS itself has to obey the offset rules, as the memory
     manager will not be loaded at that point. 

      I mean if that's executed in a running OS.

      so it cant pretent and every thing is relying on exact offsets
     for a form of crude task switching.
      oh, yes. 

      Like the MacOS did?

      but even without a ld script, it should still use a default set
     of offsets for linking, depending on ythe executable format, coff, elf,
     bin etc.. 

      OK, I think that'll answer the question. Do I have your formal
     permission to send this for potential publication?

      the offsets are set by default on set types of exe, so that the
     os can just go , heh I know this type, and not have to search for markers
     in the code etc.
      no, hehe I better read up and make sure its right first.. its
     been over a year. 

      Ah. Cool.
      Well, what you've said makes what I read in the LD manual make
     sense.

      oh well in that cvase.. sure.. just dont sign my name to it,
     klast thing i need is people with questions :-) or worse some git flaming
     me for not getting it quite right. 

      AT ( ldadr )
      The expression ldadr that follows the AT keyword specifies the
     load address of the section. The default (if you do not use the AT
     keyword) is to make the load address the same as the relocation address.
     This feature is designed to make it easy to build a ROM image. For
     example, this SECTIONS definition creates two output sections: one called
     `.text', which starts at 0x1000, and one called `.mdata', w
      hich is loaded at the end of the `.text' section even though
     its relocation address is 0x2000. The symbol _data is defined with the
     value 0x2000:

      but that said I think i got it right, been a while but I think i
     remember it right
      oh, good I did remember it right.. yeah, go me! 

      So, do I get a definite OK now?

      hehe I am still one of the knigits of ye olde ASM coding :-)
      yeah sure. 

      Thanks.

      you can tell me if some one flames you for getting it slightly
     skew ways,
      but it is a good enough explainatin to the question i think 

      Nah. People are generally polite in pointing out mistakes.
      God knows I've made enough of them.

      AT() is definitly the offset it gets loaded at and the x1000 is
     the size of the section, they are seperate in that one specifies
     properties of the process after its loaded and one specifies properties
     of the EXE. 

                                 ...............
            ____________________________________________________
=10=

1.4|5|6|7|8|9| < PREV = PAGE 10 = NEXT > |11|12|13|14|15|16.69

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.012558 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)