Commit Graph

1458 Commits

Author SHA1 Message Date
Michael Lotz
2b31f85c9e Fix two warnings caused by previous commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25811 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-05 22:18:31 +00:00
Michael Lotz
a9fbc5482c Give the debugger add-ons a chance when reading input characters. They already
got a debugger_getchar hook, it just wasn't used yet. Not that there would be
any debugger add-on implementing that hook currently...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25809 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-05 21:16:34 +00:00
Michael Lotz
22b2f0e6b5 * Panic when trying to lock a mutex twice from the same thread. Should make
mutex deadlocks more obvious.
* Fix wrong function name in panic string.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-05 21:01:47 +00:00
Michael Lotz
065ef7eb5f Replace the legacy driver mutex with a recursive lock. This fixes the deadlock
when hot-plugging a USB mass storage device. The legacy driver (usb_disk in
this case) was rescanned which locked the legacy driver mutex. The insertion
of the new device node caused the disk device manager (notified through node
monitoring) to try to scan the new node. As opening the node triggers
LegacyDevice::InitDevice() that locks the legacy driver mutex again a deadlock
occured.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25807 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-05 18:58:03 +00:00
Michael Lotz
9223644a02 Add a welcome message including the revision number when initializing the
syslog so syslogs always contain the revision number too (as does serial
output).
This is only necessary because the early part of the serial output (that
contains the revision number) does not make it into the syslog. So fixing that
might be the better way.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25804 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-04 18:37:29 +00:00
Michael Lotz
01e46bdb18 * Extract the KDL keymap to a separate header and provide a 'sg' swiss german
keymap there too.
* Add a config header where one can select what KDL keymap should be used
  (currently only 'us' and 'sg' are available though).
* Provide a third keymap that is used when the alt modifier is used (the swiss
  german keymap is pretty useless without alt as all the useful keys like
  backslash and curly braces use alt).

