Commit Graph

511 Commits

Author SHA1 Message Date
pooka
8ffd7b368a document libraries in rump/net/lib 2008-10-09 11:50:08 +00:00
pooka
02100cd42d Wrap potentially blocking operations to drop and retake the kernel
giant lock.
2008-10-09 01:19:06 +00:00
pooka
01f8a524d4 Rewrite kernel lockus maximus handling to be correct. 2008-10-09 01:17:48 +00:00
pooka
ea7f1c6709 check return value of rump_init() 2008-10-08 11:01:28 +00:00
pooka
f4ce96e86b check rump_init() return value 2008-10-07 23:22:05 +00:00
pooka
5877c6dc5e Embed library build version into the init call and refuse to init
if they don't match.  In other words, this is a lightweight library
major number.
2008-10-07 23:16:59 +00:00
pooka
e15435197f Make libnfs compile. 2008-10-06 01:00:57 +00:00
pooka
f4c6b13e6b Locally descend into new directories (build does not descend here yet). 2008-10-06 00:32:02 +00:00
pooka
61e869be3c Implement a virtual userspace networking interface. This is required
for any sensible operation when running the entire TCP/IP stack in
userspace (as opposed to libsockin which uses host kernel networking
to provide PF_INET).

While this basically works (although it is quite barebones), it
depends on some bit of cleanup in librump and is not built by
default yet.
2008-10-06 00:30:32 +00:00
pooka
86cf71862e Provide the TCP/IP as a rump library. 2008-10-06 00:27:48 +00:00
pooka
8fb9f99bba Provide essentially sys/net as a rump library. 2008-10-06 00:27:06 +00:00
pooka
ad9bbd7b26 Add a very simplistic PF_INET/SOCK_DGRAM domain/proto implementation,
which delegates the work to host kernel sockets.  This does not
run the entire kernel TCP/IP stack in userspace and therefore does
not require the ability to send or receive raw packets.  This
implies that root priviledges are not required.  As already said
above, only supports UDPv4 for now.  Extending should be easy.
2008-10-02 21:59:19 +00:00
pooka
982852e71e Add some routines related to networking. 2008-10-02 21:37:59 +00:00
pooka
fc745dffe8 Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.
2008-10-02 19:37:23 +00:00
pooka
43242e6cbe Make spec_fsync() a do-nothing instead of a do-panic. Some file
systems have it directly in the specfs op vector.
2008-09-30 21:47:33 +00:00
pooka
85ca5618f1 Check that we apply the previous kludge only to the root vnode. 2008-09-30 21:00:39 +00:00
pooka
24fd6139c3 When paging in data, do not try to read past "disk" EOF. This
fixes reads for file systems which are not bound by such mundane
limitations as block size (example: nfs).
2008-09-30 20:08:23 +00:00
pooka
4fb0fb162c Make sure proc0.p_vmspace qualifies as VMSPACE_IS_KERNEL_P(). 2008-09-30 19:50:16 +00:00
pooka
44e0ae2322 Switch to std kern_auth. 2008-09-30 19:25:56 +00:00
pooka
8bf6577840 Always set HASBUF when creating a componentname. 2008-09-30 16:51:26 +00:00
pooka
eb50fe2242 Add an unspeakable kludge for nfs, which keeps an explicit reference
to the root vnode.  Properly fixing this would require fixing p2k,
which would require fixing puffs, which has some optimizations,
which are incompatible with kernel file systems...  guess my Eyes
of the Overworld were misplaced at that time.
2008-09-30 15:26:54 +00:00
reinoud
19eb6cb8aa Remove the not anymore used UDF_READWRITE flag. 2008-09-28 09:02:45 +00:00
pooka
2208b2d0df add WARNS=4 2008-09-27 20:49:55 +00:00
pooka
9db630e082 Help out reinoud a bit with the challenge of adding vfs_dirhash.c here 2008-09-27 16:03:30 +00:00
pooka
dd1721fa8d Move global malloc types from kern_malloc into a separate module. 2008-09-25 16:23:45 +00:00
pooka
e90eb67076 * fsync after !B_ASYNC write
* replace some b_flags magic with BUF_ISREAD/WRITE()
2008-09-11 13:42:35 +00:00
tron
b8771f491d Fix build problem with puffs enabled caused by the fix for PR kern/39493.
Problem noted by Thomas Klausner, patch provided by Juan RP.
2008-09-09 19:22:00 +00:00
pooka
e63b31a974 Give lwp0 an fd table and cwd. Allows easier direct use of rump. 2008-09-07 20:17:03 +00:00
pooka
429abb75bf regen: return -1 for error 2008-09-07 19:28:29 +00:00
pooka
aa224b94d6 fix broken break (oh the irony) 2008-09-05 10:42:09 +00:00
pooka
795cda8d6a Add rump support for sysvbfs. 2008-09-04 12:21:25 +00:00
pooka
827e91dd6f Make syspuffs mount code supply mount_syspuffs_parseargs() like
the other mount binaries do.  Now syspuffs can be used to run all
puffs file systems as utilities.  This includes fuse file systems
and becomes interesting with the fs-utils project.  We can now do
e.g. this:

  ReFUSE ntfs-3g:
golem> echo hello | fsu_write/fsu_write ntfs-3g puffs ~/img/ntfs.img dafile
golem> fsu_cat/fsu_cat ntfs-3g puffs ~/img/ntfs.img dafile
hello
golem>

  puffs sysctlfs:
golem> fsu_ls/fsu_ls mount_sysctlfs puffs sysctl -l ddb
total 0
-r-xr-xr-x  1 pooka  users  1 Sep  2 22:11 commandonenter
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 fromconsole
-r-xr-xr-x  1 pooka  users  3 Sep  2 22:11 lines
-r-xr-xr-x  1 pooka  users  8 Sep  2 22:11 maxoff
-r-xr-xr-x  1 pooka  users  3 Sep  2 22:11 maxwidth
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 onpanic
-r-xr-xr-x  1 pooka  users  3 Sep  2 22:11 radix
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 tabstops
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 tee_msgbuf

Same works for psshfs etcetc.

In other words, this provides total integration for "normal"
in-kernel file systems and puffs/fuse file systems on the ukfs
library level.

Note: implementation is still "first stab" and the fs-utils usage
will no doubt change.
2008-09-02 19:38:25 +00:00
pooka
38b7d91d61 Add IPL_SOFTCLOCK, something required it (although I can't quite
recall what, this has been floating in my tree for a while)
2008-09-02 19:27:35 +00:00
pooka
4b9a5d92cf Since putter wants complete frames, make sure we can hand them to it. 2008-08-15 15:02:28 +00:00
pooka
4b5f80486c Make it possible to control starting of threads per env variable
instead of only at compile-time.
2008-08-12 10:04:57 +00:00
pooka
96a0d293a7 Don't create a new proc structure for kthreads (pid == 0).
XXX: this routine should probably do better accounting and consistency
checks as well.
2008-08-08 14:40:07 +00:00
pooka
0fca7fa92c minor nit: fix header #ifndef namespacing 2008-08-08 13:57:59 +00:00
pooka
a1e2d21c3e pg->flags &= PG_CLEAN --> &= ~PG_CLEAN;
Fixes at least writing to the fs for msdosfs.
2008-08-07 21:02:29 +00:00
pooka
3d8b145f98 some more todo points 2008-08-07 11:15:20 +00:00
pooka
7b679f625d Maintain consistency of naming between the rumpfs library name and
the MOUNT_FOOFS name.  Don't bother polluting the obsolete lists
with the original names since they were in only for a few days.
2008-08-05 14:42:03 +00:00
simonb
159018ab5b Enable "options APPLE_UFS". OK pooka@. 2008-08-05 13:16:27 +00:00
pooka
919218a908 Honor PG_RELEASED when unbusying a page.
Fixes ufs file system full problem discovered by Simon Burge.
2008-08-05 13:06:35 +00:00
pooka
27f3f4f004 Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.
2008-08-04 15:02:16 +00:00
pooka
8f1eb24c9f libs don't need NOMAN 2008-08-04 14:35:24 +00:00
simonb
b92eb9eaa1 sort sys/kern SRCS alphabetically. 2008-08-02 15:31:14 +00:00
pooka
0b5af21c5a support real sysctls 2008-08-01 19:34:51 +00:00
pooka
fb5f9816d8 regen: sys___sysctl 2008-08-01 19:33:02 +00:00
pooka
c19f1a2afd Support ukfs_modload(), which dlopens and vfs_attaches rump file
system modules for use.  Sneakily this solves the problem with the
dynamic linker not wanting to handle the modules link set for
binaries where more than one file system library is included during
the link phase and therefore only one of the file systems getting
vfs_attach()ed in rump "boot".  But more importantly, this is really
TRTTD, since now applications can be built, linked and shipped
completely independently of the file systems they support.

