2005-04-21 16:53:53 +02:00
|
|
|
# Makefile for the tests.
|
|
|
|
|
2010-11-19 11:33:26 +01:00
|
|
|
GCC?=gcc
|
2010-07-12 18:22:05 +02:00
|
|
|
CFLAGS= -O0 -D_MINIX -D_POSIX_SOURCE
|
2010-05-03 17:12:39 +02:00
|
|
|
CFLAGS-GCC= $(CFLAGS) -Wall
|
|
|
|
CFLAGS-GCCFPU= $(CFLAGS) -Wall -mhard-float
|
2010-03-12 16:58:41 +01:00
|
|
|
CFLAGS-GCCFPU= $(CFLAGS-GCC) -W -mhard-float
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
OBJ= test1 test2 test3 test4 test5 test6 test7 test8 test9 \
|
|
|
|
test10 test12 test13 test14 test15 test16 test17 test18 test19 \
|
|
|
|
test21 test22 test23 test25 test26 test27 test28 test29 \
|
2008-10-01 17:09:33 +02:00
|
|
|
test30 test31 test32 test34 test35 test36 test37 test38 \
|
Merge of David's ptrace branch. Summary:
o Support for ptrace T_ATTACH/T_DETACH and T_SYSCALL
o PM signal handling logic should now work properly, even with debuggers
being present
o Asynchronous PM/VFS protocol, full IPC support for senda(), and
AMF_NOREPLY senda() flag
DETAILS
Process stop and delay call handling of PM:
o Added sys_runctl() kernel call with sys_stop() and sys_resume()
aliases, for PM to stop and resume a process
o Added exception for sending/syscall-traced processes to sys_runctl(),
and matching SIGKREADY pseudo-signal to PM
o Fixed PM signal logic to deal with requests from a process after
stopping it (so-called "delay calls"), using the SIGKREADY facility
o Fixed various PM panics due to race conditions with delay calls versus
VFS calls
o Removed special PRIO_STOP priority value
o Added SYS_LOCK RTS kernel flag, to stop an individual process from
running while modifying its process structure
Signal and debugger handling in PM:
o Fixed debugger signals being dropped if a second signal arrives when
the debugger has not retrieved the first one
o Fixed debugger signals being sent to the debugger more than once
o Fixed debugger signals unpausing process in VFS; removed PM_UNPAUSE_TR
protocol message
o Detached debugger signals from general signal logic and from being
blocked on VFS calls, meaning that even VFS can now be traced
o Fixed debugger being unable to receive more than one pending signal in
one process stop
o Fixed signal delivery being delayed needlessly when multiple signals
are pending
o Fixed wait test for tracer, which was returning for children that were
not waited for
o Removed second parallel pending call from PM to VFS for any process
o Fixed process becoming runnable between exec() and debugger trap
o Added support for notifying the debugger before the parent when a
debugged child exits
o Fixed debugger death causing child to remain stopped forever
o Fixed consistently incorrect use of _NSIG
Extensions to ptrace():
o Added T_ATTACH and T_DETACH ptrace request, to attach and detach a
debugger to and from a process
o Added T_SYSCALL ptrace request, to trace system calls
o Added T_SETOPT ptrace request, to set trace options
o Added TO_TRACEFORK trace option, to attach automatically to children
of a traced process
o Added TO_ALTEXEC trace option, to send SIGSTOP instead of SIGTRAP upon
a successful exec() of the tracee
o Extended T_GETUSER ptrace support to allow retrieving a process's priv
structure
o Removed T_STOP ptrace request again, as it does not help implementing
debuggers properly
o Added MINIX3-specific ptrace test (test42)
o Added proper manual page for ptrace(2)
Asynchronous PM/VFS interface:
o Fixed asynchronous messages not being checked when receive() is called
with an endpoint other than ANY
o Added AMF_NOREPLY senda() flag, preventing such messages from
satisfying the receive part of a sendrec()
o Added asynsend3() that takes optional flags; asynsend() is now a
#define passing in 0 as third parameter
o Made PM/VFS protocol asynchronous; reintroduced tell_fs()
o Made PM_BASE request/reply number range unique
o Hacked in a horrible temporary workaround into RS to deal with newly
revealed RS-PM-VFS race condition triangle until VFS is asynchronous
System signal handling:
o Fixed shutdown logic of device drivers; removed old SIGKSTOP signal
o Removed is-superuser check from PM's do_procstat() (aka getsigset())
o Added sigset macros to allow system processes to deal with the full
signal set, rather than just the POSIX subset
Miscellaneous PM fixes:
o Split do_getset into do_get and do_set, merging common code and making
structure clearer
o Fixed setpriority() being able to put to sleep processes using an
invalid parameter, or revive zombie processes
o Made find_proc() global; removed obsolete proc_from_pid()
o Cleanup here and there
Also included:
o Fixed false-positive boot order kernel warning
o Removed last traces of old NOTIFY_FROM code
THINGS OF POSSIBLE INTEREST
o It should now be possible to run PM at any priority, even lower than
user processes
o No assumptions are made about communication speed between PM and VFS,
although communication must be FIFO
o A debugger will now receive incoming debuggee signals at kill time
only; the process may not yet be fully stopped
o A first step has been made towards making the SYSTEM task preemptible
2009-09-30 11:57:22 +02:00
|
|
|
test39 t10a t11a t11b test40 t40a t40b t40c t40d t40e t40f test41 \
|
2010-07-13 20:27:42 +02:00
|
|
|
test42 test45 test47 test48 test49 test50 test51 test52 test53 \
|
2010-09-01 11:07:18 +02:00
|
|
|
test54 test55 test56 test58
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
BIGOBJ= test20 test24
|
2010-07-13 20:27:42 +02:00
|
|
|
ROOTOBJ= test11 test33 test43 test44 test46
|
2010-03-12 16:58:41 +01:00
|
|
|
GCCOBJ= test45-gcc test49-gcc
|
2010-05-03 17:12:39 +02:00
|
|
|
GCCFPUOBJ= test51-gcc test52-gcc
|
2011-04-21 15:20:13 +02:00
|
|
|
OTHEROBJ= test57 test59
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2011-04-21 15:20:13 +02:00
|
|
|
all: $(OBJ) $(BIGOBJ) $(GCCOBJ) $(GCCFPUOBJ) $(ROOTOBJ) $(OTHEROBJ) depend
|
2005-09-12 13:53:22 +02:00
|
|
|
chmod 755 *.sh run
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
$(OBJ):
|
|
|
|
$(CC) $(CFLAGS) -o $@ $@.c
|
|
|
|
|
|
|
|
$(BIGOBJ):
|
|
|
|
$(CC) $(CFLAGS) -o $@ $@.c
|
|
|
|
|
2009-12-09 20:01:38 +01:00
|
|
|
$(GCCOBJ):
|
2010-08-09 07:51:01 +02:00
|
|
|
if which $(GCC) >/dev/null 2>&1; then $(GCC) $(CFLAGS-GCC) -o $@ ${@:S/-gcc//}.c; fi
|
2009-12-09 20:01:38 +01:00
|
|
|
|
2010-03-12 16:58:41 +01:00
|
|
|
$(GCCFPUOBJ):
|
2010-08-09 07:51:01 +02:00
|
|
|
if which $(GCC) >/dev/null 2>&1; then $(GCC) $(CFLAGS-GCCFPU) -o $@ ${@:S/-gcc//}.c; fi
|
2010-03-12 16:58:41 +01:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
$(ROOTOBJ):
|
|
|
|
$(CC) $(CFLAGS) $@.c
|
2006-10-25 15:35:03 +02:00
|
|
|
@install -c -o root -m 4755 a.out $@
|
2005-06-07 13:52:35 +02:00
|
|
|
@rm a.out
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2011-04-21 15:20:13 +02:00
|
|
|
depend: .gitignore
|
|
|
|
|
|
|
|
.gitignore: Makefile
|
|
|
|
echo $(OBJ) $(BIGOBJ) $(ROOTOBJ) $(GCCOBJ) $(GCCFPUOBJ) $(OTHEROBJ) | \
|
|
|
|
tr ' ' '\n' >.gitignore
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
clean:
|
2010-06-22 14:03:09 +02:00
|
|
|
$(MAKE) -C select clean
|
2009-12-09 20:01:38 +01:00
|
|
|
-rm -rf *.o *.s *.bak test? test?? test??-gcc t10a t11a t11b \
|
2009-12-09 08:59:08 +01:00
|
|
|
t40a t40b t40c t40d t40e t40f t43 DIR*
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
test1: test1.c
|
|
|
|
test2: test2.c
|
|
|
|
test3: test3.c
|
|
|
|
test4: test4.c
|
|
|
|
test5: test5.c
|
|
|
|
test6: test6.c
|
|
|
|
test7: test7.c
|
|
|
|
test8: test8.c
|
|
|
|
test9: test9.c
|
|
|
|
test10: test10.c
|
|
|
|
t10a: t10a.c
|
|
|
|
test11: test11.c
|
|
|
|
t11a: t11a.c
|
|
|
|
t11b: t11b.c
|
|
|
|
test12: test12.c
|
|
|
|
test13: test13.c
|
|
|
|
test14: test14.c
|
|
|
|
test15: test15.c
|
|
|
|
test16: test16.c
|
|
|
|
test17: test17.c
|
|
|
|
test18: test18.c
|
|
|
|
test19: test19.c
|
|
|
|
test20: test20.c
|
|
|
|
test21: test21.c
|
|
|
|
test22: test22.c
|
|
|
|
test23: test23.c
|
|
|
|
test24: test24.c
|
|
|
|
test25: test25.c
|
|
|
|
test26: test26.c
|
|
|
|
test27: test27.c
|
|
|
|
test28: test28.c
|
|
|
|
test29: test29.c
|
|
|
|
test30: test30.c
|
|
|
|
test31: test31.c
|
|
|
|
test32: test32.c
|
|
|
|
test33: test33.c
|
|
|
|
test34: test34.c
|
|
|
|
test35: test35.c
|
|
|
|
test36: test36.c
|
|
|
|
test37: test37.c
|
|
|
|
test38: test38.c
|
2008-10-01 17:09:33 +02:00
|
|
|
test39: test39.c
|
2009-07-14 11:43:33 +02:00
|
|
|
test40: test40.c
|
|
|
|
t40a: t40a.c
|
|
|
|
t40b: t40b.c
|
|
|
|
t40c: t40c.c
|
|
|
|
t40d: t40d.c
|
|
|
|
t40e: t40e.c
|
|
|
|
t40f: t40f.c
|
2009-08-15 23:37:26 +02:00
|
|
|
test41: test41.c
|
Merge of David's ptrace branch. Summary:
o Support for ptrace T_ATTACH/T_DETACH and T_SYSCALL
o PM signal handling logic should now work properly, even with debuggers
being present
o Asynchronous PM/VFS protocol, full IPC support for senda(), and
AMF_NOREPLY senda() flag
DETAILS
Process stop and delay call handling of PM:
o Added sys_runctl() kernel call with sys_stop() and sys_resume()
aliases, for PM to stop and resume a process
o Added exception for sending/syscall-traced processes to sys_runctl(),
and matching SIGKREADY pseudo-signal to PM
o Fixed PM signal logic to deal with requests from a process after
stopping it (so-called "delay calls"), using the SIGKREADY facility
o Fixed various PM panics due to race conditions with delay calls versus
VFS calls
o Removed special PRIO_STOP priority value
o Added SYS_LOCK RTS kernel flag, to stop an individual process from
running while modifying its process structure
Signal and debugger handling in PM:
o Fixed debugger signals being dropped if a second signal arrives when
the debugger has not retrieved the first one
o Fixed debugger signals being sent to the debugger more than once
o Fixed debugger signals unpausing process in VFS; removed PM_UNPAUSE_TR
protocol message
o Detached debugger signals from general signal logic and from being
blocked on VFS calls, meaning that even VFS can now be traced
o Fixed debugger being unable to receive more than one pending signal in
one process stop
o Fixed signal delivery being delayed needlessly when multiple signals
are pending
o Fixed wait test for tracer, which was returning for children that were
not waited for
o Removed second parallel pending call from PM to VFS for any process
o Fixed process becoming runnable between exec() and debugger trap
o Added support for notifying the debugger before the parent when a
debugged child exits
o Fixed debugger death causing child to remain stopped forever
o Fixed consistently incorrect use of _NSIG
Extensions to ptrace():
o Added T_ATTACH and T_DETACH ptrace request, to attach and detach a
debugger to and from a process
o Added T_SYSCALL ptrace request, to trace system calls
o Added T_SETOPT ptrace request, to set trace options
o Added TO_TRACEFORK trace option, to attach automatically to children
of a traced process
o Added TO_ALTEXEC trace option, to send SIGSTOP instead of SIGTRAP upon
a successful exec() of the tracee
o Extended T_GETUSER ptrace support to allow retrieving a process's priv
structure
o Removed T_STOP ptrace request again, as it does not help implementing
debuggers properly
o Added MINIX3-specific ptrace test (test42)
o Added proper manual page for ptrace(2)
Asynchronous PM/VFS interface:
o Fixed asynchronous messages not being checked when receive() is called
with an endpoint other than ANY
o Added AMF_NOREPLY senda() flag, preventing such messages from
satisfying the receive part of a sendrec()
o Added asynsend3() that takes optional flags; asynsend() is now a
#define passing in 0 as third parameter
o Made PM/VFS protocol asynchronous; reintroduced tell_fs()
o Made PM_BASE request/reply number range unique
o Hacked in a horrible temporary workaround into RS to deal with newly
revealed RS-PM-VFS race condition triangle until VFS is asynchronous
System signal handling:
o Fixed shutdown logic of device drivers; removed old SIGKSTOP signal
o Removed is-superuser check from PM's do_procstat() (aka getsigset())
o Added sigset macros to allow system processes to deal with the full
signal set, rather than just the POSIX subset
Miscellaneous PM fixes:
o Split do_getset into do_get and do_set, merging common code and making
structure clearer
o Fixed setpriority() being able to put to sleep processes using an
invalid parameter, or revive zombie processes
o Made find_proc() global; removed obsolete proc_from_pid()
o Cleanup here and there
Also included:
o Fixed false-positive boot order kernel warning
o Removed last traces of old NOTIFY_FROM code
THINGS OF POSSIBLE INTEREST
o It should now be possible to run PM at any priority, even lower than
user processes
o No assumptions are made about communication speed between PM and VFS,
although communication must be FIFO
o A debugger will now receive incoming debuggee signals at kill time
only; the process may not yet be fully stopped
o A first step has been made towards making the SYSTEM task preemptible
2009-09-30 11:57:22 +02:00
|
|
|
test42: test42.c
|
2009-12-04 08:52:22 +01:00
|
|
|
test43: test43.c
|
2009-12-08 14:35:52 +01:00
|
|
|
test44: test44.c
|
2009-12-09 20:01:38 +01:00
|
|
|
test45: test45.c test45.h
|
|
|
|
test45-gcc: test45.c test45.h
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
test46: test46.c
|
2009-12-24 21:22:41 +01:00
|
|
|
test47: test47.c
|
2010-01-21 07:38:17 +01:00
|
|
|
test48: test48.c
|
2010-01-25 19:16:25 +01:00
|
|
|
test49: test49.c
|
|
|
|
test49-gcc: test49.c
|
2010-02-09 09:12:37 +01:00
|
|
|
test50: test50.c
|
2010-03-12 16:58:41 +01:00
|
|
|
test51: test51.c
|
|
|
|
test51-gcc: test51.c
|
2010-05-03 17:12:39 +02:00
|
|
|
test52: test52.c
|
|
|
|
test52-gcc: test52.c
|
2010-06-23 00:07:23 +02:00
|
|
|
test54: test54.c
|
2010-06-24 02:06:40 +02:00
|
|
|
test55: test55.c
|
2010-07-15 16:52:29 +02:00
|
|
|
test56: test56.c
|
2010-08-04 11:00:58 +02:00
|
|
|
test57: test57.c test57loop.S
|
2010-08-09 07:51:01 +02:00
|
|
|
if which $(GCC) >/dev/null 2>&1; then $(GCC) $(CFLAGS-GCC) -o $@ test57.c test57loop.S; fi
|
2010-09-01 11:07:18 +02:00
|
|
|
test58: test58.c
|
2010-09-21 14:22:38 +02:00
|
|
|
test59: test59.c
|
|
|
|
$(CC) $(CFLAGS) -o $@ $@.c -lmthread
|