Our KDL is so powerful and nice to use, the only thing that bothered me was
that I always had to think about where some of the special keys are located in
the US keymap. So this simple compile-time keymap switching provided to be
helpful for me and might be for others too. Keymaps for other layouts obviously
have to be written before this becomes really useful.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25803 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-04 17:56:30 +00:00
Axel Dörfler
fd7ff3cfc8 * While it's okay to allow nodes with fixed children to register their own
children, you either have dynamic or fixed children, never both.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25801 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-04 10:50:06 +00:00
Axel Dörfler
0dedf9f081 * Removed the now superfluous pnp_devfs.h header.
* There was a leftover in devfs that still needed it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-04 10:38:59 +00:00
Jérôme Duval
5b8d33bd75 * some typos
* a driver can register children and have a fixed child (ie for a bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25799 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 21:05:58 +00:00
Axel Dörfler
d16ddc579c * The boot loader now passes on its EDID info to the kernel, and that will
be put into a boot_item in frame_buffer_console_init().
* The VESA driver now supports gettings the EDID information as well; this
  is necessary now, since the app_server no longer takes over the mode the
  boot loader had chosen.
* Note, we might want to do this via vm86 instead in the future, and remove
  the kernel part again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 15:17:59 +00:00
Ingo Weinhold
992330f54b _user_debug_output() used kputs() and thus wouldn't print anything
anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 15:04:09 +00:00
Axel Dörfler
8b07bbe108 * Added a bit more debug output when enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25780 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 13:30:45 +00:00
Axel Dörfler
557335a991 * device_nodes now have a priority that is used to sort them when they are
added to their parent. Currently, only the existence of B_FIND_MULTIPLE_CHILDREN
  influences the priority.
* This makes it possible to register/probe intelligent busses earlier than
  simple/generic busses.
* Reenabled the ISA bus manager using the new device architecture; the
  ide_isa driver can and will now actually work.
* device_node::Probe() now sets the global sGenericContextPath for generic
  nodes. This causes a special handling in _GetNextDriverPath().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 13:22:24 +00:00
Axel Dörfler
2ecef3acbe * As Korli pointed out, I got a bit confused with Rescan() vs. Probe().
* Therefore, device_manager::rescan_node() now actually causes the
  driver::rescan_child_devices() function to be called, instead of probing
  again.
* Added a device_node::Reprobe() method that does what Rescan() did previously.
* Probe() should now also work with "dumb" busses that don't support type
  information - it will now probe all of these nodes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 09:13:04 +00:00
Axel Dörfler
7830589f02 Patch by Vasilis Kaoutsis:
* Added a missing close_module_list().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25777 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 07:28:04 +00:00
Michael Lotz
83d453239c Directly use memalign instead of malloc to safe one indirection.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 06:56:24 +00:00
Michael Lotz
b4babdf47e Move the device deletion after the unpublish call. Fixes crashes where a
device is still referenced through the devfs and used right between deleting
and unpublishing.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25775 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 06:53:57 +00:00
Stefano Ceccherini
fa827b37fc took the liberty to add this to the buiild and fix compilation :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25774 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 05:02:59 +00:00
Stefano Ceccherini
54d9d37f9d Added patch by Dustin Howett: header with HPET definitions and (empty)
file for hpet implementation. Not yet added to the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 04:37:18 +00:00
Ingo Weinhold
0cb2617fa5 Before starting to wait the undertaker does now check whether there's
already a dead thread available. Fixes a race condition.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-02 04:34:09 +00:00
Ingo Weinhold
1c8de8581b * Added optional spinlock contention measurement feature. Enabled when
B_DEBUG_SPINLOCK_CONTENTION is defined to 1. It typedefs spinlock to a
  structure (thus breaking BeOS binary compatibility), containing a
  counter which is incremented whenever a thread has to wait for the
  spinlock.
* Added macros for spinlock initialization and access and changed
  code using spinlocks accordingly. This breaks compilation for BeOS --
  the macros should be defined in the respective compatibility wrappers.
* Added generic syscall to get the spinlock counters for the thread and
  the team spinlocks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-02 02:04:12 +00:00
Axel Dörfler
032f1e5f90 * Fixed an endless loop when using vfs_get_vnode_name() or the "wrong"
get_vnode_name() variant.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 18:47:18 +00:00
Jérôme Duval
19b07e67d2 when acquiring results in an error, the resource should be reset to avoid a crash on delete
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 15:27:00 +00:00
Axel Dörfler
710b77326d * vm_cache::virtual_size is not always a multiple of B_PAGE_SIZE for files.
In these cases, the last partial page would have never been written back.
* This fixes bug #2282, and eventually others.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 10:53:10 +00:00
Ingo Weinhold
123dfa78e5 Enforce 80 columns maximum line length.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 02:40:08 +00:00
Rene Gollent
3104402815 gcc4 build fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 02:36:47 +00:00
Ingo Weinhold
73aa393d73 * Introduced pipes in the kernel debugger. The syntax is similar to
pipes in the shell, though the semantics is a little different: The
  second command is invoked whenever the first command has written a
  complete line. The line is passed as last argument to the second
  command. The new command flag B_KDEBUG_PIPE_FINAL_RERUN causes the
  second command to be invoked again (with NULL argument) after the
  first command is done.
* Added kprintf_unfiltered() and kputs_unfiltered() which bypass the
  pipe mechanism and directly print to the bluescreen/serial output.
* Moved most commands from debug.cpp to the new
  debug_builtin_commands.cpp.
* B_KDEBUG_DONT_PARSE_ARGUMENTS commands don't get an argument anymore,
  if it would consist of white space only.
* Added new debugger command return value B_KDEBUG_ERROR, which
  indicates that executing the command failed. This return code will
  abort a complete pipe.
* Since debugger commands can nest (i.e. one command can invoke another
  one) the setjmp()/longjmp() mechanism to restore the stack after a
  page fault in a command needs more than one jump buffer.
* Added abort_debugger_command(), which longjmp()s out of the currently
  executed command. This will also abort the current pipe.
* When pagination is enabled pressing "a" will abort the running command
  (as opposed to "q" which only disables the blue screen output, but
  lets the command continue).
* Added debugger commands:
  - "grep" which can be used to filter output by pattern. Removed the
    "filter" command and the underlying mechanism that did that before.
  - "head" which prints only the first lines of output of another
    command.
  - "wc" counts lines, words, and characters of another command's
    output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 02:25:00 +00:00
Michael Lotz
9a18e1d269 * Do not delete the device handed over to the devfs when deleting the vnode
as it seems devfs should not take over ownership. The device is deleted
  in republish_driver for legacy drivers before the call to devfs_unpublish_device
  that in turn deletes the vnode. This looks generally suspicious to me as
  the device pointer the devfs vnode may still use gets invalid for a certain
  amount of time (until the node is unpublished). So maybe the devfs should
  take ownership of the device afterall and it shouldn't be deleted by the
  device_manager/legacy driver functions. Axel please review.
* Do not try to delete the IOScheduler for now as creating one is disabled
  currently too.

This fixes the crash on rescans of legacy drivers as seen when unplugging
USB devices.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 20:30:07 +00:00
Michael Lotz
3cec30848c Fix build with TRACE_VFS enabled and also fix a warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 19:06:30 +00:00
Michael Lotz
2ec83efbb2 Fix one reason for crashing on legacy driver rescans, but there seems to be
more to it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 17:45:27 +00:00
Ingo Weinhold
e4d2f9ba4f Removed the condition that only caches with a source can be merged.
Instead we only allow temporary caches to be merged. This remedies the
problem that after fork() + join() there remains a superfluous cache
layer for all RAM areas.
I haven't tested it, but this might improve the jam situation
memory-wise (huge heap is committed one less time), though it might
worsen it performance-wise (lots of heap pages are moved with every
merge).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 01:02:29 +00:00
Ingo Weinhold
ad66253c1a * Broke the cache merging code out of vm_cache_remove_consumer() into
new function merge_cache_with_only_consumer(), which is also used in
  vm_cache_remove_area(), now.
* Added tracing for the merge case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 00:27:02 +00:00
Ingo Weinhold
0a871009db Added VM cache kernel tracing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 22:09:51 +00:00
Ingo Weinhold
91312c915d Changed tracing output prefix from "cache" to "block cache".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 21:21:33 +00:00
Axel Dörfler
abc690633a * AHCI and other SATA drivers aren't in busses/sata, but either busses/scsi
or busses/ide.
* This change makes the AHCI driver working again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 15:03:15 +00:00
Ingo Weinhold
9101535322 Added new kernel thread "undertaker" which gets rid of dead thread
remains. This replaces the previous mechanism of switching the thread to
a dedicated death stack. We might consider moving more cleanup work to
the undertaker, but that seems a little more involved.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 14:28:31 +00:00
Ingo Weinhold
2b07b8e0f1 * Replaced all instances of benaphores in the kernel code by mutexes.
* Removed kernel benaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 02:08:23 +00:00
Ingo Weinhold
1c18a5df87 Replaced R/W lock implementation. Should have a little less overhead
than a semaphore, and can already be used in the early boot process.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25689 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 00:32:06 +00:00
Ingo Weinhold
b0f5179aa5 * Changed recursive_lock to use a mutex instead of a semaphore.
* Adjusted code using recursive locks respectively. The initialization
  cannot fail anymore, and it is possible to use recursive locks in the
  early boot process (even uninitialized, if in BSS), which simplifies
  things a little.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 23:12:36 +00:00
Axel Dörfler
3023ab11f7 Patch by Jan Klötzke:
* Improve vm86 mode tracing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 12:44:56 +00:00
Axel Dörfler
9f16184577 Patch by Jan Klötzke with minor changes by myself:
* Use vm86 mode to call the VESA BIOS to do the actual mode switching by
  providing an ioctl in the vesa driver.
* Fix vm86.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25680 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 10:48:01 +00:00
Axel Dörfler
2c8b410ad5 Patch by Jan Klötzke:
* Current linking scheme does not always export arch specific symbols from the
  kernel. Merging all compiled arch stuff into a single .o file (and linking
  that to the kernel) fixes it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 10:08:07 +00:00
Ingo Weinhold
0e82c8d555 Improved the "caches" command:
* List the sum of pages used by a cache tree in the line printed for the
  root cache.
* Also print the amount of committed memory per cache (and the sum for
  the tree), and allow sorting the list by it ("-c" switch).
* Added usage text.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-27 23:23:01 +00:00
Axel Dörfler
2976912a51 * BaseDevice didn't initialize the fInitialized member, and thus causing bug
#2265.
* Device::InitDevice()/UninitDevice() are called from outside of the device
  manager, so they better lock it.
* Turned off debug output in devfs and the device manager.
* Fixed debug output in devfs to print the actual vnode/cookie values, instead
  of the structures the VFS passes in now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-27 12:04:09 +00:00
Axel Dörfler
4584521e0b * PCI_mass_storage_other no longer scans the non-existing busses/disk path, but
all busses now. This should help with broken controllers that don't advertize
  their capabilities correctly.
* Maybe we want to have a list that translates some types for certain devices,
  too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 21:03:32 +00:00
Maurice Kalinowski
ac1d597e94 gcc4 build fix. Don't have default value for declaration+definition. Build is still broken...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 20:49:22 +00:00
Axel Dörfler
34d976b499 Forgot to remove now unused files.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 18:07:04 +00:00
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