tested by Arnaud Ysmal
2008-08-01 14:47:28 +00:00
simonb
36d65f1138 Merge the simonb-wapbl branch. From the original branch commit:
Add Wasabi System's WAPBL (Write Ahead Physical Block Logging)
   journaling code.  Originally written by Darrin B. Jewell while
   at Wasabi and updated to -current by Antti Kantee, Andy Doran,
   Greg Oster and Simon Burge.

OK'd by core@, releng@.
2008-07-31 05:38:04 +00:00
oster
55a54b5762 Fix race during creation of rumpdefs.h, rumpvnode_if.h, and rumpvnode_if.c.
Patch from pooka@ with tweak from me.

Approved by: pooka
2008-07-30 01:32:47 +00:00
pooka
4b68af9947 Prevent amd64 compiler flag -mcmodel=kernel for rump kernel code.
This allows to compile rump libraries as shared libraries also on mad64.

Problem spotted by Greg Oster.  I guess his build broke or something ...
2008-07-29 20:18:25 +00:00
pooka
eef3b7a974 * remove unnecessary .PATH
* wrap malloc
2008-07-29 14:01:25 +00:00
pooka
9dbcf29c49 NOMAN 2008-07-29 14:00:01 +00:00
pooka
cd56ab5fbf Accidentally left behind: these live in src/lib now. 2008-07-29 13:50:24 +00:00
pooka
bdf6e0b034 Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
  * install relevant headers into /usr/include/rump
  * build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
    from src/lib and install as librumpuser and librump, respectively
    + this retains the ability to test a librump build with just the
      kernel sources at hand
  * move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
    for general consumption, they are not kernel-space dwellers anyway
  * build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
  * add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
  * build and install userspace kernel file system daemons if MKPUFFS=yes
    is spexified
  * retire fsconsole for now, it will make a comeback with an actually
    implemented version shortly
2008-07-29 13:17:40 +00:00
pooka
b6138e3eb7 Backup some manual page sketches lest I delete the wrong source tree. 2008-07-28 18:34:31 +00:00
pooka
b00e8162a5 Give rump a faux vmparam.h to work around problematic ports (hooray
for evbppc).  Obligatory inlined rant: it would be really nice if
we didn't have weird ports like that which sport totally incompatible
code for different kernels.
2008-07-28 18:12:15 +00:00
pooka
2ba62ba2c7 Not everyone is building from my yet uncommitted trees, so catchup
here also.

tip-of-the-hat to simonb
2008-07-28 16:27:29 +00:00
pooka
e575982be5 blkset.S is needed on vax by some macros, so include it in the build. 2008-07-28 13:56:59 +00:00
pooka
c8ccd39051 UKFS_UIOINIT() functionality has been provided for ages by rump
function interfaces, so remove the macro.
2008-07-27 16:12:23 +00:00
pooka
2d86f776af Make the previously library-internal "builddirs" an external interface:
ukfs_util_builddirs()

