Commit Graph

2395 Commits

Author SHA1 Message Date
Axel Dörfler
c35ab0c38d * Added new devfs_unpublish_device() that gets a BaseDevice instead of a path.
* Added inode ID member to BaseDevice to make this possible.
* Removed unused and unmaintained legacy_driver::devices_published field.
* Implemented legacy driver's unpublish_driver().
* Reenabled legacy driver reloading on changes.
* Renamed devfs_driver_{added|removed}() to driver_{added|removed}(), and
  made them private.
* Simplified deletion of device_node lists (no need to use an iterator here),
  added device unpublishing.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 11:07:47 +00:00
Axel Dörfler
320bd2bd5a * More specific error message when relocating fails.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 11:03:50 +00:00
Axel Dörfler
8b97187793 * Adds the _kunlock_node_() syscall obviously used by p4. This should fix
ticket #2626.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 20:35:05 +00:00
François Revol
a4de1ff695 Fix style, ok now ?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 18:01:32 +00:00
Axel Dörfler
de4daffba0 * Fixed bug #2616, preparseDate() would clear the elements array beyond its
maximal size.
* Turned off debug output accidently enabled with the last commit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 15:00:25 +00:00
Axel Dörfler
e6a9c269be * Style cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 14:58:36 +00:00
François Revol
f4bf90f7ce We're actually using serial input for KDL for now...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 02:11:32 +00:00
François Revol
038a21940d Fix building with TRACE on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 23:47:20 +00:00
François Revol
2a1458104d Avoid mounting images inside images (inside images (inside images...)).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 22:23:10 +00:00
Salvatore Benedetto
6ae7f6879f * Reworked the way sem_undo requests are processed by following
Ingo suggestions: instead of having one global sem_undo list,
  we now have two local list, one per semaphore set and one per team
  which is held in its xsi_sem_context structure, along with a mutex.
  A mutex has also been added to the semaphore set class in order to
  protect the local list, but also in order to (hopefully) improve
  concurrency.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 18:20:54 +00:00
Michael Lotz
ee8d227588 * Update the size of the safemode settings "file" when concatenating it with
the kernel settings. Settings that were checked in the kernel (like on-screen
  debug output) didn't work anymore, because when handing the settings over to
  the kernel it would have copied only the old size part of the safemode file.
* Add a newline when the kernel and safemode settings are combined. Otherwise
  the first safemode and last kernel setting would get lost if the kernel
  settings file didn't end with a newline.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 18:06:52 +00:00
Axel Dörfler
63c96ae5a5 * Added find directory constants B_{BEOS|COMMON|USER}_DATA_DIRECTORY, which
currently points to /etc for the system, and dedicated "data" directories
  for common/user (the system directory should get a dedicated "data", too,
  though).
* Added B_USER_CACHE_DIRECTORY (in config/cache).
* These additions were discussed some years ago, but I just had a good reason
  to use them :-)
* Coding style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 11:05:59 +00:00
Axel Dörfler
6dc27eba0c * As requested by POSIX, we now have PTHREAD_STACK_MIN, and PTHREAD_KEYS_MAX
defined in limits.h.
* This closes ticket #2559.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-15 15:00:26 +00:00
Ingo Weinhold
4431edd453 Patch by Zhao Shuai with minor changes by myself:
* Moved the static functions to the beginning of the file.
* Renamed several variables for more clarity, particularly
  offset/cacheOffset to index/pageIndex in case where the unit is pages.
* _SwapBlock{Build,Free}() can deal with a range of pages now, which
  should be more efficient.
* Additional checks/panics in swap_page_alloc().
* swap_file_add(): Wrong byte count was used when allocating and
  clearing the bitmap.
* swap_page_alloc(): Fixed off-by-one check. The last page of the swap
  file could not be used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 20:46:12 +00:00
Axel Dörfler
70e2d4ac43 * Replaced the B_BLOCK_DEVICE_* defines with B_DMA_* defines that better match
our dma_restrictions structure (but we're using blocks instead of bytes,
  since unlike the block size, the restrictions attributes are constant).
* We might want to use blocks for the dma_restrictions structure as well in
  the future...
* Fixed another bug in the device_node variant of DMAResource::Init(): the max
  segment size was specified in blocks as well.
