Commit graph

889 commits

Author SHA1 Message Date
Lionel Sambuc 3e1db26a5a Termcap update, replacing elvis by nvi.
Removing elvis, importing nvi, ctags, updating libedit.

Change-Id: I881eb04d2dc64cf112facd992de1114e1a59107f
2013-01-24 07:44:38 +01:00
Lionel Sambuc f9f6c9251a Re-adding extended keys in minix termcap entry 2013-01-23 21:28:17 +01:00
Lionel Sambuc 96836647f8 Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
Arne Welzel a58c735738 virtio: generic virtio library 2013-01-23 09:03:03 +00:00
Nicholas Heath 1bbba6353d Fixed bug in getrlimit as core dumps are supported now. 2013-01-17 14:06:35 +00:00
Lionel Sambuc b1c4ba4ab6 ARM updates
Due to the ABI we are using we have to use the earm architecture
moniker for the build system to behave correctly. This involves
then some headers to move around.

There is also a few related Makefile updates as well as minor
source code corrections.
2013-01-17 10:03:58 +01:00
Lionel Sambuc ebae0113f8 Removing useless __NBSD_LIBC define in libcurses 2013-01-17 10:03:58 +01:00
Ben Gras 287c0e3b92 csu: restore crt1.o symlink
. minix gcc package uses crt1.o to link
2013-01-15 09:20:27 +00:00
Lionel Sambuc 0ac803292e Fix warnings trivial warnings.
Fix warnings about:
 . Unused variables
 . format mismatch in printf/scanf format string and arguments
 . Missing parenthesis around assignment as truth values
 . Clang warnings anout unknown GCC pragma
2013-01-14 11:44:31 +01:00
Lionel Sambuc f5435c74b7 Updating lib/libcrypt
Change-Id: I4dc5ca7c86abc5295ffc57386a14dd1d790fd489
2013-01-14 11:36:27 +01:00
Lionel Sambuc 0c3ae37f52 Updating libcurses, libterminfo and terminfo.
The three are updated together as they are tightly coupled.

Change-Id: I9e1f07b6adc6e8ae10833e6f1402f8472d2d34b8
2013-01-14 11:36:26 +01:00
Lionel Sambuc f14fb60209 Libraries updates and cleanup
* Updating common/lib
 * Updating lib/csu
 * Updating lib/libc
 * Updating libexec/ld.elf_so
 * Corrected test on __minix in featuretest to actually follow the
   meaning of the comment.
 * Cleaned up _REENTRANT-related defintions.
 * Disabled -D_REENTRANT for libfetch
 * Removing some unneeded __NBSD_LIBC defines and tests

Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
2013-01-14 11:36:26 +01:00
Lionel Sambuc f6aac1c3b5 Moving all NetBSD headers back where they belong.
Moving include/sys NetBSD headers to /sys/sys
Moving include/arch/*/ NetBSD headers to /sys/arch/*/include

Change-Id: Ia1a45d4e83ab806c84093ec2b61bdbea9bed65a0
2013-01-14 11:36:25 +01:00
Thomas Veerman aa3623d873 ARM: make cycle counter available to userspace 2013-01-11 09:18:36 +00:00
Thomas Veerman 93103f497f libmthread: add possibility to randomize scheduler 2013-01-11 09:18:35 +00:00
Ben Gras 017ce5a503 libc, libutil: remove compat hacks 2013-01-08 15:47:37 +00:00
Ben Gras d36ce68582 libexec exec fix
. restores executing shell scripts without explicit interpreter
2012-12-29 01:41:24 +00:00
Ben Gras 29edcad310 vm: replace phys avl by array
. make vm be able to use malloc() by overriding brk()
   and minix_mmap() functions
 . phys regions can then be malloc()ed and free()d instead
   of being in an avl tree, which is slightly faster
 . 'offset' field in phys_region can go too (offset is implied
   by position in array) but leads to bigger code changes
