Commit Graph

2667 Commits

Author SHA1 Message Date
Ingo Weinhold
b7b7ca0fc3 * Removed debug check.
* "iospace p" should only print the entries for actually existing
  memory.
* Fixed output of "iospace v".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28222 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 16:59:24 +00:00
Ingo Weinhold
78c90d44ca Moved definition of the PAUSE macro to <cpu.h>, respectively
<arch/cpu.h>.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28221 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 16:53:31 +00:00
Ingo Weinhold
7b8683b252 Updated write_to_cache() to use physical pages for I/O and the new
{memset,memcpy_to}_physical() functions.
Mapping lots of physical pages at once as done before was an actual
problem on systems with enough RAM, as the physical page mapper can map
only 64 chunks at a time. So multiple threads could play dining
philosophers, each getting only one of two chopsticks, waiting for
another one to be freed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28220 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 16:45:14 +00:00
Ingo Weinhold
901f1930e1 * Moved memset_physical() to vm.cpp and made it available in the kernel.
* Added memcpy_to_physical().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 16:32:12 +00:00
Ingo Weinhold
808de9c700 * The undertaker was not locking when enqueuing the thread structure in
the free queue.
* "thread" also prints the thread's I/O priority.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28218 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 16:28:02 +00:00
Axel Dörfler
703aecaaa5 * Instead of having the mount_link, struct vnode now subclasses from
DoublyLinkedListLinkImpl, and fs_mount now uses a DoublyLinkedList instead
  of a typeless struct list.
* Also added a constructor/destructor to fs_mount which simplifies and cleans
  some code.
* This should not contain any functional changes :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 15:44:13 +00:00
Axel Dörfler
552c8edcd1 * fs_sync() now holds the sVnodeMutex while iterating over the mount list.
* This has the advantage that we no longer need to call get_vnode(), and
  instead can use lookup_vnode().
* This means at least most of the "corrupted BFS inode" messages should be
  gone; they were produced when fs_sync() tried to get already deleted vnodes.
  This was actually harmless, but doesn't really help in trusting your system :-)
* Also, it no longer tries to write back removed vnodes.
* And finally, it now uses a marker vnode when iterating over the list, so
  that it doesn't need to break out of the loop anymore, and can always sync
  all willing vnodes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28212 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 09:55:34 +00:00
