Commit Graph

993 Commits

Author SHA1 Message Date
Axel Dörfler
433c716b82 Removed the empty function stubs from this file (and basically moved there
where they belong). Lazy Ingo ;-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9642 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-29 01:43:15 +00:00
Axel Dörfler
554e58f0d4 Added new functions devfs_[un]publish_file_device() - they're not implemented
yet, though, and just return B_ERROR.
devfs_unpublish_partition() now also returns B_ERROR since it's not yet
implemented.
Refactored the device publishing code, so that implementing devfs_publish_file_device()
will become easy.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9639 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-29 01:41:16 +00:00
Ingo Weinhold
de278b48c4 Now implements the _user_*() functions for the DDM syscalls.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-29 01:38:17 +00:00
Ingo Weinhold
7146639259 DDM syscalls added.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9635 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-29 01:37:37 +00:00
Ingo Weinhold
7fb2963ae4 * Added vfs_normalize_path() service call.
* Added resolve_mount_point_to_volume_root() which does what
  resolve_volume_root_to_mount_point() did. IOW the latter one didn't
  do what it advertised.
* Fixed dir_vnode_to_path(). Basically broken due to the broken
  resolve_volume_root_to_mount_point(), but also compared potentially
  unrelated vnode IDs (belonging to different volumes).
* Fixed get_dir_path_and_leaf(). It didn't deal correctly with paths
  ending in '/' (including the root dir).
* fs_mount() does now accept a NULL fsName, getting the FS name from
  the DDM in this case.
* fs_mount() now also supports mounting file images; it lets the DDM
  create a file device for them.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9629 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 22:31:43 +00:00
