summaryrefslogtreecommitdiff
path: root/Source/Applications
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-18 12:35:07 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-18 12:35:07 +0200
commitbc2eccdd11c27029096fb3e891073503eb269e27 (patch)
tree555c2a56c810af5a292dbe270ad9c12dc0f17993 /Source/Applications
parent22c06556ccbd07f4ef7da39a62d10e03fbee3fe0 (diff)
downloadMelon-bc2eccdd11c27029096fb3e891073503eb269e27.tar.gz
Melon-bc2eccdd11c27029096fb3e891073503eb269e27.zip
We can now load ELF binaries !!!
Diffstat (limited to 'Source/Applications')
-rw-r--r--Source/Applications/ASMApps/Makefile20
-rw-r--r--Source/Applications/ASMApps/testbin92 -> 0 bytes
-rw-r--r--Source/Applications/SampleApps/Makefile29
-rwxr-xr-xSource/Applications/SampleApps/asmdemobin0 -> 4725 bytes
-rw-r--r--Source/Applications/SampleApps/asmdemo.asm (renamed from Source/Applications/ASMApps/test.asm)2
-rw-r--r--Source/Applications/SampleApps/lib-melonasm.asm (renamed from Source/Applications/ASMApps/syscalls.asm)6
6 files changed, 36 insertions, 21 deletions
diff --git a/Source/Applications/ASMApps/Makefile b/Source/Applications/ASMApps/Makefile
deleted file mode 100644
index 8cc8bfd..0000000
--- a/Source/Applications/ASMApps/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-.PHONY: clean, mrproper
-
-ASM = nasm
-
-Applications = test
-
-all: $(Applications)
- echo "* Done with ASM applications : $(Applications)"
-
-rebuild: mrproper all
-
-%: %.asm
- echo "* Compiling $<..."
- $(ASM) -o $@ $<
-
-clean:
- echo "* Removing files..."
- rm -rf $(Applications)
-
-mrproper: clean
diff --git a/Source/Applications/ASMApps/test b/Source/Applications/ASMApps/test
deleted file mode 100644
index 781a4b6..0000000
--- a/Source/Applications/ASMApps/test
+++ /dev/null
Binary files differ
diff --git a/Source/Applications/SampleApps/Makefile b/Source/Applications/SampleApps/Makefile
new file mode 100644
index 0000000..28dad49
--- /dev/null
+++ b/Source/Applications/SampleApps/Makefile
@@ -0,0 +1,29 @@
+.PHONY: clean, mrproper
+
+ASM = nasm
+ASMFLAGS = -f elf
+LD = ld
+LDFLAGS = --entry=start -Ttext=40000000
+
+Applications = asmdemo
+
+all: $(Applications)
+ echo "* Done with applications : $(Applications)"
+
+rebuild: mrproper all
+
+%: %.o
+ echo "* Linking $<..."
+ $(LD) $(LDFLAGS) $< -o $@
+
+%.o: %.asm
+ echo "* Compiling $<..."
+ $(ASM) $(ASMFLAGS) -o $@ $<
+
+clean:
+ echo "* Removing object files..."
+ rm -rf *.o
+
+mrproper: clean
+ echo "* Removing applications..."
+ rm -rf $(Applications)
diff --git a/Source/Applications/SampleApps/asmdemo b/Source/Applications/SampleApps/asmdemo
new file mode 100755
index 0000000..9e6822d
--- /dev/null
+++ b/Source/Applications/SampleApps/asmdemo
Binary files differ
diff --git a/Source/Applications/ASMApps/test.asm b/Source/Applications/SampleApps/asmdemo.asm
index a79d4a3..3037897 100644
--- a/Source/Applications/ASMApps/test.asm
+++ b/Source/Applications/SampleApps/asmdemo.asm
@@ -1,4 +1,4 @@
-%include "syscalls.asm"
+%include "lib-melonasm.asm"
start: ; label used for calculating app size
mov ecx, [data]
diff --git a/Source/Applications/ASMApps/syscalls.asm b/Source/Applications/SampleApps/lib-melonasm.asm
index 1a634d7..0845770 100644
--- a/Source/Applications/ASMApps/syscalls.asm
+++ b/Source/Applications/SampleApps/lib-melonasm.asm
@@ -1,6 +1,7 @@
[bits 32]
%ifidn __OUTPUT_FORMAT__, bin
+; create a MelonBinary output
%define MEM_ORIGIN 0x10000000
@@ -11,6 +12,11 @@ dd MEM_ORIGIN
; the ($-$$) permits not taking into account the header above
[org MEM_ORIGIN - ($-$$)]
+%elifidn __OUTPUT_FORMAT__, elf
+; create an elf object
+
+[global start]
+
%endif
%define SC_PUTCH 0xFFFFFF01