Commit Graph

1229 Commits

Author SHA1 Message Date
Ingo Weinhold
de73100825 Also check whether the supplied vnode is a directory, if there's only
one path component.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24736 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-02 01:55:37 +00:00
Ingo Weinhold
0cc0b6fc8f * Fixed resolution of symlinks path components, broken since
r24721/r24722. After resolving a symlink we weren't updating the local
  type variable to the type of the link target, so that the directory
  check in the next iteration would always fail.
* Added TODO.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-02 00:51:43 +00:00
Axel Dörfler
ebe5326de3 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-01 18:21:47 +00:00
Axel Dörfler
b987779d7f Revised my previous patch as outlined in the previous one:
* No longer checks for the path delimiter twice.
* Now also checks if the first part of the path is a directory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-01 17:59:51 +00:00
Axel Dörfler
6800e4f8ba Reverted r24720, and at least fixed the problematic return code after the
first loop - the vnode passed in would still need to be checked, though.
Eventually, it would be nice to move the check to the top, though, so that
we don't need to search for the patch delimiter twice.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24721 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-01 17:39:52 +00:00
Bruno G. Albuquerque
b48c7f231a - vnode_path_to_vnode() now returns B_NOT_A_DIRECTORY instead of B_NOT_ALLOWED
as expected by POSIX programs. This allowed be to compile Haiku under itself
  without any hacks at all, so I guess this means that now we are officially
  self-hosting!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-01 15:38:01 +00:00
Axel Dörfler
10f0fc8f20 * Implemented sigwait().
* 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
2008-04-01 12:15:14 +00:00
Ingo Weinhold
32122dc5c4 * Since writers also might have to wait when there is still some room
in the buffer, they need to be notified after a read when their
  minimal write size requirement has just become satisfied. We were
  notifying only when there was no space in the buffer before, which
  caused bug #1755.
* Removed Inode::NotifyWriteDone(). It's not needed anymore, since we
  don't queue writers. They are always all notified, so that one doesn't
  have to notify the next one, when it's done.
* Renamed *Request* to *ReadRequest, since we do have WriteRequests now
  as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-30 22:35:41 +00:00
Ingo Weinhold
9fe0705bee My previous change to getgroups() broke the getgroups(0) special case,
which e.g. "awk" didn't like.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24691 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-30 20:02:38 +00:00
Jérôme Duval
7522f3082d reduced MTRR min size to 512KB
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-30 14:25:01 +00:00
Axel Dörfler
6328832fba * Changed get_boot_item() API: it now also can retrieve the size of the boot
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
2008-03-30 11:01:41 +00:00
Ingo Weinhold
360be1fc45 * Implemented support for chroot:
- 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
2008-03-30 05:59:54 +00:00
Ingo Weinhold
290946ce80 * Implemented some basics for supplementary groups support:
- 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
2008-03-30 00:08:13 +00:00
Ingo Weinhold
8c117a6d88 Added function vfs_read_stat() that also allows for stat()ing files in
the user IO context from within the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-29 23:57:34 +00:00
Ingo Weinhold
3bef7d0252 Added functions malloc_referenced[_{acquire,release}]() that implement
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
2008-03-29 23:55:34 +00:00
Axel Dörfler
a7f6ff0ff8 * Applied patch by Vasilis that updates the doxygen comment style.
* Shuffled functions around to separate the private from the public API.
* Renamed global static io_vectors to sVectors.
* Rearranged includes, replaced deprecated malloc.h with stdlib.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-29 12:01:57 +00:00
Rene Gollent
153cc3c0f4 Use the old calculations for used_pages for the time being until the issue with sAvailableMemory is resolved.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24615 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-28 04:57:49 +00:00
Ingo Weinhold
82d444a25e Changed the page allocation tracking history to kernel tracing instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-27 23:13:01 +00:00
Ingo Weinhold
989a6e05ec Made kernel tracing safe to be used right after it has officially
been initialized.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24613 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-27 23:10:22 +00:00
Jérôme Duval
9fcee65eaf take into account areas starting or ending equally
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24612 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-27 22:31:42 +00:00
Ingo Weinhold
071f9c3aa2 Build configurations shouldn't be done in svn controlled files, so I
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
2008-03-27 22:01:38 +00:00
Axel Dörfler
9e79133f4d * Reverted r22315 as far as free_vnode() is concerned: removing the
vnode from the hash before putting it caused all sorts of problems.
* For example, BFS would trim its preallocations when the vnode is put;
  if someone would read that same vnode after it had been removed, but
  before BFS could trim it, it would read the old vnode which still 
  seemed to own the blocks which would subsequently be freed.
* This fixes bug #1914, and should also fix bug #1956.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-27 09:48:33 +00:00
Axel Dörfler
14438ad555 * write_cached_block() now moves a block to the unused list when it's
not referenced and clean (is no longer part of a transaction).
  This finally gets memory consumption to a moderate level; even 
  unpacking a large archive will no longer eat all memory.
* The "block_cache" KDL command will now print the number of unused
  blocks as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24606 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-27 09:38:53 +00:00
