three code locations that didn't handle them properly (when iterating over all
areas).
That and the fact that unmap_and_free_physical_pages() is no longer broken now
leads to the boot region being unmapped and freed properly as intended before.
That revealed another bug: the boot loader region was disposed too early, we
need a few other components pick up boot loader resources first; it now happens
in vm_init_post_sem().
allocate_kernel_args() was also broken, and actually didn't try to allocate
kernel args areas, but tried to reallocate all the virtual allocated ranges
of the boot loader...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9437 a95241bf-73f2-0310-859d-f6bbb57e9c96
boot loaders passed in memory completely wrong (for example, the premapped
graphics buffer could be mapped to the same region as some thread stacks,
just because the VM did not use its knowledge about that mapping): the boot
loader regions are now reserved so that they cannot be overwritten
with other regions anymore. The kernel_args arguments are now tracked, and
areas are created for them (they are not yet freed, though). arch_vm_init_end()
must now call the new vm_free_unused_boot_loader_range() to free any remaining
parts of the memory not yet mapped in by any areas.
Renamed a lot of init functions (ie. postsem to post_sem, init2 to post_area),
also updated because of the vm_translation_map*() arch_vm_translation_map*() move.
B_ALREADY_WIRED can now only be used during kernel startup (it's a private flag).
Replaced PAGE_SIZE with B_PAGE_SIZE.
Some minor cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9429 a95241bf-73f2-0310-859d-f6bbb57e9c96
correctly by calling arch_vm_translation_map_init_kernel_map_post_sem().
dump_aspace() now behaves like all debugging functions should behave: it
now accepts decimal numbers as well as hexadecimal numbers as IDs.
vm_translation_map_create() was renamed to arch_translation_map_init_map().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9427 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved some functions around, so that the public functions come last.
Renamed the internal vm_translation_map_quick_query() to early_query(),
renamed vm_translation_map_quick_map() to arch_vm_translation_map_early_map().
Removed the _module part of the initialization functions.
Added a function that completes the initialization of the kernel map (it
creates the map's lock, which was just not done before).
arch_vm_translation_map_init_map() will now fail with an appropriate
error code if the map's lock couldn't be created for anything that
is not the kernel map.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9426 a95241bf-73f2-0310-859d-f6bbb57e9c96
loader preallocated, arch_vm_init_end() (formerly called _endvm())
now calls the new vm_free_unused_boot_loader_range() with the correct
parameters.
Moved the creation of the DMA area from 0-0xa0000 into arch_vm_init_post_area().
Changed return types to status_t rather than just having "int" stand
for a status code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9425 a95241bf-73f2-0310-859d-f6bbb57e9c96
USE_WALL feature can now be used.
Started implementing a USE_CHECKING_WALLS feature, that has a kernel
daemon running that periodically checks the walls of *all* memory
allocations - does not work yet (because of some initialization order
problems).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9396 a95241bf-73f2-0310-859d-f6bbb57e9c96
team and process group IDs as well.
Added a ToDo item that process groups do only work well as long as
their group leader is still active.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9394 a95241bf-73f2-0310-859d-f6bbb57e9c96
ignored completely (so that zero and below become valid).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9393 a95241bf-73f2-0310-859d-f6bbb57e9c96
no longer pop %fs from the iframe in that case, too.
When we restore a custom stack, however, we'll now pop %fs from the iframe
as such strange threads may even do their own business with it.
Added some comments.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9369 a95241bf-73f2-0310-859d-f6bbb57e9c96
We also should disable interrupts in arch_restore_fork_frame().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9368 a95241bf-73f2-0310-859d-f6bbb57e9c96
always copies the arguments and environment arrays.
No need for the "owns_arrays" in team_arg anymore - it now always owns
them.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9363 a95241bf-73f2-0310-859d-f6bbb57e9c96
Switched to load_image() instad of using the old team_create_team() to start "init".
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9361 a95241bf-73f2-0310-859d-f6bbb57e9c96
The path name is now always taken from the provided argument list (except for
_user_exec() which now replaces args[0] with the path argument).
The team_arg structure know nows if it must delete its arguments or not - this
also fixes a memory leak in case team_create_team() failed when invoked from
userland.
load_image() is now also exported for the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9360 a95241bf-73f2-0310-859d-f6bbb57e9c96
process ID (in the current session).
get_death_entry() could call free() with interrupts disabled; now follows
the same mechanism as chosen with the groups (ie. it returns a pointer
to a death_entry to be freed by the calling function).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9354 a95241bf-73f2-0310-859d-f6bbb57e9c96
the specified process group (by passing in a negative pid, as in BeOS).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9351 a95241bf-73f2-0310-859d-f6bbb57e9c96
- we now have a working process group/session model. Implemented related syscalls
and the kernel backend, some POSIX process functions are now available in the
kernel as well.
- dying teams now monitor their exitus by leaving death_entry structures in
their parent team.
- Implemented wait_for_child() for pid == -1 and pid > 0; IOW waiting for process
groups is missing yet. Hasn't yet been tested intensively.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9350 a95241bf-73f2-0310-859d-f6bbb57e9c96
may be renamed):
- B_RELEASE_ALL: the semaphore count is set to 0, all waiting threads are released
(the "count" argument of release_etc_sem() is ignored then)
- B_RELEASE_IF_WAITING_ONLY: the semaphore count is only decreased if there
are any waiting threads; ie. the semaphore is signaled
Together, they will make the pthread_cond_*() functions easy to implement, and
they come in handy at other places, too.
Removed release_threads variable in release_sem_etc(), as it was useless.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9330 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also removed syscall for that function (shouldn't have been there in the
first place, anyway).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9325 a95241bf-73f2-0310-859d-f6bbb57e9c96
no longer abuse the semaphore mechanism to carry an extra status value,
instead, wait_for_thread() registers a death_entry with the thread that
will be filled upon exit.
Removed delete_sem_etc() as it's no longer of use or available.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9323 a95241bf-73f2-0310-859d-f6bbb57e9c96
flag set.
Fixes _user_wait_for_thread() which returned an invalid return code in case
of error.
Some minor cosmetics.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9321 a95241bf-73f2-0310-859d-f6bbb57e9c96
not be restored from the iframe; it will be set by the scheduling code.
This is only of concern on SMP machines and could prevent TLS from working.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9310 a95241bf-73f2-0310-859d-f6bbb57e9c96
same mechanism as NewOS, ie. using the iframe "stack" pointer (using the
new i386_get_current_iframe() function).
Implemented fork() support functions arch_{store|restore}_fork_frame().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9292 a95241bf-73f2-0310-859d-f6bbb57e9c96
know about this specifier, it has to be replaced by B_EXACT_ADDRESS).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9281 a95241bf-73f2-0310-859d-f6bbb57e9c96
team's address space - for internal use, anyway.
Added a ToDo: item to exec_team() to remind me of alarms and signals.
Started implementing fork_team() based on team_create_team() - it's not
completed (or even works), though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9279 a95241bf-73f2-0310-859d-f6bbb57e9c96
must not be accessed without it.
Implemented _get_next_area_info() and _user_get_next_area_info().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9277 a95241bf-73f2-0310-859d-f6bbb57e9c96
reference to the address space, so that the calling team deletion function
doesn't have to do this.
delete_address_space() doesn't have to delete any areas anymore, since
at the point it's called, there is no area anymore, anyway: each area
holds a reference to the address space.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9276 a95241bf-73f2-0310-859d-f6bbb57e9c96
This actually reflects the only usage of this function anyway, and thus,
fixes the resize_area() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9265 a95241bf-73f2-0310-859d-f6bbb57e9c96
vm_page no longer keeps a pointer to the vm_cache_ref but to the vm_cache.
This cleans the page handling when having to make an area copy-on-write;
regions belong to vm_cache_ref, pages to vm_cache.
Fixed some return types.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9264 a95241bf-73f2-0310-859d-f6bbb57e9c96
It currently checks for temporary caches, but it should really only be used
with regions for anonymous memory.
Fixed some return types.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9259 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed the way a vm_address_space is deleted: instead of having to explicitly
call vm_delete_aspace(), the last vm_put_aspace() will remove it.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9255 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed the way a vm_address_space is deleted: instead of having to explicitly
call vm_delete_aspace(), the last vm_put_aspace() will remove it.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9254 a95241bf-73f2-0310-859d-f6bbb57e9c96
Should be tested and verified more intensively, though.
Moved the creation, initialization, and deletion of the team_arg structure out of
team_create_team(); it's now also used by exec_team().
Renamed kfree_strings_array() to free_strings_array().
Renamed the fields of the team_arg structure to be more in sync with the names used
at other places.
Fixed the routine that copied the environment/arguments into the userland space.
Improved and fixed the user_copy_strings_array() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9250 a95241bf-73f2-0310-859d-f6bbb57e9c96
of vm_delete_aspace() (which now calls it).
Fixed some return types.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9248 a95241bf-73f2-0310-859d-f6bbb57e9c96
file descriptors that have O_CLOEXEC set.
Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9242 a95241bf-73f2-0310-859d-f6bbb57e9c96
in dir_vnode_to_path() which does now continue until hitting "/".
* Refactored common volume root to mount point resolution code into a
separate function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9210 a95241bf-73f2-0310-859d-f6bbb57e9c96
via B_SET_(NON)BLOCKING_IO to notify the device about any access mode changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9199 a95241bf-73f2-0310-859d-f6bbb57e9c96
and will check against those. This fixes the rare case an interrupt frame
could cause before.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9191 a95241bf-73f2-0310-859d-f6bbb57e9c96
potential bug if MAIN_STACK_SIZE and STACK_SIZE would have been different.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9190 a95241bf-73f2-0310-859d-f6bbb57e9c96
read over two blocks, some memory behind that memory could be trashed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9188 a95241bf-73f2-0310-859d-f6bbb57e9c96
waiting on the write semaphore).
The write functions didn't change the buffer address on a partial write
which could lead to corruption in the pipe data.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9111 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed a warning that popped up if TRACE_VM was defined.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9110 a95241bf-73f2-0310-859d-f6bbb57e9c96
It now prints a warning if the device driver doesn't handle iovecs correctly.
Again, this could lead to very strange behaviour.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9092 a95241bf-73f2-0310-859d-f6bbb57e9c96
name of the node.
devfs_read_stat() now (presumably temporary) sets the size of the device
for partitions and reports a block device rather than a character device
if the size unequals zero.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9085 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Turned sMountOpMutex into a recursive lock.
* Re-inserted sMountOpLock locking in vnode_path_to_vnode(). It doesn't
deadlock on mounting anymore. :-P
* Added a check in fs_mount(), whether the mount point is a directory. If
it wasn't, in general it wouldn't be possible to get its parent
directory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8993 a95241bf-73f2-0310-859d-f6bbb57e9c96
why that was there before. Thanks to Ingo for pointing this out.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8981 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now maintains uid/gid/mode, modification and creation time for all nodes.
Implemented rootfs_write_stat() completely. rootfs_read_stat() now fills
in all required values.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8962 a95241bf-73f2-0310-859d-f6bbb57e9c96
time in st_mtime.
rootfs_write_stat() now properly locks the node access.
Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8960 a95241bf-73f2-0310-859d-f6bbb57e9c96
permissions are not tested, though.
Removed the STREAM_TYPE_ constants.
Now maintains a modification and creation time for all nodes.
Implemented rootfs_write_stat() completely. rootfs_read_stat() now fills
in all required values.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8959 a95241bf-73f2-0310-859d-f6bbb57e9c96
IDE drivers :-)) don't respect the total amount of bytes to be read in the
former readv() (now read_pages()) call. This can potentially fix all sorts
of strange errors in userland :)
Fixed the debug build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8938 a95241bf-73f2-0310-859d-f6bbb57e9c96
recreates a race condition, having it here breaks the kernel as fs_mount()
calls this function and already holds the mutex.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8936 a95241bf-73f2-0310-859d-f6bbb57e9c96
unmounted.
* Clarified a comment in fs_mount().
* Added a bit of documentation regarding the mutexes and the basic vnode
functions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8930 a95241bf-73f2-0310-859d-f6bbb57e9c96
Userland. It must always set the d_pdev and d_pino fields and, if the
Entry refers to a mount point even replace d_dev and d_ino.
* Added a TODO comment to entry_ref_to_vnode(). It should take care of
mount points, as vnode_path_to_vnode() does, I believe. Will verify
and fix that next.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8921 a95241bf-73f2-0310-859d-f6bbb57e9c96
this is the one thing most likely to fail - it now also handles this case
gracefully instead of dying.
Small cleanup, cleared some other ToDos: some user functions now delete
the area when they could not copy the target address.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8911 a95241bf-73f2-0310-859d-f6bbb57e9c96
leaving the tags Qt style though. That's a bit weird, but that's the
way Axel likes it, and we want to keep him happy, don't we? ;-P
* The common_[path_]read_stat() now fills in st_dev and st_ino in the
result stat structure after the FS had its go. The information is
readily available in the VFS, so why bother the FSs. In fact devfs
didn't (and still doesn't) fill in st_dev which gave dev_for_path()
some head ache.
* Modified _user_open_parent_dir() to accept a NULL buffer for the
entry name and added a doxygen comment for it.
df now works properly on Haiku (save that printf() doesn't support
floating point numbers at the moment).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8898 a95241bf-73f2-0310-859d-f6bbb57e9c96
always also access it through the devfs_vnode. This also solves an issue
in devfs_read() where an access of a cookie->stream would crash the
kernel, since cookie->stream was not set in devfs_open().
* devfs_open() now doesn't fail for directories and symlinks anymore.
That prevented BNode to work for devfs dirs and symlinks.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8897 a95241bf-73f2-0310-859d-f6bbb57e9c96
`.'. This fixes the _kern_open_parent_dir() syscall for the root directory.
I realized, that rootfs_read_dir() doesn't return the entries `.' and `..',
unlike Be's rootfs. Shall I add those, Axel?
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8895 a95241bf-73f2-0310-859d-f6bbb57e9c96
This has the advantage that the device can now be access in the right context.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8876 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed the calculation of the amount of bytes read in bootfs_read_pages().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8874 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added an vfs_get_cookie_from_fd() call to at least temporarily support the
cookie as in the original devfs (not sure yet how this changes).
Implemented vfs_get_file_map() which calls the corresponding FS function.
Moved vfs_get_vnode_cache() around.
vfs_get_vnode() temporarily does its job unlocked - its only to be used (safely)
from within the file cache, but this should definitely be done better.
Fixed a bug in get_vnode_name() - it did not support getting the name of
a root directory; it didn't pass the call through to the parent file system.
Fixed a bug in _user_entry_ref_to_path() which would add another "/" for
files immediately under the root (ie. "df" showed "//boot" as mount point
for the boot partition).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8873 a95241bf-73f2-0310-859d-f6bbb57e9c96
_KERNEL_MODE is already defined when using kernel build rules, no need
to do it here manually.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8872 a95241bf-73f2-0310-859d-f6bbb57e9c96
couldn't be satisfied completely (ie. because the file size is not a
multiple of the page size).
It's no longer necessary to implement this functionality in the file systems.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8858 a95241bf-73f2-0310-859d-f6bbb57e9c96
node and its interface directly. It will also convert the old interface into
the new one to simplify the implementation.
devfs_open() now contains the former pnp_devfs_open() as well.
devfs_publish_device() no longer passes the "ident" parameter to its lower
layers - it will be removed.
The VM fs interface has changed to better match the one of the device interface.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8849 a95241bf-73f2-0310-859d-f6bbb57e9c96
addresses.
Not yet used - might be used instead of the vm_cache page caching for the file cache.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8819 a95241bf-73f2-0310-859d-f6bbb57e9c96
It still contains a very dump version of a BeOS compatible block cache.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8818 a95241bf-73f2-0310-859d-f6bbb57e9c96
allocate a cache twice.
The VFS is now responsible for allocating the cache object - it will call
the VM to do that if necessary.
Added another accessor call to a pointer to the VFS private vnode object.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8817 a95241bf-73f2-0310-859d-f6bbb57e9c96
allocate a cache twice. Now handles resource shortages gracefully.
Added small description to _vm_map_file().
Minor other cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8816 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed syscalls to the new scheme.
Some minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8770 a95241bf-73f2-0310-859d-f6bbb57e9c96
The kernel no longer trashes memory when you delete a port without any
messages in its queue (i.e. you can now safely link against libbe.so :)).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8736 a95241bf-73f2-0310-859d-f6bbb57e9c96
not support the read_fs_info() function - only the values that the VFS
does know about are filled in, then.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8735 a95241bf-73f2-0310-859d-f6bbb57e9c96
* null-terminated the result of common_read_link().
* Fixed return value of _user_read_link().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8705 a95241bf-73f2-0310-859d-f6bbb57e9c96
syscalls or to the syscall mechanism (which exposed naming and parameter
inconsistencies).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8704 a95241bf-73f2-0310-859d-f6bbb57e9c96
syscalls or to the syscall mechanism (which exposed naming and parameter
inconsistencies).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8703 a95241bf-73f2-0310-859d-f6bbb57e9c96
which from now on relieves us from the duty to maintain syscalls.S and
syscalls.c manually. Either includes a generated file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8699 a95241bf-73f2-0310-859d-f6bbb57e9c96
yet, though (instead, it directly performs all requests, so there is no
functional difference to the previous mechanism).
devfs and the file cache will directly access the I/O scheduler. There is
one scheduler per raw disk device; devfs detects that automatically, and
all I/O will go through the scheduler, then.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8683 a95241bf-73f2-0310-859d-f6bbb57e9c96
It now accepts strings of any size, reduced the stack consumption.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8559 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added comments from storage/NodeMonitor.cpp to the syscalls here (they
will be removed from NodeMonitor.cpp), and adapted them where necessary.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8237 a95241bf-73f2-0310-859d-f6bbb57e9c96
that you can now also look up symbols in there.
load_kernel_add_on() now sets the text section read-only & execute after
having loaded the area - note, it currently doesn't have any effect anyway :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8173 a95241bf-73f2-0310-859d-f6bbb57e9c96
there is no boot device available - this will prevent modules from getting
lost.
Added a comment to open_module_list() about its limitations while booting.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8170 a95241bf-73f2-0310-859d-f6bbb57e9c96
it's not known (it currently only support the current version, of course :-).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7989 a95241bf-73f2-0310-859d-f6bbb57e9c96
Improved returned types.
Added and initializes Disk Device Manager.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7972 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed read/write calls to use and update the descriptor position.
Removed the CHECK_USER_ADDR() macro; it's now using the usual (more readable) check.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7967 a95241bf-73f2-0310-859d-f6bbb57e9c96
Removed KFileDiskDevice functionality for now (since it would have required more changes).
Also disabled actual partition publishing/unpublishing, because this will
be done differently.
This change will temporarily break the DiskDeviceManagerTest build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7914 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed thread_atkernel_exit() to look less broken - the way and when it's
called should still be investigated: NewOS looks a lot cleaner here.
create_thread() now creates the kernel stack upfront, so that it can easily
bail out of that fails. The user stack creation now makes use of B_BASE_ADDRESS
and is therefore a lot better and simpler. In case user stack creation failed,
it should now be able to handle that a lot more gracefully - but that hasn't
been tested yet...
Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7897 a95241bf-73f2-0310-859d-f6bbb57e9c96
Introduced RESERVED_REGION_ID definition.
Some minor cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7886 a95241bf-73f2-0310-859d-f6bbb57e9c96
stack - it just fails now (since create_area() currently panics when it
fails, this is a cosmetic change anyway :-)).
Now correctly cleans up in case elf_load_user_image() fails.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7883 a95241bf-73f2-0310-859d-f6bbb57e9c96
Replaced "addr" with "addr_t".
Header cleanups.
There is no need to call set_tls_context() in arch_thread_init_tls().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7880 a95241bf-73f2-0310-859d-f6bbb57e9c96
load_kernel_add_on() now protects the text area read-only (theoretically,
as set_area_protection() has not yet been implemented).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7879 a95241bf-73f2-0310-859d-f6bbb57e9c96
and (very) temporary extension, anyway).
- Fixed _user_create_area() - it will now also recognize B_ANY_KERNEL_BLOCK_AREA,
and it will not access a kernel address for B_EXACT_ADDRESS.
- create_area() will now handle B_EXACT_ADDRESS correctly as well.
- get_memory_map() will now silently ignore the missing final entry if the map
contains only one entry.
- The check for user memory was wrong in get_memory_map(); it worked, but it
was not necessarily portable.
- vm_reserve_address_range() was not correctly initializing the region.
- find_and_insert_region_slot() will now search for reserved regions when
B_EXACT_ADDRESS is used - not yet tested, though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7871 a95241bf-73f2-0310-859d-f6bbb57e9c96
created a call around find_and_insert_region_slot() that takes care of
everything. Fixed B_BASE_ADDRESS support (it now really works).
First shot at a new VM function vm_reserve_address_range() that will be
used to fix our ELF loader issues (which needs to create adjacent regions
which the VM cannot guaranty at this point).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7870 a95241bf-73f2-0310-859d-f6bbb57e9c96
thread exit - get_death_stack() now returns the interrupt state so that
it can be restored correctly later.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7865 a95241bf-73f2-0310-859d-f6bbb57e9c96
The stack of the main thread is now called "{team name}_main_stack" instead
of primary stack.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7863 a95241bf-73f2-0310-859d-f6bbb57e9c96
correctly when it entered the next recursion of vnode_path_to_vnode().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7854 a95241bf-73f2-0310-859d-f6bbb57e9c96
only).
Userland segments are now called _seg0rw/_seg0ro.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7851 a95241bf-73f2-0310-859d-f6bbb57e9c96
device with BFS - if it succeeds, it will print out the contents of the
volume's root directory.
fs_mount() now makes the mount structure available when mount() from the
FS is called - so that new_vnode() and get_vnode() can work.
fs_mount() did not correctly clean up when something went wrong; it also
didn't notice if the mount's recursive lock couldn't be created.
Some minor debug output improvements.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7845 a95241bf-73f2-0310-859d-f6bbb57e9c96
it's (almost) read only.
Added it to the build - libvm.a is now build as merged object file, since
the cache functions didn't get exported else.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7831 a95241bf-73f2-0310-859d-f6bbb57e9c96
something went wrong) - this would have hidden circular dependencies
as well.
Recursive directory scan was broken, it didn't filter "." and ".." out.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7829 a95241bf-73f2-0310-859d-f6bbb57e9c96
lock_memory() and unlock_memory() will now silently fail and return success -
that's only to get things working.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7754 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also made elf_lookup_symbol_address() less restrictive with respect to the
ELF symbol found (it now accepts all types, not only functions).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7714 a95241bf-73f2-0310-859d-f6bbb57e9c96
tested, though.
No longer copies the elf_header in insert_preloaded_image(); it's not used
at runtime (should be superfluous to keep in other kernel images, too).
dump_symbols() now ignores entries with invalid values - don't know exactly
what makes a good entry, but that should look okay.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7713 a95241bf-73f2-0310-859d-f6bbb57e9c96
standard byte order functions in the kernel).
Small cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7705 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed warnings when compiled with TRACE_ELF.
Changed elf_lookup_symbol_address() to returning more useful information.
It now also scans the extended debug symbol table if present - for now, this
only works with preloaded images except the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7701 a95241bf-73f2-0310-859d-f6bbb57e9c96
(in BeOS, all kernel areas are r/w).
If you use B_READ_AREA/B_WRITE_AREA flags, you make the area readable
or even writeable from userland!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7700 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now uses the extended possibilities of the elf_lookup_symbol_address() call.
Fixed a bug in dbg_stack_trace(); it could crash at the top most stack frame.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7698 a95241bf-73f2-0310-859d-f6bbb57e9c96
to deny further port/sem allocation (and also simplifies port/sem stats).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7570 a95241bf-73f2-0310-859d-f6bbb57e9c96
like any other module (yeeha!).
You can even unload preloaded images later on (to replace them with a
more up-to-date on disk version).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7532 a95241bf-73f2-0310-859d-f6bbb57e9c96
If an image cannot be created out of a preloaded_image, its resources
are freed now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7531 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also renamed elf_load_kspace() to load_kernel_add_on(), and friends.
The new unload_kernel_add_on() now has an image_id as parameter, no longer
a path (like the former elf_unload_kspace()).
Fixed missign file system unload.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7527 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now registers its images as it should do (so you can use commands like
listimage in userland).
Added new debugger command "image".
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7522 a95241bf-73f2-0310-859d-f6bbb57e9c96
to acquire the team spinlock).
Renamed the user syscalls to the new style.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7521 a95241bf-73f2-0310-859d-f6bbb57e9c96
freed in the wrong order in case of an error (could have crashed the kernel).
Implemented insert_preloaded_images() which prepares the preloaded images
for later use in the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7520 a95241bf-73f2-0310-859d-f6bbb57e9c96
the size of the stat structure to allow extensions of that structure.
Renamed those syscalls to the new naming scheme.
Updated the syscalls to support stat extensions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7494 a95241bf-73f2-0310-859d-f6bbb57e9c96
probably be available as public kernel API as well (or rather, only).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7492 a95241bf-73f2-0310-859d-f6bbb57e9c96
in device_manager.h).
Fixed some comments.
Removed realpath() from probe.c for now - mechanism will be changed, and that
prevented it from being built as part of the kernel; it's currently not functional.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7489 a95241bf-73f2-0310-859d-f6bbb57e9c96
be any size, not just full path names (even without the file name...). Optimized
it to only traverse paths that match the prefix.
The built-in modules now honor the prefix as well.
Renamed module_iterator::path_stack to stack.
The system add-on path was even wrong (but that didn't matter yet, as we're
still do a recursive search for modules).
The user add-on path now matches the real one - but that should probably be
retrieved from calling find_directory(), anyway...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7483 a95241bf-73f2-0310-859d-f6bbb57e9c96
The prefix will obviously ignored currently!
Fixed get_next_loaded_module_name(); it will now work correctly (doesn't check, though,
if the module is currently loaded...).
Removed the module_test() function - doesn't belong here.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7465 a95241bf-73f2-0310-859d-f6bbb57e9c96
main, not by getting the module any longer.
It now also creates the root node directly.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7438 a95241bf-73f2-0310-859d-f6bbb57e9c96
team_create_team() now uses the B_NORMAL_PRIORITY constant instead of the number directly.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7425 a95241bf-73f2-0310-859d-f6bbb57e9c96
system - it's now mounted a bit later.
Renamed vfs_register_filesystem() to vfs_register_file_system().
Changed return codes to status_t where appropriate.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7424 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added all of them - module_loader.c and boot_hack.c won't be needed anymore.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7351 a95241bf-73f2-0310-859d-f6bbb57e9c96
Nothing is tested right now, and it's not yet complete, but it's changed so that
it does compile in our tree (and looks a bit more like the other files, too).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7345 a95241bf-73f2-0310-859d-f6bbb57e9c96
Removed all old NewOS error codes.
Cleaned up the includes a bit.
Now prints out a list of preloaded images.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7331 a95241bf-73f2-0310-859d-f6bbb57e9c96
Implemented the possibility for built-in modules - they have to be listed
in sBuiltInModules in module.c to be registered automatically.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7318 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added system_info.c to the build.
Added stats support functions to sems & ports.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7290 a95241bf-73f2-0310-859d-f6bbb57e9c96
The syscall is not yet connected, and the code has not yet been tested.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7179 a95241bf-73f2-0310-859d-f6bbb57e9c96
Incorporated NewOS change 1930: sends the parent SIGCHLD if the team
goes away.
create_thread() now returns B_BAD_TEAM_ID when the team is in death state
instead of ERR_TASK_PROC_DELETED.
Cleaned headers.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6997 a95241bf-73f2-0310-859d-f6bbb57e9c96
from thread_exit().
Removed team_remove_team_from_hash() as it's no longer necessary.
Also incorporated NewOS change 1930: maintain the parent/children lists.
Cleaned up the headers.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6996 a95241bf-73f2-0310-859d-f6bbb57e9c96
as already suggested in my earlier comment.
Added some comments.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6993 a95241bf-73f2-0310-859d-f6bbb57e9c96
Took the chance and cleaned it up even more; this change is not a functional change.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6972 a95241bf-73f2-0310-859d-f6bbb57e9c96
using user_memcpy(); therefore it can now fail.
Taken from NewOS, thanks to Travis for pointing this out.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6971 a95241bf-73f2-0310-859d-f6bbb57e9c96
Saved the port_entry.closed member and now set the capacity to 0, since
it is not used any longer (reduces the size of the port table).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6956 a95241bf-73f2-0310-859d-f6bbb57e9c96
could be changed at startup (adapted to system properties).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6955 a95241bf-73f2-0310-859d-f6bbb57e9c96
Right now, it allocates/frees the msgs from the kernel heap for every
message sent - that might be too slow for real world usage.
Also removed all known race conditions from the code.
Not tested at all yet, though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6953 a95241bf-73f2-0310-859d-f6bbb57e9c96
did in ports.c), thanks to Jack Burton for pointing this out.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6932 a95241bf-73f2-0310-859d-f6bbb57e9c96
its semaphores get deleted, thanks to Jack Burton for reporting.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6904 a95241bf-73f2-0310-859d-f6bbb57e9c96
the info from the wrong end of the queue.
find_port() did not return the correct error codes.
write_port_etc() checked incorrectly for a deleted semaphore.
B_WOULD_BLOCK would let various functions print out a warning for no reason
(the comments in the code actually didn't fit to the implementation).
"total_count" was counting the number of messages written, not those that
have been read (as the BeBook says).
Thanks to Bill Hayden who reported a lot of these.
Added TRACE macro and moved some of the dprintf()s to that.
Added/fixed some comments.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6901 a95241bf-73f2-0310-859d-f6bbb57e9c96
run. Also create_port() now changes the port ID only when the port lock is
grabbed, so that we don't need to acquire the port list lock in find_port().
Removed setting lock to "0" in create_port() because if it's not 0 in the
first place, there is something seriously wrong (should add an assert there).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6897 a95241bf-73f2-0310-859d-f6bbb57e9c96
I don't know which part of me has written the previous version, but
it seems not have been supervised by a brain while doing it.
The read requests are now maintained per inode (as it has to be),
and there is one read lock per request.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6891 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved wait_for_team() into the exported kernel API region.
Added missing call for _user_get_current_team().
Made the team_kill_team() call to the BeOS compatible kill_team().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6868 a95241bf-73f2-0310-859d-f6bbb57e9c96
else is not found here. The BeOS kernel also exports these two *_etc()
functions, and we might want to do that, too.
{receive|send}_data() are now interruptible from userland, but not when
called from the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6700 a95241bf-73f2-0310-859d-f6bbb57e9c96
Copied over the function description of user_strlcpy() from x86/arch_cpu.h
to this file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6697 a95241bf-73f2-0310-859d-f6bbb57e9c96
Implemented the B_CURRENT_TEAM mechanism for _get_next_sem_info().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6691 a95241bf-73f2-0310-859d-f6bbb57e9c96
out the port_info setup to fill_port_info(), implemented the B_CURRENT_TEAM
behaviour as described in the BeBook (well, almost, since B_CURRENT_TEAM
is not defined in R5, it's just "0"), improved error checking.
Cleaned up user syscalls.
Replaced SYS_MAX_OS_NAME_LEN with B_OS_NAME_LENGTH.
Banned strncpy().
Added our license.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6687 a95241bf-73f2-0310-859d-f6bbb57e9c96
with B_OS_NAME_LENGTH, make use of the IS_USER_ADDRESS() macro, etc.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6685 a95241bf-73f2-0310-859d-f6bbb57e9c96
Cleaned up _get_thread_info() & _get_next_thread_info() - factored out
the thread_info setup into fill_thread_info().
Is now using team_is_alive() instead of team_get_team_struct().
Replaced SYS_MAX_OS_NAME_LEN with B_OS_NAME_LENGTH.
Banned strncpy() in favor for strlcpy().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6683 a95241bf-73f2-0310-859d-f6bbb57e9c96
Replaced some old error codes.
Explained a bit more how to solve a race condition.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6681 a95241bf-73f2-0310-859d-f6bbb57e9c96
Removed old error codes.
Replaced the DEVFS_IOCTL_* with their Be equivalents. Note, the related
functions are not user space safe yet. But since the devfs will be
almost rewritten, there is no point in changing it now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6679 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added our license to the updated source files.
Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6672 a95241bf-73f2-0310-859d-f6bbb57e9c96
of the one that issues the alarm - it now does an ugly cast to get the
real thread structure. It would be nice if we had an additional user
parameter to a timer event.
Thanks to Travis for reporting this one!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6310 a95241bf-73f2-0310-859d-f6bbb57e9c96
{get|put}_physical_page_tmap() directly.
Also replaced all occurrences of "addr" with "addr_t".
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5938 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Wrapped everything but #includes in #if _KERNEL_MODE to keep from
redeclaring/definining operator new and nothrow in userland.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5921 a95241bf-73f2-0310-859d-f6bbb57e9c96
is now honoured: the shortcut is now only made if it's okay to do it. Added
a comment what we could do to further improve performance.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5788 a95241bf-73f2-0310-859d-f6bbb57e9c96
forgotten about different address spaces with direct (unbuffered) pipe transfer,
shame on me.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5786 a95241bf-73f2-0310-859d-f6bbb57e9c96
always zeroed anyway.
cmd_help() is now able to print out help about the specified command
only - it will also print out all aliases of that command. Reduced
the distance between the command name and its description; NULL
descriptions are now also allowed.
There is now a find_command() function that's used throughout the
module. Like in the Be debugger, it will now also accept partial
matches, i.e. "co" will most probably match "continue" (as long as
there is no new "co*" command added by another component). It will
first try to find an exact match, and only if that failed it will
search for a partial match.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5307 a95241bf-73f2-0310-859d-f6bbb57e9c96
Disabled dbg_get_serial_debug(); it's only used temporarily in the keyboard
device (and I removed its usage there, too).
Added "continue", "exit", and "es" commands as in the Be kernel debugger
(they will all exit the debugger and try to continue normal kernel execution).
Reordered the sources so that public kernel API is together.
Added a _user_debug_output() syscall (not yet activated) which dumps to the
kernel's serial output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5305 a95241bf-73f2-0310-859d-f6bbb57e9c96
it might even be correct, but we also might want to have this stuff somewhere
else (libroot).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5279 a95241bf-73f2-0310-859d-f6bbb57e9c96
for the standard boot process).
Removed the STREAM_TYPE_* definitions, it's now using the stat definitions
instead.
Cleaned the source a bit.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5188 a95241bf-73f2-0310-859d-f6bbb57e9c96