Commit graph

1088 commits

Author SHA1 Message Date
Ben Gras c595699ca7 unstack, sort: cleanup and improvement
lets unstack
(a) know about in-kernel ipc entry points and
(b) be able handle >2GB symbol offsets.

	. sort: add -x for hex numerical sort
	. unstack: gnm is obsolete
	. unstack: datasizes is obsolete (use nm --size-sort instead)
	. unstack: add ipc entry points read from procfs (hex)
	. unstack: use sort -x to sort symbol order so the procfs ones are
	  sorted independent of position and original ordering
2012-09-26 18:44:55 +02:00
Thomas Veerman a458e9d00d getty: return speed option 2012-09-25 09:07:09 +00:00
Ben Gras 8a3b6ca3bb remove unused <tools.h> 2012-09-20 12:24:22 +02:00
Ben Gras 24776434f5 worldstone: add -s for statistical profiling 2012-09-19 13:43:17 +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
Erik van der Kouwe 0e83262042 Fix uninitialized variable in sprofalyze 2012-09-04 11:56:18 +02:00
Erik van der Kouwe 2a0e9af32f Two frees to appease Coverity 2012-08-31 20:12:57 +02:00
Erik van der Kouwe 6a83cf3e70 sprofdiff: give some more info in case of bad input 2012-08-31 17:01:43 +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
Erik van der Kouwe ad898517ac sprofdiff for comparing sprofile results
This patch adds the sprofdiff tool, which compares two sets of profiling
output files. It sorts processes and symbols by difference in average
number of samples, placing those that took more time on the left first
and those that took more time on the right last. If multiple runs are
combined, a standard deviation is computed and this is used to compute
the significance level, which gives an indication of which differences
are likely to be due to chance.

This tool is run not on the raw profiling files, but on the output of
sprofalyze -d (a new option). Though having to use two tools and an
intermediate file seems a bit awkward, the advantage is that the
original source tree is not needed to resolve the symbols. For
comparisons, this is very useful. Also, the intermediate file is in a
text format that can easily be processed by scripts, which may be useful
for other purposes as well.
2012-08-11 22:09:42 +00:00
pikpik 90f82bb33e Fix minimal ISO installation
- Minimal ISO's have little in /usr/src
 - Copy boot.cfg from /etc instead
2012-08-10 22:21:59 +02:00
pikpik 445f634a90 Removed legacy floppy boot support
- fdbootparams and fdboot are removed
 - fdboot manual references are removed
2012-08-10 22:21:58 +02:00
Erik van der Kouwe 10cbc9bd11 Write raw sprofile traces to preserve all information as well as save space 2012-08-10 18:49:40 +00:00
Erik van der Kouwe fc42f78836 Re-write sprofalyze in C for better performance, more options and to fix problems with the gap the kernel now has 2012-08-07 13:09:02 +00: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 85edabcb42 btrace(8): resolve Coverity warnings 2012-07-30 12:10:07 +00: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 c4d9681327 Add entry in fstab and let the mount system call start devman.
After this commit you will need an additional entry in fstab for
the /sys file system (see docs/UPDATING).
2012-07-05 14:52:16 +02:00
Kees Jongenburger 1fb60d0811 Fixes for mount -a.
* Display an error message upon failure to mount a device.
* Handle a special case when the source device is "none"
* pass the mount options stored in fourth field of fstab
  to mount(3).
2012-07-05 14:45:30 +02:00
Kees Jongenburger 101b99bc77 devmand call the cleanup method before doing an exit.
Call the cleanup mehtod before doing an exit to prevent stale pid
files.
2012-07-05 11:07:25 +02:00
Thomas Veerman 305dacf6ea setup: copy boot.cfg.default to /boot.cfg
This way the setup stays in sync with the source tree.
2012-06-20 10:48:39 +00:00
Thomas Veerman 6759b24c57 /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.
2012-06-20 10:48:38 +00:00
Kees Jongenburger b15f6fdf41 Removed unused control fifo in devmand. 2012-06-19 16:30:02 +02:00
Kees Jongenburger a55f435a36 Decrease verbosity of devmand.
Display warnings(non critical errors) only when the verbose flag
is set.
2012-06-19 16:30:02 +02:00
Thomas Veerman aab6eb7615 Clean up generated files for ash,ramdisk,libutil,libc 2012-06-18 10:54:56 +00:00
Thomas Veerman bb226763a0 Make mkfs.mfs cross compilable 2012-06-18 10:54:54 +00:00
Thomas Veerman 2ed11343a6 Remove duplicate sed 2012-06-18 10:54:51 +00:00
Thomas Veerman 9d04c193d2 Import NetBSD xinstall
Also, fix mk files for cross compilation.
2012-06-18 10:54:50 +00:00
Thomas Veerman 0b2db08aec Import NetBSD mktemp 2012-06-18 10:54:48 +00:00
Thomas Veerman 2e2caf5919 Import NetBSD make 2012-06-18 10:54:48 +00:00
Thomas Veerman 357f105029 Import NetBSD flex 2012-06-18 10:54:47 +00:00
Thomas Veerman 4a17663c14 Import NetBSD byacc 2012-06-18 10:54:17 +00:00
Thomas Veerman 5ea9e707be Import NetBSD nawk 2012-06-18 10:53:38 +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
Dirk Vogt 25ae53b165 Make commands cross-compilable 2012-06-18 10:53:23 +00:00
Kees Jongenburger 51a9903002 Add support in devmand for using config dirs.
Add support in devmand for using configuration directories to
allow 3rd party packages to add configuration items.
2012-06-18 09:29:53 +02: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
Ben Gras 85ff5a947e dumpcore: use ptrace function to trigger a coredump
. dumpcore currently relies on minix segments
	. also ptrace dumpcore fix
2012-06-15 12:13:50 +02: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 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 c2d5e01042 endianness compile fixes 2012-06-06 13:15:18 +02:00
Ben Gras 8c434cf24f synctree compile fix
. rename CANCEL to ORDER_CANCEL so the CANCEL enum name doesn't
	  clash with a minix header file. also endianness test fix.
2012-05-31 22:42:49 +02:00
Antoine Leca c662389d25 Enable LZMA supprt with tar(1) 2012-04-25 17:52:33 +02:00
Ben Gras 861bb4e571 update_bootcfg: fix: generate absolute paths 2012-04-18 16:30:06 +02:00
Ben Gras b332803b6f 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
2012-04-17 16:58:58 +02:00
Ben Gras 53f94f8ed4 dynamic executables on ramdisk support
See UPDATING about upgrading clang for dynamic linking.

	. allow executables on ramdisk to be dynamically linked; this means
	  putting a few required shared libraries and ld.elf_so on the ramdisk.
	. this makes the ramdisk (usage) smaller when they are dynamic, but
	  bigger when they're not.
	. also we can safely ditch newroot and call mount directly as that is
	  all newroot does.
	. create proto.common to share a bunch of entries between
	  small/nonsmall cases
2012-04-16 14:06:09 +02:00
Thomas Veerman d729ecb11b service: make clear who is printing the error 2012-04-13 13:51:56 +00:00
Thomas Veerman 8dd0880985 Add a simple utility to send control messages
The svrctl utility allows you to send control messages to VFS or PM.
This way you can retrieve runtime information or alter behavior.
2012-04-13 12:58:41 +00:00