Ingo Weinhold
332e24fb43 Fixed a quasi-livelock in steal_pages() as proposed in ticket #1929.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24605 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-27 05:42:43 +00:00
Jérôme Duval
395880e0a9 we should really check whether the devices are used before reloading the driver
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-26 20:51:02 +00:00
Axel Dörfler
758962ec3b * Added arch_debug_contains_call() function that returns wether or not
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
2008-03-26 17:08:51 +00:00
Axel Dörfler
c32f787401 * Added new KDL command "string" that dumps a string given a pointer.
* Use parse_expression() where appropriate.
* Removed extraneous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-26 16:21:33 +00:00
Axel Dörfler
5dafcc2b1b * Added new "symbol" command which is able to search for a symbol that
matches the specified pattern in all loaded kernel images.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-26 16:10:06 +00:00
Axel Dörfler
dc1a7867e0 * Added new pattern filters d#<expr>, x#<expr>, and s#<expr> which
set the actual pattern as "%d", "%x", and "%s" of the expression
  after '#' respectively. They are very slow, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-26 16:08:28 +00:00
Axel Dörfler
e77b684f9e * Added very basic possibility to set a filter for all KDL command
output using the new "filter" command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-26 16:05:21 +00:00
Axel Dörfler
3bb1e6c264 * The block_cache KDL command now sets some useful variables.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24589 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-26 14:38:35 +00:00
Jérôme Duval
cd9ce121d9 now checks if another mtrr range is extended by a new one and extends it
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-25 20:55:12 +00:00
Axel Dörfler
c12ed8563a Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-25 20:29:49 +00:00
Axel Dörfler
cd31b326a3 * The "block_cache" command checked the wrong variable to see if a block
could be found or not, eventually resulting in a read fault.
* It now also uses parse_expression() for its second argument, since it
  now returns an uint64 in Haiku.
* Tracing output cut off the label too early.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24579 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-25 19:21:01 +00:00
Axel Dörfler
41f8d41647 Applied patch by Rene Gollent:
* 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
2008-03-25 11:51:45 +00:00
Axel Dörfler
a121b8c83c * Added a new flag for write stat: B_STAT_SIZE_INSECURE that allows a
file system to not fill newly created space with zeros. 
  BFile::SetSize() now uses this, while [f]truncate() does not. This
  is only a temporary work-around until BFS supports sparse files.
* Apps that want to reserve space to fill up later should use 
  BFile::SetSize() for now, as this will be a lot faster than 
  [f]truncate().
* cache_io() and the functions below now use a special mode when you 
  pass in a NULL buffer: for read access, the cache is only populated
  (useful for prefetching), for write access, the file is filled with
  zeros.
* Implemented BFS's Inode::FillGapWithZeros() using this method now.
* Removed extraneous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24555 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 13:39:02 +00:00
Axel Dörfler
5e2ef462ec * Got rid of the duality of FS_WRITE_STAT_* vs. B_STAT_* flags (removed
the former ones).
* Removed extraneous white space.
* net_server settings are now also updated when the size of the 
  file changed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24552 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 12:04:47 +00:00
Ingo Weinhold
0956fd0502 Applied change proposed in #1917 after encountering the bug the third
time. Releasing the cache's store reference while holding the cache lock
could reverse the usual locking order -- the VFS could potentially call
the remove_vnode() or put_vnode() FS hook, which in turn could use the
file cache, thus resulting in a deadlock. Now we release the store ref
before locking the cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 05:15:42 +00:00
Rene Gollent
77570fb545 Disable tracing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 01:02:59 +00:00
Rene Gollent
612ab37d12 _user_set_tzfilename now correctly updates the system RTC offset. This
makes switching between GMT and local time in time prefs work correctly
without requiring a reboot to recalculate the clock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24544 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 01:01:51 +00:00
Bruno G. Albuquerque
7a66a9b8e4 - Added support in system info for extended cpu family and model.
- 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
2008-03-21 16:44:05 +00:00
Rene Gollent
0026580104 Leave tracing disabled by default though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24497 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-21 03:32:28 +00:00
Rene Gollent
7f9a9ff612 Fix broken TRACE statement.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24496 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-21 03:31:55 +00:00
Jérôme Duval
e958cea514 now fails if a write combining overlaps
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24494 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-20 22:12:28 +00:00
Axel Dörfler
a886f802fc * Added debug_screen_output_enabled() function.
* 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
2008-03-20 11:10:17 +00:00
Axel Dörfler
4495cd43c1 * Fixed warnings, mostly due to NULL changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24487 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-20 11:04:45 +00:00
Jérôme Duval
eb258077e7 added --help support for devfs_node debugger command
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-19 23:02:30 +00:00
Jérôme Duval
957d7d0732 added help support for devfs_driver debugger command
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-19 22:58:48 +00:00
Jérôme Duval
4e8c60ce4b style cleanup
replaced addr_t by uint64
more debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-19 19:00:35 +00:00
Stephan Aßmus
a529aaf3c6 Fixed 32 bit blit modes for real...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-18 21:41:02 +00:00