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