Forum > Other OS
help needed - m68k embedded based on 3.2.2
FPK:
Wrong/no linker script? Check the .elf with objdump -x
PascalDragon:
--- Quote from: parc_de on February 19, 2022, 07:00:27 pm ---- you have to create an own system.pas (which I have done now)
--- End quote ---
The embedded target already provides a System unit.
parc_de:
Well, its more than difficult to get through this topic - too many documentation pages with old content and not valid any more.
I just wanted to check, if I could get the following program to build an executable:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program test; var a: Int32; begin a := 2; a := a + 2 + 2;end.
with the following command:
ppcross68k test.pas -O1 -a -Cp68000 -Tembedded -e/home/mf/fpc-3.2.2/m68k-none-elf/bin
The hardware has nothing to do with linux or other operating system. Its bare metal programing ... embedded.
I get a test.elf, but with no content. For all the other files (system.pas) the compiler produces *.o files. The test.o file seems to have a good content:
Disassembly of section .text.n_main:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---00000000 <main>: 0: 4e56 0000 linkw %fp,#0 4: 4eb9 0000 0000 jsr 0 <main> a: 7002 moveq #2,%d0 c: 7006 moveq #6,%d0 e: 4eb9 0000 0000 jsr 0 <main> 14: 4e5e unlk %fp 16: 4e75 rts
and this is the test.s:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- .file "test.pas"# Begin asmlist al_procedures .section .text.n_main .balignw 4,0x4e71.globl PASCALMAINPASCALMAIN:.globl mainmain: link.w %a6,#0 jbsr fpc_initializeunits moveq.l #2,%d0 moveq.l #6,%d0 jbsr fpc_do_exit unlk %a6 rts.Le0:....
FPK:
--- Quote from: parc_de on February 20, 2022, 09:17:20 pm ---Well, its more than difficult to get through this topic - too many documentation pages with old content and not valid any more.
--- End quote ---
Which ones? As m68k-embedded was never officially supported so far, I doubt there are official docs about?
--- Quote ---The hardware has nothing to do with linux or other operating system. Its bare metal programing ... embedded.
I get a test.elf, but with no content. For all the other files (system.pas) the compiler produces *.o files. The test.o file seems to have a good content:
--- End quote ---
Yes, compiler/systems/t_embed.pas creates no linker script for m68k, see line 259+.
parc_de:
--- Quote from: FPK on February 20, 2022, 09:41:06 pm ---
Yes, compiler/systems/t_embed.pas creates no linker script for m68k, see line 259+.
--- End quote ---
So, this answer seems to indicate, that it is possible to get it working ? Do you have an example how such a linker script may look like for this simple example - so I could build it by hand or at least get a starting point ?
Marten
Navigation
[0] Message Index
[#] Next page
[*] Previous page