* Fixed dumping the area list of a cache I broke with the previous commit.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19789 a95241bf-73f2-0310-859d-f6bbb57e9c96
(you can still use both commands, but you'll see always the same output).
* The cache_ref's area list now also prints the owner of the area.
* Added "-p" option to "cache"/"cache_ref" that will show the pages of the cache; if you
omit it, it will now only present you a page counter.
* Nicer output for the commands above.
* Added "dl" to display memory in 64 bit values.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19787 a95241bf-73f2-0310-859d-f6bbb57e9c96
* send_signal_etc() (among others) used team::main_thread in an unsafe way; it is
possible for a team to be part of the team list and a group without having
a main thread very early in its creation process.
* Replaced most occurences of team->main_thread->id with team->id since the team
always inherits the ID of its main thread in Haiku for quite some time now.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19781 a95241bf-73f2-0310-859d-f6bbb57e9c96
the userland stack in an unsafe way - moved that stuff to arch_thread_enter_userspace(), too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19778 a95241bf-73f2-0310-859d-f6bbb57e9c96
* This is now used for userland stack - they now always pre-commit two pages, enough
to initialize TLS and copy the user-thread-exit stub to that area.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19776 a95241bf-73f2-0310-859d-f6bbb57e9c96
turned off - accessing userland memory. Now, arch_thread_enter_userspace() does that
job, and as a result, may also fail.
* dump_thread() now directly prints the info of the current thread when used without
argument (rather than iterating the thread list to look for the current thread).
* If arch_thread_init_tls() fails upon thread creation, the function will now return
an error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19775 a95241bf-73f2-0310-859d-f6bbb57e9c96
them to commit substantially less memory (we we're committing about 40 MB (!) too much
after a complete system boot). This means you'll run out of memory less likely now.
* fill_area_info() no longer filters out kernel protection flags - we may want to keep
filtering them when called from userland, though, dunno.
* Added new debugger command "avail" which shows how much memory has been committed, and
how much is regarded as free space.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19771 a95241bf-73f2-0310-859d-f6bbb57e9c96
to other kernel components.
* wait_for_thread_etc() will now search the team's death entries in case the
thread is already gone; also resume_thread() is now done later, and its return
code will no longer matter (as we already have our death entry, no matter if
the thread is gone now or not).
* The fibo_load_image test now works as expected (only tested with low numbers
yet, though - the mean testing comes later (first comes functionality) :-))
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19758 a95241bf-73f2-0310-859d-f6bbb57e9c96
in addr_range.h to add ranges to the arrays. This fixes the crashing bug reported
by Larry Baydak.
* Added some more exported functions to kernel_args.cpp (prototypes are in addr_range.h).
* TODO: let the PPC/OpenFirmware implementation use those as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19739 a95241bf-73f2-0310-859d-f6bbb57e9c96
You can build it using:
TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku-loader
Building the PXE stage1 using:
TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku
is still broken. however, it can be build using:
cd src/system/boot/platform/pxe_ia32/
as -o pxe_stage1.o pxe_stage1.S
ld --oformat binary --Ttext 0x7C00 -o pxe_stage1.bin pxe_stage1.o
cp pxe_stage1.bin /tftpboot/pxehaiku
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19722 a95241bf-73f2-0310-859d-f6bbb57e9c96
with a lower priority than the current one.
* Further reduced the probability to skip a thread to roughly 4%, that makes around
13 skips per second, and about 40 msecs spend in lower priority threads per second
(with a 3 msec quantum). Might still be too much, but we'll see.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19719 a95241bf-73f2-0310-859d-f6bbb57e9c96
not a penalty to be the first thread in the run queue...
I've reduced it to about 12.5%, but that might still be too much.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19710 a95241bf-73f2-0310-859d-f6bbb57e9c96
EDID info from the monitor if available through VESA/DDC.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19588 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Now using the new %f flag to print the level of support.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19584 a95241bf-73f2-0310-859d-f6bbb57e9c96
a very simplistic floating point output routine to snprintf() and friends, for
your convenience.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19583 a95241bf-73f2-0310-859d-f6bbb57e9c96
info to the serial line - not tested yet (as Qemu doesn't support DDC/EDID).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19580 a95241bf-73f2-0310-859d-f6bbb57e9c96
* vm_soft_fault() did not take into account that a cache's source can change while
traversing a cache chain.
* Now, we grab a reference to every cache we get before locking it, and
* no longer get the cache's source without having the cache locked.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19571 a95241bf-73f2-0310-859d-f6bbb57e9c96
for an extra check in vm_cache_release_ref() as the cache shouldn't have any areas
or consumers at this point.
* Fixed a locking problem in vm_cache_remove_consumer(): the cache was acquired after
its lock was gone, so someone else might have released in the mean time.
* if the cache's source is to be replaced, we now no longer release its lock after
having merged it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19570 a95241bf-73f2-0310-859d-f6bbb57e9c96
* the member will now also be shown when dumping a team.
* minor cleanup: moved fill_team_info() into the private functions part of the file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19551 a95241bf-73f2-0310-859d-f6bbb57e9c96
-Turns out the area removal routine had a massive race condition inside
vm_put_area(). Basically the area was removed from the address space's
area list before the pages were unmapped, so the vm could (and would)
recycle the space before the pages were finally unmapped.
It was completely reproducable on my machine during initialization of a bunch
of storage drivers that were bringing the locked_pool module into and out of
existence, which caused a thread to be spawned and stopped in rapid sucession.
On a dual processor machine, it was possible for the new thread to be started
up while the old one was still shutting down, and the kernel stack of the new
one would get wiped out.
Note, there still is a page ref counting problem with this area removal code.
It doesn't decrement the ref count of the page as it unmaps it. Will have to
figure that out.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19549 a95241bf-73f2-0310-859d-f6bbb57e9c96
put a spinlock around the serial debug routines to keep multiple
cpus from interleaving their output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19548 a95241bf-73f2-0310-859d-f6bbb57e9c96
commented the insertion of the attribute name in patterns in the case of a string attribute
notify_probe_by_file chooses a module based on a bus specific suffix
dm_register_child_device has a parameter to optionally check the support for the node
added scanning of bus devices after the boot filesystem is mounted
fixed dm_rescan, locking was misbehaving
fixed SYSTEM_DRIVER_REGISTRATION definition
added B_DRIVER_MAPPING attributes for PCI and ACPI devices:
%vendor%_%device% for PCI, hid_%hid% and type_%type% for ACPI
moved acpi_device_module_info definition to public ACPI.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19394 a95241bf-73f2-0310-859d-f6bbb57e9c96
pretty close, and the number of loaded modules have a direct influence on
this (even though we're currently loading the symbols by default).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19320 a95241bf-73f2-0310-859d-f6bbb57e9c96
added a user friendly mode for listdev: it works for PCI
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19262 a95241bf-73f2-0310-859d-f6bbb57e9c96
* added a generic syscall for device_manager
it enables to iterate the device manager tree from userland
* the listdev tool is now using it: it's still incomplete as it only dumps nodes and attributes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19260 a95241bf-73f2-0310-859d-f6bbb57e9c96
This allowes to actually execute the boot loader now.
Need to use Ingo's remote_disk_server now for booting.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19113 a95241bf-73f2-0310-859d-f6bbb57e9c96
offset was not changed correctly either: the order in which the
expression was evaluated was undefined; in fact, GCC 2.95.3 would use
the same buffer[index] twice.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19060 a95241bf-73f2-0310-859d-f6bbb57e9c96
it was never removed from the sLoadedImages list - and thus, would happily
access invalid memory.
* get_next_image_dependency() is now using the global lock as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19047 a95241bf-73f2-0310-859d-f6bbb57e9c96
* This sane heap revealed a bunch of bugs (like sLoadedImageCount not being
maintained that was used for various allocations).
* If the allocation of the image fails, opening the app will now just fail
instead of crashing of overwriting random data (IOW VLC will now load
okay, but cannot load some of its add-ons anymore).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19045 a95241bf-73f2-0310-859d-f6bbb57e9c96
This fixes bug #227 by closing that memory and semaphore leak.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19041 a95241bf-73f2-0310-859d-f6bbb57e9c96
address space of reserved areas - IOW address spaces were never freed upon
team exit.
* dump_cache() now prints a list of the cache's consumers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19040 a95241bf-73f2-0310-859d-f6bbb57e9c96
* a vm_cache now maintains a list of its "consumer" caches.
* introduced to new functions that add/remove consumer to a cache (instead
of only maintaining the vm_cache::source field).
* fixed the incorrect reference counting when doing copy-on-write; we kept
one ref too many of the lower cache.
* minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19035 a95241bf-73f2-0310-859d-f6bbb57e9c96
Executing the stage2 loader works now, up to the point where mmu_init() reuses the same address space.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19033 a95241bf-73f2-0310-859d-f6bbb57e9c96
be used to determine wether or not the executable was linked for/under Haiku or
not (ie. BeOS).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19011 a95241bf-73f2-0310-859d-f6bbb57e9c96
to determine linkage of libnet.so vs. libsocket.so/libbind.so in the libnetwork.so.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19008 a95241bf-73f2-0310-859d-f6bbb57e9c96
stuff of the boot loader to help with bug #238.
* Minor cleanup (added license headers, fixed debug output)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18977 a95241bf-73f2-0310-859d-f6bbb57e9c96
This also fixes the issue of exporting a C++ API from the kernel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18974 a95241bf-73f2-0310-859d-f6bbb57e9c96
of a team to avoid confusion. It now also accepts a NULL session pointer in
which case the actual group's session doesn't matter.
* Fixed the race condition in send_signal_etc() that could allow accessing an
invalid team pointer.
* Jerome's earlier change already fixed bug #841, and this also fixed bug #855.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18941 a95241bf-73f2-0310-859d-f6bbb57e9c96
move a 16 bit segment register into 32 bit memory location, and movzx (called movzwl within gcc) doesn't work with
segement registers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18864 a95241bf-73f2-0310-859d-f6bbb57e9c96
the next step would be to rescan the partition tree with a job to recognize unrecognized partitions (asynchronously ?)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18737 a95241bf-73f2-0310-859d-f6bbb57e9c96
parameter during construction).
* Doing so will now result in a kernel panic whenever your file system tries to
write to a block.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18719 a95241bf-73f2-0310-859d-f6bbb57e9c96
will now grab a reference to the vnode as well if successful. This way, vfs_get_vnode_cache()
now actually works how it should: it will now always grab a reference to the cache and
its underlying vnode. This removes an extra reference to the vnode (and vm_cache) that
got ignored before and prevented volumes to be unmounted (or file caches to be removed).
Thanks to Korli for pointing this out.
* file_cache_create() is now aware of that extra vnode reference and releases it; unmounting
volumes is now working again as it should.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18716 a95241bf-73f2-0310-859d-f6bbb57e9c96
of waiting threads by ID (instead of just the queue head and tail pointers).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18688 a95241bf-73f2-0310-859d-f6bbb57e9c96
(that was part of the problem of bug #702).
* Fixed send_signal_etc() when you called it with a pid_t of zero: the signals should
go to all teams in the calling team's group, not only to the team (for -1, we do
the same for now).
* Made team_get_process_group_locked() public, and rewrote send_signal_etc() to use
it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18684 a95241bf-73f2-0310-859d-f6bbb57e9c96
some signals could go to some group when a negative value was passed in.
This actually fixes bug #702 where SoundPlay obviously does a kill_thread(-1)
at the end (which accidently killed all userspace applications, including the
input_server, app_server, ...).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18683 a95241bf-73f2-0310-859d-f6bbb57e9c96
hash. This also allows them to stay valid after the group leader died when there are
other teams left in it. This closes bug #1.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18622 a95241bf-73f2-0310-859d-f6bbb57e9c96
this issue has been solved in the code that needs them (which is the same as
the PPC version also does at this time).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18570 a95241bf-73f2-0310-859d-f6bbb57e9c96
alarm, or 0 if there isn't any.
* setitimer() now also sets the previous timer values correctly, so that
alarm() and ualarm() now return the correct values as well - this fixes
the test fork_9-1 failing at alarm().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18545 a95241bf-73f2-0310-859d-f6bbb57e9c96
a waitpid() can no longer succeed; this fixes the occasional fork 3-1 test failures.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18544 a95241bf-73f2-0310-859d-f6bbb57e9c96
it waited for a specific child), as B_RELEASE_ALL opened up a race condition between
looking for an existing death entry, and waiting for the dead children semaphore.
Now we're counting all waiting threads for teams and groups separately.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18543 a95241bf-73f2-0310-859d-f6bbb57e9c96
wait_for_child() hanging less probable - there is a general problem with
this code, though, as we need to have a dedicated free counter for the
semaphore to remove all race conditions.
* Also, test fork_3-1 still sometimes fails because the thread is still
available to the public for a short time, even after its death entry
has been collected.
* Added a TODO in the code for these issues.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18529 a95241bf-73f2-0310-859d-f6bbb57e9c96
wanted to wait for a specific child; it always assumed you had specified WNOHANG.
This fixes the bug the fork_3-1 and fork_4-1 test applications reported. 3-1 still
sometimes fails, but that's a different problem (to be solved later).
* Also, it could return B_BAD_THREAD_ID instead of the expected ECHILD (for waitpid()).
* There was a race condition between testing for a thread, and checking its death
entry.
* wait_for_child() can now be interrupted in case it has to wait.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18528 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed the build of most of targets using these rules. Though the build can be still broken, feel free to fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18521 a95241bf-73f2-0310-859d-f6bbb57e9c96
* also defined STD_INSPIRED again, which lets localtime.c add some non-POSIX
behaviour for now (needed by strptime()) - we should find a better solution
to this, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18435 a95241bf-73f2-0310-859d-f6bbb57e9c96
the existing syscall...
The second ping now ends in a kernel panic, though 8-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18277 a95241bf-73f2-0310-859d-f6bbb57e9c96
buffer to allow safe access of the user provided string - maybe we should
introduce a user_strdup() instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17960 a95241bf-73f2-0310-859d-f6bbb57e9c96
issues:
* Our glue code was broken after all - it allowed Haiku apps to start under
BeOS (and vice versa), but the initialization/termination functions were
called with an invalid image ID - on *both* sides! As it turns out, the
Be glue code did *something* with %ebx, but certainly didn't put the image
ID in there, but just passed it on the stack, as we did before (just in
the wrong order...). Therefore, the arch_call_init_term stuff is not
necessary.
* When unloading add-ons, their termination functions were never called, as
the image (for get_image_symbol()) was already made inaccessible, and
therefore the symbol couldn't be found.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17928 a95241bf-73f2-0310-859d-f6bbb57e9c96
* pthread_key_create and pthread_key_delete now manages correctly a list of key/destructor
* pthread_create now uses a private thread function to add a "on_exit_thread" call for destructors
* pthread_join now returns B_OK in every case, and, as a joinable thread could already be gone, wait_for_thread would not find it
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17895 a95241bf-73f2-0310-859d-f6bbb57e9c96
syscall, but they could not know if R5 code called them (in which case the stat
size has a different size). We now always only return the R5 stat structure here.
This fixes bug #420. We might want to find a different solution to this problem,
though.
* Be got SYMLINK_MAX wrong - it's not the maximum number of links (that's SYMLOOP_MAX),
but the maximum size of a symlink buffer. Added missing SYMLOOP_MAX and SYMLINK_MAX
constants to limits.h.
* Fixes MAXSYMLINKS to use SYMLOOP_MAX, instead of SYMLINKS_MAX (which doesn't exist
in POSIX specs, but we (intentionally) break source compatibility here).
* Reenabled the Haiku versions of stat(), fstat(), and lstat() when build for Haiku.
* Removed OpenBeOS namespace stuff from the files I touched.
* Removed superfluous StorageDefs.Private.h, whyever that ended up in a public header
is beyond me.
* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17894 a95241bf-73f2-0310-859d-f6bbb57e9c96
files, too.
* Added a temporary icon for the kernel until Stephan comes up with a better
one (hint hint!) :-))
* This even fixes bug #648.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17825 a95241bf-73f2-0310-859d-f6bbb57e9c96
arch dependent code (they will be removed as soon as someone else
asks for these interrupt lines).
* Added an interrupt driven keyboard handler to the kernel that uses
this technique. As a result, you can now press F12 to enter the kernel
debugger before the input_server has been started, and Control-Alt-Delete
should reboot the system (actually I did not test the latter yet).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17806 a95241bf-73f2-0310-859d-f6bbb57e9c96
vfs_get_vnode_cache() which did not acquire an extra reference to the
cache_ref when the cache had to be created.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17693 a95241bf-73f2-0310-859d-f6bbb57e9c96
mapping, but it connected the vm_cache objects, so if it failed later, and
thus called vm_cache_release_ref() the object could have been freed accidently.
Most uses of map_backing_store() explicetly acquired a cache_ref *after* the
call was successful, but _vm_map_file() did not do this.
_vm_map_file() might still not work correctly, though, need to have a closer
look at it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17692 a95241bf-73f2-0310-859d-f6bbb57e9c96
element. We now soften the rule that the absolute path should be used, and give libraries
another chance and search them in the standard search paths. This fixes bug #601 and lets
Becasso run on Haiku.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17669 a95241bf-73f2-0310-859d-f6bbb57e9c96