* Removed the "hardcode" block_io module and header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 15:08:16 +00:00
Axel Dörfler
61b1a536e8 * Fixed the mix of bufferCount vs. max_segment_count with regards to
B_BLOCK_DEVICE_MAX_SG_BLOCKS as pointed out by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 14:28:20 +00:00
François Revol
6a5919034d This makes the FileMapDisk code work. zbeos can now locate an haiku.image embedded within another one as BEOS/IMAGE.BE (that's just for testing, it will be used with FAT or ISO9660 later on). It starts to boot the kernel but crashes later, it will need an fmap driver anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26970 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 02:10:31 +00:00
Ingo Weinhold
4141741265 * Added new(vip_io_alloc) operators allocating memory from the VIP I/O
heap.
* Allocate IOBuffers, IORequests, and cookies on the VIP I/O heap, if
  necessary.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 01:38:08 +00:00
Ingo Weinhold
749facf1eb Extended the "heap" debugger command to allow specifying the address of
the heap to print infos about.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26968 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 01:35:31 +00:00
Ingo Weinhold
d88a145e9e Added an allocator providing memory associated with VIP (i.e. page
writer) I/O requests. Not used yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 00:44:05 +00:00
Ingo Weinhold
f3e82cfe42 * Instead of a heap class index heap_create_allocator() gets an actual
heap_class object now. Removed unused heap_allocator::heap_class.
* Made heap_class, heap_create_allocator(), heap_memalign(), heap_free()
  public, so that a specialized allocator can be used elsewhere in the
  kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 00:40:40 +00:00
Axel Dörfler
6776de960b * Made the relocation more robust against incorrectly built images.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26963 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-13 23:20:18 +00:00
Ingo Weinhold
c91868ae1d * Introduced common base class SchedulerTraceEntry for the scheduler
tracing entry classes.
* Added new "scheduler" command, available when scheduler tracing is
  enabled. It analyzes the tracing entries for a given thread and prints
  scheduling statistics for that thread. Should hopefully help to
  understand the poor scheduling latencies in certain cases.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26956 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 21:23:16 +00:00
Ingo Weinhold
ef7102fa29 * Made TraceEntryIterator available in the kernel.
* Fixed TraceEntryIterator::Current(): If fEntry was NULL, it would
  return 0x4.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26955 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 21:16:15 +00:00
Ingo Weinhold
46ec230162 When in the kernel debugger we do now record the relevant information
(fault address, pc, read/write) when a page fault occurs, and print them
in case this caused the termination of a debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 17:09:42 +00:00
Ingo Weinhold
3b99126c1e Fixed table columns alignment in the "threads" command.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 17:03:43 +00:00
Rene Gollent
fb6d782320 Fix some style issues pointed out by Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26940 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 12:41:10 +00:00
Ingo Weinhold
dce8d473d5 When freeing the swap space associated with a page, the page must be
marked modified again, so that we don't lose its data when someone
decides to steal it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 00:08:33 +00:00
Ingo Weinhold
95accc28f8 Patch by Zhao Shuai with small changes by myself: The page daemon does
now also free swap space assigned to pages that are rather active.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26938 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 23:55:30 +00:00
Rene Gollent
3734bee77d When the boot loader goes to load its settings files, it will now also prepend the "kernel" settings file to the safe mode settings if it exists. This allows settings from kernel/drivers/kernel to be respected early in the boot process as well, which allows us to do things like disable_smp permanently instead of having to pick from the safe mode menu every single boot. Review welcome.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 23:03:36 +00:00
Axel Dörfler
3d3fe5a58c * Added tracing support to our scheduler to be able to do better diagnosis
with scheduling problems.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 10:20:16 +00:00
Ingo Weinhold
5409ef46f6 Squashed TODO: Clone the image list on fork().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 00:30:00 +00:00
Ingo Weinhold
77acd7fece Patch by Zhao Shuai with some changes by myself:
* Added functions swap_free_page_swap_space(), swap_available_pages(),
  and swap_total_swap_pages(). They will be used by the page daemon
  code.
* Free allocated swap space in the VMAnonymousCache destructor.
* Write(): First free swap space assigned to the pages to be written
  (was leaked before) and update fAllocatedSwapSize upfront. Both is now
  done with the cache locked, as it should be.
* Fixes several instance where the cache offset in bytes was used
  instead of in pages.
* Print the correct error when _kern_write_stat() fails.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 23:46:00 +00:00
François Revol
0bdaf02821 Start of a file map disk driver for the bootloader.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 01:24:01 +00:00
Ingo Weinhold
2fc2b436d2 Another hard code (DMAResource::TranslateNext()) fix: In the write case
if after the main loop the transfer is already block aligned, we still
have to check whether the last vec is a bounce buffer that is shorter
than a complete block, but exceeds the original end of the request. If
so, we have to cut back to the previous block and add a block-sized
bounce buffer instead. Actually that's almost the same case as when the
transfer length is not yet block aligned, and thus we let the same code
handle it. Fixes bug #2584.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 00:44:30 +00:00
Ingo Weinhold
a3afb5ee0d Handy on-demand debug tracing, I've used a few times already. So I leave
it commented out in the code for the time being.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 00:23:35 +00:00
Axel Dörfler
ed0303d19d * When creating the physical vector array, we did not advance "base" in the
loop.
* This is probably the cause for file corruptions as well as bug #2595; will
  have another look tomorrow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-09 21:27:24 +00:00
Ingo Weinhold
b328324d19 DMAResource::TranslateNext(), in case of given physical vecs:
* segmentCount was potentially set incorrectly. It could be too big,
  since we considered all vecs, not only those remaining.
* The main loop condition was incorrect. This would lead to too few
  DMABuffer vecs (or none at all) for any but the first IOOperation of a
  request. Should fix #2586.
* Correctly offset by vecIndex in debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 23:15:21 +00:00
Axel Dörfler
ae9067b364 * Fixed PXE boot loader build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 15:23:44 +00:00
Ingo Weinhold
90cd1b25e1 vm_remove_all_page_mappings(): Decrement the mapped pages count only, if
the page was really mapped before. Fixes bug #2585.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26876 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 14:01:09 +00:00
Ingo Weinhold
e387dd151b "page_stats" does now also print the number of mapped pages.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 14:00:07 +00:00
Ingo Weinhold
a9d7be0708 * Implemented mprotect(). A vm_area does now have an optional array
specifying the protection of each page (4 bits per page).
* Added no-op implementation of posix_madvise().
* Replaced a few "addr_t size" parameters by "size_t size".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26871 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 01:00:06 +00:00
Axel Dörfler
f93c785026 * FlushAndRemoveAllPages() cannot call WriteModified(), as it must be called
with the VMCache lock held, and WriteModified() locks itself.
* Added an assertion that the lock is held when calling that method.
* This fixes a KDL as soon as you would have used O_NOCACHE with a file that
  had already some pages read in.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 17:36:01 +00:00
Axel Dörfler
49a7b6198d * fix_dirent() now correctly handles buffers from userland.
* dir_read() now takes into account that we may have read more than one dir
  entry, and calls fix_dirent() for each of them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26859 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 14:23:44 +00:00
Ingo Weinhold
3394ebd3c2 * Improved some output and coding style.
* If a segment violation occurs, we do now check whether the thread in
  question has a handler for SIGSEGV. If so, we just send it the signal.
  Otherwise we notify the debugger as before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26851 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 01:18:04 +00:00
Ingo Weinhold
309922b652 Copy and paste bug. Fixes #2576.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26850 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 00:19:44 +00:00
Ingo Weinhold
993a8b776f VMCache::RemoveArea(): Don't release the store reference while having
the cache locked, since it enters the VFS and might reenter VMCache,
thus causing deadlocks. Fixes bug #2577.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26849 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 23:02:59 +00:00
Axel Dörfler
f8a59924e5 * Added Dump() method to IORequest, IOOperation, IOBuffer, and DMABuffer.
* Added KDL commands "io_request", "io_operation", "io_buffer", and
  "dma_buffer".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26838 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 08:01:07 +00:00
Ingo Weinhold
8d12bd1370 * Moved the incrementing/decrementing of vm_page::wired_count into
dedicated functions.
* Introduced gMappedPagesCount variable which counts the total number of
  physical pages that are mapped.
* Added vm_page_get_stats() which fills in the memory related part of
  the system_info structure. Used and cached pages are computed
  differently, now. The "available" (== not committed) memory is no
  longer used for the computation as it doesn't say anything about the
  actually used/free pages (with swap support enabled it is even
  less meaningful, since we first commit swap space when possible).
  We do also consider the memory used by the block cache as cached
  pages, now. All in all these changes should fix the memory statistics
  reported by get_system_info(), IOW bug #2574.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:28:28 +00:00
Ingo Weinhold
c79e66abb7 Added block_cache_used_memory() that returns the memory allocated by all
block caches for the block cache buffers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:09:31 +00:00