Commit Graph

23827 Commits

Author SHA1 Message Date
Jérôme Duval
9c6ab2ae36 fixed bug #2067
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24938 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:37:03 +00:00
Ingo Weinhold
0cc82d47d4 Added close_fd_index() which is pretty much like close(), but gets the
IO context in which to close the FD.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:32:29 +00:00
Ingo Weinhold
ac4630e161 * Added <sys/param.h> include, which is needed for _ALIGN().
* Added SCM_RIGHTS macro.
* Added a few non-standard but widely-used CMSG_*() macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:30:25 +00:00
Michael Pfeiffer
dff9173818 Save and restore MBR and write boot menu.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:25:38 +00:00
Michael Pfeiffer
7437e205be Removed debug code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24934 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:21:35 +00:00
Michael Pfeiffer
86ad7d1c71 Refactored and reformatted.
Select default item at start.
Added timeout handling.
Don't switch to graphics mode, stay in text mode instead. Graphics mode led to display issues with lilo.
Reverted order of text color like it is in original bootman.
Fixed bugs.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:19:25 +00:00
Michael Pfeiffer
1b56fe8db5 Helper application that converts the contents of a file into an uint8 array.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24932 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:10:57 +00:00
Michael Pfeiffer
20abf32b6d Boot menu and loader by Dengg David.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24931 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:10:29 +00:00
Jérôme Duval
2be56e7576 Applied patch from n3s: the check for file extension was broken. Thanks!
This fixes bug #2034


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24930 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:58:43 +00:00
Jérôme Duval
6cb51e58bc better cast to the good type to avoid confusing gcc
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:17:01 +00:00
Jérôme Duval
b1459ca4b4 hmm I managed to break the comparaison order...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:08:56 +00:00
Jérôme Duval
bdfe92370f gcc4 build fix. Here is one of the two errors:
src/system/kernel/fs/fd.cpp: In function 'ssize_t common_user_vector_io(int, off_t, const iovec*, size_t, bool)':
src/system/kernel/fs/fd.cpp:727: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the 
second:
headers/private/kernel/syscall_restart.h:151: note: candidate 1: bool SyscallRestartWrapper<Type>::operator<(const Type&) const [with Type = long int]
src/system/kernel/fs/fd.cpp:727: note: candidate 2: operator<(long int, int) <built-in>


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:04:45 +00:00
Michael Lotz
349a9cfc0f Use a list of host controller modules instead of using open_module_list() and
read_next_module_name(). This is ugly and less flexible but it allows us to
explicitly force an initialization order. As detailed by the added comment
there seem to be controllers/BIOSes that require the EHCI controller to be
initialized after the companion host controller or else they refuse to publish
any high speed devices. This was the case for bug #1236 and my laptop when
legacy emulation is enabled and any device was plugged in at boot. This change
fixed the problem for me and hopefully closes bug #1236 too.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 06:10:36 +00:00
Michael Lotz
e959baed58 * Set the interrupt threshold of the controller when doing the rest of the
initialization as suggested by the EHCI spec and do not touch it again
  once the controller is running. Doing so would result in undefined behaviour
  according to EHCI specs.
* Set the port routing policy after the controller has started and not before
  as suggested by the EHCI specs.
* Explicitly set the segment register after resetting the host controller and
  not before, as this likely has no real effect ;-)

