Loading ...
Sorry, an error occurred while loading the content.

init of the page0 section

Expand Messages
  • yann gouy
    Hi so we have won the Euro 2000, we are the Champions! but I found a problem. when making the .S19 out of the Elf, it appears that the part of the page0
    Message 1 of 8 , Jul 3, 2000
    View Source
    • 0 Attachment
      Hi

      so we have won the Euro 2000, we are the Champions!



      but I found a problem. when making the .S19 out of the
      Elf, it appears that the part of the page0
      corresponding to the soft-registers is initialized by
      default.
      can't it be done by the crt1.o? because it isn't good
      to have a supposely initialised section in embedded
      system and it downloads over my own downloader.

      is anyone got a similar problem?

      regards,






      ___________________________________________________________
      Do You Yahoo!?
      Achetez, vendez! À votre prix! Sur http://encheres.yahoo.fr
    • Enoch Wexler
      ... There s no code to initialize the soft registers (IIRC). In fact, one has to link at the end a `bss_end.s module to get the bss area cleared as C expects:
      Message 2 of 8 , Jul 3, 2000
      View Source
      • 0 Attachment
        --- In gnu-m68hc11@egroups.com, yann gouy <yann_gouy@y...> wrote:
        > but I found a problem. when making the .S19 out of the
        > Elf, it appears that the part of the page0
        > corresponding to the soft-registers is initialized by
        > default.

        There's no code to initialize the soft registers (IIRC).

        In fact, one has to link at the end a `bss_end.s' module to get the
        bss area cleared as C expects:

        .sect .install3,"ax",@progbits
        zapbss: clra
        ldx #__bss_start
        0: staa 0,x
        inx
        cpx #__bss_end
        blo 0b

        .sect .bss,"aw",@nobits
        __bss_end:

        Another comment concerning init, the OBJCOPY_OPTIONS when generating
        S19 should not include --remove-section=.data as one of Stephane's
        examples shows or the data section won't get properly initialized.

        Cheers, Enoch.
      • Franco De Angelis
        ... Does anybody know how to generate a binary file which can be burned directly into an EPROM? Is it just a matter of OBJCOPY_OPTIONS or some conversion
        Message 3 of 8 , Jul 3, 2000
        View Source
        • 0 Attachment
          > Another comment concerning init, the OBJCOPY_OPTIONS when generating
          > S19 should not include --remove-section=.data as one of Stephane's
          > examples shows or the data section won't get properly initialized.

          Does anybody know how to generate a binary file which can be burned directly
          into an EPROM?

          Is it just a matter of OBJCOPY_OPTIONS or some conversion program is needed?

          Thanks,
          Franco
          --
          e-mail: fda@...
        • Clifford Heath
          ... You don t even need to use objcopy, you can just ld --oformat binary . I set up make with rules that make file.s19, file.elf or file.bin directly with
          Message 4 of 8 , Jul 3, 2000
          View Source
          • 0 Attachment
            > Does anybody know how to generate a binary file which can be burned directly
            > into an EPROM?

            > Is it just a matter of OBJCOPY_OPTIONS or some conversion program is needed?

            You don't even need to use objcopy, you can just "ld --oformat binary".
            I set up "make" with rules that make file.s19, file.elf or file.bin directly
            with ld, seems easier that relying on conversions afterwards.

            BTW, for those who are wondering where the discussion about a Linux
            program like PCBUG11, Yann and I have been working on it without telling
            the list. The talker is written and working, although it can only reside
            in page0 at present and uses all of it (hence Yann's request), and we're
            starting on adding code to DL11 that controls the talker. When a good
            library of routines has been added, I'll call them from the gdbserver
            code and we'll have a working gdb port.

            --
            Clifford Heath, Open Software Associates, Ph +613 9895 2194, Fax 9895 2020
            56-60 Rutland Rd (or PO Box 625), Box Hill 3128, Melbourne, VIC, Australia.
            mailto:cjh@... http://www.osa.com.au/~cjh
          • Franco De Angelis
            ... I ve tried... if I do it on an assembler test program, it works, but it generates a 64 Kb bin file, while my EPROM is 8 Kb (shouldn t the EPROM size be
            Message 5 of 8 , Jul 10, 2000
            View Source
            • 0 Attachment
              >> Does anybody know how to generate a binary file which can be burned directly
              >> into an EPROM?

              > You don't even need to use objcopy, you can just "ld --oformat binary".
              > I set up "make" with rules that make file.s19, file.elf or file.bin directly
              > with ld, seems easier that relying on conversions afterwards.

              I've tried... if I do it on an assembler test program, it works, but it
              generates a 64 Kb bin file, while my EPROM is 8 Kb (shouldn't the EPROM size be
              implied by the memory.x file?)

              If I try to use ld directly in a C program, i.e. change this:

              test.out: $(TEST_OBJS)
              $(CC) $(LDFLAGS) -o test.out $(TEST_OBJS)

              with this:

              test.bin: $(TEST_OBJS)
              $(LD) -m m68hc11elfb --oformat binary -o test.bin $(TEST_OBJS)

              I get a bunch of undefined symbols, including _start and all the Z* soft
              registers... which library am I missing?

              Franco
              --
              e-mail: fda@...
            • Clifford Heath
              Franco, I can t answer all your questions, but perhaps some. ... I think that the binary format starts at address zero. If your EPROM is from (say) address
              Message 6 of 8 , Jul 10, 2000
              View Source
              • 0 Attachment
                Franco,

                I can't answer all your questions, but perhaps some.

                > I've tried... if I do it on an assembler test program, it works, but
                > it generates a 64 Kb bin file, while my EPROM is 8 Kb (shouldn't the
                > EPROM size be implied by the memory.x file?)

                I think that the binary format starts at address zero. If your EPROM
                is from (say) address $E000 to $FFFF then the binary file will contain
                56Kb of padding - I'm guessing that's why your assembler test program
                generates a 64Kb file. You can extract the bit you want using "dd".
                See the man pages, but something like
                "dd bs=1k skip=56 < file.bin > file.eprom" should work.

                > test.bin: $(TEST_OBJS)
                > $(LD) -m m68hc11elfb --oformat binary -o test.bin $(TEST_OBJS)
                > I get a bunch of undefined symbols, including _start and all the Z* soft
                > registers... which library am I missing?

                libc. There are two ways around this:

                1) Add linker options to the CC command line, like "-Wl,--oformat=binary".
                2) Use gcc -v to get the actual link command, and change that.

                --
                Clifford Heath, Open Software Associates, mailto:cjh@...,
                Ph +613 9895 2194, Fax 9895 2020, <http://www.osa.com.au/~cjh>,
                56-60 Rutland Rd, Box Hill 3128, Melbourne, Victoria, Australia.
              • Victor Sanchez
                ... Clifford is right about what is happening. My board has the EEPROM at 0xf000 and RAM at 0x0800, changing the memory.x file was the solution: MEMORY { page0
                Message 7 of 8 , Jul 11, 2000
                View Source
                • 0 Attachment
                  El Mon, 10 Jul 2000, escribiste:
                  > Franco,
                  >
                  > I can't answer all your questions, but perhaps some.
                  >
                  > > I've tried... if I do it on an assembler test program, it works, but
                  > > it generates a 64 Kb bin file, while my EPROM is 8 Kb (shouldn't the
                  > > EPROM size be implied by the memory.x file?)
                  >

                  Clifford is right about what is happening. My board has the EEPROM at 0xf000
                  and RAM at 0x0800, changing the memory.x file was the solution:

                  MEMORY
                  {
                  page0 (rwx) : ORIGIN = 0x0, LENGTH = 256
                  text (rx) : ORIGIN = 0xf000, LENGTH = 0x0dff
                  data : ORIGIN = 0x0800, LENGTH = 0x03ff
                  }
                  PROVIDE (_stack = 0x0bff);


                  Victor

                  > I think that the binary format starts at address zero. If your EPROM
                  > is from (say) address $E000 to $FFFF then the binary file will contain
                  > 56Kb of padding - I'm guessing that's why your assembler test program
                  > generates a 64Kb file. You can extract the bit you want using "dd".
                  > See the man pages, but something like
                  > "dd bs=1k skip=56 < file.bin > file.eprom" should work.
                  >
                  > > test.bin: $(TEST_OBJS)
                  > > $(LD) -m m68hc11elfb --oformat binary -o test.bin $(TEST_OBJS)
                  > > I get a bunch of undefined symbols, including _start and all the Z* soft
                  > > registers... which library am I missing?
                  >
                  > libc. There are two ways around this:
                  >
                  > 1) Add linker options to the CC command line, like "-Wl,--oformat=binary".
                  > 2) Use gcc -v to get the actual link command, and change that.
                  >
                  > --
                  > Clifford Heath, Open Software Associates, mailto:cjh@...,
                  > Ph +613 9895 2194, Fax 9895 2020, <http://www.osa.com.au/~cjh>,
                  > 56-60 Rutland Rd, Box Hill 3128, Melbourne, Victoria, Australia.
                  >
                  > ------------------------------------------------------------------------
                  > Free Worldwide Calling with Firetalk!
                  > Click Here:
                  > http://click.egroups.com/1/5481/6/_/279954/_/963271720/
                  > ------------------------------------------------------------------------
                  >
                  > To Post a message, send it to: gnu-m68hc11@...
                  >
                  > To Unsubscribe, send a blank message to: gnu-m68hc11-unsubscribe@...
                • Franco De Angelis
                  Hi! ... Yes, correct! ... That works, ... and that works too! Thanxs! Franco -- e-mail: fda@ied.unipr.it
                  Message 8 of 8 , Jul 11, 2000
                  View Source
                  • 0 Attachment
                    Hi!

                    > I think that the binary format starts at address zero. If your EPROM
                    > is from (say) address $E000 to $FFFF then the binary file will contain
                    > 56Kb of padding

                    Yes, correct!

                    > but something like
                    > "dd bs=1k skip=56 < file.bin > file.eprom" should work.

                    That works,

                    > Add linker options to the CC command line, like "-Wl,--oformat=binary".

                    and that works too!

                    Thanxs!
                    Franco
                    --
                    e-mail: fda@...
                  Your message has been successfully submitted and would be delivered to recipients shortly.