respective setter/getter methods to the KPartition class.
If a partition is mounted, the field will contain the cookie the
FS's mount() hook passed back to the VFS. This way the FS has
access to its internal data structures. We need the cooperation
of the VFS to get the cookie.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4776 a95241bf-73f2-0310-859d-f6bbb57e9c96
on disk to match to be able to find it, changed the ToDo: comment in the
affected function, and added a test call to vfs_get_module_name(); our
bootfs cannot handle the path depth/length required to be a useful module
host, so we still have our recursive search algorithm in place for now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4560 a95241bf-73f2-0310-859d-f6bbb57e9c96
of a given module name.
vnode_path_to_vnode() can now return the type of the file, changed the parameter
order.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4559 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added a comment about how to traverse the module path to find a given module -
could well be that we got that wrong (too loose, it will work perfectly, though,
just slower than it could be).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4516 a95241bf-73f2-0310-859d-f6bbb57e9c96
"sudden unmounts" (as far as that can work). This replaces the weak
find_mount() call used at several places in the fs index functions.
Fixed a bunch of warnings, mostly unused prototypes and variables.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4491 a95241bf-73f2-0310-859d-f6bbb57e9c96
#ifdef'd a variable that's only of use with TRACE() on.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4490 a95241bf-73f2-0310-859d-f6bbb57e9c96
easier to check if the partitioning_system returns the correct size :-)).
Uses %f which doesn't work in the BeOS kernel (but might in OpenBeOS).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4445 a95241bf-73f2-0310-859d-f6bbb57e9c96
renamed user_??? functions into the new _user_??? naming style.
changed implementation of PPC 64 bit atomic functions to use (un)lock_memory()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4417 a95241bf-73f2-0310-859d-f6bbb57e9c96
They are only used if the architecture doesn't support them directly.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4360 a95241bf-73f2-0310-859d-f6bbb57e9c96
Reordered the syscalls a bit (in functional groups), not completely, though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4354 a95241bf-73f2-0310-859d-f6bbb57e9c96
The lock_memory()/unlock_memory() functions cannot be implemented right
now, as the NewOS VM doesn't support locking.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4346 a95241bf-73f2-0310-859d-f6bbb57e9c96
TRACE() macro. Renamed the old TRACE macro to TRACEPFAULT.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4343 a95241bf-73f2-0310-859d-f6bbb57e9c96
ATOMIC_FUNCS_ARE_SYSCALLS is only defined on architecture like SH4.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4341 a95241bf-73f2-0310-859d-f6bbb57e9c96
kernel_os_arch_x86.o file that is genereated by libroot.
Removed duplicate implementations from this file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4337 a95241bf-73f2-0310-859d-f6bbb57e9c96
Made the "name" argument const for create_area_etc() and vm_map_physical_memory().
Moved some common conversion code (BeOS to NewOS VM constants) to separate
functions to clean them up a bit.
create_area() now automatically sets LOCK_KERNEL if the area is to be created
in kernel space (as I would guess BeOS does, too).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4331 a95241bf-73f2-0310-859d-f6bbb57e9c96
architecture can do this better. Removed from generic cpu.c file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4330 a95241bf-73f2-0310-859d-f6bbb57e9c96
Temporarily #if'd out scan_pci() and removed the compiler calming hack for it.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4324 a95241bf-73f2-0310-859d-f6bbb57e9c96
in the kernel.
Use the new delete_area_etc() call for other needs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4321 a95241bf-73f2-0310-859d-f6bbb57e9c96
delete_area() now only allows to delete areas you have created
yourself before from userland, again.
The kernel's delete_area() still allows everything, though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4320 a95241bf-73f2-0310-859d-f6bbb57e9c96
delete. Added a comment how the security should be improved by adding another
restriction.
Also mentioned that it's probably a bad idea that vm_delete_region() will
not wait until the region has been freed, but just "mark" it as to be freed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4319 a95241bf-73f2-0310-859d-f6bbb57e9c96
that will call the internal vm_*() calls. This will make it easier to just
drop in another VM.
Also (partially - Ingo was faster) introduced the new syscall naming scheme
_kern_ & _user_ prefixes to them into the system namespace, and no longer
clobber the application namespace.
Removed the now unused user_vm_create_anonymous_region() call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4311 a95241bf-73f2-0310-859d-f6bbb57e9c96
to work at all: recurse_directory() always returned failure, no matter what opendir()
returned (one semicolon too much), create_module() allocated only 4 bytes for
the module - sizeof(module) referred to the variable, not the structure name...
(the unfortunate consequences of the naming scheme I otherwise like very much -
it "just" took me 3 hours to hunt both bugs down).
Added some TRACE() and ASSERT()s.
Added a new debugger command "modules".
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4300 a95241bf-73f2-0310-859d-f6bbb57e9c96
(except for the first 4 bytes, because that's the pointer to the next buffer
in the free list).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4299 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added {Add,Clear}Flags() which are more comfortable than SetFlags() in
most cases.
* On construction the `busy' and `descendant busy' flags are set.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4220 a95241bf-73f2-0310-859d-f6bbb57e9c96
generates the jobs needed to transform the former to the state of the
latter. Currently only the jobs for deleting partitions and resizing
and moving existing ones are generated. Resizing and moving was the
hard part, though, the rest should be much easier. Completely untested
yet.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4170 a95241bf-73f2-0310-859d-f6bbb57e9c96
now no longer set in the loop, the total_length calculation should now be correct.
The CBUF_FLAG_CHAIN_TAIL is now set for the lastBuffer instead of buffer.
Removed some superfluous lines in cbuf_get_ptr(), and cbuf_ones_cksum16().
Fixed the buffer->length calculation in cbuf_truncate_tail() and added some
comments about the correctness of the code - should be investigated and fixed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4083 a95241bf-73f2-0310-859d-f6bbb57e9c96
to the module interfaces. So the disk system will be informed, when a
shadow partition has changed and it is allowed to do necessary
adjustions (e.g. adjusting the cookie, the parameters, or on
partitioning system initialization even creating special child
partitions (apple partitioning system)).
* Added `int32 *index' parameter to ValidateCreateChild(). So the
partitioning system can report at which index the new child shall be
inserted.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4065 a95241bf-73f2-0310-859d-f6bbb57e9c96
modification functions. Don't know why I didn't right from the start.
* Implemented _kern_resize_partition().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4045 a95241bf-73f2-0310-859d-f6bbb57e9c96
PrettyName() of the responsible disk system.
* Added change counter support and changes tracking.
* Added UninitializeContents().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4042 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Removed the disk_system_id parameter where superfluous.
* Got rid of the `child' variants of the _kern_{supports,validate}_*()
syscalls for moving and resizing. Reimplemented the real ones to do the
the right thing, i.e. they check all concerned disk systems now.
* Added _kern_supports_setting[_content]_parameters().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4020 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fixed handling of the deletion (removal) of shadow partitions. Formerly
the shadow partition corresponding to the disk device wasn't removed
properly.
* Added a shadow_id field to the user_partition_data structure which
contains the ID of the shadow partition, if it is one. The id field
will hold the ID of the physical partition.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3974 a95241bf-73f2-0310-859d-f6bbb57e9c96
matches the name of the header much better. :-)
* Implemented the syscalls for iterating through and finding disk systems.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3902 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Writing disk device/partition data into userland buffer added.
* Migration of some definitions into <DiskDeviceDefs.h> header.
* Small bug fixes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3882 a95241bf-73f2-0310-859d-f6bbb57e9c96
and KShadowPartition from it. KPhysicalPartition represents a partition
that exists on-disk, while KShadowPartition is a partition edited by the
API user, but not yet written to disk. Related changes in other classes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3851 a95241bf-73f2-0310-859d-f6bbb57e9c96
a chained buffer provided by cbuf.
Only select support is missing now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3736 a95241bf-73f2-0310-859d-f6bbb57e9c96
now working, but everything that would have to be temporarily buffered
is discarded right now (will use cbufs for this).
Pipes can now actually be created and removed - this didn't work before.
Changed some lock types to better suit their needs.
Small fixes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3708 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed cbuf_get_len() to cbuf_get_length().
Fixed a bug in cbuf_get_length() that would have returned an error code in
a size_t (now returns 0 in that case).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3692 a95241bf-73f2-0310-859d-f6bbb57e9c96
(creation, deletion), no reading/writing allowed (or even started),
no select support.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3683 a95241bf-73f2-0310-859d-f6bbb57e9c96
*not* change the previous behaviour (well, I added some debug output), since
the former recursive_lock_create() did always return B_OK, no matter if the
lock could be initialized or not.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3680 a95241bf-73f2-0310-859d-f6bbb57e9c96
and b) doesn't compile due to the latest lock changes (see lock.c 1.7).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3678 a95241bf-73f2-0310-859d-f6bbb57e9c96
recursive_lock_create()) - this reveals bugs in other parts of the system (VM),
but those won't be fixed for now (because of VM2).
Added the possibility of giving a recursive lock a name.
Moved the functions for benaphores and rw-locks to this file (they were
part of the lock.h header as defines).
Removed unused headers.
Small cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3677 a95241bf-73f2-0310-859d-f6bbb57e9c96
kept.
* Fixed find_{disk_device,partition}().
* Implemented delete_partition(). The device/partition management functions
should now be complete.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3654 a95241bf-73f2-0310-859d-f6bbb57e9c96
management regarding removal and deletion of objects.
* Fixed the file disk system related stuff. KFileDiskSystem now uses the
virtualdrive driver. The former method was seemed simple and brilliant,
but the B_SET_PARTITION ioctl wouldn't work.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3650 a95241bf-73f2-0310-859d-f6bbb57e9c96
files as disk devices. This will not only be great for testing the
file and partitioning system modules' writing capabilities, it will also
just be a nice feature to have.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3598 a95241bf-73f2-0310-859d-f6bbb57e9c96
KPartition and as no-ops in KDiskDevice.
* Prefixed partition names with "obos_" to not interfere with R5's
partition names.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3509 a95241bf-73f2-0310-859d-f6bbb57e9c96
Some changes to KPartition, KDiskDevice, KDiskSystem on this way.
Still missing is KPartition::Publish() and its invocation in
KDiskDeviceManager. Then everything should be in place to start with
porting the scanning parts of our disk system modules.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3486 a95241bf-73f2-0310-859d-f6bbb57e9c96
the fs register correctly - not that it should have much effect since it's
rarely used anyway (no reason to might be wrong, though) :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3483 a95241bf-73f2-0310-859d-f6bbb57e9c96
since they are implemented in the libroot's os/arch directory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3235 a95241bf-73f2-0310-859d-f6bbb57e9c96
it build again; it doesn't work yet at all (pretty similar to NewOS change 1772).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3161 a95241bf-73f2-0310-859d-f6bbb57e9c96
implementing a more efficient on_exit_thread().
Note, this extra parameter is currently only used for user space code,
not yet in the kernel; thus on_exit_thread() is not available in the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3075 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added TRACE_SMP and a TRACE() macro that is used instead of dprintf() directly.
Also fixed all warnings with TRACE_SMP set to 1.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2941 a95241bf-73f2-0310-859d-f6bbb57e9c96
changed the field order in a couple of structs back to their previous ordering
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2856 a95241bf-73f2-0310-859d-f6bbb57e9c96
normally, I wouldn't checkin a file with cosmetic changes only
however, Marcus just made a change on this file earlier today,
so the file would have to be rebuilt anyway -- might as well
make it pretty too!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2853 a95241bf-73f2-0310-859d-f6bbb57e9c96
but doesn't have to be read from disk for efficiency reasons.
Fixed a bug in get_vnode() in case of fs->get_vnode() returns an error of some
kind.
fs_mount() no longer hides the return code from the fs->mount() function anymore (for now).
Added some comments and ToDo items.
Changed some return error values to the B_xxx style (will probably need to define
some new error codes for OpenBeOS).
Changed some return types to status_t/void where appropriate.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2786 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed apic_read()/apic_write() to accept offsets not addresses as register
parameter.
Cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2605 a95241bf-73f2-0310-859d-f6bbb57e9c96
thread code now properly traces time spent in user vs kernel mode. The code was
just plain broken before
http://www.newos.org/cgi-bin/perfbrowse.perl?@describe+1704
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2599 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added a SIGNAL_TO_MASK() macro.
Removed the useless disable_interrupts() call in set_alarm().
More cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2584 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now directly exports (as is, most of) the kernel thread API.
Now has user_*() functions where needed.
Moved thread_set_priority() from scheduler.c to set_thread_priority().
Renamed thread_wait_on_thread() to wait_for_thread().
user_get_thread_info() now uses user_strlcpy() instead of user_strncpy().
Fixed the snooze() implementation - it now returns B_OK where appropriate. Now all snooze()
calls will call snooze_etc().
New private call spawn_kernel_thread_etc() to replace thread_create_kernel_thread_etc().
Moved some functions around.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2578 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed a bug in sigaction(): it would have crashed with act/oact == NULL (which
is perfectly legal).
Now directly exports the kernel API.
Now has user_*() calls where needed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2577 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed team_wait_on_team() to wait_for_team() (more BeOS-alike).
Adapted to other changes (new thread functions).
Cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2576 a95241bf-73f2-0310-859d-f6bbb57e9c96
and don't have any functionality at this place.
Added new syscall for set_thread_priority().
Some other changes due to cleanup.
Fixed userland snooze() call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2575 a95241bf-73f2-0310-859d-f6bbb57e9c96
have the scheduler_ prefix instead of thread_.
Moved thread_set_priority() back to thread.c where it belongs to.
Added new function to remove a thread from the run queue.
Renamed run_q to gRunQueue.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2572 a95241bf-73f2-0310-859d-f6bbb57e9c96
Actually never unlocked the daemon's lock (always called mutex_lock() instead
of mutex_unlock()...).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2568 a95241bf-73f2-0310-859d-f6bbb57e9c96
the vnodes of a mount structure).
Removed stubs for send_notification() and notify_listener() (they are now located
in message.c and node_monitor.c).
Added support for the node monitoring service.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2482 a95241bf-73f2-0310-859d-f6bbb57e9c96
unmounts is not yet implemented.
Added an empty implementation for send_notification() - the function that is
(or will be) able to send out BMessages from within the kernel; currently
just prints out what should be done.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2481 a95241bf-73f2-0310-859d-f6bbb57e9c96
Adapted because of changing structure names (struct uspace_program_args).
Added comments, fill_team_info() now sets the team_info.image_count correctly.
Some cleanups and style changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2426 a95241bf-73f2-0310-859d-f6bbb57e9c96
arch_cpu: could have used the TLS_SIZE macro in one place, removed
a now unused variable, assignments to tss_loaded are now booleans.
thread.c: added the new fields to _dump_thread_info().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2393 a95241bf-73f2-0310-859d-f6bbb57e9c96
from the USER_STACK_REGION (until B_BASE_ADDRESS is available), made it much better
readable. It now grows from the lower USER_STACK_REGION up to the start of the main
thread's stack location.
Calls arch_thread_tls_init() and accounts for the TLS area in the stack region.
Added some comments, some cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2382 a95241bf-73f2-0310-859d-f6bbb57e9c96
area. It now also calls arch_thread_init_tls(). Cleaned it up to make it more
readable, added some comments.
Some other cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2381 a95241bf-73f2-0310-859d-f6bbb57e9c96
and TSS_BASE_SEGMENT in i386_set_tss_and_kstack() (thanks Daniel for pointing this
out)).
Added a arch_thread_init_tls() function which fills the reserved slots - the find_thread()
inline asm in OS.h is finally working.
Added some more comments, resolved the ToDo items from last time :-)
arch_thread_context_switch() now calls set_tls_context() at the correct location.
arch_thread_enter_uspace() now calls set_tls_context() as there is no context
switch in this case for the current thread after TLS has been set up, and it
now gets a pointer to the thread structure directly, and calculates the user
stack top itself, rather than the callee.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2380 a95241bf-73f2-0310-859d-f6bbb57e9c96
at all, and assumes a fixed and wrong number of preallocated GDT entries.
Implemented TLS: there is one GDT entry per CPU. If a context switch happens,
the FS register of the new thread is set to the matching GDT, and the GDT is
changed so that it points to the current thread's TLS storage area.
This area currently resides unsafely at the bottom of the user stack - for
some reason I could not figure out, it doesn't even work correctly most of
the time (it segfaults when accessing a slot via FS). I've added a ToDo item
explaining the situation - hopefully I have more ideas when I slept a bit more...
The GDT is now no longer static in arch_cpu.c and has been renamed from gdt to
gGDT. It's now also referenced in arch_thread.c, and it would make sense for
arch_selector.c to use it as well (instead of another local copy).
arch_cpu_init2() now uses the set_tss_descriptor() inline function and the
TSS_BASE_SEGMENT macro to set up the TSS section. It now also sets up the
TLS segment descriptors (as TSS, one entry per CPU).
Since I removed desc_table from the headers (the GDT is now a (segment_descriptor *)),
I added it locally to arch_int.c.
i386_enter_uspace() now don't set the FS register to 0x23 anymore, since it's
now already set correctly at the end of arch_thread_context_switch().
Some clean-ups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2366 a95241bf-73f2-0310-859d-f6bbb57e9c96
I was too lazy to revert that little change back, so that I would be able
to write this short paragraph explaining what I've done.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2364 a95241bf-73f2-0310-859d-f6bbb57e9c96
some structure definitions (to outline some basic ideas), and the symbols
exported to userland.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2214 a95241bf-73f2-0310-859d-f6bbb57e9c96
Some int -> cpu_state cleanup on the way, and implement the
B_KDEBUG_CONT and B_KDEBUG_QUIT features in our kernel debugger.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2173 a95241bf-73f2-0310-859d-f6bbb57e9c96
code and made it much simpler (it now just uses a stack of path names
instead of this complex doubly-linked module_iterator_dir list).
Now works together with the rest of the code without making any problems.
Added a module_test() function which iterates over all existing modules.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2149 a95241bf-73f2-0310-859d-f6bbb57e9c96
Some cleanups, moved user_*() functions to the end of the file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2144 a95241bf-73f2-0310-859d-f6bbb57e9c96
field to the thread structure to keep track of the current state.
forbids/permits can be nested.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2141 a95241bf-73f2-0310-859d-f6bbb57e9c96
disabled. If a page fault happend while a interrupt handler is executed,
or while a section of code is running with interrupts disabled (with the
exception of the initial kernel startup), the page fault handler will
now panic, to give you the chance to fix the bug.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2124 a95241bf-73f2-0310-859d-f6bbb57e9c96
thread_exit() for now prints a warning if it was called with interrupts
disabled.
Fixed a bug in thread_exit2() that restored the interrupts too early,
instead of simply enabling them (and restoring them later) [found by
Marcus O. great debug additions].
Fixes for the khash changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2119 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now the d_reclen field of struct dirent is correctly calculated in all
file systems (read_dir() function).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2114 a95241bf-73f2-0310-859d-f6bbb57e9c96
leak fixed, some other bugs fixed, removed the global queues as there weren't
needed and used at all, moved to the other hash table implementation
(because the new_hash_table stuff was buggy). Should really work okay now :-)
Added the last missing function get_next_loaded_module_name() - I am not
sure the Be version works this way, but we could easily change that after
actually having found out how that one is really working.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2113 a95241bf-73f2-0310-859d-f6bbb57e9c96
and to have better performance on Hyper Threading systems. Should be
backward compatible with all x86 systems, according to Intel documentation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2068 a95241bf-73f2-0310-859d-f6bbb57e9c96
some minor rearrangement (sys_xxx() calls now placed together)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1997 a95241bf-73f2-0310-859d-f6bbb57e9c96
output strings -- the old debug table is still there,
now renamed 'sigstr[]'
MAX_SIGNO replaces 32 in several spots
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1976 a95241bf-73f2-0310-859d-f6bbb57e9c96
to use the newly provided function for this.
module.c now also uses the initque() function, some minor cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1973 a95241bf-73f2-0310-859d-f6bbb57e9c96
yet, but the jam problem is gone and some bugs fixed.
We are now using merged objects to bind different functionality together,
which simplified the kernel Jamfile a lot.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1841 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed some minor a larger issues (one memory corruption due to the use of FD_ZERO()).
notify_select_event() is no longer binary compatible (hasn't been used on R5).
Added syscalls for select/poll in the syscall dispatcher.
Fixed some debug output in fd.c, adapted for the new notify_select_event()
call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1831 a95241bf-73f2-0310-859d-f6bbb57e9c96
Implemented realloc().
Adapted all other sources, some minor cleanups in some files as well.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1773 a95241bf-73f2-0310-859d-f6bbb57e9c96
hash implementations in that file... we should really remove one of them.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1747 a95241bf-73f2-0310-859d-f6bbb57e9c96
Not yet tested.
Moved the CHECK_USER_ADDRESS() macro from vfs.c to kernel.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1746 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed module.c and int.c to use that one.
Some minor cleanups in module.c.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1744 a95241bf-73f2-0310-859d-f6bbb57e9c96
not available in BeOS, so there is no reason to add them).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1663 a95241bf-73f2-0310-859d-f6bbb57e9c96
Implemented index syscall functions in VFS.
Added fs_index.c to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1566 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed sys_read_stat() to sys_read_path_stat() - sys_read_stat() is now
the fd operation (same for the corresponding write call).
Removed the sys_write_attr_stat() call because it is no longer needed.
Added stat(), fstat(), and other POSIX calls to the kernel - many are still
missing (mainly from stdio).
Added symbols (but no implementation) for unistd.h's process id functions.
Adapted libroot calls that used sys_read_stat() before to the new architecture.
module.c and bus_man.c now use stat() directly instead of the sys_read_path_stat()
call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1555 a95241bf-73f2-0310-859d-f6bbb57e9c96
which is now used thorough the VFS code instead of user_strncpy().
fd.c: Replaced some return codes.
vfs.c: joined attr_dir_open(), and attr_dir_open_fd(), added sys_/user_
calls to access attributes, and attribute directory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1455 a95241bf-73f2-0310-859d-f6bbb57e9c96
Included NewOS change 1656 (O_CLOEXEC support, and a bug fix in get_vnode()).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1431 a95241bf-73f2-0310-859d-f6bbb57e9c96
for a valid team id.
Added a comment about a race condition in set_sem_owner().
Some minor style changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1309 a95241bf-73f2-0310-859d-f6bbb57e9c96
variables now have the 'g' prefix).
Fixed a very unlikely race condition in create_sem_etc() (can only happen if
that call isn't used properly).
Fixed some wrong return values (i.e. B_BAD_TEAM_ID wasn't returned anywhere).
Optimized _get_next_sem_info(): it now only grabs the semaphore lock
if it has good reason to do so.
Added some comments.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1308 a95241bf-73f2-0310-859d-f6bbb57e9c96
vm_translation_map_create() checks if the kmalloc()'d page is aligned - maybe
we should just disable the USE_WALL setting if size is PAGE_SIZE for now...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1264 a95241bf-73f2-0310-859d-f6bbb57e9c96
set to 1 (which it currently is).
I've only used it with bochs yet, and it lets it crash reliably in some
VFS code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1261 a95241bf-73f2-0310-859d-f6bbb57e9c96
You need to enable BOCHS_INPUT_HACK and type inside the BeBochs window,
NOT inside the Terminal where the output is printed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1219 a95241bf-73f2-0310-859d-f6bbb57e9c96
also fixed a bug, because fs_read_info()/fs_write_info() already locked the
mutex before calling find_mount().
Implemented the file system API for attribute directories, and index
directories.
Introduced a new macro FS_MOUNT_CALL() to call fs ops directly from the
mount structure.
get_new_fd() now panics if it is called with an unknown fd type.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1189 a95241bf-73f2-0310-859d-f6bbb57e9c96
Reimplemented file system handling, it's now loading file systems on an
on-demand basis - code is not tested yet, but should work!
That also fixed a bug that was in that code before (the image was not
unloaded in case of an error in vfs_load_fs_module()).
Renamed fs_id to mount_id.
Renamed all global variables to have the 'g' prefix in vfs.c.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1175 a95241bf-73f2-0310-859d-f6bbb57e9c96
or entry_ref names (paths are safe).
Implemented attr_remove(), and attr_rename().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1171 a95241bf-73f2-0310-859d-f6bbb57e9c96
new_file_fd() is now called get_new_fd(), and can also create fds for other
types as well. Furthermore, it lost some memory if it couldn't allocate a
new fd.
Implemented most of the VFS attribute API (kernel internal only), only
remove_attr(), and rename_attr() is missing for now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1168 a95241bf-73f2-0310-859d-f6bbb57e9c96
in fs_interface.h.
Fixed many warnings due to the int/int32/status_t changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1137 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also kernel/module.h was hidden by os/drivers/module.h - fixed; kernel/module.h
is now called kmodule.h and only contains the module_init() function for the
kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1122 a95241bf-73f2-0310-859d-f6bbb57e9c96
Only implements access from within the kernel, not from the BIOS. Since
it requires malloc(), realloc(), open(), etc. in the kernel, you can't
currently link it, but it's added to the build anyway (it's just not
linked against the kernel).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1114 a95241bf-73f2-0310-859d-f6bbb57e9c96
another terrible bug that managed to exist this long and not clobber everything.
The io vector table was being created with an incorrect size, so all sorts of garbage was getting written to whomever was allocated after it.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1112 a95241bf-73f2-0310-859d-f6bbb57e9c96
also initialize newly allocated memory with non zero (0xCC)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1014 a95241bf-73f2-0310-859d-f6bbb57e9c96
This change also introduces a lot of new warnings concerning printf format
anomalies. Please do NOT fix them. Currently, int32 (and also status_t)
is of type int, but it will be of type long (BeOS compatible) soon, and
these warnings will disasappear.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@973 a95241bf-73f2-0310-859d-f6bbb57e9c96
many kernel debugger commands to be removed accidently...
Added a message if you entered an unknown command.
Some cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@758 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added syscalls for, and implemented sys_create_link(), sys_remove_dir().
Implemented link(), unlink(), rmdir().
Fixed the inconsistent path buffer handling in the user|sys vfs functions; the
path buffer is now exactly SYS_MAX_PATH_LEN from userland (incl. terminating
null byte).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@748 a95241bf-73f2-0310-859d-f6bbb57e9c96
Replaced the unused syscall for getdtablesize() with one for access().
Implemented sys_access() and added it to the file system interface.
Removed the fs function interface from vfs.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@738 a95241bf-73f2-0310-859d-f6bbb57e9c96
getcwd().
Introduced new xyz(int fd, char *path, ...) style of functions for
sys_setcwd(), and sys_write_stat().
Added missing sys_fstat(). Removed duplicated prototypes in syscalls.h
Fixed some minor bugs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@669 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed a bug in module.c that I caused due to changes in the VFS.
Added the sys_write_link() call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@666 a95241bf-73f2-0310-859d-f6bbb57e9c96
rel type (111) when it tried to load the PCI bus manager - I've only removed
the crash, but I didn't dig any deeper yet.
Note, this only happens using bochs - on a real computer, the kernel runs
obviously without any problems.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@593 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added a mode parameter to sys_create_symlink().
Added an open_mode field to struct file_descriptor.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@592 a95241bf-73f2-0310-859d-f6bbb57e9c96
- added needed syscalls to access symlink support from userland
- implemented lstat(), symlink(), and readlink()
- added dev_t to ktypes.h (for now - should be in a public header anyway)
- added symlink support to the "ls" command (now calls lstat() and shows the
link target with the -l option)
- changed the sys_read_stat() call to support symlinks, and updated files
using that function (it gets an extra argument: bool traverseLink)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@560 a95241bf-73f2-0310-859d-f6bbb57e9c96
- if the path name exceeded about 56 bytes, the function would have seg-faulted
- the calculation to decide if there is an extra region for the bss needed was wrong -
that caused the kernel to be not able to load certain executables
Also, fixed a warning, and cleaned up the above mentioned function a bit, added
some more comments.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@558 a95241bf-73f2-0310-859d-f6bbb57e9c96
yet) - up to 16 symlinks are allowed in one path (following BeOS' restriction).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@518 a95241bf-73f2-0310-859d-f6bbb57e9c96
Cleanup of the code in many places.
Fixed bad bugs in dir_vnode_to_path(), and entry_ref_to_vnode().
Fixed some other bugs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@509 a95241bf-73f2-0310-859d-f6bbb57e9c96
the PCI specifications lists it as two 8 bit entities, followed by
a unknown number of vendor specific data. It should be better to do
two 8 bit reads, instead of one 16 or 32 bit access.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@479 a95241bf-73f2-0310-859d-f6bbb57e9c96
We were disabling the PCI to PCI bridge which is the connection
to the AGP port on my system, and made an error when trying to
enable it again. Fixed now!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@470 a95241bf-73f2-0310-859d-f6bbb57e9c96
PCI configuration space read/write of 16bit at offset 1 never worked. Fixed.
Added warnings for unsupported PCI configuration space read/write offsets.
Fixed numerous bugs in PCI Capabilites detection code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@468 a95241bf-73f2-0310-859d-f6bbb57e9c96
for VGA accesses.
Marcus: can you try this and see if it makes any difference? There should
be a debug message if it detects your agp bridge and applies the fix.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@451 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now finds PCI cards connected to second pci-pci bridge on my motherboard.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@446 a95241bf-73f2-0310-859d-f6bbb57e9c96
config_manager and busses works, and this is a large correction based on
my current working thoughts.
I also think we need to have a new interface between the bus modules and
the config_manager to allow them to work together. I have some ideas
on it and will start fleshing it out next week.
This update basically moves all PCI stuff back to the PCI module and
cleans up config_manager.c. We now print a small amount of info for
devices and more for bridges. My system only has a single bridge, but if
anyone has a more exotic system and tries this can they let me know
what sort of results they see?
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@444 a95241bf-73f2-0310-859d-f6bbb57e9c96
power management states for cards that support it.
ISTR that Be forced all devices to full power, so we do the same
for the moment.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@439 a95241bf-73f2-0310-859d-f6bbb57e9c96
- add finding the PCI IRQ Routing table
- add pci_get_capability and some simple uses to test it
Thanks to Michael N for his help on getting the region working as
I expected it to :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@435 a95241bf-73f2-0310-859d-f6bbb57e9c96
for accessing the config space! So, become a good citizen and add locking
to ensure we only have one dabbler at a time in config space.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@424 a95241bf-73f2-0310-859d-f6bbb57e9c96
A couple of changes in various interrupt and thread functions and structures.
These make it now possible to change the stack at any time without making the kernel crash. This is needed for calling VESA 3.0 VBE functions through the protected mode interface.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@422 a95241bf-73f2-0310-859d-f6bbb57e9c96
This now reports better and starts configuring the busses we find.
There is still a long way to go but this another step on the way.
NB the information comes from 2 different methods and presently doesn't
agree This is known and will be fixed, so please don't start yelling
that it's broken! If people have strange debug information please
let me have a copy so I can try to debug further :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@403 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added functions to retrieve set the fs_info structure (i.e. used to get the
partition's name); not implemented yet in the internal file systems.
Implemented the dir_create_entry_ref() function.
Re-ordered some parameters for the fs calls to be more consistent.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@396 a95241bf-73f2-0310-859d-f6bbb57e9c96
arch_int_init has already enabled it, and enabling it again is never a problem.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@357 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed many bugs.
Now, the vfs_ prefix is for functions that are called by other parts of the
kernel. file_ is for file related stuff, dir_ for directory related, and
common_ for both, fs_ for general file system stuff.
Put all prefixed functions together in the source.
Implemented (currently without a user/sys call) opening/creating of entry_refs,
and node_refs (the latter for opening directories only).
Moved vfs_dup(), and vfs_dup2() to fd.c, fd_dup(), and fd_dup2().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@351 a95241bf-73f2-0310-859d-f6bbb57e9c96
we now differntiate between an I/O interrupt (ie one that is likely
to be triggered by a device on the system using an IRQ between
0 and 15) and one that we're creating to allow us to have functions
called for events, ie a software interrupt. Behaviour is all
commented in the file int.c, but you need to make sure that you call the
correct version.
install_io_interrupt_handler now needs an IRQ value between 0 and 15 and
will treat the irq as one it needs to enable/disable
install_interrupt_handler is for software interrupts and is essentially
the function we had.
For mroe read the comments in the file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@348 a95241bf-73f2-0310-859d-f6bbb57e9c96
- catch up with the changes to the interrupt functions
- change the way we handle the list of handlers to use a standard
function rather than a home spun one :)
- don't add every function on a pci device as a seperate device
- add more info to the pci_info structure
- when FULL_MONTY turned on show more information
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@340 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also reflect the change of function name and number of
parameters.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@339 a95241bf-73f2-0310-859d-f6bbb57e9c96
fully implemented.
I removed all those insane INSANE() debug output and found what made
the difference between a working and a crashing kernel - will have
to investigate this later, because those two lines a) really belong
there, and b) even if they are there, the kernel shouldn't crash just
because of that.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@330 a95241bf-73f2-0310-859d-f6bbb57e9c96
This fixed a lot of ongoing segfaults which were both intermittent
and unpredicatble.
Also improve some logic so we take a shorter path in simple_module_info
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@323 a95241bf-73f2-0310-859d-f6bbb57e9c96
Essentially the code that the net stack used. the code is based on the
hash impl. in APR, that was itself based on a large number of different
people's efforts and various papers.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@322 a95241bf-73f2-0310-859d-f6bbb57e9c96
Remove some duplicated build options
Comment out the beos section as it's not really of interest to people
not working on the modules/device code :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@320 a95241bf-73f2-0310-859d-f6bbb57e9c96