patch from Arnaud Ysmal
2008-07-22 20:02:16 +00:00
pooka
348d0d344d Have a COW with fscow_run(). Fixes problem of allocating files
on ffs with indirect blocks.

found by simonb
2008-07-21 10:51:03 +00:00
pooka
4a0d2098e7 Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL 2008-07-21 10:40:37 +00:00
pooka
cb5ae8f020 Call mountpoint VFS_FSYNC() from specfs fsync.
Makes rump kern/38057-happy.
2008-07-21 00:08:30 +00:00
pooka
655d81c21a Make the user-namespaced rumpuser_cv_has_waiters() of type int
instead of bool to avoid unnecessary problems in trying to provide
the bool type.
2008-07-20 19:03:04 +00:00
pooka
83548151e2 assert -> KASSERT 2008-07-20 16:18:13 +00:00
pooka
0217e22507 You must untypo what you have typoed: rumpnode_if.h -> rumpvnode_if.h 2008-07-20 16:14:22 +00:00
he
6512b04025 The build options for the library parts are mostly located in this
file.  So, in order to better support UPDATE builds, add a dependency
on this file for object files in subdirectories using this file.
2008-07-20 15:56:44 +00:00
pooka
1d89d2370c enable DIAGNOSTIC 2008-07-18 16:20:03 +00:00
pooka
28fdf2df68 support cv_has_waiters() 2008-07-18 16:19:12 +00:00
pooka
00e37d073d emulate vlog() 2008-07-18 16:18:04 +00:00
pooka
6fed9eb99d Don't biohazardwait B_ASYNC buffers. 2008-07-18 16:15:56 +00:00
pooka
3e3b9ce9de Deregister fakeblock path immediately after mount to get it
deregistered also in the case of an error.
2008-07-17 11:25:07 +00:00
pooka
cc7d901591 vfs_subr2 has lost its will to live. vfs_subr was originally split
into two parts so that some of the routines could be used by rump.
Now that rump uses both vfs_subr and vfs_subr2 and there is no
reason to keep two files lying around, re-unite them.
2008-07-16 20:06:19 +00:00
pooka
2707ee274f bring todo list upper-to-dater 2008-07-16 15:54:24 +00:00
pooka
76ee3b3a51 Sync data to baking storage in ukfs_write() 2008-07-16 15:44:11 +00:00
pooka
514afdda21 regen: fsync 2008-07-16 15:43:30 +00:00
pooka
aa652b7453 Nuke the "-p" argument to ukfs_mkdir(). It's not a particularly
brilliant idea to provide that functionality at this level.
2008-07-15 16:21:19 +00:00
pooka
e6891fd321 Honor PGO_FREE in putpages.
Fixes cp-then-rm ukfs panic reported by Arnaud Ysmal.
2008-07-15 15:04:42 +00:00
pooka
37d1079aad add ukfs_utimes() and ukfs_lutimes()
from Arnaud Ysmal
2008-07-07 09:07:18 +00:00
pooka
1a7f1d4a4e regen: u times, lu times, you know i had my share 2008-07-07 09:04:08 +00:00
he
3cb806e403 Add dependencies on the input files + Makefile for the auto-generated
files rumpdefs.h, rumpnode_if.h, and rumpvnode_if.c.  This is so that
an UPDATE build has a chance of succeeding.

Discussed with pooka@, and he wasn't totally against adding this...
2008-07-02 23:03:35 +00:00
he
b6ffc4250b Don't rely on <sys/mutex.h> being implicitly included, because on
some ports (mvme68k for example) that's not happening.
2008-07-02 21:18:14 +00:00
pooka
371212ff48 Add missing calls for attribute management (e.g. chown, stat).
[Incidentally, stat() won't work on non-NetBSD because of struct stat
binary layout difference and needs to be fixed some day]

