Index: apps/helloworld/ls.x |
— | — | @@ -1,10 +1,10 @@ |
2 | | -ENTRY(__embios_executable_hdr)
|
| 2 | +ENTRY(__emcore_entrypoint)
|
3 | 3 | OUTPUT_FORMAT(elf32-littlearm)
|
4 | 4 | OUTPUT_ARCH(arm)
|
5 | 5 |
|
6 | 6 | MEMORY
|
7 | 7 | {
|
8 | | - RAM : ORIGIN = 0x08000000, LENGTH = 0x01f00000
|
| 8 | + VIRTUAL : ORIGIN = 0x00000000, LENGTH = 0x10000000
|
9 | 9 | }
|
10 | 10 |
|
11 | 11 | SECTIONS
|
— | — | @@ -11,17 +11,21 @@ |
12 | 12 | {
|
13 | 13 | .text :
|
14 | 14 | {
|
15 | | - KEEP(.execheader*)
|
16 | | - *(.execheader*)
|
| 15 | + KEEP(.emcoreentrypoint*)
|
| 16 | + *(.emcoreentrypoint*)
|
17 | 17 | *(.text*)
|
18 | 18 | *(.glue_7)
|
19 | 19 | *(.glue_7t)
|
20 | 20 | . = ALIGN(0x4);
|
| 21 | + } > VIRTUAL
|
| 22 | +
|
| 23 | + .data :
|
| 24 | + {
|
21 | 25 | *(.rodata*)
|
22 | 26 | . = ALIGN(0x4);
|
23 | 27 | *(.data*)
|
24 | 28 | . = ALIGN(0x4);
|
25 | | - } > RAM
|
| 29 | + } > VIRTUAL
|
26 | 30 |
|
27 | 31 | .bss (NOLOAD) :
|
28 | 32 | {
|
— | — | @@ -29,8 +33,7 @@ |
30 | 34 | *(.bss*)
|
31 | 35 | *(COMMON)
|
32 | 36 | __bss_end = .;
|
33 | | - *(.stack*)
|
34 | | - } > RAM
|
| 37 | + } > VIRTUAL
|
35 | 38 |
|
36 | 39 | /DISCARD/ :
|
37 | 40 | {
|
Index: apps/helloworld/main.c |
— | — | @@ -1,8 +1,8 @@ |
2 | | -#include "embiosapp.h"
|
| 2 | +#include "emcoreapp.h"
|
3 | 3 |
|
4 | 4 |
|
5 | 5 | void main();
|
6 | | -EMBIOS_APP_HEADER("Test application", 0x4000, main, 127)
|
| 6 | +EMCORE_APP_HEADER("Hello world", main, 127)
|
7 | 7 |
|
8 | 8 |
|
9 | 9 | void main()
|
Index: apps/helloworld/Makefile |
— | — | @@ -1,16 +1,18 @@ |
2 | 2 | NAME := helloworld
|
| 3 | +STACKSIZE := 4096
|
| 4 | +COMPRESS := false
|
3 | 5 |
|
4 | | -EMBIOSDIR ?= ../../embios/trunk/
|
| 6 | +EMCOREDIR ?= ../../emcore/trunk/
|
5 | 7 |
|
6 | | -CROSS ?= arm-none-eabi-
|
| 8 | +CROSS ?= arm-elf-eabi-
|
7 | 9 | CC := $(CROSS)gcc
|
8 | 10 | AS := $(CROSS)as
|
9 | 11 | LD := $(CROSS)ld
|
10 | 12 | OBJCOPY := $(CROSS)objcopy
|
11 | | -UCLPACK := ucl2e10singleblk
|
| 13 | +ELF2ECA := $(CROSS)elf2emcoreapp
|
12 | 14 |
|
13 | | -CFLAGS += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMBIOSDIR)/export -ffunction-sections -fdata-sections -mcpu=arm940t
|
14 | | -LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --gc-sections
|
| 15 | +CFLAGS += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMCOREDIR)/export -ffunction-sections -fdata-sections -mcpu=arm940t
|
| 16 | +LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" -d -r --gc-sections
|
15 | 17 |
|
16 | 18 | preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#")
|
17 | 19 | preprocesspaths = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:")
|
— | — | @@ -18,7 +20,7 @@ |
19 | 21 | REVISION := $(shell svnversion .)
|
20 | 22 | REVISIONINT := $(shell echo $(REVISION) | sed -e "s/[^0-9].*$$//")
|
21 | 23 |
|
22 | | -HELPERS := build/__embios_armhelpers.o
|
| 24 | +HELPERS := build/__emcore_armhelpers.o
|
23 | 25 |
|
24 | 26 | SRC := $(call preprocesspaths,SOURCES,-I. -I..)
|
25 | 27 | OBJ := $(SRC:%.c=build/%.o)
|
— | — | @@ -28,22 +30,22 @@ |
29 | 31 |
|
30 | 32 | -include $(OBJ:%=%.dep)
|
31 | 33 |
|
32 | | -$(NAME): build/$(NAME).embiosapp.ucl
|
| 34 | +$(NAME): build/$(NAME).emcoreapp
|
33 | 35 |
|
34 | | -build/$(NAME).embiosapp.ucl: build/$(NAME).embiosapp
|
35 | | - @echo [UCL] $<
|
36 | | - @$(UCLPACK) $^ $@
|
| 36 | +build/$(NAME).emcoreapp: build/$(NAME).elf
|
| 37 | + @echo "[EMCAPP] $<"
|
| 38 | +ifeq ($(COMPRESS),true)
|
| 39 | + @$(ELF2ECA) -z -s $(STACKSIZE) -o $@ $^
|
| 40 | +else
|
| 41 | + @$(ELF2ECA) -s $(STACKSIZE) -o $@ $^
|
| 42 | +endif
|
37 | 43 |
|
38 | | -build/$(NAME).embiosapp: build/$(NAME).elf
|
39 | | - @echo [OC] $<
|
40 | | - @$(OBJCOPY) -O binary $^ $@
|
41 | | -
|
42 | 44 | build/$(NAME).elf: ls.x $(OBJ)
|
43 | | - @echo [LD] $@
|
| 45 | + @echo "[LD] $@"
|
44 | 46 | @$(LD) $(LDFLAGS) -o $@ -T ls.x $(OBJ)
|
45 | 47 |
|
46 | 48 | build/%.o: %.c build/version.h
|
47 | | - @echo [CC] $<
|
| 49 | + @echo "[CC] $<"
|
48 | 50 | ifeq ($(shell uname),WindowsNT)
|
49 | 51 | @-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
|
50 | 52 | else
|
— | — | @@ -60,7 +62,7 @@ |
61 | 63 | @rm -f $@.dep.tmp
|
62 | 64 |
|
63 | 65 | build/%.o: %.S build/version.h
|
64 | | - @echo [CC] $<
|
| 66 | + @echo "[CC] $<"
|
65 | 67 | ifeq ($(shell uname),WindowsNT)
|
66 | 68 | @-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
|
67 | 69 | else
|
— | — | @@ -76,8 +78,8 @@ |
77 | 79 | endif
|
78 | 80 | @rm -f $@.dep.tmp
|
79 | 81 |
|
80 | | -build/__embios_%.o: $(EMBIOSDIR)/export/%.S
|
81 | | - @echo [CC] $<
|
| 82 | +build/__emcore_%.o: $(EMCOREDIR)/export/%.S
|
| 83 | + @echo "[CC] $<"
|
82 | 84 | ifeq ($(shell uname),WindowsNT)
|
83 | 85 | @-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
|
84 | 86 | else
|
— | — | @@ -86,7 +88,7 @@ |
87 | 89 | @$(CC) -c $(CFLAGS) -o $@ $<
|
88 | 90 |
|
89 | 91 | build/version.h: version.h .svn/entries build
|
90 | | - @echo [PP] $<
|
| 92 | + @echo "[PP] $<"
|
91 | 93 | ifeq ($(shell uname),WindowsNT)
|
92 | 94 | @sed -e "s/\$$REVISION\$$/$(REVISION)/" -e "s/\$$REVISIONINT\$$/$(REVISIONINT)/" < $< > $@
|
93 | 95 | else
|