flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > elf format, symbols and ld linker script |
Author |
|
FlashBurn 22 May 2006, 10:47
Ok, I found a sample script and modified it a little bit for my needs!
Code: /* Link.ld */ OUTPUT_FORMAT("elf32-i386") OUTPUT(kernel.so) ENTRY(init) SECTIONS { .text 0xc0100000 : AT ( 0x100000 ) { _code = .; *(.text) . = ALIGN(4096); } .data : AT ( 0x100000 + ( ADDR(.data) - ADDR(.text) ) ) { _data = .; *(.data) . = ALIGN(4096); } .bss : AT ( 0x100000 + ( ADDR(.bss) - ADDR(.text) ) ) { _bss = .; *(.bss) . = ALIGN(4096); } _end = .; } I haven´t tested if the code works alright. |
|||
22 May 2006, 10:47 |
|
FlashBurn 22 May 2006, 12:13
Ok, the script and the kernel are working now
I have only one problem left How can it be made that all sections except .text, .data and .bss come direct after the elf header and then these 3 section come? |
|||
22 May 2006, 12:13 |
|
MarcoAlves 19 Jun 2006, 13:10
FlashBurn, I've tried to use your ld script but with no success. I'm using
djgpp under windows. When I try to link the linker says that it can't recognize elf32-i386 format. Please, help me. Thx in advance. Best regards, Marco Alves. |
|||
19 Jun 2006, 13:10 |
|
FlashBurn 19 Jun 2006, 14:36
Show me your kernel source and then maybe I can help you.
|
|||
19 Jun 2006, 14:36 |
|
MarcoAlves 19 Jun 2006, 14:44
The kernel is attached.
It's SO simple. I'm noob yet.
|
|||||||||||
19 Jun 2006, 14:44 |
|
FlashBurn 19 Jun 2006, 19:11
1st thing is that you use djgpp and with this compiler you can´t compile for elf format! And my script isn´t something for someone who don´t have enough knowledge. I think you should use grub as bootloader and I don´t know but I think it should load coff files.
|
|||
19 Jun 2006, 19:11 |
|
MarcoAlves 19 Jun 2006, 19:38
FlashBurn, I've understood entirely your script. I'm new on asm, but senior C# .NET programmer, so I think that I can acquire the "enough knowlege" just reading, and reading and reading.
I just didn't understood why the error happens because djgpp's ld was not linking. Now, i get it. Nevertheless, thank you. |
|||
19 Jun 2006, 19:38 |
|
FlashBurn 21 Jun 2006, 18:01
Either you make yourself a crosscompiler or you use grub + coff kernel. djgpp isn´t the best solution for os deving!
|
|||
21 Jun 2006, 18:01 |
|
MarcoAlves 22 Jun 2006, 12:41
I'm downloading cygwin. Hope it help me.
|
|||
22 Jun 2006, 12:41 |
|
FlashBurn 23 Jun 2006, 14:49
I don´t know if I used mingw or cygwin for creating my crosscompiler, but I think it was mingw and I also onyl needed ld for linking, because I´m only writing in asm.
|
|||
23 Jun 2006, 14:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.