Commit graph

204 commits

Author SHA1 Message Date
Lionel Sambuc c7c2299cbe Removing hacky defines from top.c 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 280d8c668e Importing cksum (needed by NetBSD build system)
Change-Id: I47308635f6307066643f83f07b6751b1f2a05eb4
2012-10-23 12:02:51 +02:00
Prasanna Kumar T S M 8de781761f Remove some usage of 64bit functions (minix/u64.h)
. Removed the usage of 64 bit functions in top.c. Compiles successfully.
. Scaling 64 bit values to 32 bit is removed.
. Retain make64 instead of using | with shift.
. Add order cycling display
2012-10-15 18:24:30 +02:00
Ben Gras b6aab00c37 top task uid clear 2012-09-19 19:38:19 +02:00
Ben Gras 7047e014c9 coverity appeasement 2012-09-19 13:07:18 +02:00
Ben Gras fe6e291f59 vm, kernel, top: report memory usage of vm, kernel 2012-09-18 23:43:52 +02:00
Ben Gras 4eca12cde5 top: clarify ordering in blocked mode 2012-09-11 15:39:00 +02:00
Ben Gras 17e41d3081 top: add memory order, order cycling key 2012-09-11 02:17:25 +02:00
Kees Jongenburger 86344bb535 Upgrade to NetBSD: tic.c,v 1.19
The upgrade of tic to v 1.19 fixes a memory corruptions that  was
visible when cross building (specially when using  long  path
names in the output file argument).
2012-07-25 11:48:27 +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
Thomas Veerman f8c6b27b69 sed: unbreak crosscompilation 2012-06-21 14:07:59 +00:00
Ben Gras 1906a5b9b4 sed: add compatability symlink properly 2012-06-20 15:47:44 +02:00
Ben Gras 4725854459 sed: add compatability symlink 2012-06-20 14:47:01 +02:00
Thomas Veerman 966cbef4fd xinstall fix for cross compilation 2012-06-18 10:54:52 +00:00
Thomas Veerman ff555cdea6 Fix sed for cross compilation 2012-06-18 10:54:50 +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
Ben Gras 4b999f1962 build shared versions of libraries
building defaults to off until clang is updated.

current clang does not handle -shared, necessary to change the ld
invocation to build shared libraries properly. a new clang should be
installed and MKPIC defaults to no unless the newer clang is detected.

changes:

	. mainly small imports of a Makefile or two and small fixes
	  (turning things back on that were turned off in Makefiles)
	. e.g.: dynamic librefuse now depends on dynamic
	  libpuffs, so libpuffs has to be built dynamically too
	  and a make dependency barrier is needed in lib/Makefile
	. all library objects now have a PIC (for .so) and non-PIC
	  version, so everything is built twice.
	. generate PIC versions of the compat (un-RENAMEd) jump files,
	  include function type annotation in generated assembly
	. build progs with -static by default for now
	. also build ld.elf_so
	. also import NetBSD ldd
2012-04-16 05:21:20 +02:00
Ben Gras a2d1372680 Import NetBSD usr.bin/login 2012-04-11 20:02:15 +02:00
Ben Gras 8c4cdbd3c5 import genassym and use it for sconst.h in kernel 2012-03-31 15:29:53 +02:00
Antoine Leca 1972ccefae Actually consider the new su(1) 2012-03-30 02:34:45 +02:00
Ben Gras 4de51eedad import NetBSD su 2012-03-27 02:19:46 +02:00
Ben Gras d65f6f7009 imported code harmonisation
. common/include/arch/i386 is not actually an imported
	  sys/arch/i386/include but leftover Minix files;
	  remove and move to include/
	. move include/ufs to sys/ufs, where it came from, now that
	  we have a sys/ hierarchy
	. move mdocml/ to external/bsd/, now we have that
	. single sys/arch/i386/stand/ import for boot stuff
2012-03-14 16:02:59 +01:00
David van Moolenbroek 4aaa5377b3 Import NetBSD du(1) 2012-03-05 22:32:33 +01:00
Ben Gras a64ad3054b start modules at 16MB
. keep more memory free below 16MB for e.g. lance
2012-02-24 11:50:28 +01:00
Arun Thomas a17f6600ce mkimage: use a lower start address 2012-02-21 15:54:05 +01:00
Ben Gras 5a645f22a8 gzip boot modules.
. import gzip
2012-02-17 12:32:35 +00:00
Ben Gras 2fe8fb192f Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
2012-02-14 14:52:02 +01:00
Vivek Prakash 79bfef9aab import NetBSD bzip2 and libbz2 2011-11-18 11:11:04 +01:00
Ben Gras 5c00743626 Switch to NetBSD passwd format
Based on work by Vivek Prakash and Gianluca Guida.

See UPDATING about caveats on currently existing accounts.

	. restores netbsd libc pwcache functions
