Commit graph

834 commits

Author SHA1 Message Date
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
Thomas Veerman
c77228c77b ARM: fix clock
The GPTIMER1 clock is configured to run at 32 kHz and generate
(overflow) interrupts every 1 ms. However, the Timer Overflow Wrappping
Register (TOWR) was configured to filter every other interrupt. This
caused to the internal 'realtime' value to be off.
2013-01-11 09:18:36 +00:00
Thomas Veerman
aa3623d873 ARM: make cycle counter available to userspace 2013-01-11 09:18:36 +00:00
Thomas Veerman
ea8ff9284a Add stack trace dumps for VFS over serial 2013-01-11 09:18:36 +00:00
Antoine Leca
ffdb12bc9b Drop obsolete klib16.S
The 16-bit poweroff16() function is not called any more.
2013-01-08 16:00:37 +00:00
Ben Gras
604046faf3 kernel: trap-dependent state restore, trace fixes
. restore state depends on how saving of state was done;
	  also remember trap style in sig context
	. actually set and restore TRACEBIT with new trap styles;
	  have to remove it once process enters kernel though, done
	  in debug trap exception handler
	. introduce MF_STEP that makes arch-specific code
	  turn on trace bit instead of setting TRACEBIT directly,
	  a bit more arch-friendly and avoids keeping precious
	  state in per-process PSW arch-dependently
2013-01-08 15:47:37 +00:00
Ben Gras
51a3e84a97 kernel: separate state for trace-deferred syscalls
state is usually not in p_reg any more with sysenter/syscall trap entries,
so when saving/restarting do_ipc invocations the state has to be remembered
explicitly.
2013-01-08 15:47:37 +00:00
Ben Gras
7f1018b145 kernel: restore setting KTS_NONE
The 'trap style' variable records how a process has trapped into the
kernel (hardware/software interrupt, or one of the other trap
instructions). KTS_NONE indicates the process isn't trapped into the
kernel at all and is useful for sanity checking. The KTS_NONE reset was
inadvertently removed while removing some debugging code and this commit
restores it.
2013-01-08 15:47:37 +00:00
Kees Jongenburger
75c515e5f8 kernel:add a some information in backtraces.
* Display the pid and process name in the backtrace as we can
currently not read stackframes.

Change-Id: I2435d4098553c5b02adfe36f08b5aa3f47e9b531
2013-01-08 13:40:32 +01:00
Kees Jongenburger
09895f86fc vm:enable the instruction and data caches.
Enable the instruction and data caches. Whether data is cached
will depend on the MMU entries.

Change-Id: I51e9ebc38924db5525d4e7ad9ab69b2a5b1ca7b4
2013-01-08 13:40:32 +01:00
Ben Gras
9ee8c2c75f kernel: restore stacktraces
When processes have entered the kernel with one of the new
trap modes, %ebp is not valid, used for stacktraces, so we
need an alternative way to retrieve it to make the stacktraces
valid again.
2013-01-07 20:18:48 +00:00
Ben Gras
125fc7a918 kernel: vm kernel call can't suspend 2012-12-29 00:56:46 +00:00
Ben Gras
59ff758441 kernel debug: priv can be NULL early on 2012-12-29 00:56:42 +00:00
Lionel Sambuc
456a46e6bf Removing useless minix/types.h header
Change-Id: If5f922279b87f075f301b64c7786caa18b434c2a
2012-12-07 13:58:06 +01:00
Erik van der Kouwe
57c748b968 Remove ability to pass commands to bootloader 2012-11-22 19:16:17 +01:00
Erik van der Kouwe
22fa466268 Restore poweroff to some of it's former glory (on QEMU, at least) 2012-11-21 20:28:37 +01:00
Ben Gras
6e535c3aaf kernel: kill proc with bogus ipc address 2012-11-19 10:53:17 +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
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
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
Ben Gras
ba05f39d1e kernel: some boottime sanitychecks
. Check if we have the right number of boot modules
	. Check if the ELF parsing of VM actually succeeded

Both these are root causes of less-than-obvious other
errors/asserts a little further down the line; uncovered
while experimenting with booting by iPXE, specifically
(a) iPXE having a 8-multiboot-modules limit and
(b) trying to boot a gzipped VM.
2012-11-08 11:40:35 +01:00
Ben Gras
196021cd82 drop safemap code 2012-10-30 13:55:42 +01:00
Thomas Veerman
aeda8e5c7b Kernel: reenable interrupts before halting 2012-10-30 11:32:05 +00:00
Thomas Veerman
87de141141 Kernel: busy wait until serial out has finished 2012-10-30 11:32:04 +00:00
Arun Thomas
471a03a362 ARM support for kernel and vm 2012-10-07 21:38:03 -04:00
Arne Welzel
d8a89dcbe6 kernel: add safememset() kernel call 2012-09-26 02:18:00 +02:00
Arne Welzel
0617743bd1 kernel: handle pagefaults in vm_memset() 2012-09-26 02:17:59 +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
Arne Welzel
629829e69c phys_memset improvements
. verify length argument
	. use rep stosl / stosb
2012-09-21 14:15:44 +02:00
Ben Gras
fe6e291f59 vm, kernel, top: report memory usage of vm, kernel 2012-09-18 23:43:52 +02:00
Ben Gras
19e6dad47b VM: only single page chunks
. only reference single pages in process data structures
   to simplify page faults, copy-on-write, etc.
 . this breaks the secondary cache for objects that are
   not one-page-sized; restored in a next commit
2012-09-18 13:17:49 +02: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
9a9d555f56 machine/ipcconst.h for arch-specific constants 2012-08-27 19:46:41 -04:00
Ben Gras
e4ac80eb60 various warning/errorwarning fixes for gcc47
. warnings (sometimes promoted to errors) in servers/ and kernel/
 . -Os for ext2 boot module to make it small enough
2012-08-27 16:19:18 +02:00
Ben Gras
41ab295654 hide block_t behind _MINIX (for gcc) 2012-08-24 18:07:37 +02:00
Ben Gras
caa7efa117 kernel: rely on alignment directive for stacks
. unnecessary to do it manually with ELF
	. also makes 1 extra alignment page unnecessary
2012-08-19 01:04:51 +02:00
Ben Gras
d69cc76e03 rename struct mem_range to minix_mem_range
. avoid a name clash with gdb
2012-08-15 15:17:25 +02:00
David van Moolenbroek
8e116b71a1 Kernel: resolve Coverity warnings 2012-08-15 11:12:11 +00:00
David van Moolenbroek
0b5c2a058c Kernel: use okendpt() to resolve stored endpoints
This adds an integrity check at very little cost, and should stop
Coverity from flagging array overruns on the result.
2012-08-15 08:50:30 +00:00
David van Moolenbroek
c0aa9bf6ed Kernel: resolve -Wall warnings for SMP 2012-08-14 16:38:03 +00:00
David van Moolenbroek
cf9a4ec79b Kernel: clean up include statements a bit
Coverity was flagging a recursive include between kernel.h and
cpulocals.h. As cpulocals.h also included proc.h, we can move that
include statement into kernel.h, and clean up the source files'
include statements accordingly.
2012-08-14 16:29:05 +00:00
Arun Thomas
697f0d097f Rename sys_vmctl_get_cr3_i386 2012-08-12 23:30:54 +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
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
Ben Gras
53a947167c kernel: few more objects required in unpaged mode
. for 64-bit printf()
2012-07-28 22:26:52 +02:00
Ben Gras
11084d94e6 kernel: clean up objects
. objects left over from libraries are left around
2012-07-28 22:21:53 +02:00
David van Moolenbroek
6ded58b510 kernel: give kernel tasks their process name back 2012-07-26 14:35:08 +00:00
Ben Gras
49d4116100 kernel: keep serial info in system env
. otherwise serial hardware gets reinitialized by tty
2012-07-18 15:16:57 +02:00