Ingo Weinhold
c06238cbd6 * Reworked publishing/unpublishing of the device. This is now basically
done by (currently not existing) devfs functions.
* Overridden GetMediaStatus() and GetGeometry() to return useful data.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9627 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 22:22:04 +00:00
Ingo Weinhold
1e2e4b3c71 Re-added support for file devices.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9626 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 22:18:20 +00:00
Ingo Weinhold
cba3b01fdf Added support for path normalization.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 22:16:41 +00:00
Ingo Weinhold
da87ac8c9a Added KFileDiskDevice to the build again. Fixed compile errors. It won't work yet, though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 16:05:22 +00:00
Ingo Weinhold
6a6164e712 Renamed RecursiveLockAutoLocker to RecursiveLocker. Don't mount the standard file systems read-only anymore -- they either aren't or know better anyway.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9563 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 15:57:04 +00:00
Ingo Weinhold
e5452be634 Cleaned up GetPath(). In the kernel we no longer prefix the partition path names with "obos_" or "haiku_".
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9561 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 15:13:08 +00:00
Ingo Weinhold
0402530222 Extended Append() to also allow adding parts of path components. Added leaf component manipulation. Now always chop trailing slashes off the path.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 15:09:48 +00:00
Axel Dörfler
9902467dac Fixed the build in case debug output was enabled.
Moved the debug macros into the program flow, so that they don't look so
temporary :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9557 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 00:32:10 +00:00
Ingo Weinhold
480742bd7a KPath added to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9556 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 22:15:11 +00:00
Ingo Weinhold
f3604f65e7 * Added missing `flags' parameter for the mount functions.
* fs_mount() and fs_unmount() are now aware of partitions. A device to
  be mounted is looked up by the DDM and the mount state and mount
  cookie of the corresponding KPartition are updated accordingly.
  Still missing is support for mounting files. Moreover the device path
  needs to be normalized.
* Added RecursiveLockAutoLocker class to ease the `goto errN' pain a bit.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9555 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 22:11:57 +00:00
Ingo Weinhold
5de8542789 Since the kernel links against libgcc.a and we use some C++ features that cause functions of libgcc.a to be included that use a couple of formerly undefined symbols (stderr, fprintf, abort, debugger) those had to be added to kernel_cpp.cpp. We don't build the kernel utils as static library anymore, since libgcc.a is listed at the end of the link command line and trying to change that would be a bit ugly. For C++ in the boot loader nothing changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 22:07:00 +00:00
Ingo Weinhold
2cee54a863 Use KPath now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9553 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:59:54 +00:00
Ingo Weinhold
8ece359269 Uses KPath now, which significantly reduces the stack footprint.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9552 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:59:05 +00:00
Ingo Weinhold
1766c66484 Added header directories needed now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9551 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:57:23 +00:00
Ingo Weinhold
92eb857652 Used KPath where possible.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9550 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:56:38 +00:00
Ingo Weinhold
92221d2425 KPath is used now where possible.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9549 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:56:05 +00:00
Ingo Weinhold
1b5f626633 * Changes to use KPath where possible now.
* Made GetMediaStatus() a bit more robust. If the ioctl fails (e.g. if it
  is not implemented as in Thomas' drivers), it gets the device geometry
  and does not fail, if the device is not removable.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:52:33 +00:00
Ingo Weinhold
0707c10377 KPartition::GetPath() now uses the new KPath class, which makes it more convenient to use.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:48:47 +00:00
Ingo Weinhold
d68a188e6d Added class KPath. Convenient wrapper for a fixed-sized path buffer.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9541 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:41:16 +00:00
Ingo Weinhold
42b568aeb5 Moved to headers/private/kernel/disk_device_manager, since it is included by KDiskDevice.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9540 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:38:01 +00:00
Axel Dörfler
0ec71451f5 Added a more or less clean implementation of devfs_publish_partition(); might
be changed later.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 15:21:11 +00:00
Axel Dörfler
b81068c0c8 Turns out that the interrupts were temporarily turned on during startup,
and that main2() cannot therefore just wait until interrupts become
enabled.
Now, the main2() thread is resumed after interrupts are turned on.
I am not yet sure if this is really necessary, but I have the feeling that it is.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 14:00:40 +00:00
Axel Dörfler
4002d2d272 Improved state_to_text() output to match the states in get_thread_info().
Improved the threads list: despite looking much better, it now also prints
out the semaphore number a thread is waiting on.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9530 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 12:50:48 +00:00
Axel Dörfler
b229567a92 Now puts out a message if the kernel doesn't fit to the boot loader.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9519 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-26 23:31:48 +00:00
Axel Dörfler
c32cb87156 Moved arch_dbg_con_init() to the end of the file.
Added the new arch_dbg_con_early_boot_message() function.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9518 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-26 23:30:51 +00:00
Axel Dörfler
8083619cf7 Since the additional 512 bytes of dprintf() on the stack can potentially
change the flow of things, it now has its own buffer, and fills it with
interrupts disabled (everything comes at a price).
Now uses the safe vsnprintf() instead of vsprintf() which could crash
the kernel.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9510 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-25 22:53:37 +00:00
Axel Dörfler
e88a0f0885 thread_init() now calls the new arch_thread_init() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-25 22:30:44 +00:00
Axel Dörfler
f9fea8ac78 A clean FPU state is now saved during init, and copied into every fresh
thread. That also allows kernel threads to use the FPU as well.
arch_thread_enter_uspace() no longer needs to initialize the FPU.
i386_stack_init() is now only called once, in arch_thread_init(), as
thought.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-25 22:29:00 +00:00
Axel Dörfler
ad2a2999a9 In early boot mode, open_module_list() is not able to find everything we
want it to find; therefore, we're now using get_next_loaded_module_name().
Added a temporary suffix to the FS DDM modules (disk_device/v1) - they
might get merged with the standard FS interface modules.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-25 13:53:52 +00:00
Axel Dörfler
06eec38c23 Added a table with the names of the standard interrupts on x86: they are
now printed out when an unhandled exception is taken.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-24 14:42:43 +00:00
Axel Dörfler
3ae4fa637a Now also prints the size of every stack frame, as well as the kernel and
eventual user stack regions of the thread.
The registers are no longer jumping around depending on the length of their values.
Removed some unused or doubly included headers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-24 14:02:51 +00:00
Axel Dörfler
ddccb72483 Improved the kernel debugger's "thread" command: it will now dump the current
thread if no arguments were given.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 17:09:51 +00:00
Axel Dörfler
8c3666d980 Renamed heap_init_postsem() to _post_sem(), added new heap_init_post_thread().
We now have a working periodic wall checker, enabled by USE_CHECKING_WALL.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 13:59:27 +00:00
Axel Dörfler
842b03d549 Now calls vm_free_kernel_args().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 13:53:13 +00:00
Axel Dörfler
25c4f39f68 Implemented vm_free_kernel_args() which frees all arguments from the kernel_args arguments
list (but not the structure itself).
Now calls heap_init_post_thread(), heap_init_post_sem() was called ..._postsem() before.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 13:52:42 +00:00
Axel Dörfler
4a3a8d94e5 Add a different approach to calm down page fault handling when debug output is enabled.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9443 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 02:44:07 +00:00
Axel Dörfler
8a37c740eb Renamed some init2() functions to init_post_vm() to make clearer when and why
they are called.
Fixed some return types (mostly from int to status_t).
Some minor other cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9440 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 01:50:09 +00:00
Axel Dörfler
d330cc09e2 Renamed some init2() functions to init_post_vm() to make clearer when and why
they are called.
Introduced a cpu_init_post_vm() that will now call arch_init_post_vm() instead
of letting main() doing it.
Fixed some return types (mostly from int to status_t).
Some minor other cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 01:45:43 +00:00
Axel Dörfler
93048e141e The decision to put reserved regions along real ones proves problematic: fixed
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
2004-10-21 01:38:37 +00:00
Axel Dörfler
3433f318e0 Disabled the USE_WALL checking by default.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-20 10:53:03 +00:00
Axel Dörfler
7605ddddf0 Replaced all remaining PAGE_SIZE with B_PAGE_SIZE and "addr" with addr_t.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-20 00:19:38 +00:00
Axel Dörfler
64807a40c3 As Thomas and I found out in a late debugging session, the VM handled the
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
2004-10-19 23:51:42 +00:00
Axel Dörfler
be84cd391c Renamed vm_alloc_from_ka_struct() to vm_alloc_from_kernel_args().
Replaced PAGE_SIZE with B_PAGE_SIZE.
Changed some return types to status_t.
Added proper debugging macro instead of dprintf() usage - disabled
debugging output.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:41:48 +00:00
Axel Dörfler
952d67454e Now make sure that the kernel address space translation map is initialized
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
2004-10-19 23:38:05 +00:00
Axel Dörfler
189a0b84e6 Renamed all externally available functions to have the arch_ prefix.
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
2004-10-19 23:35:30 +00:00