2012-12-26 16:14:41 +00:00
Ben Gras 59ba14bb1d libutil: add O_NOCTTY back to old pty open code
restores fix 4f78dfcabc

	. fixes e.g. ssh sessions not getting their own
	  controlling tty
2012-12-10 15:22:12 +01:00
Lionel Sambuc 456a46e6bf Removing useless minix/types.h header
Change-Id: If5f922279b87f075f301b64c7786caa18b434c2a
2012-12-07 13:58:06 +01:00
Lionel Sambuc 100babf0e0 Removing last reference to NETBSDINCLUDES
Also removing minix-config.inc and placing its content in
Makefile.inc, as the file is modified anyway. Simplifies diff.

Change-Id: I6262fdb790a5455b59e07acdccdc221fd5dd41f8
2012-12-07 13:58:06 +01:00
Lionel Sambuc 7faf801d1f fixing warning about uninitialized variable in libsys/vprintf.c
Change-Id: I8764a57b502edc3d50a32b3e2db56c4f94592309
2012-12-07 13:58:06 +01:00
Thomas Veerman d9f4f71916 Implement dynamic mtab support
With this patch /etc/mtab becomes obsolete.
2012-11-26 15:20:18 +00:00
Lionel Sambuc 9903b9fb96 Fixing wrong dependency from libc on libsys. 2012-11-26 13:53:02 +01:00
Erik van der Kouwe 57c748b968 Remove ability to pass commands to bootloader 2012-11-22 19:16:17 +01:00
Lionel Sambuc 4a711bea63 Upgrading bzip2
Change-Id: I6968b0f0401f3f42dc55a0f4938a7e12a3a55ae7
2012-11-21 18:32:06 +01:00
Ben Gras a89ec8bc3b can't get_block(NO_DEV) any more
. 'anonymous' cache blocks (retrieved with NO_DEV as dev
	  parameter) were used to implement read()s from holes in
	  inodes that should return zeroes
	. this is an awkward special case in the cache code though
	  and there's a more direct way to implement the same functionality:
	  instead of copying from a new, anonymous, zero block, to
	  the user target buffer, simply sys_safememset the user target
	  buffer directly. as this was the only use of this feature,
	  this is all that's needed to simplify the cache code a little.
2012-11-16 16:37:44 +01:00
Tomas Hruby 10f30159a9 struct minix_ipcvecs - pretty-print
- the _ptr suffix is not needed anymore :-)
2012-11-15 16:52:00 +01:00
Lionel Sambuc cd554e7284 Hack for unresolved symbol read_tsc_64 2012-11-15 16:07:30 +01:00
Lionel Sambuc d19d7d58aa Toolchain upgrade and portability improvements.
upgrade to NetBSD CVS release from 2012/10/17 12:00:00 UTC

Makefiles updates to imporve portability

Made sure to be consistent in the usage of braces/parenthesis at
least on a per file basis. For variables, it is recommended to
continue to use braces.
2012-11-15 16:07:29 +01:00
Lionel Sambuc 9152e1c5a7 Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-11-15 16:07:29 +01:00
Lionel Sambuc bdb3f57135 Adding shlib_version for libsys 2012-11-15 16:07:29 +01:00
Lionel Sambuc e415d48872 Libc update to simplify merge.
Bumping libc files for unsupported architectures, to simplify merging.
A bunch of small fixes:
 * in libutil update
 * the macro in endian.h
 * some undefined types due to clear separation from host.
 * Fix a warning for cdbr.c

Some modification which were required for the new build system:
 * inclusion path for const.h in sconst, still hacky
 * Removed default malloc.c which conflicts on some occasions.
2012-11-15 16:07:29 +01:00
Lionel Sambuc dba3562d78 Updating libutil from netbsd 2012-11-15 16:07:29 +01:00
Ben Gras 196021cd82 drop safemap code 2012-10-30 13:55:42 +01:00
Lionel Sambuc 85fee539f4 Upgrading pax.
This also means importing librmt.

