Initial commit for Syscalls
authorAnselm Busse <anselm.busse@tu-berlin.de>
Mon, 18 Jan 2016 11:58:13 +0000 (12:58 +0100)
committerAnselm Busse <anselm.busse@tu-berlin.de>
Wed, 20 Jan 2016 10:20:59 +0000 (11:20 +0100)
framework/os/linux/Makefile
framework/os/linux/os_syscall.c [new file with mode: 0644]
framework/usr/cobas [new file with mode: 0755]
framework/usr/cobas.c [new file with mode: 0644]
linux/Makefile
linux/initramfs.conf.tmpl
linux/qemu_root/usr/bin/cobas [new file with mode: 0755]

index 94bd5cd..8bdc9fa 100644 (file)
@@ -1,4 +1,4 @@
-obj-y += linux_sched.o os.o os_kdb.o os_lock.o os_sched.o
+obj-y += linux_sched.o os.o os_kdb.o os_lock.o os_sched.o os_syscall.o
 obj-y += ../../lib/fw.o \
                 ../../lib/fw_comm.o \
                 ../../lib/fw_list.o \
diff --git a/framework/os/linux/os_syscall.c b/framework/os/linux/os_syscall.c
new file mode 100644 (file)
index 0000000..11f161b
--- /dev/null
@@ -0,0 +1,10 @@
+#include <fw.h>
+
+#include <linux/syscalls.h>
+
+SYSCALL_DEFINE2(sched_notify, unsigned int, topic, void __user *, info)
+{
+       fw_printf("called CoBaS notification syscall for topic %d.\n", topic);
+
+       return 0;
+}
diff --git a/framework/usr/cobas b/framework/usr/cobas
new file mode 100755 (executable)
index 0000000..1290f68
Binary files /dev/null and b/framework/usr/cobas differ
diff --git a/framework/usr/cobas.c b/framework/usr/cobas.c
new file mode 100644 (file)
index 0000000..a819b59
--- /dev/null
@@ -0,0 +1,11 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main(int argc, char *argv[])
+{
+       return syscall(400,0,0,0);
+}
\ No newline at end of file
index 9e66a7e..3783c29 100644 (file)
@@ -31,6 +31,10 @@ BB_SOURCES = http://www.busybox.net/downloads/$(BB_PACKAGE)
 BB_DIR     = busybox
 BB_BIN     = $(BB_DIR)/busybox
 
+# User-Space tool
+US_NAME = cobas
+US_BIN = $(PWD)/../framework/usr/$(US_NAME)
+
 # GIT
 GIT_ARCHIVE = archive --remote=git:projects/modsched/$(DEV_DIR).git HEAD:linux/
 
@@ -41,7 +45,7 @@ MAKE_DIR = $(shell pwd)
 CPU_CORES ?= 16
 
 # Dependencies
-PREREQ_CONFIG = $(INITRAMFS_CONFIG) $(BB_BIN) $(KERNEL_CONFIG)
+PREREQ_CONFIG = $(INITRAMFS_CONFIG) $(BB_BIN) $(KERNEL_CONFIG) $(US_BIN)
 
 
 
@@ -159,3 +163,5 @@ $(BUILD_DIR)/.config: $(KERNEL_CONFIG)
        fi; \
        $(CP) $< $@
 
+$(US_BIN): $(US_BIN).c
+       $(CC) -static $< -o $@
\ No newline at end of file
index 3fbce18..4d73f65 100644 (file)
@@ -33,6 +33,7 @@ file /lib64/librt.so.1 ===HOME===/qemu_root/lib64/librt.so.1 755 0 0
 file /lib64/ld-linux-x86-64.so.2 ===HOME===/qemu_root/lib64/ld-linux-x86-64.so.2 755 0 0
 file /etc/terminfo/l/linux /etc/terminfo/l/linux 644 0 0
 slink /usr/share/terminfo/l/linux /etc/terminfo/l/linux 644 0 0
+file /usr/bin/cobas ===HOME===/qemu_root/usr/bin/cobas 755 0 0
 file /usr/bin/htop ===HOME===/qemu_root/usr/bin/htop 755 0 0
 file /usr/bin/stress ===HOME===/qemu_root/usr/bin/stress 755 0 0
 file /usr/bin/cyclictest ===HOME===/qemu_root/usr/bin/cyclictest 755 0 0
diff --git a/linux/qemu_root/usr/bin/cobas b/linux/qemu_root/usr/bin/cobas
new file mode 100755 (executable)
index 0000000..1290f68
Binary files /dev/null and b/linux/qemu_root/usr/bin/cobas differ