Ingo Weinhold
51f837ae42 Dynamically adjust the page writer's I/O priority depending on how many
pages have to be written and how tight the memory situation is.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28198 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 22:02:55 +00:00
Ingo Weinhold
d52718a5f8 Fixed serious race condition: If the thread waiting for a request was
interrupted, another thread closing the other end of the pipe could
invoke thread_unblock() while the first thread already entered
mutex_lock(). This would make the first thread think it successfully
locked the mutex, without removing its (on-stack) wait entry from the
mutex queue, thus leading to crashes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28195 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 21:40:32 +00:00
Ingo Weinhold
8a05bb865f Added TODO regarding serious locking problem.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28192 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 21:32:14 +00:00
Michael Lotz
d4c300d8f1 Prepare usage of the ACPI module. Actual code for getting PCI interrupt routing
not yet done though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28187 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 21:12:33 +00:00
Michael Lotz
83d8936cff Move semaphore initialization a bit earlier in boot. They'll be needed by ACPI.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28186 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 21:11:37 +00:00
François Revol
1e2bc11e99 bonefish+mmu_man: fix cbuf_user_memcpy_from_chain() returning an error when the source buffer was NULL despite being asked for 0 bytes, while the counterpart was actually not creating a buffer for 0 bytes to send... Also don't bother calling it from receive_data() in that case anyway.
This fixes a deadlock in SoundPlay that made it freeze when trying to play the 2nd sound.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28179 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 19:48:28 +00:00
Stephan Aßmus
f73283cf6a When opening mails with slightly larger attachements in Beam, I noticed that
it was quite sluggish. When opening larger mails, like a 1.14 MB mail for
example, it could take almost half a minute until it was displayed. It turned
out that the offending thread was in strstr().
This is an implementation taken from Wikipedia (declared as public domain
there), which makes the mails open instantly. This usecase may have represented
a worst-case scenario for the previous implementation. It may be beneficial to
take a look at more of these string functions, but I am happy for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28172 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 15:31:58 +00:00
Oliver Tappe
e1e083d584 * added skipping of '0'-modified supported by glibc (formats are padded
with zeros anyway)
this fixes creation of unique file names in Beam under haiku


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28170 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 13:51:45 +00:00
François Revol
861fb97cf9 Inline Unset and SetTo correctly. I copied the class from BFS which only uses it in a single file...
Thx for the gcc4 fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 10:05:59 +00:00
Stefano Ceccherini
a96b4beb84 Fix build for gcc4. If you really want to inline these methods, they need to be implemented in the header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 09:53:06 +00:00
Stefano Ceccherini
b5e67ab6fb Fix build for gcc4
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28160 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 09:30:07 +00:00
François Revol
fcbcb00e18 Turn off debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28157 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 00:06:42 +00:00
François Revol
2cf4975b4b Add FAT32 support. This allows the bootloader to find a BFS image file (currently named BEOS\IMAGE.BE) and start booting for it, until the kernel tries to mount the boot partition.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28156 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 23:54:04 +00:00
Michael Lotz
a04a170937 bonefish + mmlr:
Don't use the spinlock in arch_debug_serial_puts if we're inside the kernel
debugger. This fixes a tripplefault when faulting with said spinlock held
(due to a NULL string argument for example).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28155 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 23:49:24 +00:00
Michael Lotz
945a6a41ac bonefish + mmlr:
* Add possibility to restart a complete pipe through B_KDEBUG_RESTART_PIPE.
* Implement tail in the kernel debugger making use of the former.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28154 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 23:43:27 +00:00
Axel Dörfler
669ab2141b * The "info" KDL command now also dumps the built-in SVN revision.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28153 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 21:24:32 +00:00
Oliver Tappe
bc6a5f8697 bonefish + zooey:
* added tracing of stack traces to userspace entries


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 09:04:37 +00:00
Michael Lotz
39e9e0e43b Fix typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 08:08:31 +00:00
Michael Lotz
c2b295654c Initialize the parameters to NULL so that a later reload doesn't try to free
uninitialized memory. Fixes a crash on boot with a preloaded settings file
present that wasn't used before the boot device was available (like the vm
settings file).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 08:06:30 +00:00
François Revol
86cb5b45da - Move MFP freq to a separate header
- initialize the time_base_frequency kernel arg (should be done in the bootloader though...). We will use MFP timer to support system_time(). At least try to.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28098 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 18:40:45 +00:00
Axel Dörfler
260e077ff7 * Registering a file device now also normalizes the path now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:49:52 +00:00
François Revol
5ad3245c2b Timer & RTC code
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28061 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:24:09 +00:00
François Revol
1fa01fe47a Fix the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28060 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:23:14 +00:00
François Revol
5088b34272 Code to read and write the RTC, copied from the x86 version.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28056 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:04:49 +00:00
Axel Dörfler
38bbc95758 * Made the use of file devices more convenient and complete by adding
the methods IsFile() and GetFilePath() to BDiskDevice, and
  BDiskDeviceRoster::GetFileDeviceForPath().
* Added new syscalls to implement this functionality.
* Added new flag B_DISK_DEVICE_IS_FILE.
* Fixed wrong operator precedence assumption in the BDiskDevice class at
  several places.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 21:51:43 +00:00
Axel Dörfler
25174582be Fixed two problems recently introduced by korli and found by aldeck:
* When invalidating unused settings, we should remove the handle from the list
  before freeing it, or else the settings list will be corrupted.
* We should protect the safemode settings against being removed, or else they
  won't be availabe anymore after we mounted the boot device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 13:38:01 +00:00
