Commit graph

4073 commits

Author SHA1 Message Date
Erik van der Kouwe c50ec2b4e2 fix missing return statement in nonamed causing network failure after 300s when compiling with GCC 2011-04-21 19:14:25 +00:00
Thomas Veerman 20a04a068d Generate .gitignore file for tools directory 2011-04-21 13:20:55 +00:00
Thomas Veerman 22049c1ec3 Enable generation of .gitignore file for the test dir 2011-04-21 13:20:13 +00:00
Thomas Veerman 827daf1fca Make test40 behave
Make test40 behave better. It should create its own subdirectory to
conduct its tests and should not write to /tmp. Also, the master-slave
terminal pair it tries to open might be in use; it should try to obtain
another pair. These changes allow the test to be run multiple times
simultaneously from different paths (to test select() more intensively).
2011-04-21 13:18:00 +00:00
David van Moolenbroek 196de8bc40 sprofalyze.pl: fix for forked-nonexeced processes 2011-04-20 21:39:13 +00:00
Ben Gras 2b09bfde6d kernel: fix logic error in the case vm_lookup fails 2011-04-20 10:17:08 +00:00
David van Moolenbroek 46cee00ad8 Kernel: try_async/try_one fixes
- skip processes that are not asynsending to the target
- do not clear whole asynsend table upon IPC permission error
- be more accepting when one table entry is bogus later on
2011-04-18 22:56:34 +00:00
David van Moolenbroek afb8067c4f dhcpd: fix newly introduced ACK warnings 2011-04-16 11:13:31 +00:00
David van Moolenbroek 020277a38f libmthread: support for thread-local storage (keys/specifics) 2011-04-14 11:54:43 +00:00
Tomas Hruby dc8ee363db SMP - INIT IPI deasserting fix
When deasserting the INIT IPI the DM field must be zero
2011-04-13 16:57:43 +00:00
Thomas Veerman b1a60476c0 Return errors directly instead of using errno 2011-04-13 14:01:13 +00:00
Thomas Veerman aba392e630 Clean up and fix multiple bugs in select:
- Remove redundant code.
 - Always wait for the initial reply from an asynchronous select request,
   even if the select has been satisfied on another file descriptor or
   was canceled due to a serious error.
 - Restart asynchronous selects if upon reply from the driver turns out
   that there are deferred operations (and do not forget we're still
   interested in the results of the deferred operations).
 - Do not hang a non-blocking select when another blocking select on
   the same filp is still blocking.
 - Split blocking operations in read, write, and exceptions (i.e.,
   blocking on read does not imply the write will block as well).
 - Some loops would iterate over OPEN_MAX file descriptors instead of
   the "highest" file descriptor.
 - Use proper internal error return values.
 - A secondary reply from a synchronous driver is essentially the same
   as from an asynchronous driver (the only difference being how the 
   answer is received). Merge.
 - Return proper error code after a driver failure.
 - Auto-detect whether a driver is synchronous or asynchronous.
 - Remove some code duplication.
 - Clean up code (coding style, add missing comments, put all select
   related code together).
2011-04-13 13:25:34 +00:00
Thomas Veerman f0740680cd Do not print an error message when a binary is corrupt 2011-04-12 13:09:19 +00:00
David van Moolenbroek c51cd5fe91 Server/driver protocols: no longer allow third-party copies.
Before safecopies, the IO_ENDPT and DL_ENDPT message fields were needed
to know which actual process to copy data from/to, as that process may
not always be the caller. Now that we have full safecopy support, these
fields have become useless for that purpose: the owner of the grant is
*always* the caller. Allowing the caller to supply another endpoint is
in fact dangerous, because the callee may then end up using a grant
from a third party. One could call this a variant of the confused
deputy problem.

From now on, safecopy calls should always use the caller's endpoint as
grant owner. This fully obsoletes the DL_ENDPT field in the
inet/ethernet protocol. IO_ENDPT has other uses besides identifying the
grant owner though. This patch renames IO_ENDPT to USER_ENDPT, not only
because that is a more fitting name (it should never be used for I/O
after all), but also in order to intentionally break any old system
source code outside the base system. If this patch breaks your code,
fixing it is fairly simple:

- DL_ENDPT should be replaced with m_source;
- IO_ENDPT should be replaced with m_source when used for safecopies;
- IO_ENDPT should be replaced with USER_ENDPT for any other use, e.g.
  when setting REP_ENDPT, matching requests in CANCEL calls, getting
  DEV_SELECT flags, and retrieving of the real user process's endpoint
  in DEV_OPEN.

The changes in this patch are binary backward compatible.
2011-04-11 17:35:05 +00:00
Gianluca Guida 4e86b0d53f Move back resolv.h, nameser.h and netdb.h as they conflict with NetBSD headers and libc. 2011-04-08 18:50:58 +00:00
David van Moolenbroek c4928b2df9 libsys: fix micro_delay() 2011-04-08 16:57:44 +00:00
Thomas Veerman 2cde22ee10 Enable a process to find out what the error code was when delivery of an
asynchronous message resulted in an error.

The model here is that:
 - Iff a sender wishes to be notified, the sender MUST check for errors
   BEFORE sending another asynchronous message.

The reason is that in order to remember the error code, we can't clean up
the message table and hence we risk running out of table space. This is
less of a problem when the sender enables notifications only for errors.
2011-04-08 15:23:12 +00:00
Thomas Veerman 7457cbe62f Enable sending a notification when sending of an asynchronous message was
completed (successfully or not). AMF_NOTIFY_ERR can be used if the sender 
only wishes to be notified in case of an error (e.g., EDEADSRCDST). A new
endpoint ASYNCM will be the sender of the notification.
2011-04-08 15:14:48 +00:00
Thomas Veerman 16e0e9370e Use a bitmap for pending asynchronous messages instead of a global flag.
That way it works similar to pending notifications.
2011-04-08 15:03:33 +00:00
Thomas Veerman 9db2311b22 Reduce the number of copies done by the kernel when handling retrieval and
delivery of asynchronous messages.
2011-04-08 14:53:55 +00:00
Tomas Hruby 8200e91073 Fixed smp compilation
- missing u64.h include after 64bit routines for gcc got inlined
2011-04-08 11:52:30 +00:00
Arun Thomas cd9b4b46f4 libexec: return physaddr info from ELF headers 2011-04-07 12:22:36 +00:00
Tomas Hruby b2c2dc72bc LWIP - Fix for dhcpd broadcast to work after boot
Dhcp only works if devices are configured with a broadcast source
address at the begining as it currently uses raw ip sockets and the
sockets sets the source address. It is a quick hack and proper hdcpd
fix is preferable
2011-04-07 07:44:27 +00:00
Tomas Hruby 0039e02339 LWIP - scripts
This changes to the boot scripts allow switching to lwip simply by
setting lwip=yes  in the boot monitor.
2011-04-07 07:44:23 +00:00
Tomas Hruby 8171eb0b3d LWIP - dhcpd --lwip
A sort of quick hack for dhcpd to work as a client with lwip server.

- The functionality is not changed unless --lwip switch is supplied.
  dhcpd does not use broadcast udp sockets but some sort of raw
  sockets and changes their behavior during their life by ioctls.

- I thought there is no need to polute lwip just to make dhcp client
  work. Instead I decided to twist the client a little bit.

