aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--bam.lua1
-rw-r--r--src/kernel/core/kmain.c2
-rwxr-xr-xsrc/tests/ktests/run_qemu_test.sh2
-rw-r--r--src/tests/utests/fs2/test.c2
-rwxr-xr-xsrc/tests/utests/run_qemu_test.sh5
-rw-r--r--src/tests/utests/subfs/test.c2
7 files changed, 11 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 47ed44a..ada41d0 100644
--- a/Makefile
+++ b/Makefile
@@ -9,14 +9,14 @@ rebuild: clean all
mrproper: clean
run_tests:
- bam
- src/tests/run_tests.sh
+ rm build/tests/*.log
+ bam test
run_qemu: all
- qemu-system-i386 -cdrom cdrom.iso -serial stdio -m 12
+ qemu-system-i386 -cdrom cdrom.iso -serial stdio -m 12 </dev/null
run_qemu_debug: all
- qemu-system-i386 -cdrom cdrom.iso -serial stdio -m 12 -s -S & \
+ qemu-system-i386 -cdrom cdrom.iso -serial stdio -m 12 -s -S </dev/null & \
(sleep 0.1; gdb src/kernel/kernel.bin -x gdb_cmd)
run_bochs_debug: all
diff --git a/bam.lua b/bam.lua
index b0c6d54..47fc5f1 100644
--- a/bam.lua
+++ b/bam.lua
@@ -19,6 +19,7 @@ host_settings.cc.Output = BuildOutput
host_settings.cc.extension = ".host.o"
host_settings.cc.includes:Add("src/lib/include/proto",
"src/common/include")
+host_settings.link.extension = ".bin"
common_settings = NewSettings()
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c
index 2774e11..99ad0d7 100644
--- a/src/kernel/core/kmain.c
+++ b/src/kernel/core/kmain.c
@@ -250,7 +250,7 @@ fs_t *setup_iofs(multiboot_info_t *mbd) {
(char*)mods[i].mod_start,
len, FM_READ | FM_MMAP));
- if (strncmp(modname, "kernel.map", 10) == 0) {
+ if (strlen(modname) > 4 && strcmp(modname + strlen(modname) - 4, ".map") == 0) {
// remark: load_kernel_symbol_map modifies the data region,
// which is not a problem because nullfs_add_ram_file copied the thing already
load_kernel_symbol_map((char*)mods[i].mod_start, len);
diff --git a/src/tests/ktests/run_qemu_test.sh b/src/tests/ktests/run_qemu_test.sh
index 92cf10a..4249a96 100755
--- a/src/tests/ktests/run_qemu_test.sh
+++ b/src/tests/ktests/run_qemu_test.sh
@@ -7,7 +7,7 @@ MAPFILE=$3
RESULTFILE=`mktemp`
PIDFILE=`mktemp`
-(timeout 10s qemu-system-i386 -kernel $BINFILE -initrd $MAPFILE -serial stdio -m 16 -display none 2>/dev/null \
+(timeout 3s qemu-system-i386 -kernel $BINFILE -initrd $MAPFILE -serial stdio -m 16 -display none 2>/dev/null \
& echo $! >$PIDFILE) \
| tee >(grep -m 1 "TEST-" >$RESULTFILE; kill -INT `cat $PIDFILE`) > $LOGFILE
diff --git a/src/tests/utests/fs2/test.c b/src/tests/utests/fs2/test.c
index 7cc5fb6..0acf11d 100644
--- a/src/tests/utests/fs2/test.c
+++ b/src/tests/utests/fs2/test.c
@@ -17,7 +17,7 @@ int main(int argc, char **argv) {
while (ent_no < 2) {
ASSERT (readdir(f, ent_no++, &x));
- ASSERT((!strcmp(x.name, "init.bin")) || (!strcmp(x.name, "kernel.map")));
+ ASSERT((!strcmp(x.name, "utest_fs2.bin")) || (!strcmp(x.name, "kernel.map")));
ASSERT(x.st.type == FT_REGULAR);
}
diff --git a/src/tests/utests/run_qemu_test.sh b/src/tests/utests/run_qemu_test.sh
index eb535ac..e806501 100755
--- a/src/tests/utests/run_qemu_test.sh
+++ b/src/tests/utests/run_qemu_test.sh
@@ -2,13 +2,12 @@
BINFILE=$1
LOGFILE=$2
-MAPFILE=$3
RESULTFILE=`mktemp`
PIDFILE=`mktemp`
-(timeout 10s qemu-system-i386 -kernel build/kernel.bin -append "init=io:/mod/`basename $BINFILE`" \
- -initrd "$BINFILE,$MAPFILE" -serial stdio -m 16 -display none 2>/dev/null \
+(timeout 3s qemu-system-i386 -kernel build/kernel.bin -append "init=io:/mod/`basename $BINFILE`" \
+ -initrd "$BINFILE,build/kernel.map" -serial stdio -m 16 -display none 2>/dev/null \
& echo $! >$PIDFILE) \
| tee >(grep -m 1 "TEST-" >$RESULTFILE; kill -INT `cat $PIDFILE`) >$LOGFILE
diff --git a/src/tests/utests/subfs/test.c b/src/tests/utests/subfs/test.c
index 5233ffe..52c1025 100644
--- a/src/tests/utests/subfs/test.c
+++ b/src/tests/utests/subfs/test.c
@@ -19,7 +19,7 @@ int main(int argc, char **argv) {
while (ent_no < 2) {
ASSERT (readdir(f, ent_no++, &x));
- ASSERT((!strcmp(x.name, "init.bin")) || (!strcmp(x.name, "kernel.map")));
+ ASSERT((!strcmp(x.name, "utest_subfs.bin")) || (!strcmp(x.name, "kernel.map")));
ASSERT(x.st.type == FT_REGULAR);
}