Commit Graph

94 Commits

Author SHA1 Message Date
Axel Dörfler
95839f5c92 The file cache now has another init method that is called after the boot
device becomes available.
Currently, it opens the "launch_speedup" module (if available), later it
should consult a settings file for what to do.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 17:25:03 +00:00
Axel Dörfler
0d299e8a4b The team watching mechanism now works as intended.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13892 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 16:57:40 +00:00
Axel Dörfler
5159717538 team_delete_team() should have called delete_team_struct() instead of just
freeing the team - it leaked dead children semaphores and death entries;
waiting for a specific team could not have worked before.
Fixed delete_team_struct(), it did not correctly free the death list (would
have accessed freed memory).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 12:42:01 +00:00
Axel Dörfler
99c566f6c9 Added a team watching mechanism in the kernel, not yet tested (but at least doesn't cause any harm yet :-)).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 12:00:42 +00:00
Axel Dörfler
3798d46911 Calmed down start up a tiny bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:43:30 +00:00
Axel Dörfler
8fef8adb6e Replaced all dprintf() calls from the kernel debugger with kprintf() calls.
(there might be some more left, but it's not urgent or fatal)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:28:20 +00:00
Axel Dörfler
8b45467cd0 Added debug commands "ready", "running", and "waiting" that only list those
threads which are doing said thing.
Replaced all dprintf() calls from the kernel debugger with kprintf() calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13883 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:27:00 +00:00
Axel Dörfler
ed65cbe349 The kernel debugger no longer uses dprintf() but kprintf() when printing
(dprintf() locks using acquire_spinlock() which can itself drop into the
kernel debugger, causing an endless loop (until the stack was full).
Removed debug_putchar().
The gdb interface is now calling arch_debug_serial_*() directly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:25:27 +00:00
Axel Dörfler
0a51327f98 Fixed on-screen KDL keyboard input routine: it now works much more reliable
and ignores keyboard input. Also, it now uses the definitions from the PS/2
HID driver (from ps2.h).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:19:36 +00:00
Axel Dörfler
c50cfe23dd Fixed crashing bug in remove_vnode(): it freed the vnode, but it didn't
remove it from the hash, and thus, left a dead pointer around.
free_vnode() does now also remove the vnode from the hash - this is done
so that the file system is notified about removal/put of the vnode before
there is a chance that this vnode is recreated/reloaded (could make the
life of file system writers a bit easier).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13877 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 11:20:04 +00:00
Axel Dörfler
11a3346caa The file extent map is now cached as well. Code is not optimal yet, and almost not
tested for fragmented files - but it seems to work good enough for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 22:34:02 +00:00
Axel Dörfler
b72cf2601f Renamed vfs_vnode_acquire_ref() to vnode_acquire_vnode().
Removed vfs_vnode_release_ref(), as vfs_put_vnode() already does the same thing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:32:23 +00:00
Axel Dörfler
186857529e cache_prefetch() now comes in two flavours: one with a direct vnode pointer,
the other one with usual device/inode ID pair.
Both versions now accept an offset/size pair to specify the region of the
file to be prefetched - this may be turned into a file_vec_io array later on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13866 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:24:58 +00:00
Axel Dörfler
b7d8ef5a0d The term vnode_ptr is not used anywhere else; renamed vfs_put_vnode_ptr() to vfs_put_vnode().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:17:41 +00:00
Axel Dörfler
9882caaadd The path resolving functions can now also fill in the ID of the parent directory.
This is currently only used for the file cache module API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 12:44:59 +00:00
Ingo Weinhold
d35f0da76d Aesthetical change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13854 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-29 13:15:39 +00:00
Philippe Houdoin
685645f9bc USER == ! _KERNEL_MODE, right (!?).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13845 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-28 23:25:41 +00:00
Axel Dörfler
da1f176a9a You can no longer write to O_RDONLY streams, and you can no longer read from O_WRONLY streams (thanks to Ingo for this hint).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-22 06:54:19 +00:00
Ingo Weinhold
d08379a80b * Now we deal with all x86 exceptions, i.e. we no longer panic() when a
user application performs a division by zero or causes a general
  protection fault. For some exceptions (e.g. machine check) I wasn't
  quite sure whether they can be caused by user apps at all, so we panic()
  in those cases. Wouldn't harm, if someone more knowledgable would check
  this, though.
* Removed the unused fault handling stuff, respectively moved the little
  that was used into x86/arch_int.c.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13795 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-21 23:47:08 +00:00
Axel Dörfler
f4a8c33b5c Fixed a bug in put_death_stack_and_reschedule(): release_sem_etc() was called
with the thread lock held, which might have caused a panic later on, if there
was another thread waiting for the death stack semaphore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13769 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-19 18:10:12 +00:00
Axel Dörfler
230a037ed4 Fixed a bad bug in vm_copy_on_write_area(): the area's cache offset was not taken
into account when remapping the pages read-only; it could have overwritten valid
page mappings this way. This was also the reason for the Terminal to crash - it
does now work as it should, although some keys don't work (like tab completion)).
vm_copy_area() no longer always sets B_KERNEL_WRITE_AREA if no kernel protection
was specified, but mirrors the userland protection (for example, the x86 MMU is
not able to have a page writable in kernel but not in userland). This caused
some areas to be read/write when read-only would have been enough.
vm_copy_area() now panics when vm_copy_on_write_area() fails - that's of course
no real solution, but it's bettern than letting it silently fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-19 18:00:31 +00:00
Axel Dörfler
a00d33c094 No longer reboots when a shutdown was requested - this gives the registrar
the opportunity to show the "System is now ready to reboot" alert.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-17 13:28:11 +00:00
Ingo Weinhold
aeaa4a21a4 It's considered rude to try killing the kernel team.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-16 23:38:07 +00:00
Ingo Weinhold
d3bdf71ea6 The debug nub port of a debugged team is owned by the debugger. Hence we
need to transfer the ownership, when handing over the team to another
debugger.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-16 21:04:22 +00:00
Ingo Weinhold
7f9c673981 * Introduced a new debugger message B_DEBUGGER_MESSAGE_HANDED_OVER, which
is sent to a debugger when the debugged team has been successfully handed
  over to another debugger.
* Fixed handling of B_DEBUG_MESSAGE_PREPARE_HANDOVER. We don't send a reply.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-15 12:18:33 +00:00
Axel Dörfler
31a5ff5d8e We now have a (private) writev_port_etc() call. This could be used to avoid
allocating a buffer and copying your data into it, when you have data to
send in several chunks (for example, this could be used by BMessage, as
suggested by Ingo Weinhold).
Code is untested, but should work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-13 23:55:15 +00:00
Axel Dörfler
d7013609a8 Fixed a big memory leak: _user_writev() and _user_readv() allocated
a new iovec array, but only freed them on (early) error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-13 23:43:05 +00:00
Axel Dörfler
c9955bf00a Added new but empty function file_cache_invalidate_file_map().
This is needed in case the on-disk representation of a file changes (due to reorganization/defragmentation).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-13 16:33:05 +00:00
Axel Dörfler
54476a21b5 file_create() now also supports FD relative path specifications.
This was the cause for some apps to put their settings files to the current
directory, and also that Tracker did not find some icons (from the icons
it installed in the MIME database).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-12 16:33:10 +00:00
Axel Dörfler
0160c6fbda Fixed minor drawing problem of the on-screen KDL: in NO_CLEAN mode, the first two
lines would be left untouched instead of cleared before use.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13375 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-01 06:42:07 +00:00
Axel Dörfler
b7a96f02fd Now fills in system_info::cpu_infos[] (ie. CPU activity) by looking at the active
time of the idle thread. IOW Pulse now works :-)
Renamed the idle thread/stack to start with 1 instead of 0 (first idle thread will
be called "idle thread 1").
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13373 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-01 00:31:38 +00:00
Axel Dörfler
e970b839a0 Disabled B_USER_CLONEABLE_AREA for now - maybe this should be handled via kernel settings later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13372 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-30 23:14:13 +00:00
Ingo Weinhold
07b6630b86 Made reading and writing memory overflow safe.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13306 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-28 11:19:30 +00:00
Ingo Weinhold
047ab3f955 Be on the safe side when checking the size of data to be written to an area (overflow).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-28 00:35:28 +00:00
Axel Dörfler
229b2db028 cache_node_launched() is now called later, so that the environment will
be the same for both ways (via load_image() and exec*()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13112 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 11:15:05 +00:00
Axel Dörfler
b84688be5f Added a basic low memory handler service.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 13:03:54 +00:00
Axel Dörfler
b1a248305b Minor cleanup, changed return type of page count functions (from addr_t to size_t,
as that's more correct).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13089 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 13:02:24 +00:00
Axel Dörfler
a69e0ac327 The boot item list was not initialized; this was no problem, though, as
no items can be removed from that list - nevertheless, it's wrong.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13088 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 13:01:13 +00:00
Axel Dörfler
ff9fb62471 Some cleanup (made static variables static).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13087 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 12:59:11 +00:00
Axel Dörfler
183dee22cb Unlike R5, receive_data() could return an error code under Haiku - this
can now only happen if the thread is killed.
_user_receive_data() will now longer pass B_CAN_INTERRUPT to receive_data(),
but B_KILL_CAN_INTERRUPT - this should fix the problem Stefano experienced
with this function, even if I couldn't reproduce it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-12 11:14:37 +00:00
Axel Dörfler
2a1492f0fa Moved the definition of the BlockAddressPool class into block_allocator.cpp, as it's
not used outside of it.
Added tracking for the last transaction in the block cache; that way it can test
if the last transaction has been closed before opening a new one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13022 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-09 02:14:28 +00:00
Axel Dörfler
584d673049 Fixed various bugs in the block allocator: new free ranges were never added
to the free list, so a new range was started for every allocation (!).
block_range::Free() did not update the chunk's used_mask correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-09 02:09:06 +00:00
Axel Dörfler
78d6683c68 Changed the "help" command to be able to only show all commands starting with a certain string.
This helps to reduce the flood of commands for those blue screen "users" :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-08 17:16:40 +00:00
Axel Dörfler
68c1f3d2eb Disabled code that could find newly installed drivers - it's not likely we
will do that anytime soon, and it should be done by using node monitoring,
anyway.
devfs_open_dir() now makes sure the directory contents are up-to-date - this
should fix the app_server device lookup.
Disabled debug output in the read/write hooks to improve its usage.
Renamed part_map to partition.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-03 00:51:17 +00:00
Axel Dörfler
80f6ef8bd8 Moved load_driver() and load_driver_symbols() over to devfs.
Added new devfs_add_driver() function that the device manager will now call
to register new drivers.
Devfs will now keep a list of known drivers and remembers, if they have
been initialized already - a driver can now safely scan the directory it's
in while being scanned itself without having its hooks called twice.
Devfs is now using a recursive lock instead of a mutex (that's not really
a requirement right now, but would allow us to keep the fs lock during
scanning).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-02 18:32:21 +00:00
Axel Dörfler
19b77242ac Some minor cleanup: removed unneeded includes, updated introducing comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12932 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-02 18:23:26 +00:00
Axel Dörfler
317121e102 Work in progress of the new block allocator for the block cache. It works, but
currently needs even more memory than the old one 8-)
Not cleaned up at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-01 16:39:38 +00:00
Axel Dörfler
dde78a340e Fixed off by one error: could call memcpy() with '0' as size argument.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-31 01:17:25 +00:00
Axel Dörfler
d1407b9d2b The "PANIC" line will now also appear on the blue screen, not only over serial.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-30 23:09:36 +00:00
Axel Dörfler
f4e5c34143 cache_abort_transaction() freed the wrong block, and thus causing a file system
corruption even better than during its absence.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-30 16:54:08 +00:00