from Arnaud Ysmal
2008-07-01 13:09:44 +00:00
pooka
e940fdb5d3 regen 2008-07-01 13:03:56 +00:00
pooka
d2e855d5a6 Fixes to build rump utilities as host binaries on Linux by removing
sys namespace pollution which has crept in.

Submitted in private mail by takemura, domain ca2.so-net.ne.jp
2008-07-01 12:33:32 +00:00
matt
0500366437 Don't build rb.c anymore since it's in libc now. 2008-06-30 20:14:42 +00:00
chris
e645b45bcf Add sysctl_teardown stub, moves the build past breakage in rump. 2008-06-28 09:36:29 +00:00
pooka
d496f014ff Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.
2008-06-25 13:16:58 +00:00
pooka
3129a376df Fix location of postcall() in ukfs_chdir().
from Arnaud Ysmal
2008-06-24 14:16:37 +00:00
pooka
281bc3d490 retire rumpuser_usleep() in favor of rumpuser_nanosleep() 2008-06-24 14:14:57 +00:00
pooka
441a8c67a3 Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal
2008-06-24 14:11:44 +00:00
pooka
4de5567459 Allow KAUTH_SYSTEM_MKNOD in kauth_authorize_generic() to make it
possible to execute sys_mknod().

from Arnaud Ysmal
2008-06-23 12:58:12 +00:00
tsutsui
57b3a1930e Regen from syscalls.master rev 1.204. 2008-06-17 16:13:37 +00:00
pooka
77fa4c0e46 Use -3 for wizardmode credentials instead of -1. Technically we
shouldn't have to do this, but some pieces of kernel code still
make direct comparisons like cred == NOCRED (which, incidentally,
is defined as -1).
2008-06-06 10:46:35 +00:00
ad
1f3c2824c9 Make it build again. 2008-06-05 21:27:50 +00:00
ad
f8e053bde9 Make it build again. 2008-06-05 12:43:52 +00:00
ad
75e0baf4da Make it build. 2008-06-04 13:10:06 +00:00
ad
1b23b70818 vfs_cache:
- Don't use goto in critical paths, it can confuse the compiler.
- Sprinkle some branch hints.
- Make namecache stats per-CPU and collate once per second.
- Use vtryget().
2008-06-03 15:50:22 +00:00
ad
fdce452b03 Turn off DIAGNOSTIC so it builds. 2008-05-31 19:28:36 +00:00
pooka
11e4a43ad9 Specify RUMP_WITHOUT_THREADS only in one place. 2008-05-29 13:12:29 +00:00
pooka
3bca2d2000 Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).
2008-05-29 12:25:12 +00:00
pooka
0e278b287d Use rump_sys_pread/write instead of rump_sys_read/write to make I/O
from offset != 0 work again.

from Arnaud Ysmal
2008-05-29 12:03:52 +00:00
pooka
df177ce90b regen 2008-05-29 12:02:31 +00:00
ad
e32f4b0a8d Fix rump build. 2008-05-20 19:02:36 +00:00
reinoud
5d5fb047a1 Make rump compile UDF correctly. Note that it won't work though since rump
needs to be compiled with thread support.
2008-05-14 20:13:05 +00:00
ad
42d0626726 PR kern/38141 lookup/vfs_busy acquire rwlock recursively
Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
  sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
  and is only ever write locked in dounmount(). A write hold can't be taken
  on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
  example when going r/o -> r/w, and is only present to serialize updates.
  In order to take this lock, a read hold must first be taken on
  mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