Might help with some legacy support or UHCI/OHCI to EHCI handover problems.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 06:10:28 +00:00
Rene Gollent
487171f0b9 Keymap preferences now saves an attribute on the Key_map file to indicate
what keymap it came from. This allows us to indicate the current keymap in
the list views. I'm not sure how to get the build system to populate that
attribute by default though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 03:28:12 +00:00
François Revol
3ee7fad0a9 export foo=bar doesn't seem to work with plain sh...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 02:45:21 +00:00
François Revol
a559f87af8 Remove use of bashisms since we use #!/bin/sh. This should help supporting solaris.
Added sunos to the list of platforms, but it needs more work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24922 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 02:40:10 +00:00
Michael Lotz
77599d6d06 Redefine B_KERNEL_{READ|WRITE}_AREA to 0 for BeOS compatibility and not to
B_{READ|WRITE}_AREA. Otherwise we'd allow any user process to shredder our
data as Axel put it so nicely ;-) Thanks for the clarification.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 22:03:34 +00:00
Michael Lotz
dbcfdd5ca7 Correct the way serial devices are deleted. They are either deleted on removal
when they are not open or they are deleted on free when they are already
removed. This should fix the sudden crashes when you unplugged a device that
might not have been fully closed yet.
Also handle the case of removal correctly and don't use the usb_device anymore
after releasing it by returning from the device removed hook. Calls to the
device just return B_DEV_NOT_READY in that case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24920 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 21:52:39 +00:00
Ingo Weinhold
c1add58abb Resolved TODOs: We now do know whether the call comes from userland or
the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 20:43:40 +00:00
Ingo Weinhold
43d5590ce1 Yep, first clear THREAD_FLAGS_SYSCALL, then check whether it is set.
That would explain why syscall restarts were broken. In fact there's no
reason to check the flag at all, since we know we set it.

ftp appears to work again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 20:36:50 +00:00
Ingo Weinhold
3118b3a7cb * Added fd_ops::set_flags() hook. It's only implemented by socket FDs
ATM.
* Changed common_fcntl() to also work for non-vnode-based FDs. Only the
  operations that require a vnode do fail now. F_SETFL uses the new
  fd_ops::set_flags() if available, falling back to the vnode respective
  operation.
* Changed some direct accesses to file_descriptor::u::vnode. It was safe
  in those cases, but might not be anymore if we ever change fd_vnode().

ftp can at least connect to servers again, now, but apparently we still
have a problem with syscall restarts -- downloads fail after one second,
when the timer goes off.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 19:21:14 +00:00
Stephan Aßmus
f156c25d14 Applied patch by JiSheng Zhang:
Synchronized firewire bus manager with FreeBSD current.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 17:35:11 +00:00
Axel Dörfler
ac0e5c1ce5 The fs_sync() function (or any other, for that matter) must not hold the
sMountMutex lock when calling sync() on a file system. This fixes a potential
deadlock (I just encountered for the first time).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 17:01:25 +00:00
Ingo Weinhold
75015ff525 * Renamed THREAD_FLAGS_IOCTL_SYSCALL to THREAD_FLAGS_SYSCALL,
syscall_restart_ioctl_is_restarted() to syscall_restart_is_restarted,
  IoctlSyscallFlagUnsetter to SyscallFlagUnsetter, and
  IoctlSyscallRestartWrapper to SyscallRestartWrapper, as they are no
  longer only used for ioctl().
* Removed unused syscall_restart_ioctl_handle_post().
* Made SyscallRestartWrapper a lot fancier. Instead of storing a
  reference to the result value, it stores the value itself, and it
  features all the interesting operators that make it appear like that
  value. This simplifies the use of the class quite a bit.
* THREAD_FLAGS_SYSCALL is now set for all socket function and the
  read[v](), write[v]() syscalls.
* Added is_syscall() function and net_stack hook to the net stack.
* Removed "kernel" parameter from all net_stack_interface and net_socket
  module hooks. They aren't need any longer, since is_syscall() can be
  used instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 16:13:47 +00:00
Axel Dörfler
9493edbe9f Applied patch by Christian Fasshauer:
* get_dir_path_and_leaf() now removes trailing slashes from the path.
* This fixes bug #2016, thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 14:37:48 +00:00
Stefano Ceccherini
838c73ba76 Removed unused BWindow friend classes, renamed some BView member
variables to fit our guidelines.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 09:26:11 +00:00
Stefano Ceccherini
18af47f5c4 Renamed some private methods to have the underline prefix, now that
BWindow doesn't call them directly anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:53:25 +00:00
Stefano Ceccherini
150ddd17b1 added missing header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:29:54 +00:00
Stefano Ceccherini
10f4d0679a Added a class MenuPrivate to handle access to private BMenu methods.
BMenuItem and BWindow are no longer friends of BMenu, but use this class 
instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:22:09 +00:00
Ingo Weinhold
df50f7a9b4 * Changed the way the socket functions work:
- The net_stack driver is no longer used. Instead we have a kernel
    module which is directly used by syscall implementations in the
    kernel. I.e. we no longer tunnel those functions through ioctls, but
    have normal syscalls.
  - Removed the superfluous net starter module.
  - Implemented the FDTYPE_SOCKET type file_descriptors, that is sockets
    are no longer vnode based.
  - Adjusted libnetwork (the socket function implementations)
    accordingly.
  - Adjusted netstat accordingly.
