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
This can be turned back on when the library is compiled with
-DMTHREAD_STRICT (which enables more sanity checks). However,
always performing this check shows up in system profiling results.
Thomas Veerman [Mon, 23 Apr 2012 13:33:43 +0000 (13:33 +0000)]
VFS: release what can be released
Only attempt to release blocked processes that are blocked. There is
no use in trying to find more blocked processes than we know that are
blocked (on a pipe).
Thomas Veerman [Wed, 18 Apr 2012 13:44:33 +0000 (13:44 +0000)]
VFS: simplify stat for pipes
According to POSIX the st_size field of struct stat is undefined for
fifos and anonymous pipes. Thus we can do anything we want. We save a
copy by not being accurate on pipe sizes.
Ben Gras [Wed, 18 Apr 2012 14:32:38 +0000 (16:32 +0200)]
AT_SUN_EXECNAME support
. vfs: pass execname in aux vectors
. ld.elf_so: use this to expand $ORIGIN
. this requires the executable to reserve more
space at exec() calling time
MFS' get_block() must never return a newly acquired block buffer that
is marked dirty from previous use. This patch replaces git-dd59d50,
which assumed a working model where blocks for device NO_DEV would
never be dirty. For at least one scenario, that assumption does not
hold, triggering superblock overwrite warnings. In this patch, blocks
are explicitly marked as clean upon being repurposed. The working
model is now restored to be: the dirty state of a block is relevant
only when its associated device is not set to NO_DEV.
POSIX mandates that a file's modification and change time be left
untouched upon truncate/ftruncate iff the file size does not change.
However, an open(O_TRUNC) call must always update the modification and
change time of the file, even if it was already zero-sized. VFS uses
the file systems' truncate call to implement O_TRUNC. This patch
replaces git-255ae85, which did not take into account the open case.
The size check is now moved into VFS, so that individual file systems
need not check for this case anymore.
Previously, procfs would consider all processes that have a non-free
kernel slot *or* an in-use PM slot. However, since AVFS, a non-free
kernel slot does not imply an in-use PM slot. As a result, procfs
may use PM slots that have a zero PID value. If two such entries are
present in the retrieved PM table, procfs would try to add two inodes
with the same name "0", triggering an assertion in vtreefs.
This patch makes procfs consider only the PM slot for (non-task)
processes.
Ben Gras [Tue, 17 Apr 2012 12:02:14 +0000 (14:02 +0200)]
release fixes
. make ramdisk buildable without ../etc having pwd.db
. add cat to release bootstrap cmds
. support running dynamically linked executables for
release bootstrap cmds
. import netbsd chroot to help