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
- make pci into a true module now.
- the pci module builds and keeps a linked list of devices it finds, with
a filled in pci_info structure
- pci module detects (at runtime) whcih config mech to use, though to date
only mech 1 is implemented
- pci module does sanity check and warns if it fails
- config manager loads pci module and calls get_nth_pci_info to iterate
through the list printing details
- pci is no longer called directly from the bus init function
there is still lots to do and I've tried to make sure that there are plenty
of comments in the pci.c file. I've also left the previous code in
place until we move on a little further when it will be removed.
This has been working with no problems on my system and doesn't change
any functionality as we don't have any devices that need PCI in our build
yet.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@319 a95241bf-73f2-0310-859d-f6bbb57e9c96
thing dir_vnode_to_path().
But beware, it's not yet working correctly - will fix it later, I have no
time anymore.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@315 a95241bf-73f2-0310-859d-f6bbb57e9c96
benaphores; benaphores aren't that beneficial in kernel land, the benaphores
are a way to reduce the number of kernel calls.
They can now only be released by the same thread who originally acquired it.
Included other changes geist (change 1499) did to a) fix some bugs, and
b) reflect the changes made to the mutexes.
Cleaned the files a bit up, all the commented dprintf()s in elf.c are now
deactivated through a macro.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@311 a95241bf-73f2-0310-859d-f6bbb57e9c96
a load of comments explaining why it does the things it does.
In the get_module code we now correctly
call the init function, which was being missed before if we got
the module via search_module.
If people can test and confirm this works. It works here and has solved
all the issues I was trying to fix.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@276 a95241bf-73f2-0310-859d-f6bbb57e9c96
Provide more info when a duplicate module name is detected during a scan.
Remove some code we no longer use.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@274 a95241bf-73f2-0310-859d-f6bbb57e9c96
Minor bug fixes.
fd_close() now doesn't have to call remove_fd() anymore - it's now called
in user|sys_close(), fd_close() is now only called in the last put_fd().
Cleanup, improved debug output (without any warnings).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@266 a95241bf-73f2-0310-859d-f6bbb57e9c96
manager module. As time goes on we can start fleshing these out.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@217 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed some bugs in fd.c (how many more bugs can be in a small file like this? :-).
Added the syscalls for sys_open_dir(), and sys_create_dir().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@209 a95241bf-73f2-0310-859d-f6bbb57e9c96
functions. sys_create() now returns an fd of the open file (some code in the
kernel shell already depend on this).
Moved the seek functions to fd.c.
Updated all internal file systems to a new and updated API.
vfs.c is not cleaned up well, but also has some bug fixes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@208 a95241bf-73f2-0310-859d-f6bbb57e9c96
the warnings about sem_info and port_info (defined in kernel/OS.h)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@128 a95241bf-73f2-0310-859d-f6bbb57e9c96
Remove the iso9660 stuff from the build as it's no longer being
maintained and never did anything anyways :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@98 a95241bf-73f2-0310-859d-f6bbb57e9c96
use of the IOCPARM_LEN() macro to the ioctl() function in libc.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@61 a95241bf-73f2-0310-859d-f6bbb57e9c96