Commit Graph

1411 Commits

Author SHA1 Message Date
Axel Dörfler
368167ede8 * Integration of the new driver architecture.
* Moved devfs from fs/ to device_manager/, and separated the legacy driver
  support from it.
* Removed fast_log module.
* There are a couple of (temporary) regressions, though:
  - legacy SATA and ISA IDE support is disabled, the drivers haven't been
    ported yet.
  - The not yet used ATA bus manager hasn't been ported yet, either.
  - AHCI changes have not been tested.
  - the listdev command has been removed from the build (as it currently
    doesn't work anymore).
  - device manager generated IDs currently are not freed anymore when a device
    node is removed.
  - generic drivers can't yet use the new driver architecture.
  - simple busses that do not support device types won't work yet.
  - legacy driver publishing/unpublishing (ie. what USB needs) has not been
    tested, and may be broken.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 16:52:27 +00:00
Axel Dörfler
113a13d83e Print actual floating point number, instead of integer fraction.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 16:13:19 +00:00
Axel Dörfler
1e18692e12 * get_vnode() now accepts a NULL parameter for the fsNode argument.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 11:32:27 +00:00
Ingo Weinhold
61de73e29c Memory leak in error cases. CID 729.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25659 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-25 23:41:22 +00:00
Ingo Weinhold
5839058aa9 Memory leak in error cases. CID 737.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:29:53 +00:00
Ingo Weinhold
a1e3759f69 Memory leak in error cases. CID 808.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25644 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:17:56 +00:00
Ingo Weinhold
cefcb7b41c Memory leak in error case. CID 872.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:07:29 +00:00
Ingo Weinhold
7ad3cf0bc3 Memory leak in error case. CID 873.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25642 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:04:57 +00:00
Ingo Weinhold
1462a0827b Reordered the functions (private -> public). No functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 15:27:31 +00:00
Ingo Weinhold
6607b17d6b Pimped up the "caches" command. Now it prints the caches in trees with
additional info (offset, size, used pages, areas), sorting the trees
by used pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 00:48:15 +00:00
Ingo Weinhold
5e3a974d1e * When KERNEL_HEAP_LEAK_CHECK is enabled we also store the calling
function requesting the allocation.
* The "allocations" commands does also print the caller and can filter
  by caller, now.
* Added new "allocations_per_caller" command, which sums up allocations
  per caller and prints them in a table sorted by size or count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25632 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 22:30:20 +00:00
Ingo Weinhold
fe8878faa4 Implemented unmapping of partial areas (mmap()/munmap()). Review
welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25629 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 14:00:15 +00:00
François Revol
15ebab7616 *pathconf() need to call statvfs() to be more correct, but the kernel doesn't have it. Remove conf.c for now, it's likely not needed anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 00:11:07 +00:00
Ingo Weinhold
0f448d21e5 * Added vm_page_write_modified_page_range(), which is similar to
vm_page_write_modified_pages(), save that it only writes pages in the
  given range.
* Added vm_page_schedule_write_page_range() which schedules all modified
  pages in the given cache's range for writing by the page writer.
* Added _kern_sync_memory() syscall and the msync() POSIX function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 21:51:12 +00:00
Axel Dörfler
403bfdda6c * The floating point output now correctly honours eventual sign flags,
and actually shows the sign (before, it would just absorb it).
* On calling floating() from vsnprintf(), the order of the "fieldWidth", and
  "flags" parameters were mixed, causing some strange output.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25611 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 15:38:09 +00:00
Axel Dörfler
15173df4e9 Last patch of the vm86 patch series from Jan Klötzke - thanks!:
* The new function vm86_do_int(struct vm86_state *state, uint8 vec) provides a
  facility to call BIOS interupt handlers. The function must only be called from
  a user thread context because the lower 1MB of the address space is used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25610 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 13:54:28 +00:00
Axel Dörfler
7da0a81c0e Patch by Jan Klötzke (with additional TODO comments):
* Add a "fault_callback" to the thread structure which is called when a
  unhandled page fault happens in user space. A SIGSEGV will only be sent
  if the callback returns "true".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 12:33:30 +00:00
Axel Dörfler
ec09e0a89d Patch by Jan Klötzke:
* For vm86 mode the kernel stack top is adjusted -> do not rely on the
  kernel_stack_base + KERNEL_STACK_SIZE calculation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25608 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 12:02:30 +00:00
Axel Dörfler
bb107c4e29 Patch by Jan Klötzke:
* In vm86 mode CS will have arbitrary values so we check for both USER_CODE_SEG
  and the VM flag in EFLAGS. This is also done when entering interrupt gates.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 11:59:47 +00:00
Axel Dörfler
a71e7c8d43 Patch by Jan Klötzke:
* The IO permission bitmap is always checked for virtual 8086 mode tasks.
  Make sure it is invalid.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25605 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 11:44:42 +00:00
Axel Dörfler
b8caf749bf * _user_cpu_enabled() accidently returned an error code instead of "false".
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25604 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 11:38:00 +00:00
Axel Dörfler
44431460dd Daemons are now spawned with "new", and thus they should be sent back using
"delete", not free().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25603 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 11:37:20 +00:00
François Revol
867bc16149 It should be eieio...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25586 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-20 21:49:25 +00:00
Ingo Weinhold
0a89fae916 wait_for_child() does now wait for the main thread of a dead child to be
gone. Fixes bug #1639.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-19 23:21:58 +00:00
Ingo Weinhold
b3d6c12dbf * Fixed kernel tracing for gcc 4. The ABI changed in a way that isn't
compatible with what our code assumed (pointers to objects of
  TraceEntry and its POD base class trace_entry aren't identical
  anymore).
* Added optional stack traces for ktrace_printf() output in the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-17 18:59:19 +00:00
Ingo Weinhold
fbe0c27a94 axeld + bonefish:
Changed condition variables so that it is allowed to block (e.g. lock
mutexes etc.) between Add() and Wait(). This fixes #2059, since the
block writer used them this way and could thusly fail to wait for a
condition variable, causing a temporary stack object to be used past its
lifetime.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-17 10:21:37 +00:00
Stephan Aßmus
9aa2788e97 Another patch by Vasilis Kaoutsis:
* Use find_directory() for the hash for preloaded modules. I am not sure this
  patch is needed, since it only concerns the hash. Please review.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25511 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-15 12:28:08 +00:00
Stephan Aßmus
7c61d84fcd Patch by Vasilis Kaoutsis:
* Renamed main.c to main.cpp
* Use find_directory() to construct the Bootscript path.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-15 12:10:12 +00:00
Stephan Aßmus
ea26d9f0c2 Honour 80 char/line limit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-15 12:09:12 +00:00
Stephan Aßmus
5dc81824d6 Another patch by Vasilis Kaoutsis:
Use find_directory() to find the runtime_loader when starting teams.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-15 11:55:09 +00:00
Stephan Aßmus
2764548ef3 Use find_directory() in the devfs. Based on patch by Vasilis Kaoutsis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-15 10:06:58 +00:00
Ingo Weinhold
6b202f4e3d * Introduced new header directory headers/private/system which is supposed
to contain headers shared by kernel and userland (mainly libroot).
* Moved quite a few private kernel headers to the new location. Split
  several kernel headers into a shared part and one that is still kernel
  private. Adjusted all affected Jamfiles and source in the standard x86
  build accordingly. The build for other architectures and for test code
  may be broken.
* Quite a bit of userland code still includes private kernel headers.
  Mostly those are <util/*> headers. The ones that aren't strictly
  kernel-only should be moved to some other place (maybe
  headers/private/shared/util).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-14 03:55:16 +00:00
Ingo Weinhold
541532342d Fixed build with tracing turned on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-13 20:04:11 +00:00
François Revol
f5c558edc1 The wonders of C++ in the kernel... you get C++ linkage by default :^)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25480 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 22:01:12 +00:00
Ingo Weinhold
b5e3c0a1ea Added new syscalls _kern_block_thread()/_kern_unblock_thread[s]().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25469 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 13:53:56 +00:00
Jérôme Duval
036cf4dd20 block_cache_delete(): only lock the cache mutex and avoid MutexLocker. the mutex is destroyed in the destructor.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25467 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 12:56:59 +00:00
Jérôme Duval
c1d860fb1f block_cache_delete(): unlock the cache mutex before deleting the cache
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25463 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 10:54:14 +00:00
Ingo Weinhold
d648afb8d7 * For each userland team the kernel creates an area in the userland
address space that is fully locked and marked B_KERNEL_AREA. It can
  thus be accessed by the kernel without additional checks.
* For each userland thread we do create a user_thread structure in that
  area. The structure is accessible from userland via TLS, using the
  private get_user_thread() function.
* Introduced private userland functions [un]defer_signals(). They can be
  used to cheaply disable/re-enable signal delivery. They use the
  user_thread::defer_signals/pending_signals fields which are
  checked/updated by the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25451 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-11 16:25:35 +00:00
Ingo Weinhold
58148e2e02 Added new private area protection flag B_KERNEL_AREA, which prevents all
changes to the area (delete, resize, clone) from userland.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-11 16:02:13 +00:00
Ingo Weinhold
a636a33926 Use the new B_ABSOLUTE_REAL_TIME_TIMEOUT. Fixes pthread_cond_timedwait()
and pthread_mutex_timedlock() which were waiting system time relative
although their timeout parameter is Epoch relative.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 21:44:03 +00:00
Ingo Weinhold
4d3680aaef Added timeout constant B_ABSOLUTE_REAL_TIME_TIMEOUT which specifies a
timeout relative to the Epoch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 21:34:51 +00:00
Ingo Weinhold
eb1a8c446e siglongjmp() calls __longjmp_return() also on x86, now. This resets the
signal mask as required. and also makes my recent return value fix
unnecessary, since __longjmp_return() already does that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 18:05:41 +00:00
Ingo Weinhold
8bba1c2637 Forgot to check this one in. setjmp.S is no more.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25429 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 17:39:29 +00:00
Ingo Weinhold
378a1cbb0c Added poll() kernel tracing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25425 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 16:23:48 +00:00
Axel Dörfler
1da9f5cea5 * Added BDiskSystem::ShortName() and everything needed to get it there.
* Added BDiskDeviceRoster::GetDiskSystem() method, that can get a disk system
  by short/pretty/module name - since they should all be unique, I put them
  in a single namespace, please complain if you don't like that :-)
* Cleaned up DiskSystem.h and DiskDeviceRoster.h according to the updated
  header guidelines.
* Renamed ntfs pretty name from "ntfs File System" to "Windows NT File System".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 11:44:00 +00:00
Ingo Weinhold
c44fb2a62c Advisory locking fixes:
* Made the access strategy to vnode::advisory_locking consistent.
  get_advisory_locking() was guarding it with sVnodeMutex,
  create_advisory_locking() was using atomic_pointer_test_and_set(), and
  release_advisory_lock() just set it unguardedly. We do use sVnodeMutex
  consequently, now.
* Beautified create_advisory_locking() (got rid of the gotos,
  reorganized the control flow).
* Fixed race conditions in acquire_advisory_lock(). It was always
  unlocking and relocking the advisory_locking object when it didn't
  have to wait, but in the meantime someone else could have changed the
  locking situation. Reorganized the control flow, so that it only drops
  the lock when it has to fail or wait. Using create_advisory_locking()
  upfront simplifies the code quite a bit (and fixes another race
  condition).

APR's testprocmutex test seems happy now, at least.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 00:53:13 +00:00
Ingo Weinhold
d59239b300 Also align the given size to pages when unmapping memory. Fixes munmap()
for non-aligned sizes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 18:23:23 +00:00
Ingo Weinhold
4c49f2056b * Changed _kern_spawn_thread() and create_thread(): Instead of individual
arguments they get a single thread_creation_attributes structure now.
* Added stack_address and stack_size to thread_creation_attributes,
  which allow to specify the stack size or the stack to be used for the
  new user thread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 01:32:36 +00:00
Axel Dörfler
56bbbbc9ca * Added Adopt() method that steals the other path's buffer.
* Fixed operator=(): the second argument of SetTo() is a boolean (normalize),
  not the length of the buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25382 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 16:45:29 +00:00
Axel Dörfler
9623534399 Now uses mutexes instead of benaphores, that also simplified object
instantiation at early boot a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 16:06:51 +00:00