Commit Graph

25366 Commits

Author SHA1 Message Date
Ingo Weinhold
c586076dca Patch by Zhao Shuai with changes by myself:
* Init swap support in main().
* Added "bool swappable" parameter to
  VMCacheFactory::CreateAnonymousCache(). A cache supporting swapping
  is created when true. Adjusted invocations accordingly.
* The page writer does now write non-locked swappable pages (when
  memory is low).
* Fixed header guard of VMAnonymousNoSwapCache.h.
* Swap support is compiled conditionally, controlled by the
  ENABLE_SWAP_SUPPORT in src/system/kernel/vm/VMAnonymousCache.h. It is
  disabled ATM. Since no swap files are added, it wouldn't have much
  effect anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 23:33:38 +00:00
Ingo Weinhold
a6d2523e37 Removed superfluous whitespace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 23:19:51 +00:00
Ingo Weinhold
3e3045f5cf Create the cbuf area full locked for the time being. We can't create it
swappable, since that happens before we can initialize swap support
(which requires the later initialized VFS).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 23:06:58 +00:00
Ingo Weinhold
cdc6ad72bb Don't clone the user thread area on fork(), just create a new one for
the new team. Otherwise it would lose it's properties (full lock,
B_KERNEL_AREA).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 23:03:59 +00:00
François Revol
29ec0f52d2 Add copyrights for Udis86, used in the kernel debugger disasm module.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 21:47:12 +00:00
François Revol
2f5ec25ea6 Add disasm kernel debugger addon for x86 to the image.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 21:40:34 +00:00
François Revol
6ef4bb05f8 Fixed PPC_ONLY define, added M68K_ONLY just in case.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26619 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 21:38:11 +00:00
François Revol
76c9eb5b42 disasm kernel debugger module providing a dis addr [count] command, currently only for x86, using Udis86.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 21:20:29 +00:00
Oliver Ruiz Dorantes
76646d9f67 Cleanups
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26615 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 20:54:32 +00:00
Oliver Ruiz Dorantes
3205e523cd Implement pairing with a remote bluetooth device
- Fix PincodeWindow to send the pincode commands dissapear after clicking 
- Improve the debug output of bluetooth_server
- Handle all needed events for the pairing
- Simple request could send and receive the event before adding the request to the events wanted list. Inverted the order of this sequence.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 20:50:49 +00:00
Oliver Ruiz Dorantes
e54b6bb39a Make the local devices register in some module of the Kernel land... for the moment as bridge for l2cap
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26613 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 20:41:11 +00:00
Oliver Ruiz Dorantes
25ae4a6a68 Prevent softfault, although I would like not to have to declare the sender if I dont care...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26612 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 18:28:27 +00:00
Rene Gollent
eb9c6bd38a Adopt Axel's solution to the unmount/rmdir problem (only remove from rootfs) in DriveSetup also.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26611 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 14:15:23 +00:00
Maurice Kalinowski
8e27997c00 Prefer NULL over 0 and not need to initialize globals with zero as pointed
out by Axel.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26610 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 12:57:41 +00:00
Ingo Weinhold
0d4d5abea1 An IORequest's memory needs to be unlocked when it is done. Since this
happens in the I/O scheduler thread, we need to use unlock_memory_etc().
Changed the IOBuffer::{Lock,Unlock}Memory() methods accordingly.

The test driver seems to be working stable, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 12:29:32 +00:00
Ingo Weinhold
d4e2720651 More debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26608 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 12:26:23 +00:00
Ingo Weinhold
bfbae5e594 The I/O callback will eventually move the operation back to the
completed operations queue. That doesn't need to happen synchronously
either. So we have to restart the loop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 12:10:39 +00:00
Ingo Weinhold
3f18ee2626 More debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26606 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 12:06:29 +00:00
Ingo Weinhold
04b04600f2 Trust the compiler to do optimize simple stuff like this. This also
helps to avoid stupid mistakes. The driver works again, though things
are still not stable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26605 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 11:34:55 +00:00
Axel Dörfler
489075a3b4 * Renamed _ForceUnmount() to _SuggestForceUnmount() to clarify what it does.
* Factored an _UnmountAndEjectVolume() method that takes a partition and mount
  path out of the method with the same name that gets a BMessage.