- It is so far the only big collision I found between inet and lwip.
2011-04-07 07:44:17 +00:00
Tomas Hruby dca25a1b39 LWIP - the lwip server
The server implements inet-like interface to vfs and drivers. The core
functionality is contained in the liblwip.
2011-04-07 07:44:11 +00:00
Tomas Hruby abab24b785 LWIP - liblwip
lwip-1.4.0-rc1 imported as liblwip
2011-04-07 07:43:36 +00:00
Tomas Hruby 77172e23f7 LWIP - udp_io_hdr.h
lwip server needs to include struct udp_io_hdr but must not include
struct udp-hdr as it conflicts with its internal type. So it is split
into to files now.
2011-04-07 07:43:03 +00:00
Gianluca Guida 3bbd454578 [NBSD libc] Various fixes. 2011-04-06 15:59:10 +00:00
David van Moolenbroek 8e5cad159f mkfs.mfs: use bitchunk_t (reported by Maurizio Lombardi) 2011-04-05 19:42:08 +00:00
David van Moolenbroek 53ad9d83b9 libvtreefs: return OK from REQ_INHIBREAD (this unbreaks grep on /proc) 2011-03-31 16:23:00 +00:00
David van Moolenbroek 8a925dcf90 tail(1): write partial last line also with -f 2011-03-25 10:59:48 +00:00
David van Moolenbroek 28f2a169da VFS: bugfixes for handling block-special files:
- on driver restarts, reopen devices on a per-file basis, not per-mount
- do not assume that there is just one vnode per block-special device
- update block-special files in the uncommon mounting success paths, too
- upon mount, sync but also invalidate affected buffers on the root FS
- upon unmount, check whether a vnode is in use before updating it
2011-03-25 10:56:43 +00:00
David van Moolenbroek 14e641cb8c PFS: UDS code cleanup:
- coalesce lots of duplicate code
- avoid using errno as much as possible
- fix bugs in some error handling cases
2011-03-25 10:52:53 +00:00
David van Moolenbroek 7a9e3651fd drivers/sb16: delete altogether; the latest copy is in drivers/audio/sb16 2011-03-25 10:48:16 +00:00
David van Moolenbroek 294112db54 misc drivers: remove more non-safecopy support 2011-03-25 10:45:57 +00:00
David van Moolenbroek f56c4001d5 TTY/LOG driver cleanup:
- remove non-safecopy support from TTY
- make TTY warning-free with gcc -Wall
- remove obsolete diagnostics support
2011-03-25 10:43:24 +00:00
Gianluca Guida 9caa53e8d9 Add libasyn, asynchio support for netbsd libc. 2011-03-23 15:28:22 +00:00
Gianluca Guida 15e58909b6 NBSD includes: Include sys/reboot.h in unistd.h
Minix expect RBT_* ops to be defined in unistd.h.
2011-03-22 14:54:38 +00:00
Gianluca Guida 878ba523ac Add libminlib for NBSD libc compilation.
This library includes various random and minix-specific functions
included in the Minix libc. Most of them should be part of libsys,
and in general it would be nice to extinguish this library over
time.
2011-03-22 13:47:35 +00:00
Gianluca Guida 6bcf58bab8 Add libcompat_minix for NBSD libc
libcompat_minix is a compatibility layer meant to let existing commands to work
with the new libc.
2011-03-18 16:08:26 +00:00
Gianluca Guida 0dc9e0996a Import unmodified NetBSD's libm for compiling with new libc.
As the current libc includes a libm implementation, with the new libc
this is needed. Unneeded (for the moment) archs have been removed.
2011-03-18 15:52:16 +00:00
Gianluca Guida 6f4e3dd910 Move elf headers in common/include and libexec.h in lib/libexec.
It also fixes elf headers for NBSD compilation.
2011-03-18 15:13:05 +00:00
Thomas Veerman c8d0edc06a - Refactor mthread structure fields to prevent name clashes
- Remove sanity checks for initialized mutexes and condition variables. This
  significantly boosts performance. The checks can be turned back on by
  compiling libmthread with MTHREAD_STRICT. According to POSIX operations on
  uninitialized variables are a MAY fail if, therefore allowing this
  optimization.
- Test59 has to be accommodated to the lack of sanity checks on uninitialized
  variables in the library. It specifically tests for them and will run into
  segfaults when the checks are absent in the library.
- Fix a few bugs related to the scheduler
- Do some general code cleanups
2011-03-18 10:29:54 +00:00
Erik van der Kouwe 03a7d0e8ae Add cttybaud boot monitor variable to control speed of serial console (combine with ctty 0) 2011-03-16 12:25:10 +00:00
Ben Gras 5f1ab506c8 remove some debugging output from vm/region.c
- don't print verbose process map when legitimate errors occur
2011-03-16 11:57:35 +00:00
Thomas Veerman 898cce256f Add support for the 82567LM flavor of e1000 2011-03-15 10:04:35 +00:00
Thomas Veerman ba8af817fc Fix compilation error. Does not need ansi.h header. 2011-03-10 14:10:16 +00:00
Ben Gras db8c7af0b8 release.sh: explicitly use the pkgin pkg_install pkg_add
. when switching from the base pkg_install to the pkgin pkg_install,
    the version number changed, causing a compatability problem if the
    old base system binary was inadvertently left behind.

  . this change checks for that situation by specifically invoking
    the pkgin instance of pkg_install and telling the user to install
    it if it doesn't exist.
2011-03-10 12:54:58 +00:00
Dirk Vogt 97980446a4 Cleaning up Makefiles (thx antoine) 2011-03-07 13:54:17 +00:00