2008-05-06 18:43:44 +00:00
ad
0f457ea616 Pull in the kernel module stuff so that rump can set up built-in modules. 2008-05-04 12:52:58 +00:00
lukem
66176dfdff Rename MKPRIVATELIB to LIBISPRIVATE, to make it clearer that this is
a variable that is used by in-tree Makefiles to control behaviour.
(MKsomevar variables are generally intended to be controlled by the end-user)
2008-05-03 14:48:30 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
pooka
2d66ed28b9 Unbreak recent breakage. 2008-04-28 19:31:45 +00:00
ad
caba38b804 Catch up with process locking changes. 2008-04-24 17:02:18 +00:00
ad
026542bb25 Regen. 2008-04-24 11:51:47 +00:00
ad
6bd54792e3 Regen. 2008-04-21 12:57:00 +00:00
ad
1c3c41f771 +evcnt_attach_dynamic 2008-04-11 15:24:48 +00:00
ad
481e4d16cb More stubs. 2008-04-11 15:23:45 +00:00
pooka
01c429027f Workaround gcc -Wunitialized bug for -Osomething compilations.
PR lib/38385, Matthew Mondor
2008-04-08 08:25:49 +00:00
matt
6c93bdee60 Add a device_xname() stub. 2008-04-06 05:17:54 +00:00
drochner
76ad1614e9 remove useless passing of the lwp from the KERNEL_LOCK() ABI
(not the API; this would be easy as well)
agreed (a while ago) by ad
2008-04-01 19:49:31 +00:00
ad
2ffc44f47b Regen. 2008-03-27 17:14:21 +00:00
yamt
91ae756395 - for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well.  fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map.  XXX a bit arbitrary.
- add a comment.
2008-03-25 23:21:42 +00:00
yamt
ef630703b1 regen. 2008-03-24 23:47:06 +00:00
martin
99c43f077e Adapt to sel* changes 2008-03-24 19:40:18 +00:00
yamt
2acbe71698 regen. 2008-03-24 12:25:42 +00:00
rmind
42c415f8f1 pool_cache_init: Remove the alignment of pc according to the CACHE_LINE_SIZE,
which is not useful for rump.  This fixes the pool_cache_destroy() which was
freeing the modified pointer, instead of the original one.