* Remove the mount point only if it's in rootfs.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26604 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 11:25:16 +00:00
Stephan Aßmus
93706b7208 Added optional package CVS, as it is still sometimes handy to have. The package follows
the scheme that Ingo started and thus installs the license and copyright to the right
places.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26603 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 09:50:58 +00:00
Ingo Weinhold
91ccfa19a0 Added missing vm_put_physical_page() in do_io().
Something is still fishy though: Opening the dma_resources_test device
in DiskProbe, the wrong data is shown. do_io() seems to be invoked with
the correct physical address, vm_get_physical_page() succeeds, and after
memcpy() the correct data are in the virtual address it returned, but
db in the kernel debugger shows that the data in the physical page have
not been changed. When quitting DiskProbe the "page still has mappings"
assert is triggered for the page.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26602 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 04:25:06 +00:00
Ingo Weinhold
9951d585b6 * We have to use get_memory_map_etc() instead of get_memory_map(), since
the scheduler thread doing that has no direct access to the
  destination team's address space.
* Improved some debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 04:11:03 +00:00
Ingo Weinhold
6e60a6ac03 Added function get_memory_map_etc() which works similar to
get_memory_map(), but has a saner semantics and allows specifying a
team.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26600 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 04:07:14 +00:00
François Revol
0ae1957465 - Cleanup
- rewrote early_query() to use the TT0 mapping to remove the page_hole stuff.
- fixed natfeat, using a page set up from the bootloader for now as it wants physical address. At least it's enough to see from the debugger:
load kernel...
kernel entry at 8003711a
Welcome to kernel debugger output!
Haiku revision: 26582
PANIC: unknown cpu_type 68040

Welcome to Kernel Debugging Land...
Running on CPU 0
kdebug>


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26599 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 02:59:47 +00:00
Ingo Weinhold
feb6103338 * Maybe I just missed something, but module names not matching the
driver name didn't work here.
* Enabled using the I/O scheduler in the read() and write() hooks.
  Something's still broken, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 02:02:39 +00:00
Ingo Weinhold
902559ce32 * Added a mutex to IORequest. It doesn't look like we can get around
using a lock and I'm not very much in favor of a global one.
* Added "finished" callback to IORequest.
* IOOperation::Finish() no longer invokes its parent request's
  ChunkFinished(). The finisher does this instead. ChunkFinished()
  can optionally remove the chunk from the parent.
* Added IORequest::Wait() which waits for the completion of the request.
* Introduced IORequestChunk::ResetStatus() to make setting the status to
  "pending" somewhat more explicit.
* Implemented the missing IOScheduler::SetCallback() methods.
* The NotifyAll() calls on the IOScheduler's condition variables were
  missing, so it just waited forever.
* Added some more debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 01:54:41 +00:00
François Revol
77cbdee787 Add platform specific kernel args, use them to pass nat_feat info so at least the kernel can print something from the emulator...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 01:10:36 +00:00
Rene Gollent
7a1c09b66a Only try to rmdir in the case of success.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26595 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 23:09:08 +00:00
Ingo Weinhold
b71e631972 * Fixed race condition between OperationCompleted() and the scheduler
thread. Interrupting a thread only works when it is already waiting.
  We do now use a flag to indicate whether the scheduler thread is
  waiting (avoids thread_interrupt() calls when the thread is in driver
  code). Furthermore before starting to wait, we check whether any
  finisher work has to be done -- we do that (and the addition of the
  entry to the condition variable) with the finisher lock being held to
  avoid the race condition.
* Moved waiting for and getting the next unscheduled request into new
  method _GetNextUnscheduledRequest().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:56:51 +00:00
Rene Gollent
5c4fff2ef1 Tracker and DriveSetup now attempt to clean up the mount point after successfully unmounting the volume.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:55:00 +00:00
Ingo Weinhold
f587c66c57 Obsolete TODO.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:36:55 +00:00
Maurice Kalinowski
4d49d73f17 * whitespace cleanup, no functional change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:22:26 +00:00
Maurice Kalinowski
ba97f78287 julun+mauricek:
* add cygwin specific options.
   * Cygwin cannot handle -fPIC option and throws warnings, thus we only use it on non windows platforms for the host tools.
   * Windows uses PATH instead of LD_LIBRARY_PATH, so before calling a host tool this environment variable needs to be expanded... Brilliant...
   * Using jam on Windows is kind of complicated, as the cygwin included gcc creates executables with a .exe extension. When jam parses dependencies for being up to date it ignores this extension again and tries to rebuild the executables again and again. This hack removes the extension after successful linking. Though jam has a SUFEXE variable for cygwin builds, we cannot use this one directly as crosscompiled targets do not have an extension, it is complicated to use the same jam for both platforms. A more clean attempt would be to check for the extension on each host target depending on the platform. This should be fixed later on.
   * Btw. Say hello to Haiku compiling successfully on Windows :) with one patch to be discussed for jam...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:20:37 +00:00
