summaryrefslogtreecommitdiff
path: root/Source/Applications
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-17 23:22:41 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-17 23:22:41 +0200
commit7dc8c19f7d6220c9e3dac43796faf77c4f11974f (patch)
tree7a63b88ed80583198776ce706f85d528eff28b16 /Source/Applications
parente35e95188674ae4802df2a511825218253d01d2c (diff)
downloadMelon-7dc8c19f7d6220c9e3dac43796faf77c4f11974f.tar.gz
Melon-7dc8c19f7d6220c9e3dac43796faf77c4f11974f.zip
Melon now loads a simple ASM application out of the ramfs
The format is very simple, but an ELF loader is planned.
Diffstat (limited to 'Source/Applications')
-rw-r--r--Source/Applications/ASMApps/Makefile20
-rw-r--r--Source/Applications/ASMApps/syscalls.asm7
-rw-r--r--Source/Applications/ASMApps/testbin0 -> 62 bytes
-rw-r--r--Source/Applications/ASMApps/test.asm20
4 files changed, 47 insertions, 0 deletions
diff --git a/Source/Applications/ASMApps/Makefile b/Source/Applications/ASMApps/Makefile
new file mode 100644
index 0000000..8cc8bfd
--- /dev/null
+++ b/Source/Applications/ASMApps/Makefile
@@ -0,0 +1,20 @@
+.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/syscalls.asm b/Source/Applications/ASMApps/syscalls.asm
new file mode 100644
index 0000000..cdd5cc6
--- /dev/null
+++ b/Source/Applications/ASMApps/syscalls.asm
@@ -0,0 +1,7 @@
+[bits 32]
+
+dd 0xFEEDBEEF ; magic number ^^
+dd end - start
+
+%define SC_PUTCH 0xFFFFFF01
+%define SC_SLEEP 0xFFFFFF02
diff --git a/Source/Applications/ASMApps/test b/Source/Applications/ASMApps/test
new file mode 100644
index 0000000..397abf1
--- /dev/null
+++ b/Source/Applications/ASMApps/test
Binary files differ
diff --git a/Source/Applications/ASMApps/test.asm b/Source/Applications/ASMApps/test.asm
new file mode 100644
index 0000000..80965b4
--- /dev/null
+++ b/Source/Applications/ASMApps/test.asm
@@ -0,0 +1,20 @@
+%include "syscalls.asm"
+
+start:
+ mov ecx, ' '
+ loop:
+ inc ecx
+ mov eax, SC_PUTCH ;temporarily defined for writing one char to screen
+ mov ebx, ecx
+ int 64
+ mov eax, SC_SLEEP ;temporary syscall for sleeping
+ mov ebx, 30 ;20ms
+ int 64
+ cmp ecx, 127
+ jnz loop
+ mov eax, 0
+ mov eax, SC_PUTCH
+ mov ebx, 10 ;newline
+ int 64
+ int 66 ;finish task
+end: