Commit graph

4505 commits

Author SHA1 Message Date
Ben Gras
1eea0f5680 inet: strncmp() fix 2012-02-03 14:49:18 +01:00
Ben Gras
cdbc4bfb13 temporarily disable update-superblock check
. incompatible with installboot -d FSDEV on mounted filesystems
	. should be re-enabled when netbsd boot loader is default
2012-02-02 15:04:51 +01:00
Thomas Veerman
b33f504e8f APFS: fix link issue when compiling with Clang 2012-02-02 15:00:01 +00:00
Thomas Veerman
a65ff8a1aa INET: fix 'improved' assert 2012-02-02 11:53:52 +00:00
Thomas Veerman
23491b7f46 Remove unused variables 2012-02-02 10:47:06 +00:00
Thomas Veerman
224a0f6e90 INET: fix a few GCC compilation warnings 2012-02-01 13:24:28 +00:00
Thomas Veerman
71634240a0 libpuffs: make GCC happy 2012-02-01 13:23:33 +00:00
Thomas Veerman
4d3a0887b4 AVFS: only put mount point when it was used as one
When a mount operation fails and the FS exits, free_proc could try and
clean up resources associated with the mount point before the mount
thread itself can do that. However, the clean up procedure should only
clean up resources that were actually in use.
2012-02-01 13:22:53 +00:00
Thomas Veerman
d4cdd59eaa service: allow starting service with user's realuid 2012-02-01 13:21:56 +00:00
Thomas Veerman
d5210e9bdd e1000: reset hardware before stopping 2012-01-30 16:47:11 +00:00
Thomas Veerman
a87ec6840f INET: remove erroneous assert
The queue may contain established connections which have
tc_connInprogress clear.
2012-01-30 16:09:08 +00:00
Thomas Veerman
1ff24e3f2f Don't panic on a misconfigured machine 2012-01-30 15:16:20 +00:00
Thomas Veerman
1fc399a5c1 Add permission test for bind and socket
Also, apply forbidden patch to VFS from AVFS (fixes hanging test56 if
it has the permission test).
2012-01-30 15:16:20 +00:00
Thomas Veerman
9330d92639 INET: drop privileges upon startup 2012-01-30 15:16:20 +00:00
Thomas Veerman
becf700bc2 APFS: drop privileges upon startup
Move SERVICE_LOGIN to rs.h global header so it's accessible for all.
2012-01-30 15:16:20 +00:00
Thomas Veerman
9233fdb359 AVFS: make forbidden check for specific proc instead of fp 2012-01-30 15:16:20 +00:00
Thomas Veerman
0e537f1085 AVFS: initialize root FS before receiving new work 2012-01-30 15:16:20 +00:00
Thomas Veerman
0bd011affd PM: extend srv_fork to set a specific UID
Currently, all servers and drivers run as root as they are forks of
RS. srv_fork now tells PM with which credentials to run the resulting
fork. Subsequently, PM lets VFS now as well.

This patch also fixes the following bugs:
 - RS doesn't initialize the setugid variable during exec, causing the
   servers and drivers to run setuid rendering the srv_fork extension
   useless.
 - PM erroneously tells VFS to run processes setuid. This doesn't
   actually lead to setuid processes as VFS sets {r,e}uid and {r,e}gid
   properly before checking PM's approval.
2012-01-30 15:16:19 +00:00
Erik van der Kouwe
4bee3cff2e Prevent the ramdisk makefile from failing if the last image is not ELF 2012-01-27 13:10:00 +01:00
Tomas Hruby
5c0927e108 SMP - clock calibration spurious IRQ deadlock fix
- this patch fixes a deadlock which may occur if we get a
   spurious interrupt while calibrating clocks during the boot
   time. Since we never handle interrupts while in the kernel
   (BKL locked) the interrupt code locks the lock. This is a
   different situation, a corner case, boot time only. We do not
   return to userspace but to the kernel, so the BKL is not
   unlocked. So we need irq handler which leaves the BKL
   unlocked.  The clock handler does it already, this patch adds
   a dummy spurious irq handler for the same reason. It is better
   to handle the situation this way to keep the normal runtime
   code simple.
2012-01-26 11:39:40 +00:00
Tomas Hruby
c468f4efa5 SMP - no_apic=0 and acpi=1 set when CONFIG_SMP=y
- this is a temporary change which makes images compiled for SMP
  boot in SMP mode by default.

- this change is needed until we can configure the multiboot
  images from the boot loader again.
2012-01-25 19:02:13 +00:00
Tomas Hruby
9e1d244cbe Revert 93b9873a56
- non need to have free PDEs per CPU since we only run one
  instance of the kernel at any time
2012-01-25 18:59:18 +00:00
Ben Gras
57b2fe851c mtree: zoneinfo dirs 2012-01-20 19:13:25 +01:00
Antoine Leca
57794c6690 Don't overwrite old mv, ln, cp, etc man pages with new rm 2012-01-20 09:48:48 +00:00
Thomas Veerman
e894c9e1b5 Don't print events that happen often 2012-01-19 17:06:14 +00:00
Thomas Veerman
700641afb8 lseek should not yield a negative file position 2012-01-19 16:48:01 +00:00
Thomas Veerman
5691dca9f4 Don't try to find file position beyond double indirect blocks 2012-01-19 16:47:47 +00:00
Thomas Veerman
ddbdca6cdb Add support for survival of crashed FSs
When an FS crashes, VFS will clean up resources tied to that FS:
 - Pending requests to the FS are canceled (i.e., fail with EIO)
 - Threads waiting for a reply are stopped (i.e., fail with EIO)
 - Open files are marked invalid. Future operations on a file descriptor
   will cause EBADF errors.
 - vmnt entry is cleared, so in-flight system calls that got past the
   file descriptor check but not yet talking to the crashed FS, will
   fail with EIO.
 - The reference counter of the mount point is decreased, effectively
   removing the crashed FS from the file system tree. Descendants of
   this part of the tree are unreachable by means of a path, but can
   still be unmounted by feeding the block special file to unmount(2).

This patch also gets rid of the "not a known driver endpoint" messages
during shutdown.
2012-01-19 14:21:46 +00:00
Ben Gras
dd59d50944 mfs: mark blocks clean when invalidated
. it could happen that newly filled blocks were still marked
	  dirty
	. causing unnecessary i/o and the new warning of the superblock
	  being written
2012-01-18 17:51:04 +01:00
Thomas Veerman
a6d0ee24c3 Use correct value for _NSIG
User processes can send signals with number up to _NSIG. There are a few
signal numbers above that used by the kernel, but should explicitly not
be included in the range or range checks in PM will fail.

The system processes use a different version of sigaddset, sigdelset,
sigemptyset, sigfillset, and sigismember which does not include a range
check on signal numbers (as opposed to the normal functions used by normal
processes).

This patch unbreaks test37 when the boot image is compiled with GCC/Clang.
2012-01-16 11:42:29 +00:00
Thomas Veerman
a282e942bf INET: initialize timer to not-in-use 2012-01-16 11:09:46 +00:00
Thomas Veerman
e35528ae79 New zoneinfo port from NetBSD 2012-01-16 11:03:25 +00:00
Thomas Veerman
e257c999b8 Replace rm and rmdir with NetBSD version 2012-01-16 10:46:14 +00:00
Thomas Veerman
f18dab92bf Remove unused variable 2012-01-16 10:12:29 +00:00
Thomas Veerman
078adc7ed7 Increase thread stack space for GCC compiled images 2012-01-16 10:12:29 +00:00
Thomas Veerman
e6c98c3c55 AVFS: Return actual last dir when path is named by a symlink
Last_dir didn't consider paths that end in a symlink and hence didn't
actually return the last_dir when provided with one. For example,
/var/log is a symlink to /usr/log. Issuing `>/var/log' would trigger
an assert in AVFS, because /var/ is not the actual last directory; /usr/
is.

Last_dir now verifies the final component is not a symlink. If it is, it
follows the symlink and restarts finding of the last the directory.
2012-01-16 10:12:29 +00:00
David van Moolenbroek
c89aaf7a87 vfs/avfs: renumber stat calls so as to be unique
The old stat call numbers are still supported for a while.
2012-01-14 00:27:07 +01:00
David van Moolenbroek
2c685f34e0 Cut PM out of the adddma/deldma/getdma call path 2012-01-14 00:27:06 +01:00
David van Moolenbroek
8cb7ba7951 Remove obsolete PROCSTAT/getsigset call. 2012-01-14 00:27:06 +01:00
Jan Wieck
2fe79d0b76 Implement AcpiOsStall, AcpiOsSleep, AcpiOsGetTimer
- change AcpiOsRemoveInterruptHandler() to print a warning
  instead of panic.

- we do the same in AcpiOsInstallInterruptHandler().

Signed-off-by: Tomas Hruby <thruby@few.vu.nl>
2012-01-13 18:57:53 +00:00
Ben Gras
4668b84158 vm_remap_ro
- allows shared memory to be mapped in readonly

- ben@minix3.org & tom@minix3.org
2012-01-13 11:30:01 +00:00
Tomas Hruby
88f990e122 VM - vm_unmap() takes SELF as valid argument 2012-01-13 11:30:01 +00:00
Tomas Hruby
974452d4dd VM - clear vminhibit iff it was set 2012-01-13 11:30:01 +00:00
Tomas Hruby
758d788bbe SMP - asyn send SMP safe
- we must not deliver messages from/to unstable address spaces.
  In such a case, we must postpone the delivery. To make sute
  that a process which is expecting an asynchronous message does
  not starve, we must remember that we skipped delivery of some
  messages and we must try to deliver again once the source
  address space is stable again.
2012-01-13 11:30:01 +00:00
Tomas Hruby
0bb56e0e04 SMP - smp_schedule()
- always issues an IPI
2012-01-13 11:30:01 +00:00
Tomas Hruby
41bd5f2fc6 SMP - cpu_is_idle made volatile 2012-01-13 11:30:00 +00:00
Tomas Hruby
8fa95abae4 SMP - fixed usage of stale TLB entries
- when kernel copies from userspace, it must be sure that the TLB
  entries are not stale and thus the referenced memory is correct

- everytime we change a process' address space we set p_stale_tlb
  bits for all CPUs.

- Whenever a cpu finds its bit set when it wants to access the
  process' memory, it refreshes the TLB

- it is more conservative than it needs to be but it has low
  overhead than checking precisely
2012-01-13 11:30:00 +00:00
Tomas Hruby
0a55e63413 SMP - fixed IPI livelock
- two CPUs can issue IPI to each other now without any hazzard

- we must be able to handle synchronous scheduling IPIs from
  other CPUs when we are waiting for attention from another one.
  Otherwise we might livelock.

- necessary barriers to prevent reordering
2012-01-13 11:30:00 +00:00
Tomas Hruby
0468fca72b SMP - do_update fix
- adjust_proc_slot() must preserve scheduling info, for example
  on which cpu the process should run

- do_update() - consitency check
2012-01-13 11:30:00 +00:00
Tomas Hruby
192db70960 KERNEL - cause SIGSEGV if bad pointer to kernel 2012-01-13 11:30:00 +00:00