|
From: Jeremy F. <je...@go...> - 2004-01-08 21:06:46
|
I've been thinking about how to rearrange the source tree to handle multiple OS and CPU combinations. I'm basing my thinking from looking at Doug's FreeBSD port, and Dirk's initial cut at an arch/ directory. It looks to me that there's a lot more in common between FreeBSD and Linux than I would have hoped for; almost all of vg_syscalls and vg_signals is intact, and vg_libpthread is mostly just syntactic changes rather than anything of substance. It would be really nice to put all that common stuff into a common place, to try and cut down on duplication. I'd also like to minimise #ifdefs in shared code. To this end, I think we'll need a number of arch directories: i386-linux machine-specific linux stuff i386-freebsd machine-specific freebsd stuff common-linux general linux stuff common-freebsd general freebsd stuff i386-common OS-independent i386 stuff common-unix things common to Unix-like systems (I decided to go with CPU names like autoconf/uname -i uses) So far, i386-linux/freebsd has things like vg_syscall.S, and the various very machine-dependent parts of ume. Later it will get things like the details of how to get/set syscall args for vg_syscalls.c, signal restart, etc. Also syscall numbering, and CPU-specific syscalls (LDT stuff, etc). common-linux/freebsd will probably get most of the rest of vg_signals where they differ, and probably most of the OS-specific parts of vg_syscalls.c i386-common will ultimately get most of vg_to/from_ucode.c. common-unix will get all the really generic syscall handling (things like read/write/exit/fork/exec, etc). I'm attaching my patch-in-progress. This is all still an experiment, so if it doesn't work out, I'm happy to throw it away. But I'd like to get something like this in place as I merge the FreeBSD port (or before, and merge FreeBSD into it). Comments? Thoughts? BTW: I put some stuff in the Makefile.am files which doesn't look good, and surely can't be right - there seems to be a lot of duplication. How can I fix this? Maybe something to do with aclocal? J |