* Revised the RLE algorithm used for compressing the boot splash artwork to
handle uncompressed runs.
* Compress the RGB channels separately for improved efficiency.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24844 a95241bf-73f2-0310-859d-f6bbb57e9c96
FIFO. Reimplemented pipe() to use it.
* pipefs is no longer mounted. Will remove the superfluous code soon.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24823 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Moved most file_system_module_info hooks into separate structures.
Those that operate on mounted volumes to fs_volume_ops, those
operating on a vnode to fs_vnode_ops.
- Got rid of the fs_volume, fs_cookie, fs_vnode typedefs. We use void*
again.
- Instead of a void* volume and node cookie hooks are passed a
fs_volume and fs_vnode structure pointer, which contain the cookie
and an ops pointer (fs_volume a few more things).
- The VFS {new,publish,get,...}_vnode() functions take a fs_volume*
instead of the volume ID. So does vfs_get_fs_node_from_path().
- Added type and flags arguments to publish_vnode() and the
get_vnode() hook and removed the type argument from lookup() hook.
Added vnode::type using formerly unused bits to store the node type.
Simplified a few things in the VFS due to the now always available
node type.
- Added fs_volume_ops::{create,delete}_sub_vnode() and
fs_vnode_ops::get_super_vnode() hooks. They are used to support file
system layers, e.g. allowing to extend an FS not supporting BeOS
attribute with attribute support. Needs some more work in the VFS.
- Added fs_vnode_ops::create_special_node() hook for creating special
nodes (e.g. FIFOs).
* Adjusted the built-in file systems and BFS according to the interface
changes. Removed all other FSs from the image for the time being.
We'll see whether further API changes are necessary before porting
them.
* Adjusted the bfs_shell accordingly.
* Implemented create_special_node() in rootfs to support special nodes.
* Added support for FIFOs:
- Added syscall _kern_create_fifo() (used by mkfifo()), which creates
a special node (type S_IFIFO) in the respective file system.
- When a special node is published the VFS creates a respective sub
node. Currently only FIFOs are supported.
- Added a little support for FIFO subnodes by using functionality from
the pipefs.
- Added mkfifo to the image. It can create FIFOs in the rootfs, but
the FIFOs aren't really usable ATM, since they still work like
pipes, i.e. readers and writers need to have them open at the same
time.
* Some smaller changes in the VFS:
- Made the *_CALL macros nicer to use (vargs).
- Refactored FS entry lookup into new function lookup_dir_entry().
- create_vnode() no longer just calls the FS create() hook. First it
looks up the entry and uses open_vnode(), if it already exists. This
is necessary for two reasons: 1) The FS might not support create()
while still allowing to open() entries. 2) When the FS has other
layers on to of it (or the respective node) it might not be
responsible for opening the node.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24816 a95241bf-73f2-0310-859d-f6bbb57e9c96
and ino_t instead of a path. Supposed to work with node monitoring messages.
Took the name from vfs_entry_ref_to_path() that takes the same arguments, but
suggestions for a better name are welcome.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24813 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Implemented RLE compression for the boot splash images, resulting in
smaller kernel and boot loader.
* Only the boot loader contains the RLE compressed images, the decompressed
buffer for the icons is passed to the kernel via kernel args.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24812 a95241bf-73f2-0310-859d-f6bbb57e9c96
The dividing line is back although with a little more spacing. Also the icon
spacing is a little increased and I added a subtle outline as well as a little
brighter background for the active icon look. The placement logic is now not
independant of each other anymore, otherwise I couldn't center both images
as a unit. But only the vertical placement is affected.
Comments as always on the commit mailing list... :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24796 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added {Create|Delete}Device() analogous to {Create|Delete}FileDevice
* Added a small DeviceWatcher class that reacts to entry creation/removal
* Implemented a way to start/stop node monitoring
* Start watching for devices after the boot volume has been mounted and the
the second initial scan was run
The disk device manager now creates and scans a device when a "raw" node is
published and deletes the device on removal. This makes hot-plugging of disk
devices (for example memory sticks using usb_disk) work. Their partitions will
be scanned and published so they can be mounted. Somehow the removal of the
partitions does not yet work however, any insights are welcome.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24777 a95241bf-73f2-0310-859d-f6bbb57e9c96
the icons are centered.
* The boot loader and kernel now use the placement info that
generate_boot_screen now generates.
* Made the code that draws the images handle the case where any of the images
is larger than the frame buffer.
* All drawing functions need to know the image width (analogous for bytes per
row).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24773 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Not sure if it works as intended, as the specs are a bit vague.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24717 a95241bf-73f2-0310-859d-f6bbb57e9c96
item entry.
* The bios_ia32 video platform code now stores the available VESA modes in
the new vesa_modes kernel_args field.
* When configuring a VESA mode via settings file, it's no longer needed to
specify the exact mode - the closest available mode is now used. This should
help with bug #1962.
* frame_buffer_console_init() now also creates a boot_item for the VESA modes
in the kernel_args.
* The VESA accelerant now filters the mode list to only contain modes that
are actually supported.
* Moved non-shared vesa driver data into its own file vesa_private.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24675 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Added a "root" vnode to the io_context. It is used for resolving
paths and converting nodes to paths instead of sRoot. Some more
passing around of io_context structures was necessary.
- Introduced a new lock sIOContextRootLock to protect
io_context::root. The current uses of io_context::io_mutex
(put_vnode(), remove_vnode() while holding it) looked too suspicious
to use that mutex in vnode_path_to_vnode().
- Added _kern_change_root() syscall and chroot() libroot function.
- Added chroot coreutils program to the image. Funnily it seems to be
much easier to set up a little jail than under Linux (just copy
bash and libroot.so into respective subdirs; mount another pipefs
if you want pipe support).
With Haiku allowing direct access to directories via inode IDs
jailing is obviously not very secure at the moment.
- Added /var/empty to the image. It will be the chroot target for ssh.
* Changed vfs.cpp:get_cwd() so that the io_context::io_mutex is no
longer held when calling dir_vnode_to_path().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24673 a95241bf-73f2-0310-859d-f6bbb57e9c96
- The kernel stores the group IDs in the team structure. They are
correctly inherited on fork() and load_image_etc().
- Implemented getgroups() for real, i.e. it retrieves the groups
associated with the process.
- Implemented setgroups(), initgroups() and (the BSDish)
getgrouplist(). The latter two read the group information from the
"group database" /etc/group (if existing).
- Change the BIND port config, since we do have getgrouplist() now.
* The set-uid feature was broken when the path to the executable was
relative, since we used stat(), which, in the kernel, uses the kernel
IO context.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24669 a95241bf-73f2-0310-859d-f6bbb57e9c96
reference counted memory allocations. Can be used for sharing immutable
structures.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24666 a95241bf-73f2-0310-859d-f6bbb57e9c96
finally created a solution to avoid that: Header files that contain
configuration settings (and nothing else) go to build/config_headers.
To change settings, create a directory build/user_config_headers (which
is ignored by svn), copy the respective header there and modify it at
your leisure. Currently only tracing_config.h has been moved to the new
location, but more files will follow eventually. It is also recommended
to move optional macro definitions in Jamfile (as for BFS) to a config
header instead; the build system will then automatically rebuild on
changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24611 a95241bf-73f2-0310-859d-f6bbb57e9c96
a call chain contains a specific symbol (or address).
* Added a new KDL command "calling" that you can use to get a list of
threads that have a specific function in their call chain.
* Removed extraneous white space.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24594 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Add a cached_pages field to the system_info structure, and change the
meaning of the used_pages field to not include cached pages.
* Provide the needed info using the new calls vm_get_available_memory(),
and vm_page_num_available_pages().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24571 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Take extended family and model into account when generating the cpu
type and revision.
- Added Intel Core 2 Extreme to the cpu list.
Please review.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24509 a95241bf-73f2-0310-859d-f6bbb57e9c96
* The boot splash code now checks wether debug screen output is enabled or not
using the above function.
* The boot splash code no longer maps it's own copy of the frame buffer, instead,
it will use the boot item feature as the VESA driver does. Also removed the
lock, as that's not needed at all.
* Renamed splash.cpp to boot_splash.cpp, and boot/splash.h to boot_splash.h
(it's not part of the boot loader, but the kernel).
* Removed dead code from boot_splash.cpp, added license. Replaced license
header in boot_splash.h to a style guide conforming one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24489 a95241bf-73f2-0310-859d-f6bbb57e9c96
executable permissions of the file by hand. We use _kern_access()
instead, which also handles the root case correctly.
* The user and group arguments of test_executable() aren't needed any
longer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24483 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fixed the icons image, it was upside down.
* Support the new 24 bit boot screen images in the boot_loader and the kernel.
* Prepare the code for future indexed versions of the boot screen images.
But the generate_boot_screen tool currently does not generate those.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24449 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Calculate icon offset from stage in splash.cpp, remove hard coded placement
values. Draw only icon, not the whole image from top/left to right of
icon.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24439 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added the feature of an animated boot screen (icons lighting up at
different boot stages).
* Added first version of new boot splash images, generated by the new
hsbg tool. (Also finally contains the "new" Haiku logo.)
changes by myself:
* Added Artur to the contributors list in About System.
* Fixed some left overs in the patch, kept tracing turned off.
TODO:
* Remove the need for hard coding the icon positions. (Maybe generate
those from hsbg and put them into images.h? Have user provide icon
spacing/offsets at the command line for hsbg?)
* Rename the stages to something meaningful.
* Use hsbg as a build system tool and generate images.h during build
from PNGs provided in the artwork folder.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24434 a95241bf-73f2-0310-859d-f6bbb57e9c96
structure. They are properly inherited and updated on
fork(), load_image(), and exec().
* Implemented the get[e]{u,g}id(), set[[r]e]{u,g}id() family for real.
* getgroups() also calls the kernel now, but only returns the effective
group ID. Supplementary groups support is still missing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24359 a95241bf-73f2-0310-859d-f6bbb57e9c96
as the death entries of a deceased processes that were in this group
and have not yet been reaped hold references to the group, so that it
won't be deleted until the group is empty and all gone group members
have been reaped. This fixes#1799 at last.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24335 a95241bf-73f2-0310-859d-f6bbb57e9c96
in code that has interrupts disabled. The chunks of memories are queued
and free()d periodically by a kernel daemon.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24332 a95241bf-73f2-0310-859d-f6bbb57e9c96
of the resolved ToDo, but could probably be made more efficient. Instead of
transfering the area, the area is cloned into the target teams' address space
and the original is deleted. This generates a new area_id for the transfered
area (as suggested by the ToDo). Updated syscall prototypes according to the
status_t to area_id return type change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24320 a95241bf-73f2-0310-859d-f6bbb57e9c96
options.
* module_init() now sets sDisableUserAddOns to whatever the safemode settings
say, ie. the B_SAFEMODE_DISABLE_USER_ADD_ONS setting is now respected by
the module code.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24315 a95241bf-73f2-0310-859d-f6bbb57e9c96
* driver_entry::api_version now stores the actual version instead of a
pointer to it.
* Renamed node_path_entry to path_entry and reused it for driver
reloading: handle_driver_events() will now also check for drivers to
add in the sDriversToAdd list.
* Added new devfs_driver_added(), and devfs_driver_removed() functions
that trigger certain driver actions.
* Implemented notifying devfs on B_ENTRY_CREATED, B_ENTRY_REMOVED, and
B_ENTRY_MOVED events in probe.cpp. The watched directory inode numbers
are now stored in a hash for B_ENTRY_MOVED.
* unpublish_driver() did not actually delete the node, it only marked
it removable since we never get/put the node. We now do, and so the
node is actually removed as intended.
* Added "devfs_driver" KDL command.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24152 a95241bf-73f2-0310-859d-f6bbb57e9c96
and made it public (within the kernel).
* _user_entry_ref_to_path() is now using that function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24151 a95241bf-73f2-0310-859d-f6bbb57e9c96
negative relative timeout would be converted to B_INFINITE_TIMEOUT.
For some reason the ScreenSaver preflet is snooze()ing with such
a value.
* Some more comments.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24080 a95241bf-73f2-0310-859d-f6bbb57e9c96
utilizes the THREAD_FLAG_DONT_RESTART_SYSCALL (but only in SIGCONT
for now).
* resume_thread() is now using that flag to be compatible with BeOS.
* This fixes the Terminal hanging on close.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24045 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added team::flags. Currently only used for setting a flag when a team
has exec()ed.
* Some improvements of _user_setpgid():
- It failed incorrectly when the target process was a process group
leader. According to the standard it shall fail when the process is
a session leader. Moving a process group leader to another process
group is fine, even if that leaves the group leaderless.
- Fixed race conditions. We need to recheck the error conditions when
we hold the team spinlock. Otherwise the situation could change
while we allocated the new process group. This was one of the
reasons for bug #1799 -- after the shell fork()'s both parent and
child invoke setpgid() for the child.
- Fixed behavior for pid == pgid. It doesn't necessarily mean that a
new group has to be created.
- Fixed update of target process group orphaned state.
- Squashed TODO: setpgid() on a child is supposed to fail after the
child has exec()ed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24041 a95241bf-73f2-0310-859d-f6bbb57e9c96
This eliminates the edge case where the grow thread would not be able to create
a new area because no memory could be allocated for the allocation of the area.
As this case cannot happen anymore, it is also not possible to deadlock in
memalign. Therefore the timeout (which would only have prevented the deadlock
but wouldn't have solved the edge case anyway) has been removed too.
Add options to dump the dedicated grow heap and to only print the current heap
count to the "heap" debugger command.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23994 a95241bf-73f2-0310-859d-f6bbb57e9c96
but there's a special handling for 0 us relative timeouts. Syscalls
usually return B_WOULD_BLOCK instead of B_TIMED_OUT in this case, and
callers might explicitely check for it. Hence we don't convert 0 us
timeouts anymore. gdb works again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23989 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Implemented automatic syscall restarts:
- A syscall can indicate that it has been interrupted and can be
restarted by setting a respective bit in thread::flags. It can
store parameters it wants to be preserved for the restart in
thread::syscall_restart::parameters. Another thread::flags bit
indicates whether it has been restarted.
- handle_signals() clears the restart flag, if the handled signal
has a handler function installed and SA_RESTART is not set. Another
thread flag (THREAD_FLAGS_DONT_RESTART_SYSCALL) can prevent syscalls
from being restarted, even if they could be (not used yet, but we
might want to use it in resume_thread(), so that we stay
behaviorally compatible with BeOS).
- The architecture specific syscall handler restarts the syscall, if
the restart flag is set. Implemented for x86 only.
- Added some support functions in the private <syscall_restart.h> to
simplify the syscall restart code in the syscalls.
- Adjusted all syscalls that can potentially be restarted accordingly.
- _user_ioctl() sets new thread flag THREAD_FLAGS_IOCTL_SYSCALL while
calling the underlying FS's/driver's hook, so that syscall restarts
can also be supported there.
* thread_at_kernel_exit() invokes handle_signals() in a loop now, as
long as the latter indicates that the thread shall be suspended, so
that after waking up signals received in the meantime will be handled
before the thread returns to userland. Adjusted handle_signals()
accordingly -- when encountering a suspending signal we don't check
for further signals.
* Fixed sigsuspend(): Suspending the thread and rescheduling doesn't
result in the correct behavior. Instead we employ a temporary
condition variable and interruptably wait on it. The POSIX test
suite test passes, now.
* Made the switch_sem[_etc]() behavior on interruption consistent.
Depending on when the signal arrived (before the call or when already
waiting) the first semaphore would or wouldn't be released. Now we
consistently release it.
* Refactored _user_{read,write}[v]() syscalls. Use a common function for
either pair. The iovec version doesn't fail anymore, if anything could
be read/written at all. It also checks whether a complete vector
could be read/written, so that we won't skip data, if the underlying
FS/driver couldn't read/write more ATM.
* Some refactoring in the x86 syscall handler: The int 99 and sysenter
handlers use a common subroutine to avoid code duplication.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23983 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Tracing of allocations, reallocations and frees
* Leak checking infrastructure to dump allocations
The leak checking code records the team and thread id when an allocation is
made as well as stores the originally requested size. It also adds the
"allocations" debugger command that can dump all current allocations (usually
a huge list) or filter by either a team or thread id. This way it's easily
possible to find leftover allocations of no more active teams/threads.
Combined with the tracing support one might be able to track down the time and
reason of an allocation and possibly find the corresponding leak if it is one.
Note that kernel heap leak checking has to be enabled manually by setting the
KERNEL_HEAP_LEAK_CHECK define to 1.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23953 a95241bf-73f2-0310-859d-f6bbb57e9c96
and pages are now kept in lists as well. This allows to return free pages once
a bin does not need them anymore. Partially filled pages are kept in a sorted
linked list so that allocation will always happen on the fullest page - this
favours having full pages and makes it more likely lightly used pages will get
completely empty so they can be returned. Generally this now goes more in the
direction of a slab allocator.
The allocation logic has been extracted, so a heap is now simply attachable to
a region of memory. This allows for multiple heaps and for dynamic growing. In
case the allocator runs out of free pages, an asynchronous growing thread is
notified to create a new area and attach a new heap to it.
By default the kernel heap is now set to 16MB and grows by 8MB each time all
heaps run full.
This should solve quite a few issues, like certain bins just claiming all pages
so that even if there is free space nothing can be allocated. Also it obviously
does aways with filling the heap page by page until it overgrows.
I think this is now a well performing and scalable allocator we can live with
for quite some time. It is well tested under emulation and real hardware and
performs as expected. If problems come up there is an extensive sanity checker
that can be enabled by PARANOID_VALIDATION that covers most aspects of the
allocator. For normal operation this is not necessary though and is therefore
disabled by default.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23939 a95241bf-73f2-0310-859d-f6bbb57e9c96
function has the old behavior. When false, it just calls the scheduler
without any priority adjustment or other stuff.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23906 a95241bf-73f2-0310-859d-f6bbb57e9c96
TraceOutput for output options instead.
* Added "traced" option --difftime. Instead of the absolute system time
it prints the difference time to the previously printed entry.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23864 a95241bf-73f2-0310-859d-f6bbb57e9c96
(must also compare to BSD; I've looked at their sources, but I might have
missed something).
* Added sys/file.h and the flock() system call.
* common_fcntl() could forget to put back the file descriptor on some error
conditions (I guess we should introduce and use a DescriptorGetter class).
* Cleaned up fcntl.h, moved the BSD extensions S_IREAD and S_IWRITE to
sys/stat.h where they belong, and added the missing S_IEXEC to them.
* Added some more comments.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23836 a95241bf-73f2-0310-859d-f6bbb57e9c96
* While this is not a really good idea for a lock with supposedly little
contention, but it'll fix bug #1731. I haven't tested it yet, but will
do so in a minute :-)
* I will need to rework the slab anyway so that it's possible to use it
as a replacement for our heap, and then I'll switch back to a benaphore
again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23822 a95241bf-73f2-0310-859d-f6bbb57e9c96
destination of the message and it's "what" field are stored. It might be
nice to also get some info about its fields -- maybe as an additional
option.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23810 a95241bf-73f2-0310-859d-f6bbb57e9c96
* The kernel now opens up to 8 debugger modules (and puts them into an array;
maybe we'll want to switch to a doubly linked list when there is the need).
* Implemented an example debugger module that prints a stack trace of the
current thread when the kernel debugger is entered (not included in the
image).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23794 a95241bf-73f2-0310-859d-f6bbb57e9c96
For commands with this flag set, the parser won't parse the
arguments provided (it will only check for matching parentheses and
brackets), but will pass the unparsed argument list string to the
command instead.
* Set the new flag for the "expr" command, so one doesn't have to quote
the expression to evaluate anymore (or put it in parentheses).
* Fixed tokenizing of quoted and unquoted strings in expression mode.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23697 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Removed the public hash_grow() function again (at least for now, it's only
private).
* Removed the newSize argument from hash_grow(); it will compute the new size
automatically.
* The block cache is now using hash_insert_grow() instead of hash_insert()
which should make hash lookups much faster with some 10 thousand blocks,
also increased the initial table size from 32 to 1024...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23692 a95241bf-73f2-0310-859d-f6bbb57e9c96
kSyscallParametersInfos to kExtendedSyscallInfos) and added "name"
field. Now the classes for syscall kernel tracing don't need to lookup
the syscall function symbol anymore, which speeds up printing/filtering
of those entries dramatically.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23687 a95241bf-73f2-0310-859d-f6bbb57e9c96
is recorded in a kernel trace entry (if tracing is enabled).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23686 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added "printteam" switch to "traced" command, enabling the printing of
the team ID.
* Added "team" filter to the "traced" command expression language.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23684 a95241bf-73f2-0310-859d-f6bbb57e9c96
write code aligned to what one has written in the comment (or the
other way around).
* Made trace_entry structure doubly linked, by introducing a
previous_size member. By using bit fields, shrinking the flags field
to 4 bits, and not saving the lower two bits of size and previous_size
(which are always 0 due to alignment), the structure remains 4 byte
sized and can still address the same entry size.
* kBufferSize is no longer one less than it could be.
* "traced" command:
- Use static variable for the iteration state rather then cluttering
the temporary debug variable name space.
- The <count> parameter can now be negative, in which case the entries
before (and including) <start> are printed.
- Added a new optional parameter, specifying the maximal number of
entries to be filtered. Filtered iteration is beautifully
comfortable now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23678 a95241bf-73f2-0310-859d-f6bbb57e9c96
command usage texts, which can be too long for kprintf().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23677 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Add platform methods for timer as it is platform dependent.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23673 a95241bf-73f2-0310-859d-f6bbb57e9c96
boolean operators ("not", "and", "or") and filters matching thread IDs
or contained strings.
I'm still not fully happy with the command. It should be possible to
define a filter and then comfortably scroll through the matching
entries. Currently having to specify an index range of the unfiltered
entries is rather unhandy in combination with filtering.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23658 a95241bf-73f2-0310-859d-f6bbb57e9c96
So now there's a central place to enable tracing in general and for
individual components.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23645 a95241bf-73f2-0310-859d-f6bbb57e9c96
used it for an hour or so, I really wonder how we could live without it.
:-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23640 a95241bf-73f2-0310-859d-f6bbb57e9c96
about syscall parameters. Particularly interesting is a type_code field
for each parameter. The mechanism isn't very accurate, but we can
classify everything in string, pointer, and integer types.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23618 a95241bf-73f2-0310-859d-f6bbb57e9c96
add_debugger_command(), but additionally takes parameters "usage"
and "flags".
* Added add_debugger_command_alias() which creates another name for an
existing command.
* Added print_debugger_command_usage() to print a command's usage.
* invoke_debugger_command() intercepts invocations with "--help" and
prints the command's usage text, if it is known. If unknown, the
command will be called normally.
* Made use of the new functions in debug.cpp.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23573 a95241bf-73f2-0310-859d-f6bbb57e9c96
a command is executed anymore. Instead the least recently used
temporary variable is overwritten, if there's no free slot for a new
temporary variable.
* Removed the special handling for the command result variable ("_"). It
just works like any other temporary variable, now.
* Individual temporary variables can be removed (e.g. using the "unset"
command).
* Added unset_all_debug_variables() and "unset_all" command to unset
all persistent and temporary variables.
* Removed remove_all_temporary_debug_variables and renamed
remove_debug_variable() to unset_debug_variable().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23568 a95241bf-73f2-0310-859d-f6bbb57e9c96
* As a temporary work-around for the current slab allocator's area usage,
I added the CACHE_LARGE_SLAB flag, which will force the allocator to
use larger areas.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23564 a95241bf-73f2-0310-859d-f6bbb57e9c96
that is a little more powerful than BeOS'. It features:
- Persistent and temporary uint64 variables. The former kind is set
only by the user. The latter (those prefixed "_") can be set
automatically by commands, thus e.g. making it easier to access
members of a dumped structure. They are unset when the next command
is invoked. The special temporary variable "_" is defined as a
command's return value.
- Expressions can contain nested command invocations using brackets
("[ ... ]").
- Command lines are parsed by the expression parser, too. They can
contain command invocations (in brackets) and expressions (in
parentheses).
* Added debugger commands:
- expr: Evaluates the given expression and prints the result.
- unset: Undefines a variable.
- vars: Prints the values of all defined variables.
* Moved debugger command code into its own source file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23546 a95241bf-73f2-0310-859d-f6bbb57e9c96
As (our) gcc unfortunately uses atexit() to clean up lazily initialized static
variables inside functions we have to ensure that we do the right thing with
unloadable shared objects. In case a shared object was unloaded that installed
an atexit() hook the application would crash on exit. We now implement a
callback into libroot that is used to call all the atexit() hooks of a
component that is to be unloaded. Most prominently this fixes the media_server
crash at shutdown.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23486 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added function to allocate space in the buffer.
* Dump() now fills a buffer instead of printing its data directly.
* This allows the new "#pattern" argument of the "traced" command to
work. When you're using that, the index of the trace entry is printed
out, too, so that you can then get a full dump around the hits.
* Added an AddDump() method to the AbstractTraceEntry class so that
there is no need to call the inherited function anymore.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23479 a95241bf-73f2-0310-859d-f6bbb57e9c96
will not accept if the allocator returns NULL and crashes instead
(ie. not compiling in tracing would have crashed if some module tried
to use it).
* Added total entries count to the KDL command output.
* Fixed computing the start index of the KDL command.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23460 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Implemented an optional tracing layer that can be used in the kernel.
Nice to use if you don't have serial output or need something that doesn't
slow down the system as much.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23447 a95241bf-73f2-0310-859d-f6bbb57e9c96
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
the assembly handler which now uses a jump table to call C functions
handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
rare events (signals, user debug enabling/disabling) on the
common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
common functions (currently memcpy() only). They are used in the
kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
member offsets in assembly code.
Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
(caused by refactoring and introduction of "call" debugger command).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96
resized but still had dirty pages to be written back,
vm_cache_resize() (which is called with the inode lock being held)
deadlocked with the page writer.
* Now, I reintroduced busy_writing: it'll be set by everything that
writes back pages (vm_page_write_modified(), and the page writer),
and will be checked for in vm_cache_resize() - other functions are not
affected for now, AFAICT.
* vm_cache_resize() will clear that flag, and the writer will check it
again after it wrote back the page (which will fail when it's outside
the file bounds), and if it's cleared, it will get rid of the page
(if the file has been resized again in the mean time, writing it will
succeed then, and we'll keep the page around).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23334 a95241bf-73f2-0310-859d-f6bbb57e9c96
appear: when freeing a modified page, it wouldn't have a cache
anymore, but set_page_state_nolock() depended on it.
* To work around this, I added a vm_page_free() function, which the
caches that free modified pages have to call (but others may, too).
It will correctly maintain the sModifiedTemporaryPages counter in case
the cache has already been removed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23318 a95241bf-73f2-0310-859d-f6bbb57e9c96
* ACPI is evaluated first as it also handles things like multi core or hyper threading setups
* Removed other (disabled) hyper threading code per the notes in the corresponding ToDo
* Limit the detected CPU count to 2 for now as I wasn't able to get it working in either emulation nor real hardware with more than 2 CPUs
* Added a reserved byte to the mp_config_table struct, it worked only by luck as the compiler did padding there to get to the same size
I can now boot my Core 2 Quad with two out of four processors active :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23100 a95241bf-73f2-0310-859d-f6bbb57e9c96