OK by <pooka>.
2008-03-23 14:39:17 +00:00
yamt
c3c197ba35 when calculating some cache sizes, consider the amount of available kva.
PR/33185.
2008-03-23 14:12:39 +00:00
ad
53d9c2f69b Update for select/poll changes. 2008-03-22 19:27:23 +00:00
ad
141056103a Er, regen... 2008-03-21 22:12:13 +00:00
ad
a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
bjs
718a9a20d9 Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@ 2008-03-19 00:40:34 +00:00
pooka
0b82eddb8b Reorder a few init bits into a better order to make syspuffs work again. 2008-03-18 15:16:22 +00:00
pooka
546bf50253 Cache referenced rootvp in struct ukfs. Makes it possible to run
pre/postcall wrapper around the exported namei, since postcall no
longer needs to execute VFS_ROOT (which is a bad thing to do while
potentially holding on to a locked vnode, mmkay).
2008-03-13 14:24:30 +00:00
pooka
e8401439ac Implement all ukfs interfaces (except getdents, that's a bit more
tricky) with the help of rump system calls instead of calling namei
by themselves.  Trust me when I say it was non-trivial to get the
namei calls right.
2008-03-12 21:37:15 +00:00
pooka
b590aae6d8 Support chdir. This is useful for example when testing and not
wanting to stress namei() so much as test individual ops.
XXX: it should be implemented per calling thread, not per fs.
2008-03-12 14:49:19 +00:00
pooka
8ca4306537 Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.
2008-03-12 11:17:33 +00:00
lukem
471f389be3 Add -I${LIBRUMPDIR} to fix objdir builds. 2008-03-12 05:11:51 +00:00
pooka
3f429ae81b Compile rump_syscalls, use them in a few places. 2008-03-11 22:57:26 +00:00
pooka
5a2a7c7039 gen 2008-03-11 22:53:54 +00:00
pooka
a7ece3ec53 Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".
2008-03-11 10:50:16 +00:00
ad
6ae89ed2af +cpu_lookup_byindex 2008-02-27 17:02:56 +00:00
ad
5485a8d6a0 Remove call to sched_yield() to fix compiler warnings. 2008-02-19 20:37:09 +00:00
ad
99f27439b5 Implement yield(). 2008-02-15 23:36:26 +00:00
ad
74d14c2433 Add dummy hardclock_ticks. 2008-02-15 13:07:02 +00:00
ad
aeeed1e5b6 Make it compile. 2008-01-30 14:57:24 +00:00
ad
508b2997d7 Fix pasto. Spotted by pooka@ 2008-01-30 10:22:02 +00:00
ad
3490efcc63 Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
2008-01-30 09:50:19 +00:00
pooka
bc13687cf3 default owner to getuid() 2008-01-29 18:17:21 +00:00
pooka
4f8496ecf6 compile genfs_vfsops.c (hi dh2 ;) 2008-01-28 15:48:18 +00:00
pooka
cc7f05eb50 Do puffs_fakecc instead of puffs_usethreads for now. 2008-01-28 11:52:38 +00:00
pooka
eb6074e41f Replace vrelel() 010101-mania with a flags parameter. However,
leave flags unimplemented for a while (no change in functionality).
2008-01-27 22:47:31 +00:00
pooka
2ff7c33801 honor pager locking protocol in uao_detach() 2008-01-27 20:10:53 +00:00
pooka
18e91c156a Don't fool around when recycling vnodes, simply override refcount
to 1, hold on tight to your hat, and call recycle.  The reason is
that we might pick up extra references such as from lookup and we
don't really care about tracking those.  For example with p2k,
puffs in the kernel already does all the refcounting we could ever
dream of, and therefore it's left to the client and unnecessary.
2008-01-27 20:01:29 +00:00
pooka
67b0c1ab9c unlock vp in error branch 2008-01-27 19:19:42 +00:00
pooka
fb3107360b Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.
2008-01-27 19:07:20 +00:00
pooka
052fd49d29 Fix locking botches: take vm object lock before calling pager,
not inside the pager.
2008-01-27 00:16:22 +00:00
pooka
b7b052548e Nuke local copy of getcwd_common(), we compile in the real thing now. 2008-01-25 06:43:30 +00:00
pooka
22b1964406 Include vfs_getcwd.c too. It isn't used currently, but it's linked. 2008-01-25 06:42:29 +00:00
pooka
2b1b5d29b8 Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation.  This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().
2008-01-24 22:41:07 +00:00
pooka
daadf5acef Make work again by repairing spec_node_init() and not being afraid
to use it.
2008-01-24 20:06:46 +00:00
ad
703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
pooka
d25a6ab97f Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time.  We could init it runtime, but it's just a random
number anyway.
2008-01-24 15:02:16 +00:00
pooka
9af1c338e2 Default physmem was too tight, increase to 256megs from 0 bytes. 2008-01-24 08:34:49 +00:00
pooka
2310c71b91 Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround.  If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.
2008-01-22 09:23:39 +00:00
pooka
65a36d9ef8 In case cv_timedwait() gets ticks == 0, make sure we sleep eternally
(or at least until wakeup) instead of immediately waking up.

In other words, fix this after it broke when another piece of the
code was fixed.  Ain't programming fun?
2008-01-21 17:56:48 +00:00
pooka
fdedd21efc Implement dummy bmap which just does 1:1 translation. 2008-01-21 03:40:59 +00:00
joerg
3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
reinoud
ef25457ba7 pthread_cond_timedwait() needs an absolute time to wait for instead of the
relative time in ticks.
2008-01-18 14:12:19 +00:00
pooka
fd1f386de1 fix incorrect tick -> timespec calculation. noticed by reinoud 2008-01-17 21:05:36 +00:00
ad
cd7be76fdb Add a dummy vrevoke(). 2008-01-17 17:31:48 +00:00
ad
5080b2dad0 Pull in my modules code for review/test/hacking. 2008-01-16 13:22:29 +00:00
pooka
d7412d56b1 Introduce PUFFS_STACKSIZE_MIN to avoid overloading 0 and getting
a warning from the library when really wanting to say "just the
minimum, please".
2008-01-14 13:57:26 +00:00
he
7d83a06dfc Declare nbpg if we're building for sparc, and initialize to the
smallest sparc pagesize.  This should deal with the IOCPARM_MAX
build problem, which occurs on sparc because various models have
different page size, so it's run-time determined instead.

