diff --git a/repos/ports/run/noux_fork.run b/repos/ports/run/noux_fork.run index 06bf7264b..0de92d7aa 100644 --- a/repos/ports/run/noux_fork.run +++ b/repos/ports/run/noux_fork.run @@ -1,13 +1,7 @@ -if {[have_spec linux]} { - puts "\nLinux not supported because of missing UART driver\n" - exit 0 +build { + core init server/log_terminal noux/minimal lib/libc_noux test/noux_fork } -build "core init drivers/timer drivers/uart noux/minimal lib/libc_noux test/noux_fork" - -# create tar archive -exec tar cfv bin/noux_fork.tar -h -C bin test-noux_fork - create_boot_directory install_config { @@ -28,21 +22,14 @@ install_config { - - - - - + - - - - + @@ -50,23 +37,10 @@ install_config { } build_boot_image { - core init timer uart_drv ld.lib.so noux libc.lib.so - libc_noux.lib.so noux_fork.tar + core init log_terminal noux ld.lib.so libc.lib.so libc_noux.lib.so + test-noux_fork } -# -# Redirect the output of Noux via the virtual serial port 1 into a file to be -# dumped after the successful completion of the test. -# -set noux_output_file "noux_output.log" - -append qemu_args " -nographic" -append qemu_args " -serial mon:stdio" -append qemu_args " -serial file:$noux_output_file" +append qemu_args " -nographic " run_genode_until "child.*exited.*\n" 20 - -puts "[exec cat $noux_output_file]" - -exec rm bin/noux_fork.tar -exec rm $noux_output_file diff --git a/repos/ports/src/test/noux_fork/test.cc b/repos/ports/src/test/noux_fork/test.cc index 4db1b5021..ecebd6447 100644 --- a/repos/ports/src/test/noux_fork/test.cc +++ b/repos/ports/src/test/noux_fork/test.cc @@ -12,7 +12,7 @@ enum { MAX_COUNT = 1000 }; int main(int, char **) { - int i = 0; + printf("--- test-noux_fork started ---\n"); pid_t fork_ret = fork(); if (fork_ret < 0) { @@ -25,7 +25,7 @@ int main(int, char **) if (fork_ret == 0) { printf("pid %d: child says hello\n", getpid()); for (int j = 0; j < MAX_COUNT; j++) { - printf("pid %d: child i = %d\n", getpid(), i); + printf("pid %d: child j = %d\n", getpid(), j); } return 0; } @@ -33,7 +33,7 @@ int main(int, char **) printf("pid %d: parent received child pid %d, starts counting...\n", getpid(), fork_ret); - for (; i < MAX_COUNT; ) { + for (int i = 0; i < MAX_COUNT; ) { printf("pid %d: parent i = %d\n", getpid(), i++); }