Ben Gras [Thu, 28 Jun 2012 12:56:50 +0000 (14:56 +0200)]
various symbol referencing fixes
make weak symbol references and namespace renames references
the renamed versions.
function renaming, weak symbol references and libc namespace.h
protection interact in hairy ways and causes weak symbol references
for renamed functions to be unresolved; e.g. vfork should be an
alias for _vfork but _vfork doesn't exist because __vfork14()
exists.
this is a problem for dynamically linked executables as all symbols
have to be resolved, used or not, at link time. it was masked by
clang-compiled base system libraries but is a problem when gcc does
it.
Ben Gras [Fri, 22 Jun 2012 09:55:11 +0000 (11:55 +0200)]
ld.so: be more mmap()-behaviour-independent
. if the layout of virtual address regions as returned
by mmap() without a location hint changes, ld.so could
trip itself up (under minix). this change allocates
the full size it needs for every object that's loaded
so that if that succeeds, it's sure there's virtual address
space for the whole thing no matter what other bits happen
to be there already.
. this fix exposed a bug in the test; at atexit() execution
time the loaded object is unmapped, so that part of the
test is removed.
Thomas Veerman [Tue, 19 Jun 2012 16:03:11 +0000 (16:03 +0000)]
/etc/rc: use mount -a instead of manual parsing
The rc script manually parses /etc/fstab to mount all file systems.
To do that it needs /bin/sed which does not exist anymore. mount(8)
now supports the -a flag which causes it to mount all file systems
listed in /etc/fstab except for '/'. File systems marked with 'noauto'
are skipped.
Thomas Veerman [Wed, 6 Jun 2012 14:46:00 +0000 (14:46 +0000)]
Import NetBSD tools and build.sh
This commit finalizes support for cross compilation. The tools
directory are all links to the actual tools and are built on the
host system to build Minix. build.sh is the work horse that takes
care of all environment settings. It's slightly adjusted for Minix.
The /usr/src/Makefile has additional targets needed for cross
compilation.
Thomas Veerman [Wed, 6 Jun 2012 14:34:11 +0000 (14:34 +0000)]
Import NetBSD mtree
mtree is only used for cross compilation at this point. Also, the
required patches to make it compile on Minix cripple it probably
enough to make it unusable anyway.
Thomas Veerman [Wed, 6 Jun 2012 13:06:52 +0000 (13:06 +0000)]
Partially import gcc and binutils
They are used as build tools for cross compilation. This import does
not include the full distribution. Rather, it sports a shell script
that will download and patch the distribution when compiled from
/usr/src/tools (yet to be committed). This part of the source tree is
only necessary for cross compilation. It's not used or compiled for
native builds.
Thomas Veerman [Mon, 7 May 2012 11:38:39 +0000 (13:38 +0200)]
Cross-compilation fixes
. Some Makefile fixes to automatically differentiate between a normal
compilation and cross-compilation. Also, build compressed images.
. Harmonize ramdisk rc scripts for normal use case and ext2 ramdisk.
. ext2_ramdisk filesystem prototype fixes.
Ben Gras [Sat, 16 Jun 2012 17:29:37 +0000 (17:29 +0000)]
drop from segments physcopy/vircopy invocations
. sys_vircopy always uses D for both src and dst
. sys_physcopy uses PHYS_SEG if and only if corresponding
endpoint is NONE, so we can derive the mode (PHYS_SEG or D)
from the endpoint arg in the kernel, dropping the seg args
. fields in msg still filled in for backwards compatability,
using same NONE-logic in the library
Adding hot plugging infrastructure in rc file. This includes
starting the devman service, mounting it's file system and
starting the corresponding devmand daemon.
This patch also provide error free shutdown of the USB sub-system.
The USB sub system needs to be shutdown in a certain order but also
consists of components living in /usr/pkg/. By checking the
existence of usbd we can stop it in the correct order.
Ben Gras [Sat, 16 Jun 2012 01:46:15 +0000 (03:46 +0200)]
drop segment from safecopy invocations
. all invocations were S or D, so can safely be dropped
to prepare for the segmentless world
. still assign D to the SCP_SEG field in the message
to make previous kernels usable
Ben Gras [Wed, 6 Jun 2012 17:05:28 +0000 (19:05 +0200)]
further libexec generalization
. new mode for sys_memset: include process so memset can be
done in physical or virtual address space.
. add a mode to mmap() that lets a process allocate uninitialized
memory.
. this allows an exec()er (RS, VFS, etc.) to request uninitialized
memory from VM and selectively clear the ranges that don't come
from a file, leaving no uninitialized memory left for the process
to see.
. use callbacks for clearing the process, clearing memory in the
process, and copying into the process; so that the libexec code
can be used from rs, vfs, and in the future, kernel (to load vm)
and vm (to load boot-time processes)
Ben Gras [Wed, 30 May 2012 17:34:07 +0000 (19:34 +0200)]
exec() cleanup, generalization, improvement
. make exec() callers (i.e. vfs and rs) determine the
memory layout by explicitly reserving regions using
mmap() calls on behalf of the exec()ing process,
i.e. handling all of the exec logic, thereby eliminating
all special exec() knowledge from VM.
. the new procedure is: clear the exec()ing process
first, then call third-party mmap()s to reserve memory, then
copy the executable file section contents in, all using callbacks
tailored to the caller's way of starting an executable
. i.e. no more explicit EXEC_NEWMEM-style calls in PM or VM
as with rigid 2-section arguments
. this naturally allows generalizing exec() by simply loading
all ELF sections
. drop/merge of lots of duplicate exec() code into libexec
. not copying the code sections to vfs and into the executable
again is a measurable performance improvement (about 3.3% faster
for 'make' in src/servers/)
Ben Gras [Wed, 6 Jun 2012 22:35:10 +0000 (00:35 +0200)]
drop aout support
justification: soon we won't be able to execute sep I&D aouts at
all (because of the vanishing segments), which was the default mode
to generate them so most binaries will be sep I&D.
this makes the vfs/rs exec() unification work simpler.
after unification, common I&D aout could be added back quite simply.
Ben Gras [Tue, 5 Jun 2012 22:50:13 +0000 (00:50 +0200)]
vm: add third-party mmap() mode and PROCCTL
these two functions will be used to support all exec() functionality
going into a single library shared by RS and VFS and exec() knowledge
leaving VM.
. third-party mmap: allow certain processes (VFS, RS) to
do mmap() on behalf of another process
. PROCCTL: used to free and clear a process' address space
Ben Gras [Wed, 9 May 2012 14:45:11 +0000 (16:45 +0200)]
set major version of shlibs to 0
WARNING: this will break existing dynamically linked binaries if they
exist. If you have any:
. re-build world statically first if necessary
. remove libraries from /lib and /usr/lib
. then build world
This change:
. avoids possible future dismay when interfacing other
systems' binaries; done until they are abi-compatible
Ben Gras [Wed, 9 May 2012 16:34:40 +0000 (18:34 +0200)]
retire BIOS_SEG and umap_bios
. readbios call is now a physical copy with range check in
the kernel call instead of BIOS_SEG+umap_bios
. requires all access to physical memory in bios range to go
through sys_readbios
. drivers/dpeth: wasn't using it
. adjusted printer