pooka says that rump doesn't use ioctl(), so the value is apparently
of no consequence.
2008-01-09 13:59:43 +00:00
pooka
72b3924d8b Set stacksize to minimum acceptable (two pages, one for cc, one
for actual stack) to mimic kernel stack size better.
2008-01-08 00:23:15 +00:00
ad
77e0b2120f Patch up sysctl locking:
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
  regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
2008-01-07 16:12:52 +00:00
riz
f28eb587da Add #include <sys/simplelock.h> 2008-01-05 04:03:01 +00:00
pooka
9b30791f86 Print "panic: " before panicstr when panicking. 2008-01-04 00:38:24 +00:00
pooka
deeebf9713 Theoretically this is supposed to be interchangeable with real
kernel code.  Use kmem_alloc/free instead of some wily homerolled
rump interfaces for memory allocation.
2008-01-03 02:48:02 +00:00
pooka
2c7914f588 use UVM_OBJ_INIT/DESTROY() 2008-01-03 02:44:05 +00:00
pooka
daaf5e53c9 initialize error value 2008-01-03 02:38:23 +00:00
pooka
d53e261066 valloc -> vnalloc, vfree -> vnfree
Avoids collision with userland valloc(3).

no functional change
ad ok
2008-01-03 01:26:28 +00:00
pooka
f8ff426bbb fix build for OBJDIR case. noticed by plenty 2008-01-02 22:01:41 +00:00
pooka
4f69d01d2f Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

    golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

    ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs
2008-01-02 18:15:12 +00:00
pooka
3c068d8021 fix vmlocking2 fallout:
* I heard a wild rumor that vp_interlock is a mutex these days (hi ad!)
* init new locks (hi ad)
* observe that with simple_locks only deadlocks would be caught while
  releasing unlocked locks would go unnoticed.  make locking work (hi pooka)
2008-01-02 15:44:03 +00:00
ad
ae47be00a8 Provide valloc(), fix vfree(). 2008-01-02 13:42:47 +00:00
ad
896ac1329e Build intr.c. 2008-01-02 12:49:53 +00:00
ad
888ef28a4d Fix merge error. 2008-01-02 12:46:07 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
pooka
ffd37c1db1 pass mmap to file systems 2008-01-01 22:31:42 +00:00
pooka
d89e3e05a2 emulate a couple more locking interfaces 2008-01-01 22:03:24 +00:00
pooka
312cc39e60 pull in atomic ops from vmlocking2 2007-12-30 23:30:26 +00:00
pooka
7baf23bce3 fake sigcantmask 2007-12-30 23:29:06 +00:00
pooka
ec137c87f4 steal 1.4.2.1 from vmlocking2: cv_xwait_sig() 2007-12-30 03:35:20 +00:00
perry
b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
pooka
6db2b1c100 LFS_KERNEL_RFW 2007-12-13 16:08:12 +00:00
elad
021227aa78 Don't compile lfs_rfw.c, suggested by cube@. 2007-12-12 18:52:00 +00:00
pooka
db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
ad
4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
hannken
b1446c225c Make it compile again. 2007-12-02 18:24:34 +00:00
yamt
e8abff70f2 constify pagerops. 2007-12-01 10:40:27 +00:00
dsl
956bff160a Temporarily make 'atomic_add_int()' a non-atomic add so the build suceeds.
At some point the functions will (presumably) make their way into either
libc or libutil.
2007-11-30 21:48:40 +00:00