2011-11-14 14:47:42 +00:00
Thomas Veerman a209c3ae12 Fix a ton of compiler warnings
This patch fixes most of current reasons to generate compiler warnings.
The changes consist of:
 - adding missing casts
 - hiding or unhiding function declarations
 - including headers where missing
 - add __UNCONST when assigning a const char * to a char *
 - adding missing return statements
 - changing some types from unsigned to signed, as the code seems to want
   signed ints
 - converting old-style function definitions to current style (i.e.,
   void func(param1, param2) short param1, param2; {...} to
   void func (short param1, short param2) {...})
 - making the compiler silent about signed vs unsigned comparisons. We
   have too many of those in the new libc to fix.

A number of bugs in the test set were fixed. These bugs were never
triggered with our old libc. Consequently, these tests are now forced to
link with the new libc or they will generate errors (in particular tests 43
and 55).

Most changes in NetBSD libc are limited to moving aroudn "#ifndef __minix"
or stuff related to Minix-specific things (code in sys-minix or gen/minix).
2011-11-14 10:07:49 +00:00
Ben Gras f2e991439e mdocml/man: dummy cleandepend target 2011-09-28 15:36:24 +00:00
Ben Gras 0c3983b25a update/fix manpage support
. add bsd-style MLINKS to minix man set, restoring aliases
	  (e.g. man add64 -> int64)
	. update daily cron script to run makewhatis and restore makewhatis
	  in man Makefile (makedb), restores functionality of man -k
	. netbsd imports of man, mdocml, makewhatis, libutil, apropos
	. update man.conf with manpage locations, restoring man [-s] <section>
	. throws out some obsolete manpages
2011-09-28 15:24:15 +00:00
Ben Gras bc0a39238e worldstone benchmark script
. also imports seq(1) to help it
	. add -C option to time(1) to print tsc difference
	. increase col width for ministat for tsc numbers
2011-09-24 14:49:55 +00:00
Ben Gras 10375d2629 don't keep minix-port.patch files in repo
. causes git noise, and unnecessary conflicts
	. are easily generated with 'make nbsd_diff' in tools/
2011-08-10 13:38:12 +00:00
Ben Gras 3977443581 terminfo fixes
. add TERM=minix to builtin terms
	. regenerate compiled-in compile_terms.c
	. fix terminfo db path
	. update termcap command
	. By Antoine Leca
2011-08-04 16:50:57 +00:00
Ben Gras 989934b37c rename -lutil to -lminixutil
. in preparation for netbsd -lutil
2011-08-01 14:32:14 +02:00
Ben Gras f614d0015a mk: single mk fragment for new libc
. allow commands to use it by setting NEED_NBSDLIBC
	. also add mkfiles to clean and cleandepend so they
	  don't break on missing new mkfiles
2011-07-27 18:23:36 +02:00
Arun Thomas 3a69da5f86 usr.bin/Makefile: cosmetic change
-Move mkimage to list of MINIX commands
2011-07-25 11:50:46 +02:00
Ben Gras 51ffecc181 import elf-only -lcurses
. abandons mixer, gomoku, talk, talkd, top from base system
	. compile top with clang so no ack-compiled program
	  needs -lcurses any more
2011-07-25 11:08:17 +02:00
Vivek Prakash 1ea07af9da Replace uniq with NetBSD version 2011-07-24 21:40:02 +02:00
Arun Thomas 06617e7fdf Import NetBSD mkdep 2011-07-22 17:28:27 +02:00
Ben Gras f789fee254 import netbsd sed
. speeds up mkdep (i.e. world builds) significantly
	. have to keep minix /bin/sed for a while because previous
	  usr/etc/rc depends on it
	. force mkdep to use /usr/bin/sed for speedup
2011-07-20 15:14:48 +02:00
Vivek Prakash 51e66a47d8 import libterminfo, terminfo.db and stat command 2011-07-18 16:17:14 +02:00
Vivek Prakash 49cab1c73c import NetBSD stat 2011-07-18 16:16:57 +02:00
Ben Gras d83af38877 import ministat utility from freebsd 2011-07-16 17:21:11 +02:00
Vivek Prakash 97c7d358ea Replace indent with NetBSD version
- minix-port.patch is empty as it compiles unchanged
2011-07-05 12:37:57 +02:00
Ben Gras f3d5a9dc61 Reduce compiler/libraries/headers cases to only two
1. ack, a.out, minix headers (moved to /usr/include.ack),
	   minix libc
	2. gcc/clang, elf, netbsd headers (moved to /usr/include),
	   netbsd libc (moved to /usr/lib)

So this obsoletes the /usr/netbsd hierarchy.

No special invocation for netbsd libc necessary - it's always used
for gcc/clang.
2011-07-04 04:09:52 +02:00
Arun Thomas 5971d0532c GCC build option for elf libs and usr.bin 2011-06-29 10:32:37 +02:00
Arun Thomas ecb1c96fc5 Build libelf and mkimage in world 2011-06-29 09:33:40 +02:00
Arun Thomas 2e8d1eda1b Replace m4 with NetBSD version
-Create usr.bin hierarchy
-Update minix-port.patch to include m4
2011-06-29 09:33:30 +02:00