* Socket module:
  - Implemented socketpair().
  - Added "kernel" parameter to the control hook. Quite a few more hooks
    would actually need the parameter, but I didn't change those yet,
    since that would probably also require changes to the protocol
    module interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24908 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 04:12:23 +00:00
Ingo Weinhold
446d50a652 Removed unused _kern_socket() dummy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:37:18 +00:00
Ingo Weinhold
0fc6c43728 Resolved TODO: We can check for sockets, now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:35:15 +00:00
Ingo Weinhold
3cc3dcb385 Preparation for socket file descriptors.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:33:59 +00:00
Ingo Weinhold
08b2313e70 * Fixed some checks for user addresses. IS_KERNEL_ADDRESS is not the
same as !IS_USER_ADDRESS.
* Use the new IoctlSyscallFlagUnsetter helper class in _kern_ioctl().
  The former implementation wasn't checking correctly for a previous
  syscall flag.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24904 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:32:45 +00:00
Ingo Weinhold
89df64c56e Added two helper classes for dealing with restarts of ioctl() like
syscalls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:29:42 +00:00
Ingo Weinhold
bab4c3bbff Changed the type of msghdr::{msg_name,msg_control} to void* as dictated
by POSIX.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24902 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:27:53 +00:00
Ingo Weinhold
681fe624a3 Define HAVE_STDINT_H unconditionally. We have it, and some header
modification seemed to have caused the macro not to get defined anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24901 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:25:56 +00:00
Ingo Weinhold
7e8cb518e9 Finally decided to put the often copied RETURN_AND_SET_ERRNO() macro
into a header. This version instantiates the given argument only once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24900 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:23:51 +00:00
François Revol
716bba3eae start of a header for a beos compatible tty module.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24899 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 23:29:45 +00:00
François Revol
ef16b3bb76 Use the thread's stack size for RLIMIT_STACK, this should work even if we ever implement changing a thread's stack.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 21:56:22 +00:00
Stefano Ceccherini
0323cae536 Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 20:58:32 +00:00
Stefano Ceccherini
42bf22abf8 fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 20:57:29 +00:00
Stefano Ceccherini
47908b9ae3 fixed warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24895 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 20:48:38 +00:00
Michael Lotz
017d539c2a A few more things to get the USB stack working under BeOS again. We now have
KDEBUG on by default which causes benaphores to always use their semaphore.
Therefore when initing the benaphore with the inline compatibility function
and then using it using the lock.h provided inline would always cause a
deadlock and a hanging system under BeOS. Also we now (re-)define the
B_KERNEL_{READ|WRITE}_AREA defines for non Haiku targets to 0 apparently which
would probably also cause the stack to misbehave. Therefore they are now
just redefined (again) to plain B_{READ|WRITE}_AREA in BeOSCompatibility.h.
Change the inclusion order in some places so things work as expected.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 19:55:51 +00:00
François Revol
c4a7b4e09e Report the stack size from getrlimit(), we might want to get fancier later but that should be enough. Tcl will want that.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24893 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 19:27:26 +00:00
François Revol
85e1e2f4d6 Coding style :P
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24892 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 18:05:00 +00:00
François Revol
42fe011d2a Set close-on-exec flag on USB Kit device descriptors, so apps launched by Tracker won't inherit all the fds to hubs as they do on Zeta :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24891 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 16:46:26 +00:00
François Revol
0116de8b74 The artist's reinterpretation of the Tcl/Tk interpreter (wish) icon, derived from the GLTeapot one.
It's the old oil lamp with the genius getting out. Would miss a top cover.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 14:52:36 +00:00
Axel Dörfler
c28d31cce6 Removed unused variables.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 12:48:42 +00:00