Change-Id: Ie5b314aeaad28dca46acb64f20f2d70746ea52d0
2012-10-24 13:42:44 +02:00
Ben Gras bd3cde4571 Move primary cache code to libminixfs.
Add primary cache management feature to libminixfs as mfs and ext2
currently do separately, remove cache code from mfs and ext2, and make
them use the libminixfs interface. This makes all fields of the buf
struct private to libminixfs and FS clients aren't supposed to access
them at all. Only the opaque 'void *data' field (the FS block contents,
used to be called bp) is to be accessed by the FS client.

The main purpose is to implement the interface to the 2ndary vm cache
just once, get rid of some code duplication, and add a little
abstraction to reduce the code inertia of the whole caching business.

Some minor sanity checking and prohibition done by mfs in this code
as removed from the generic primary cache code as a result:
        - checking all inodes are not in use when allocating/resizing
          the cache
        - checking readonly filesystems aren't written to
        - checking the superblock isn't written to on mounted filesystems

The minixfslib code relies on fs_blockstats() in the client filesystem to
return some FS usage information.
2012-10-23 19:48:38 +02:00
David van Moolenbroek 23907fa712 libvboxfs: fix setting file mtimes 2012-10-17 23:01:24 +02:00
Tomas Hruby ee99bb81b9 LIBC - getifaddrs() fix
ifpa must be set to something meaningful every time it returns 0.
2012-10-11 09:43:33 +00:00
Arun Thomas 471a03a362 ARM support for kernel and vm 2012-10-07 21:38:03 -04:00
Arne Welzel bf33a1c097 libsys: add sys_safememset() 2012-09-26 02:18:00 +02:00
Ben Gras 2d72cbec41 SYSENTER/SYSCALL support
. add cpufeature detection of both
	. use it for both ipc and kernelcall traps, using a register
	  for call number
	. SYSENTER/SYSCALL does not save any context, therefore userland
	  has to save it
	. to accomodate multiple kernel entry/exit types, the entry
	  type is recorded in the process struct. hitherto all types
	  were interrupt (soft int, exception, hard int); now SYSENTER/SYSCALL
	  is new, with the difference that context is not fully restored
	  from proc struct when running the process again. this can't be
	  done as some information is missing.
	. complication: cases in which the kernel has to fully change
	  process context (i.e. sigreturn). in that case the exit type
	  is changed from SYSENTER/SYSEXIT to soft-int (i.e. iret) and
	  context is fully restored from the proc struct. this does mean
	  the PC and SP must change, as the sysenter/sysexit userland code
	  will otherwise try to restore its own context. this is true in the
	  sigreturn case.
	. override all usage by setting libc_ipc=1
2012-09-24 15:53:43 +02:00
Ben Gras 8a3b6ca3bb remove unused <tools.h> 2012-09-20 12:24:22 +02:00
Ben Gras d526f1a0db some coverity fixes. 2012-09-18 15:11:51 +02:00
Ben Gras ed1af3c86c VM: full munmap
complete munmap implementation; single-page references made
a general munmap() implementation possible to write cleanly.

	. memory: let the MIOCRAMSIZE ioctl set the imgrd device
	  size (but only to 0)
	. let the ramdisk command set sizes to 0
	. use this command to set /dev/imgrd to 0 after mounting /usr
	  in /etc/rc, so the boot time ramdisk is freed (about 4MB
	  currently)
2012-09-18 13:17:52 +02:00
Ben Gras 2cb560297c VM: remove unused dma memory support functions from vm
. unused calls / data structures
2012-09-18 13:17:47 +02:00
Ben Gras d3d8c30c2e libc/libminc malloc reorganization
. rename minix malloc sources to minix-* so Makefile
    references aren't ambiguous
  . throw out malloc source file copies in libminc
  . make libminc use phkmalloc instead of minix malloc (slightly faster)
