./usr/tests/minix-posix/blocktest/support.sh minix-sys
./usr/tests/minix-posix/blocktest/system.conf minix-sys
./usr/tests/minix-posix/blocktest/test.sh minix-sys
+./usr/tests/minix-posix/ddekit minix-sys
+./usr/tests/minix-posix/ddekit/ddekittest minix-sys
+./usr/tests/minix-posix/ddekit/ddekittest_driver minix-sys
+./usr/tests/minix-posix/ddekit/system.conf minix-sys
./usr/tests/minix-posix/mod minix-sys pic
./usr/tests/minix-posix/run minix-sys
./usr/tests/minix-posix/t10a minix-sys
/set type=dir uid=2 gid=0 mode=755
./usr/tests/minix-posix
./usr/tests/minix-posix/blocktest
+./usr/tests/minix-posix/ddekit
# this one is for term(1)
/set type=dir uid=0 gid=5 mode=775
.include <bsd.own.mk>
-SUBDIR= blocktest
+SUBDIR+= blocktest
+SUBDIR+= ddekit
# Some have special flags compiling
.if ${MACHINE_ARCH} == "i386"
--- /dev/null
+# Makefile for the DDE kit Test driver (ddekitest)
+PROG= ddekittest_driver
+SRCS= ddekittest_driver.c
+FILES= system.conf
+SCRIPTS= ddekittest.sh
+#uncomment the following for proper debugging
+#CFLAGS+=-g
+#LDFLAGS+= -Ttext=0x4000000
+LDADD+= -lsys -lddekit -lminlib
+DPADD+= ${LIBSYS} ${LIBDDEKIT} ${LIBMINLIB}
+
+MAN=
+
+BINDIR?= /usr/tests/minix-posix/ddekit
+FILESDIR?= /usr/tests/minix-posix/ddekit
+
+.include <minix.service.mk>
--- /dev/null
+#!/bin/sh
+
+# Supporting routines for ddekit Do not run directly.
+
+# usage: run_ddekittest
+# runs the ddekit driver on the given device with the given parameters
+run_ddekittest () {
+ if [ ! -x ddekittest_driver ]; then echo "compile ddekittest first!" >&2; exit 1; fi
+ service up `pwd`/ddekittest_driver -config system.conf \
+ -script /etc/rs.single -label ddekittest
+}
+
+
+#
+# We do not have much here just calling the source run_ddekittest here
+#
+run_ddekittest
+sleep 10
+service down ddekittest
--- /dev/null
+#include <ddekit/ddekit.h>
+#include <ddekit/printf.h>
+#include <ddekit/thread.h>
+#include <ddekit/initcall.h>
+
+#include <stdio.h>
+
+void
+long_running_thread()
+{
+ int x=10;
+ do {
+ ddekit_printf("Long Running\n");
+ ddekit_thread_msleep(2000);
+ x--;
+ } while(x >0);
+}
+
+void
+short_running_thread()
+{
+ int x=15;
+ do {
+ ddekit_printf("Short Running\n");
+ ddekit_thread_msleep(500);
+ x--;
+ } while(x >0);
+}
+
+void ddekit_minix_wait_exit(void); /* import from dde-minix */
+
+#if 0
+#include <ucontext.h>
+ucontext_t ctx;
+#endif
+
+int
+main(void)
+{
+
+#if 0
+ getcontext(&ctx);
+ if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
+ printf("FLAG_NONE\n");
+ }
+
+ memset(&ctx,0,sizeof(ucontext_t));
+ ctx.uc_flags = _UC_IGNSIGM | _UC_IGNFPU;
+ getcontext(&ctx);
+ if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
+ printf("_UC_IGNSIGM | _UC_IGNFPU FAIL\n");
+ }
+
+ memset(&ctx,0,sizeof(ucontext_t));
+ ctx.uc_flags = _UC_IGNSIGM ;
+ getcontext(&ctx);
+ if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
+ printf("_UC_IGNSIGM FAIL\n");
+ }
+
+ memset(&ctx,0,sizeof(ucontext_t));
+ ctx.uc_flags = _UC_IGNFPU ;
+ getcontext(&ctx);
+ if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
+ printf("_UC_IGNFPU FAIL\n");
+ }
+#endif
+
+ ddekit_init();
+ ddekit_thread_create(long_running_thread, NULL, "Long_thread");
+ ddekit_thread_create(short_running_thread, NULL, "Short_thread");
+ ddekit_minix_wait_exit();
+
+ return 0;
+}
--- /dev/null
+service ddekittest_driver {
+ uid 0;
+ system ALL;
+ ipc ALL;
+};