Commit Graph

20690 Commits

Author SHA1 Message Date
Ingo Weinhold
5b53519c63 Some setre{g,u}id() tweaking. What happens to the saved set-{g,u}id is
not specified by the standard, but other systems set it as well in most
cases. We set it to real {g,u}uid now, if that changes. OpenSSH (sshd)
seems to be agreeable with that solution.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 21:18:07 +00:00
Axel Dörfler
2d8e02e435 * Started playground for the new device manager. This will eventually evolve
into the full thing, and will then be adapted to the kernel.
* Doesn't do a lot at this point - it can be built as a test app under BeOS
  and Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 19:07:08 +00:00
Ingo Weinhold
6fd31accd3 makebootable was broken under Haiku:
* Haiku partitions are block devices.
* Unlike BeOS Haiku requires a size parameter to be passed to ioctl()
  for B_GET_PARTITION_INFO.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 17:28:22 +00:00
Oliver Ruiz Dorantes
717c9b00f2 - Fix correct handling of the command status event
- Fix Removal of specifil event wanted in a given request



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24971 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 17:17:47 +00:00
Ingo Weinhold
b27b39f198 Added libMicro benchmark. Ported by Vasilis Kaoutsis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 16:27:00 +00:00
Ingo Weinhold
9b293bf653 mmap() was a little strict: The length parameter need not be page
aligned. It shall be rounded up by the implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 14:22:50 +00:00
Stephan Aßmus
e806cb517a Applied patch by Scott McCreary:
* Added a whole lot of missing copyright statements, small corrections in
  some existing ones.
Changes by myself:
* Fixed line breaks to honor 80 char limit.
* Removed unused function declaration to avoid warning.
* Small style fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 14:22:03 +00:00
Michael Lotz
33574eaf6e Exclude the frame list rollover interrupt from the interrupts we are interested
in. We do not enable this interrupt and if we still "handle" it in our
interrupt handler we might prevent the interrupt from reaching the real intended
handler in a shared interrupt setup. Not sure if this could have happend at
all, but this is more correct in any case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-14 06:35:25 +00:00
Ingo Weinhold
3cf7ecd1e4 * Added <sys/mman.h> header. It declares only mmap() and munmap() yet
and defines the macros needed by them.
* Renamed syscall sys_vm_map_file() to _kern_map_file() and changed the
  path to an FD parameter. Changed vm_map_file() accordingly and
  adjusted the kernel ELF loader and the runtime loader.
* Added syscall _kern_unmap_memory().
* Added bool unmapAddressRange parameter to vm_create_anonymous_area()
  and map_backing_store(). If true and the address specification is
  B_EXACT_ADDRESS, all areas in the specified address range will be
  deleted (unless an area is covered only partially).
* Introduced B_SHARED_AREA flag, which is set on areas that have been
  created by {vm,_user}_map_file() with REGION_NO_PRIVATE_MAP. When
  fork()ing those areas won't be copied CoW, but rather be cloned. This
  is needed for mmap() MAP_SHARED.
* {vm,_user}_map_file() also accept an FD argument < 0, in which case an
  anonymous area is created.
* Implemented mmap() and munmap(). Currently there's the restriction
  that we can't partially unmap areas. Otherwise the functions should be
  rather compliant. We also support the non-POSIX extension
  MAP_ANONYMOUS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24964 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 22:52:11 +00:00
François Revol
ebf8c71d74 Fix warnings about missing protos.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 17:52:41 +00:00
Axel Dörfler
c54a6536d6 Committed patch by Gerald Zajac, thanks!:
* Enabled testing the checksum of the EDID info.
* Added a version check of the EDID info.
* Added more debug output.
* In the ModeList class, changes were made to how the refresh rate is 
  computed and used.  Previously, some of the basic VESA modes were not 
  added to the mode list because the computed and specified refresh rates 
  did not exactly match.  Now if the computed refresh rate is within 1.2% 
  of the specified rate, the mode is added.  With this change, all basic 
  VESA modes selected by the EDID info are now added to the mode list.
* The "additional video modes" shown in the EDID dump are now added to 
  the mode list.  Previously, this mode data was setup but not added to 
  the mode list.  Code was also added here to set the vertical & 
  horizontal sync polarity according the EDID info.  The sync polarities 
  are set according to a VESA document that I have.
* Fixed copy_str() warning, broken removal of trailing spaces, and null
  termination.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24959 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 10:58:30 +00:00