2012-09-18 13:17:44 +02:00
David van Moolenbroek 41df1b59f1 libsys: let optset parse largeish positive values
Note that strtoul() also parses negative numbers correctly.
2012-09-03 12:20:17 +00:00
David van Moolenbroek 6b97790a38 libblockdriver: minor whitespace fix 2012-08-31 12:36:17 +00:00
Ben Gras 053fa581b5 vm: remove stack handling for signals
. moved to the kernel as the handling was only
	  reading it; the kernel may as well write it too
2012-08-29 17:31:38 +02:00
Arun Thomas fd43d93ce5 ARM support for system libraries 2012-08-28 13:49:27 -04:00
Arun Thomas 9a9d555f56 machine/ipcconst.h for arch-specific constants 2012-08-27 19:46:41 -04:00
David van Moolenbroek 201031fb38 libaudiodriver: properly deallocate memory 2012-08-24 09:17:27 +00:00
David van Moolenbroek 9821bbf780 libaudiodriver: call drv_init() again 2012-08-24 09:17:26 +00:00
David van Moolenbroek ca216b3d97 libaudiodriver: resolve Coverity warnings 2012-08-24 09:17:25 +00:00
Arun Thomas a57a591f25 Reorganize arch consts and types
-DEFAULT_HZ const moved to archconst.h
-cpu_info struct moved to archtypes.h
2012-08-16 17:07:43 +02:00
Arun Thomas 697f0d097f Rename sys_vmctl_get_cr3_i386 2012-08-12 23:30:54 +02:00
Arun Thomas ed9152a1a3 csu: build for ARM 2012-08-12 23:30:54 +02:00
Ben Gras 31d8526346 libexec: add load_offset feature, used for ld.so
. ld.so is linked at 0 but it can relocate itself; we
	  wish to load ld.so higher though to trap NULL dereferences.
	  if we know we have to execute ld.so, vfs tells libexec to put it
	  higher.
2012-08-12 23:22:54 +02:00
Arun Thomas fbd456ee2b libc/mallocdebug: Make arch-generic 2012-08-10 22:45:35 +02:00
Arun Thomas caa798bbe1 brksize: Remove non-ELF code 2012-08-10 22:45:35 +02:00
Arun Thomas 65a87d5bcb Fix prototypes for getdents, read, readlink 2012-08-10 22:09:43 +02:00
Arun Thomas fbad9eaf95 Clean up arch Makefiles for libminc 2012-08-10 19:02:38 +02:00
Arun Thomas ad95bad8f7 Restore and use C version of oneC_sum 2012-08-10 14:48:48 +02:00
David van Moolenbroek 378164d359 libnetsock: resolve Coverity warnings 2012-08-09 00:16:36 +02:00
David van Moolenbroek ebc85e54c4 libsys: resolve Coverity warnings 2012-08-09 00:16:36 +02:00
David van Moolenbroek 49aed1ad97 libsys: remove unused stacktrace variant 2012-08-09 00:16:35 +02:00
Arun Thomas 0ae2e2df94 libc: ARM generateasm 2012-08-07 17:01:25 +02:00
Arun Thomas 19ffad7692 Remove ACK EM_WSIZE/EM_PSIZE macro usage 2012-08-06 17:49:22 +02:00
Arun Thomas 6723dcfab7 Replace MACHINE/CHIP macros with compiler macros 2012-08-06 17:49:22 +02:00
David van Moolenbroek 5909c8ba20 libvtreefs: resolve Coverity warnings 2012-07-30 14:00:22 +00:00
David van Moolenbroek ee71bbbcb5 libsffs: resolve Coverity warnings 2012-07-30 12:10:14 +00:00
David van Moolenbroek 0b30c0a1bb libchardriver: resolve Coverity warnings 2012-07-30 12:10:13 +00:00
David van Moolenbroek 55c3f4800e libbdev: resolve Coverity warnings 2012-07-30 12:10:12 +00:00
Ben Gras b6ea15115c kernel: facility for user-visible memory
. map all objects named usermapped_*.o with globally visible
	  pages; usermapped_glo_*.o with the VM 'global' bit on, i.e.
	  permanently in tlb (very scarce resource!)
	. added kinfo, machine, kmessages and loadinfo for a start
	. modified log, tty to make use of the shared messages struct