Maurice Kalinowski
39fd631a39 julun+mauricek:
* as on darwin platform we cannot use resources for the boot sector data. Instead use attributes to store the data.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26589 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:17:54 +00:00
Maurice Kalinowski
ea70c8b6f3 julun+mauricek:
* additional includes for cygwin
   * some automatic whitespace cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26588 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:15:05 +00:00
Maurice Kalinowski
dff0e735eb julun+mauricek:
* Cygwin does not have regex support, so we use the one we already have in our glibc.
   * Keymap.h has a automatic forward declaration of re_registers, which causes a compile break on Cygwin, but not on other platforms. So add a include for regex.h in the header and remove it in the source file.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 21:40:12 +00:00
Rene Gollent
ef7fb431ed Remove extraneous put_vnode(). This would result in decrementing the vnode ref count even if an unmount operation failed, which in turn would cause other fun problems. This fixes tickets 1982 and 2538. However, there seems to be another problem remaining with unmounting: the placeholder dir in the rootfs is not removed when the volume is unmounted, or it's not reused correctly. As a consequence, on subsequent remounts of the same volume via Tracker or mountvolume, a new dir is created each time, leaving empty placeholders. (i.e. remounting the volume HaikuData results in the creation of /HaikuData1, 2, 3, 4, etc.).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26586 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 21:39:48 +00:00
Maurice Kalinowski
7db9e218e4 julun+mauricek:
* rc uses a global instance of BResources. On destruction it calls Unset() of the BFile member fFile. BNode::Unset then calls close_fd(), which parses the static global DescriptorMap to actually close the descriptor. However on Cygwin the DescriptorMap has been destroyed already for some reason, thus accessing it is invalid. The "fix" is to put the map on the heap and delete it as soon as it gets empty. This way the global BResources instance can be freed without a crash.
   * If someone likes to review, feel free to, it didn't cause any issues here


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26585 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 21:39:38 +00:00
Maurice Kalinowski
59c40b2f95 julun+mauricek:
* Cygwin needs some additional defines compared to other platforms
   * Additionally stpcpy and strcasestr are unknown on Cygwin. Thus we need to use the one from our posix library.
   * ECANCELED is not defined on Cygwin, so only add error in case it is.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 21:39:13 +00:00
Maurice Kalinowski
e688a433ca julun+mauricek:
* add Cygwin to the list of supported platforms

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 21:38:49 +00:00
Axel Dörfler
b4395038ee * Replaced the sAreaHashLock with an rw_lock.
* As this was the last user of the READ_COUNT/WRITE_COUNT definitions in
  vm_priv.h, I removed those as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 16:10:52 +00:00
François Revol
8881176ff3 A module that hooks into the debugger to provide it with a demangle() so at least when using C++ in the kernel stack crawls are meaningful.
It does its job by using part of libsupc++, with fake malloc and friends to make sure it won't double fault.
Works here, but cp-demangle must be extracted by hand from the lib, can't get the rule to work as I want, Ingo ?
Maybe using it directly without malloc hack would be ok with 16KB buffer, but I'm not sure of that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 16:08:16 +00:00
Ingo Weinhold
4e99b4683e * Fixed kernel tracing.
* Re-added tracing for cache creation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26580 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 15:55:51 +00:00
Ingo Weinhold
e6bd90c58d * bfs_fsync() was the only place which could cause the
fs_vnode_ops::write_pages() to be called with fsReenter = true. Since
  this is no longer the case, the argument has become superfluous. For
  read_pages() it always was. Removed the argument from the functions
  and all functions that propagated it.
* Some whitespace at the end of lines was removed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26579 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 15:47:47 +00:00
Axel Dörfler
4ed05c6869 * Replaced the simplistic semaphore based R/W lock in the vm_address_space with
the new rw_lock locking primitive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26578 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 15:45:40 +00:00
Axel Dörfler
190712ced9 * file_cache_sync() no longer needs the file system's lock.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 15:03:41 +00:00
Axel Dörfler
fe08828a3c * The identify_cookie was allocated unchecked, spotted by Stippi.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26576 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 14:53:15 +00:00
Axel Dörfler
5d0a5f7cac * The bfs_shell needs to include <new> as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26575 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 11:59:47 +00:00
Axel Dörfler
082bae1aa5 * bfs_fsync() no longer grabs the Inode's read lock - instead, Inode::Sync()
will take care of the locking.
* Use new(std::nothrow) over new, and malloc (only in kernel_interface.cpp);
  the kernel_cpp.h header isn't really necessary anymore, so there is no reason
  BFS should continue to use it.
* Removed superfluous NULL checks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 11:56:08 +00:00