Bruno G. Albuquerque
9c383d9867 Applied patch by Hervé W.
- Updated Intel processor IDs.
- Only take extended family/model into account on Intel processors.




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24958 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 07:27:12 +00:00
Michael Lotz
93209d82e2 Fully clear the EHCI members too, so an incompletely constructed object can be
safely deleted.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24957 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 06:04:20 +00:00
Axel Dörfler
3a4a214197 Some more work on the ActivityMonitor:
* Added legend.
* Added network receiving/sending DataSource.
* Now uses the new layout engine.
* Added support for per CPU DataSources, and added a per CPU CPU usage
  DataSource.
* The DataSources can now be turned on and off via popup menu.
* You can now add more than one view to the window.
* The DataSources of the ActivityViews are now remembered.
* Now uses an offscreen bitmap to reduce flicker (it should now no longer
  flicker with accelerated graphics).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24955 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 06:02:45 +00:00
Michael Lotz
656af4e869 * Initialize all of the fields in the UHCI class so in case of an error in the
constructor the object can be safely deleted (as documented for bug #1473)
* Some simplifications by caching the Pipe object for a transfer
* Minor cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 05:56:10 +00:00
Axel Dörfler
6ad23dbbf4 Some cleanup:
* Reordered to have the constructor/destructor first.
* Two blanks between functions.
* Removed superfluous constructor calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 04:57:13 +00:00
Rene Gollent
1174007caf Modified bin/keymap's -h option to write a variable to the generated header
indicating the name of the keymap. Correspondingly, modified input_server 
to use the aforementioned variable in order to write the name attribute
to ~/config/Key_map. This allows Keymap prefs to correctly recognize the name
of the default keymap on a fresh build.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 22:41:19 +00:00
Ingo Weinhold
f13ba03959 * Removed SyscallRestartWrapper comparison operators. They are not
needed, since we've got a cast operator.
* Reverted r24927-r24929. There's no potential ambiguity anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 17:18:31 +00:00
Ingo Weinhold
460c990c5d The syscalls that were returning an address always copied back the full
address back to userland, even if the provided buffer was smaller. Fixes
a problem with Firefox, which is for some reason providing a buffer
smaller than our sockaddr_in.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 16:59:49 +00:00
Michael Lotz
c8661c3885 Make a local copy of the passed in isochronous packet descriptors before
handing them over to the USB stack. Otherwise the finisher (kernel) thread
would have no way to fill those packets when they came from a user space
address range. Completely untested though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 14:20:53 +00:00
Jérôme Duval
c103aef2b3 disabled check for memory overlaps for the time being
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24946 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 13:36:33 +00:00
Stephan Aßmus
2082f2d5c1 * Cleanup and improvements in the debug output
* Handles wrapping of the chunk buffer for the case that we need to read
  additional chunk data, but still need the data from the last chunk
  buffer as well.
* Don't skip the very first frame when calculating the timing.
* Includes some new code to handle seeking internally, but it is currently
  disabled and incomplete.
* Prepared to recover from floating point exceptions generated in some rare 
  situations by xvid, but we are currently missing fenv.h in our public POSIX
  headers, so it is disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 13:24:33 +00:00
Michael Lotz
b6d44561ff Quick buildfix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24944 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 10:27:04 +00:00
Ingo Weinhold
59234b36ce * Added support for SCM_RIGHTS (sending file descriptors).
* Fixed shutdown(). It was computing the wrong fifo flags and set the
  wrong ones from the wrong variable on the peer fifo.
* Generally made the Unix sockets behave more like they should. E.g.
  after closing one end, it must still be possible to read from the
  other (as long as there are buffered data). Also fine-tuned when to
  return what errors from recv()/send().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24943 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:37:13 +00:00
Jérôme Duval
316b5f9214 updated bzip2 to 1.0.5
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:30:47 +00:00
Ingo Weinhold
97cdbb548e Added support for sending/receiving ancillary data. The protocol modules
have two more optional hooks for attaching supplied ancillary data to a
net_buffer and for processing received ancillary data. Not sure, if that
is flexible enough for all kinds of ancillary data, but it is for
SCM_RIGHTS and also should for SCM_CRED[ENTIAL]S (if we ever decide to
implement one of those) -- don't know any other types on other protocol
levels.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:28:05 +00:00
Ingo Weinhold
62d7da1f45 Added support for attaching ancillary data to a net_buffer. It's a naive
implementation ATM, since it malloc()s the required memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24940 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:19:44 +00:00
Ingo Weinhold
5f2d64a25e * _user_{send,recf}msg() no longer copy iovecs on the stack. They use
the heap and the IOV_MAX limit.
* They also take the responsibility of copying the ancillary data in and
  out.
* These syscalls were badly broken. They used a member of an
  uninitialized structure instead of the iovec pointer passed from
  userland. sendmsg() would thus fail or send arbitrary data, recvmsg()
  would overwrite arbitrary memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:50:17 +00:00
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
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
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
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