2012-07-28 20:57:38 +00:00
David van Moolenbroek 8caec1b57b libsys: 64-bit numbers support for printf()
Change some drivers accordingly.
2012-07-26 09:45:05 +00:00
Ben Gras cbcdb838f1 various coverity-inspired fixes
. some strncpy/strcpy to strlcpy conversions
	. new <minix/param.h> to avoid including other minix headers
	  that have colliding definitions with library and commands code,
	  causing parse warnings
	. removed some dead code / assignments
2012-07-16 14:00:56 +02:00
Ben Gras 50e2064049 No more intel/minix segments.
This commit removes all traces of Minix segments (the text/data/stack
memory map abstraction in the kernel) and significance of Intel segments
(hardware segments like CS, DS that add offsets to all addressing before
page table translation). This ultimately simplifies the memory layout
and addressing and makes the same layout possible on non-Intel
architectures.

There are only two types of addresses in the world now: virtual
and physical; even the kernel and processes have the same virtual
address space. Kernel and user processes can be distinguished at a
glance as processes won't use 0xF0000000 and above.

No static pre-allocated memory sizes exist any more.

Changes to booting:
        . The pre_init.c leaves the kernel and modules exactly as
          they were left by the bootloader in physical memory
        . The kernel starts running using physical addressing,
          loaded at a fixed location given in its linker script by the
          bootloader.  All code and data in this phase are linked to
          this fixed low location.
        . It makes a bootstrap pagetable to map itself to a
          fixed high location (also in linker script) and jumps to
          the high address. All code and data then use this high addressing.
        . All code/data symbols linked at the low addresses is prefixed by
          an objcopy step with __k_unpaged_*, so that that code cannot
          reference highly-linked symbols (which aren't valid yet) or vice
          versa (symbols that aren't valid any more).
        . The two addressing modes are separated in the linker script by
          collecting the unpaged_*.o objects and linking them with low
          addresses, and linking the rest high. Some objects are linked
          twice, once low and once high.
        . The bootstrap phase passes a lot of information (e.g. free memory
          list, physical location of the modules, etc.) using the kinfo
          struct.
        . After this bootstrap the low-linked part is freed.
        . The kernel maps in VM into the bootstrap page table so that VM can
          begin executing. Its first job is to make page tables for all other
          boot processes. So VM runs before RS, and RS gets a fully dynamic,
          VM-managed address space. VM gets its privilege info from RS as usual
          but that happens after RS starts running.
        . Both the kernel loading VM and VM organizing boot processes happen
	  using the libexec logic. This removes the last reason for VM to
	  still know much about exec() and vm/exec.c is gone.

Further Implementation:
        . All segments are based at 0 and have a 4 GB limit.
        . The kernel is mapped in at the top of the virtual address
          space so as not to constrain the user processes.
        . Processes do not use segments from the LDT at all; there are
          no segments in the LDT any more, so no LLDT is needed.
        . The Minix segments T/D/S are gone and so none of the
          user-space or in-kernel copy functions use them. The copy
          functions use a process endpoint of NONE to realize it's
          a physical address, virtual otherwise.
        . The umap call only makes sense to translate a virtual address
          to a physical address now.
        . Segments-related calls like newmap and alloc_segments are gone.
        . All segments-related translation in VM is gone (vir2map etc).
        . Initialization in VM is simpler as no moving around is necessary.
        . VM and all other boot processes can be linked wherever they wish
          and will be mapped in at the right location by the kernel and VM
          respectively.

Other changes:
        . The multiboot code is less special: it does not use mb_print
          for its diagnostics any more but uses printf() as normal, saving
          the output into the diagnostics buffer, only printing to the
          screen using the direct print functions if a panic() occurs.
        . The multiboot code uses the flexible 'free memory map list'
          style to receive the list of free memory if available.
        . The kernel determines the memory layout of the processes to
          a degree: it tells VM where the kernel starts and ends and
          where the kernel wants the top of the process to be. VM then
          uses this entire range, i.e. the stack is right at the top,
          and mmap()ped bits of memory are placed below that downwards,
          and the break grows upwards.

Other Consequences:
        . Every process gets its own page table as address spaces
          can't be separated any more by segments.
        . As all segments are 0-based, there is no distinction between
          virtual and linear addresses, nor between userspace and
          kernel addresses.
        . Less work is done when context switching, leading to a net
          performance increase. (8% faster on my machine for 'make servers'.)
	. The layout and configuration of the GDT makes sysenter and syscall
	  possible.
2012-07-15 22:30:15 +02:00
Kees Jongenburger 30b5c227e9 Allow to specify the rslabel to use for a file system.
When a file system is mounted some heuristics are used to define
a RS label for that system. This commit allows to specify the
label to use in an optional mount argument using either
mount -o rslabel=fs_myfs or as a mount option in fstab.

This can be used to start services that later also need to be
accessed directly.
2012-07-05 14:52:16 +02:00
Ben Gras c3db1c6939 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.
2012-06-28 15:20:53 +02:00
Thomas Veerman 8d1c219676 libvassert: don't build shared lib 2012-06-26 09:32:15 +00:00
Ben Gras cb1418a5e1 generate offsets for ucontext.S 2012-06-19 15:47:25 +02:00
Thomas Veerman aab6eb7615 Clean up generated files for ash,ramdisk,libutil,libc 2012-06-18 10:54:56 +00:00
Thomas Veerman 357f105029 Import NetBSD flex 2012-06-18 10:54:47 +00:00
Thomas Veerman f09c2e014f Use MACHINE_ARCH instead of ARCH 2012-06-18 10:53:35 +00:00
Thomas Veerman f93afa00e9 Remove MINIXSRCDIR and use NETBSDSRCDIR
NETBSDSRCDIR is used all over the place anyway, and this reduces
our diff with NetBSD a little.
2012-06-18 10:53:35 +00:00
Ben Gras 0fb2f83da9 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
2012-06-18 12:28:40 +00:00
Ben Gras 0e35eb0c6b drop segments from safemap/safeunmap invocations 2012-06-18 12:28:40 +00:00
Kees Jongenburger ade7dc8ded Upgrade libddekit and introduce devmand.
Devmand (Device manager daemon) is the daemon that will
dynamically manage services based on events received from
the system.
2012-06-18 09:23:42 +02:00
Kees Jongenburger 6b8821515d Move setjmp and strnlen to common/lib.
Move setjmp and strnlen to common/lib to allow libddekit to use them.
2012-06-18 09:20:22 +02:00
Ben Gras 2bfeeed885 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
2012-06-16 16:22:51 +00:00
Ben Gras 769af57274 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)
2012-06-07 15:15:02 +02:00
Ben Gras 040362e379 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/)
2012-06-07 15:15:01 +02:00
Ben Gras 41b869d4d6 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.
2012-06-07 12:43:16 +02:00
Ben Gras ee4016155e 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
2012-06-07 12:43:16 +02:00
Ben Gras c0ef4c4956 mthread: mmap returns MAP_FAILED on error 2012-05-31 00:54:11 +02:00
Ben Gras 73379f0be5 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

Thanks to Antoine Leca for pointing this out.
2012-05-10 16:38:24 +02:00
Ben Gras 543adbed3a libarchive import
. clean and nbsd_ports managed import
	. also makes it shared
2012-05-02 13:31:48 +02:00
Thomas Veerman 76092ddf33 libmthread: don't always verify library initialization
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.
2012-05-01 09:55:06 +00:00
Ben Gras 755102d67f 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
2012-04-26 13:32:39 +02:00