Commit Graph

25353 Commits

Author SHA1 Message Date
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
Ingo Weinhold
7c27db095e Typo spotted by Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26573 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 20:58:23 +00:00
Ingo Weinhold
5c99d63970 Merged branch haiku/branches/developer/bonefish/vm into trunk. This
introduces the following relevant changes:
* VMCache:
  - Renamed vm_cache to VMCache, merged it with vm_store and made it a
    C++ class with virtual methods (replacing the store operations).
    Turned the different store implementations into subclasses.
  - Introduced MergeStore() callback, changed semantics of Commit().
  - Changed locking and referencing semantics. A reference can only be
    acquired/released with the cache locked. An unreferenced cache is
    deleted and a mergeable cache merged when it is unlocked. This
    removes the "busy" state of a cache and simplifies the page fault
    code.
* Added VMAnonymousCache, which will implement swap support (work by
  Zhao Shuai). It is not integrated and used yet, though.
* Enabled the mutex/recursive lock holder asserts.
* Fixed DoublyLinkedList::Swap().
* Generalized the low memory handler to a low resource handler. And made
  semaphores and reserved memory handled resources. Made
  vm_try_resource_memory() optionally wait (with timeout), and used that
  feature to reserve memory for areas.
...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26572 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 20:36:32 +00:00
Karsten Heimrich
61a2483a53 * missed that one
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 20:35:28 +00:00
Karsten Heimrich
12fd6cc2e7 * move libprint sources into libs, as it is a 3rdparty lib
* move libprint headers into libs headers folder accordingly
* merge all shared folders sources into kits print, we might build later on a
  real print kit, propably also to access cups from an nicely API, atm static
* move all shared headers into private print, also pr_server.h from interface
* adjust build to work with the changed folder layout



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 20:30:14 +00:00
Axel Dörfler
467acc16f5 * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 17:57:00 +00:00
Axel Dörfler
33f9067b36 * Started using the I/O scheduler -- disabled it for now, though, as it doesn't
really work yet (there are some bits missing in the IORequest and IOScheduler
  to able to use them this way).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26565 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 16:31:35 +00:00
Axel Dörfler
6835a76dfe * Now supports formatting file devices as well as partitions.
* Fixed crash when it couldn't find the device.
* Added a "-l|--list-types" option that list all file systems that support
  initializing (currently only BFS).
* Added a "-q|--dont-ask" option that prevents mkfs from questioning your
  command :-)
* Fixed return value - would return failure to the shell when it actually
  succeeded and vice versa.
* Improved/clarified some output and fixed spelling errors.
* Errors now have the command name as prefix, as that's how it is usually
  done (and very useful for batch processing).
* Cleanup, though I kept the FsCreator class which is kinda superfluous.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26564 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 14:11:54 +00:00
Axel Dörfler
6cc43bfbb0 * _user_find_partition() did not work for partitions (only for devices), as it
did not set the "devicesOnly" flag to false when calling RegisterDevice().
* ddm_userland_interface.cpp incorrectly wrote to userland memory when it
  assigned "neededSize" in several places.
* Replaced on-stack path with the UserStringParameter class where appropriate.
* Made the UserStringParameter class castable to char*.
* Minor cleanup in KDiskDeviceManager.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26563 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 14:05:47 +00:00
Stephan Aßmus
ebdb1a612b Just small white space cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26562 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 11:03:03 +00:00
Stephan Aßmus
ea021c679f Clicking on a menu item that already has an open submenu will close the
sub menu and quit menu tracking. This closes #1826. I tested a bit with
various different menu situations and there seem to be no negative side
effects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26561 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 10:50:34 +00:00
François Revol
dcd20e9d16 forgotten -fno-pic makes arch_elf.cpp give the correct pointers to dprintf instead of garbage.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 01:56:33 +00:00
François Revol
9a486099e8 better english, tell about rela relocs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26559 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 01:11:45 +00:00
François Revol
9f8e918d80 The .dynamic section should be both part of the data and dynamic segments!
This makes the kernel loadable by the bootloader, which does load it, and all the modules \o/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26558 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 00:46:07 +00:00