François Revol
7d49488b80 - cleanup
- remove dead ppc code
- add support for probing hardware registers the way linux does (early, hook with VBR to trap faults)
- detect MFPs this way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 12:56:16 +00:00
Michael Lotz
ecb3d008d6 If a device reports no media is present, don't try to get the geometry anyway.
This confused some USB card readers, that would stop working if you still
requested the geometry when they reported no media.
Note the case that the B_GET_MEDIA_STATUS fails (because it's not implemented or
an error occured) is still handeld in _GetMediaStatus() and then we still try to
get the geometry to check for media presence.
This should fix that some USB card readers wouldn't work and should also remove
the wrongly reported size in DriveSetup for CD drives that don't actually contain
a media.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28029 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 12:34:44 +00:00
François Revol
9f5e12b6b3 - use asm_def.h and FUNCTION_END
- remove some dead ppc code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28023 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 09:25:13 +00:00
Axel Dörfler
1fdc8a49aa * Factored out the demangled function call dump to a print_demangled_call().
* The stack_trace() command now also uses this call by default to give you
  the arguments to all functions in a stack crawl (beware of templates for now,
  though).
* Use the new option '-d' to disable the demangling. You can now also specify
  '-d' in the "call" command which has the same meaning there.
* NULL pointers are now printed as "NULL", and NULL strings are printed as
  well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28019 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 01:39:03 +00:00
Axel Dörfler
ddecb4a7da * Changed the way the demangle functionality works: instead of having a kernel
debugger add-on set a demangle hook, all modules under debugger/demangle/ are
  now considered demangle modules.
* Added another function to the demangle module interface that gives you access
  to the arguments.
* Implemented a demangling module for GCC2.
* The older demangling module is now called "gcc3+", but doesn't support
  getting the arguments yet.
* The "call" KDL command is now using demangling to automatically show you
  the arguments of a call from a stack crawl.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 23:50:41 +00:00
François Revol
94b1f00114 - init PIC earlier
- stub out RTC


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28016 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 23:33:11 +00:00
François Revol
fd630a4552 Might work better with the interrupt handler... I should go to bed now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 22:52:51 +00:00
François Revol
e673981e7e Add support for using the MFP0 timer A. Not calibrated though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 22:43:45 +00:00
François Revol
feec0dd969 Fix ifdef, should be DEBUG_PAGE_QUEUE there.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 21:35:49 +00:00
François Revol
33fa38c894 Avoid using the first physical page. The first 2kB are supposedly protected by the hardware (though it should be accessible by supervisor...) This fixes an segfault.
Now the kernel panics in M68KAtari::InitTimer()... "WRITEME" :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 21:34:31 +00:00
François Revol
c87d34624e Fix identifying iframes in stack_traces. What you get copying ppc code without trying to understand :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 21:23:04 +00:00
Axel Dörfler
4a4abaf25f mmlr:
* Actually call prepare_sleep_state() instead of calling enter_sleep_state()
  twice...
* Commented out disabling interrupts when calling enter_sleep_state(), as our
  ACPI modules would then crash (needs memory & uses sems with interrupts
  disabled). This way, it at least works on some hardware, including emulators
  (as before).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 19:59:51 +00:00
Axel Dörfler
e1ca73e1f1 * do_iterative_fd_io_iterate() must check for B_BUFFER_OVERFLOW to handle the
case it has to call the file map translation hook again to fulfill the whole
  request; it already handled the partial case correctly.
* This fixes an occasional "Value too large" error when accesssing fragmented
  files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 19:14:55 +00:00
François Revol
5222f12a32 - Add m68k pendant of: r27529 & r27778 - handle skipIframes parameter
r27530 - allow faults with ints disabled if there is a handler
r27648 - call the end-of-interrupt thread callback
r27718 - add <asm_defs.h>, not used yet
r27722 - register the commpage as image and symbols (but we don't use it yet)
- remove dupped call to thread_get_current_thread()
- use 16MB iospace for now, 4MB seems too small.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 18:13:11 +00:00
François Revol
5bb2204e46 Enable and fix the asm memcpy(). It's far from optimized, but works now and fixes the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 18:07:47 +00:00
Ingo Weinhold
c73aeac11e We need to let the runtime loader call shared object termination hooks
from exit().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 12:26:27 +00:00
Axel Dörfler
5c2e513005 * The device manager must use kprintf() when printing out stuff in the KDL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 00:03:05 +00:00