Commit Graph

986 Commits

Author SHA1 Message Date
Axel Dörfler
ff718cafed * Maintain the vm_cache::virtual_size field in all cases.
* Fixed dumping the area list of a cache I broke with the previous commit.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-13 18:33:13 +00:00
Axel Dörfler
81d5ce45a8 * Merged "cache"/"cache_ref" commands, as you usually want to have all the info, anyway
(you can still use both commands, but you'll see always the same output).
* The cache_ref's area list now also prints the owner of the area.
* Added "-p" option to "cache"/"cache_ref" that will show the pages of the cache; if you
  omit it, it will now only present you a page counter.
* Nicer output for the commands above.
* Added "dl" to display memory in 64 bit values.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19787 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-13 17:24:40 +00:00
Axel Dörfler
dcadebae62 The "thread" debugger command now also prints out the thread exit waiters.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-13 17:13:50 +00:00
Jérôme Duval
1f2d4a5e2d fix build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19782 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-13 12:49:12 +00:00
Axel Dörfler
b129e4cee1 Another kernel bug less:
* send_signal_etc() (among others) used team::main_thread in an unsafe way; it is
  possible for a team to be part of the team list and a group without having
  a main thread very early in its creation process.
* Replaced most occurences of team->main_thread->id with team->id since the team
  always inherits the ID of its main thread in Haiku for quite some time now.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 22:54:21 +00:00
Marcus Overhagen
43792b9eed propagate required settings for the remote disk from boot loader to kernel (client-ip, server-ip, server-port)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19780 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 22:27:48 +00:00
Marcus Overhagen
93b2b9ce66 made a copy
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 21:05:47 +00:00
Axel Dörfler
fa4858af26 Didn't notice that x86_enter_userspace() also copied the thread entry's arguments to
the userland stack in an unsafe way - moved that stuff to arch_thread_enter_userspace(), too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 20:40:39 +00:00
Jérôme Duval
173acea776 added a boot menu option "Disable ACPI" and code to avoid loading the ACPI module when it's active. untested (because of sudden reboots when boot menu is used).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19777 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 20:01:08 +00:00
Axel Dörfler
dc688434ed * Added the possibility to pre-commit pages for areas that can overcommit.
* This is now used for userland stack - they now always pre-commit two pages, enough
  to initialize TLS and copy the user-thread-exit stub to that area.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 18:51:01 +00:00
Axel Dörfler
8fc075ac5c * There was no reason to copy the "userland calls exit_thread()" stub with interrupts
turned off - accessing userland memory. Now, arch_thread_enter_userspace() does that
  job, and as a result, may also fail.
* dump_thread() now directly prints the info of the current thread when used without
  argument (rather than iterating the thread list to look for the current thread).
* If arch_thread_init_tls() fails upon thread creation, the function will now return
  an error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19775 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 18:26:32 +00:00
Marcus Overhagen
f5fa54f798 Improved error reporting when a failure to find/mount the root device occurs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19774 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 18:09:15 +00:00
Axel Dörfler
7039ae3f3d Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 18:03:21 +00:00
Axel Dörfler
d1b0be94b0 * Private and temporary vm_caches now maintain their new virtual_base field, which allows
them to commit substantially less memory (we we're committing about 40 MB (!) too much
  after a complete system boot). This means you'll run out of memory less likely now.
* fill_area_info() no longer filters out kernel protection flags - we may want to keep
  filtering them when called from userland, though, dunno.
* Added new debugger command "avail" which shows how much memory has been committed, and
  how much is regarded as free space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19771 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-12 15:07:18 +00:00
Axel Dörfler
7ed5e61cdb arch_thread_init_tls() now accesses user memory safely, and therefore could now
fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-11 18:21:35 +00:00
Axel Dörfler
cdcb059571 * Renamed get_team_death_entry() to team_get_death_entry() and make it available
to other kernel components.
* wait_for_thread_etc() will now search the team's death entries in case the
  thread is already gone; also resume_thread() is now done later, and its return
  code will no longer matter (as we already have our death entry, no matter if
  the thread is gone now or not).
* The fibo_load_image test now works as expected (only tested with low numbers
  yet, though - the mean testing comes later (first comes functionality) :-))


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-09 23:58:59 +00:00
Jérôme Duval
9481ed48de updated to tzcode2007a
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19755 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-09 23:16:26 +00:00
Axel Dörfler
32e2879f10 We now ignore all memory beyond the 4 GB barrier in 32-bit mode.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-08 17:44:32 +00:00
Axel Dörfler
3e161fb661 * Instead of its home-brewn solution, mmu_init() now uses the functions declared
in addr_range.h to add ranges to the arrays. This fixes the crashing bug reported
  by Larry Baydak.
* Added some more exported functions to kernel_args.cpp (prototypes are in addr_range.h).
* TODO: let the PPC/OpenFirmware implementation use those as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19739 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-08 12:14:06 +00:00
Marcus Overhagen
aa86f3868f Cleanup naming of PXE stage2. It no longer interferes with zbeos build process.
You can build it using:

TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku-loader

Building the PXE stage1 using:

TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku

is still broken. however, it can be build using:

cd src/system/boot/platform/pxe_ia32/
as -o pxe_stage1.o pxe_stage1.S
ld --oformat binary --Ttext 0x7C00 -o pxe_stage1.bin pxe_stage1.o
cp pxe_stage1.bin /tftpboot/pxehaiku


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-06 13:46:41 +00:00
Axel Dörfler
ddcd53aaf0 * Instead of choosing the next thread if we skip one, we now choose the first thread
with a lower priority than the current one.
* Further reduced the probability to skip a thread to roughly 4%, that makes around
  13 skips per second, and about 40 msecs spend in lower priority threads per second
  (with a 3 msec quantum). Might still be too much, but we'll see.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-06 12:50:01 +00:00
Axel Dörfler
97ad772ada * Moved PXE page directory and page tables below the 1 MB limit.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-06 11:51:21 +00:00
Marcus Overhagen
6c3245f6a7 fixed error return in _Scan() function. now only returns B_OK when a device was found.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-06 01:04:09 +00:00
Axel Dörfler
9640130c40 Removed the R5 icon from the kernel resources - it can only be compiled for Haiku.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-05 20:16:48 +00:00
Axel Dörfler
92870c3b39 We always handled signals as if their SA_RESTART flag was set - but that's not
the default case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19711 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-05 19:27:48 +00:00
Axel Dörfler
4621a82e74 Our scheduler skipped over threads in about 30% of all cases - that's a bit much; it's
not a penalty to be the first thread in the run queue...
I've reduced it to about 12.5%, but that might still be too much.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19710 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-05 19:01:09 +00:00
Marcus Overhagen
dceaa55687 updated comment to account for PXE memory ranges
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-03 20:39:33 +00:00
Marcus Overhagen
ec9d1637b5 fixed copy & paste bugs
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19639 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 20:15:27 +00:00
Marcus Overhagen
db5b50665b Fixed gcc4 "error: cast from 'foobar *' to 'uint16' loses precision" problem by doubly casting.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19638 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 19:57:21 +00:00
Marcus Overhagen
203cf32414 Disabled debug output, but show errors with dprintf.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 19:30:33 +00:00
Marcus Overhagen
99784f5666 reduce debug output and add an additional test
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 19:21:31 +00:00
Marcus Overhagen
6d92b426ae Use only the immediate buffer to send data.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19635 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 19:18:30 +00:00
Marcus Overhagen
c4a05ef079 Determine client IP address and make it known to the ethernet interface.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19634 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 19:17:28 +00:00
Marcus Overhagen
6378dd7cf4 Fixed endian errors in UDP source and destination port handling.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 19:12:35 +00:00
Marcus Overhagen
569f4174e1 Fixed setting of the "don't fragment" bit, it was placed into the wrong byte.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19631 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 18:00:27 +00:00
Marcus Overhagen
03c2b46cdf fix build when TRACE is enabled
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19630 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 17:50:34 +00:00
Marcus Overhagen
c828668959 Return -1 when no data is available in receive hook, and 0 to indicate a retry, to make the net stack happy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19629 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 16:23:37 +00:00
Marcus Overhagen
57a88e1c79 Implemented UNDI ethernet interface, receiving frames already appears to work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-26 16:00:35 +00:00
Marcus Overhagen
5fd605e278 prettify formatting
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-25 03:05:00 +00:00
Marcus Overhagen
8456183dfd implemented the first pxe bios call
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-25 02:48:50 +00:00
Marcus Overhagen
578e3c2607 fixed the bugs, calling the pxe bios now works
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-25 02:48:08 +00:00
Marcus Overhagen
f7110a4231 first attempt to call the pxe bios, still untested
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-25 00:47:41 +00:00
Marcus Overhagen
84a31142ed Added some code to call real mode pxe bios functions, based on Axel's bios_ia32/bios.S
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19619 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-24 01:21:17 +00:00
Marcus Overhagen
0ecd75e986 Made the idt_descriptor symbol global to share it with pxe_ia32.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-24 01:18:52 +00:00
Marcus Overhagen
fd992230f6 Fixed pxe zbeos build, got broken by recent edid changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19617 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-24 01:02:24 +00:00
Axel Dörfler
d2de13bdd4 The boot loader (BIOS IA32 only) now chooses the default video mode by looking at the
EDID info from the monitor if available through VESA/DDC.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19588 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-21 14:20:17 +00:00
Axel Dörfler
9a4b4c617b * Fixed warning.
* Now using the new %f flag to print the level of support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-21 12:12:50 +00:00
Axel Dörfler
dedf1bccfe Since we're using floating point values at several places in the kernel, I added
a very simplistic floating point output routine to snprintf() and friends, for
your convenience.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-21 12:05:16 +00:00
Axel Dörfler
d6edf65b05 Fixed error checks for EDID retrieval.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-20 22:49:53 +00:00
Axel Dörfler
5d7d960fac Added EDID version 1 retrieval from VESA; doesn't do anything yet besides dumping the
info to the serial line - not tested yet (as Qemu doesn't support DDC/EDID).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19580 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-20 21:44:03 +00:00
Axel Dörfler
b5428267c7 This should fix the most often found kernel crash (on bootup):
* vm_soft_fault() did not take into account that a cache's source can change while
  traversing a cache chain.
* Now, we grab a reference to every cache we get before locking it, and
* no longer get the cache's source without having the cache locked.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-20 12:34:21 +00:00
Axel Dörfler
eb445177f9 * When a vm_cache is merged with another one, we now remove the consumer; that allows
for an extra check in vm_cache_release_ref() as the cache shouldn't have any areas
  or consumers at this point.
* Fixed a locking problem in vm_cache_remove_consumer(): the cache was acquired after
  its lock was gone, so someone else might have released in the mean time.
* if the cache's source is to be replaced, we now no longer release its lock after
  having merged it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-20 12:30:07 +00:00
Travis Geiselbrecht
02c92f8256 change the 'iospace' debug to use a more reasonable number of columns
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19563 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-19 03:27:50 +00:00
Axel Dörfler
6b507ddd46 Made set[e]gid() and set[e]uid() succeed in case they don't have anything to do.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19553 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-18 18:00:21 +00:00
Axel Dörfler
da758f9fce * team::args is now correctly filled in.
* the member will now also be shown when dumping a team.
* minor cleanup: moved fill_team_info() into the private functions part of the file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19551 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-18 12:56:27 +00:00
Travis Geiselbrecht
c4546ea038 A fix for the double-fault on bootup:
-Turns out the area removal routine had a massive race condition inside
vm_put_area(). Basically the area was removed from the address space's
area list before the pages were unmapped, so the vm could (and would)
recycle the space before the pages were finally unmapped.

It was completely reproducable on my machine during initialization of a bunch
of storage drivers that were bringing the locked_pool module into and out of
existence, which caused a thread to be spawned and stopped in rapid sucession.
On a dual processor machine, it was possible for the new thread to be started
up while the old one was still shutting down, and the kernel stack of the new
one would get wiped out.

Note, there still is a page ref counting problem with this area removal code.
It doesn't decrement the ref count of the page as it unmaps it. Will have to 
figure that out.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19549 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-18 09:38:00 +00:00
Travis Geiselbrecht
9bc7a58b1d Fixes a nit:
put a spinlock around the serial debug routines to keep multiple
cpus from interleaving their output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-18 07:23:39 +00:00
Travis Geiselbrecht
c3a89b90d3 fix the 'cache_ref' and 'cache' kdl commands
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-18 04:29:39 +00:00
Jérôme Duval
e20b9d2cf1 added missing asin asinf functions for ppc
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-13 21:06:18 +00:00
Axel Dörfler
a7854360ac Added vfork() as a wrapper to fork().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19491 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-13 14:50:14 +00:00
Marcus Overhagen
8d16d3335d added ethernet interface framework, taken from openfirmware boot platform
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-09 22:52:23 +00:00
Axel Dörfler
489caaef82 setitimer() allows the second argument to be NULL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-01 13:08:24 +00:00
Jérôme Duval
c20e9eefcd added a jam rule AddDriverRegistrationToHaikuImage to add device mappings on the image
commented the insertion of the attribute name in patterns in the case of a string attribute
notify_probe_by_file chooses a module based on a bus specific suffix
dm_register_child_device has a parameter to optionally check the support for the node
added scanning of bus devices after the boot filesystem is mounted
fixed dm_rescan, locking was misbehaving
fixed SYSTEM_DRIVER_REGISTRATION definition
added B_DRIVER_MAPPING attributes for PCI and ACPI devices:
  %vendor%_%device% for PCI, hid_%hid% and type_%type% for ACPI
moved acpi_device_module_info definition to public ACPI.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-29 19:09:45 +00:00
Stephan Aßmus
1f1316fc68 My first commit to the kernel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-19 00:30:18 +00:00
Axel Dörfler
35d3421dc5 Greatly enlarged the number of possible kernel_arg ranges as we were already
pretty close, and the number of loaded modules have a direct influence on
this (even though we're currently loading the symbols by default).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19320 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-17 15:42:42 +00:00
Jérôme Duval
01b06fcc52 commented raw type handling, as it doesn't work for now
added a user friendly mode for listdev: it works for PCI


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19262 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-12 17:22:29 +00:00
Jérôme Duval
bef4e1fc77 * each device manager node has now an autogenerated identifier
* added a generic syscall for device_manager
it enables to iterate the device manager tree from userland
* the listdev tool is now using it: it's still incomplete as it only dumps nodes and attributes


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19260 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-12 15:28:09 +00:00
Jérôme Duval
2bc2898a84 fix warning
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19251 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-10 20:26:54 +00:00
Jérôme Duval
c74d27255b avoid crashing at the end of the list
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-07 00:51:33 +00:00
Axel Dörfler
0ad660a168 Remap all preloaded executables read-only and executable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19180 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-02 20:38:30 +00:00
Marcus Overhagen
dd2413230f started the PXE UNDI network device support
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-25 21:48:08 +00:00
Marcus Overhagen
326862c203 removed usage of the 0x8d000 to 0x9ffff memory range, as its needed by PXE UNDI.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19126 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-25 20:27:09 +00:00
Marcus Overhagen
7613b42bcd copy of the original trampoline code, needs to be modified as UNDI needes the used address range
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19125 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-25 20:04:46 +00:00
Axel Dörfler
095ee89840 Fixed warning with debug info turned on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-25 15:29:41 +00:00
Marcus Overhagen
79372d08b0 Reduced allowed stage 2 size, as PXE and UNDI have memory reserved. Added comment explaining memory map.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-24 22:17:55 +00:00
Marcus Overhagen
a1939ee423 Modified the pxe_ia32 stage 1 loader to load stage 2 at the same address as bios_ia32 stage 1 does.
This allowes to actually execute the boot loader now. 
Need to use Ingo's remote_disk_server now for booting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-24 20:53:30 +00:00
Axel Dörfler
cf1f73778d Fixed PPC boot loader build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19061 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-13 12:10:55 +00:00
Axel Dörfler
d0d30c36ca The length of the extra field was not correctly determined, and the
offset was not changed correctly either: the order in which the
expression was evaluated was undefined; in fact, GCC 2.95.3 would use
the same buffer[index] twice.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19060 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-13 12:10:03 +00:00
Axel Dörfler
f5fc6356c4 Fixed a GCC 4 warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-13 11:37:00 +00:00
Axel Dörfler
d12497173a Fixed PPC kernel build (and a warning).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19058 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-13 11:35:28 +00:00
Axel Dörfler
6e7dc54655 Fixed GCC 4 warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19057 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-13 11:23:34 +00:00
Axel Dörfler
78d0219799 Fixed GCC 4 warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19056 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-13 10:49:08 +00:00
Axel Dörfler
57d9d07781 * Fixed another big bug that the new heap revealed: when loading an image failed,
it was never removed from the sLoadedImages list - and thus, would happily
  access invalid memory.
* get_next_image_dependency() is now using the global lock as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19047 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-11 17:50:06 +00:00
Axel Dörfler
5cfd3a1592 The heap now grows if needed; this allows VLC to load all of its plugins.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-11 17:45:13 +00:00
Axel Dörfler
6f0994d460 * Switched to the boot loader's heap implementation.
* This sane heap revealed a bunch of bugs (like sLoadedImageCount not being
  maintained that was used for various allocations).
* If the allocation of the image fails, opening the app will now just fail
  instead of crashing of overwriting random data (IOW VLC will now load
  okay, but cannot load some of its add-ons anymore).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19045 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-11 16:02:43 +00:00
Axel Dörfler
3862cbfeee Fixed a potential buffer overflow error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-11 13:54:51 +00:00
Axel Dörfler
4e4c58037e Implemented collapsing forked vm_cache object chains when they become unused.
This fixes bug #227 by closing that memory and semaphore leak.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19041 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-10 22:47:00 +00:00
Axel Dörfler
bcf2f8133b * Fixed a big memory leak: vm_delete_areas() did not put the reference of the
address space of reserved areas - IOW address spaces were never freed upon
  team exit.
* dump_cache() now prints a list of the cache's consumers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-10 22:42:12 +00:00
Axel Dörfler
45894e1088 Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19039 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-10 22:39:57 +00:00
Axel Dörfler
a7181e951d Accidently turned on printing stack traces with the last commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19037 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-10 17:27:03 +00:00
Axel Dörfler
0b8e0bfc08 Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19036 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-10 17:25:38 +00:00
Axel Dörfler
d593e74a27 First steps towards being able of collapse vm_cache objects after forking:
* a vm_cache now maintains a list of its "consumer" caches.
* introduced to new functions that add/remove consumer to a cache (instead
  of only maintaining the vm_cache::source field).
* fixed the incorrect reference counting when doing copy-on-write; we kept
  one ref too many of the lower cache.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-10 17:16:06 +00:00
Marcus Overhagen
ffffd44b12 Moved switching to protected mode into stage1 loader, so code above 1MB can be executed in protected mode.
Executing the stage2 loader works now, up to the point where mmu_init() reuses the same address space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-08 20:17:03 +00:00
Marcus Overhagen
4ba8420ca5 save and restore destination address
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-08 19:10:53 +00:00
Axel Dörfler
3cf73255de The Haiku startup code now exports a symbol called __gHaikuStartupCode. This can
be used to determine wether or not the executable was linked for/under Haiku or
not (ie. BeOS).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-06 12:19:20 +00:00
Axel Dörfler
e979f4bac7 get_image_symbol() and get_nth_image_symbol() now accept NULL arguments for the
location and type parameters.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19010 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-06 12:17:06 +00:00
Axel Dörfler
0d7ec13a82 Simplified a bit, removed unneeded function stubs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-06 11:46:23 +00:00
Axel Dörfler
7f4e6824df Added a private call to get the dependencies of a loaded image. This will be used
to determine linkage of libnet.so vs. libsocket.so/libbind.so in the libnetwork.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-06 11:40:20 +00:00
Marcus Overhagen
b488dcdbad modified, but still wrong
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-04 23:39:19 +00:00
Marcus Overhagen
5fc3827fb4 removed some unused code. not finished yet
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-04 23:11:30 +00:00
Axel Dörfler
8d9e5a451e * Turned on debugging in the Intel partitioning system add-on, and the partition
stuff of the boot loader to help with bug #238.
* Minor cleanup (added license headers, fixed debug output)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-29 13:13:02 +00:00
Axel Dörfler
02cc779b7d Moved datastore implementation into net_buffer.cpp - there is no reason to clobber the kernel with it.
This also fixes the issue of exporting a C++ API from the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-28 18:27:30 +00:00
Axel Dörfler
5af206180e Removed executable property.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-28 18:09:27 +00:00
Marcus Overhagen
83bf699b3f some build fixes for pxe_ia32 platform
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-28 12:52:20 +00:00
Marcus Overhagen
7c3aba03bc git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18961 a95241bf-73f2-0310-859d-f6bbb57e9c96 2006-09-28 12:03:26 +00:00
Marcus Overhagen
47e8242b26 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18960 a95241bf-73f2-0310-859d-f6bbb57e9c96 2006-09-28 12:02:58 +00:00
Jérôme Duval
1ba8377d45 releases the team lock even when group is NULL
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-27 08:30:15 +00:00
Axel Dörfler
d9766fe30b * Changed team_get_process_group_locked() to have a session parameter instead
of a team to avoid confusion. It now also accepts a NULL session pointer in
  which case the actual group's session doesn't matter.
* Fixed the race condition in send_signal_etc() that could allow accessing an
  invalid team pointer.
* Jerome's earlier change already fixed bug #841, and this also fixed bug #855.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-26 12:51:59 +00:00
Jérôme Duval
dc0bf743e1 fix the build for the stage 2 pxe
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 22:35:35 +00:00
Marcus Overhagen
c69902c5fc initial attempt to build platform target pxe_ia32
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 16:40:38 +00:00
Marcus Overhagen
c6bbe85233 make boot loader platform dependant
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 15:52:46 +00:00
Marcus Overhagen
fa38d53374 make boot loader platform dependant
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 15:51:02 +00:00
Marcus Overhagen
bf905142eb make boot loader platform dependant
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 15:50:41 +00:00
Marcus Overhagen
97de040e29 make boot loader platform dependant
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18922 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 15:49:10 +00:00
Marcus Overhagen
88dde23969 just start a little higher
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 14:48:37 +00:00
Marcus Overhagen
931460f676 copied from boot_loader.ld
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18920 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 14:32:16 +00:00
Marcus Overhagen
d68ec99f12 copied from src/system/boot/platform/bios_ia32/Jamfile
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 14:28:58 +00:00
Marcus Overhagen
36020a912d copied from src/system/boot/platform/bios_ia32/shell.S
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-25 14:25:58 +00:00
Jérôme Duval
0de38aa00b added needed symbols for gcc4 linking
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-23 14:01:49 +00:00
Marcus Overhagen
9993ff374a load stage 2 image at address 1MB and execute it
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-21 15:53:43 +00:00
Niels Sascha Reedijk
5fe9705942 Fix the fix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18899 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-21 08:21:55 +00:00
Niels Sascha Reedijk
1a2f476148 Build broke in r18896. Fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-21 06:57:22 +00:00
Andrew Galante
b425ce77ad A helper datastructure for network buffers. Defines a fixed-size region of same-size data blocks, and maintains a reference count for each
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-21 02:40:20 +00:00
Marcus Overhagen
46564600a4 Fixed server IP detection. Implemented TFTP file size request and connection setup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18895 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-21 02:15:39 +00:00
Jérôme Duval
d75882bf8b finally add a good tmpfile function
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-19 14:31:40 +00:00
Jérôme Duval
13510b4105 added oldtmpfile.c to libroot.so, hopefully should fix bug #857
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-19 13:41:01 +00:00
Jérôme Duval
65afc3a011 also dump group and session ids
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18887 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-19 09:40:09 +00:00
Jérôme Duval
46a7b50c3b try to better handle signal for teams
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-18 22:51:07 +00:00
Marcus Overhagen
b8759025a9 PXE stage 1 bootloader for Haiku
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-18 21:51:07 +00:00
Marcus Overhagen
20e1d3e5e2 added _Unwind_* to make the gcc 4 linker happy, but I'm not sure if this is the correct way.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-17 00:05:21 +00:00
Marcus Overhagen
82029bdae8 added missing nothrow parameter
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18868 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-16 23:25:56 +00:00
Marcus Overhagen
a07acab41b fixed assembly code to compile with gcc 4.0.3. the original code was invalid, as there is no mov instruction to
move a 16 bit segment register into 32 bit memory location, and movzx (called movzwl within gcc) doesn't work with 
segement registers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-16 20:40:19 +00:00
Marcus Overhagen
6639eae245 prevent possible crash
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-16 19:58:41 +00:00
Axel Dörfler
5bab2844c1 This fixes the crashing bug #849. Unfortunately, it still crashes, just at a different location.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-12 00:22:10 +00:00
Marcus Overhagen
a6e8772d9f fix debug output
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18807 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-11 16:37:02 +00:00
Jérôme Duval
4c3702d42a moved rescan call to vfs_mount_boot_file_system() as suggested by axeld :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18738 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-04 13:10:08 +00:00
Jérôme Duval
d564275ba7 added disk systems rescan to DiskDeviceManager, and called it in the post init phase
the next step would be to rescan the partition tree with a job to recognize unrecognized partitions (asynchronously ?)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18737 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-04 12:37:56 +00:00
Axel Dörfler
9b906ccf04 * You can now create the block cache in read-only mode (using an additional
parameter during construction).
* Doing so will now result in a kernel panic whenever your file system tries to
  write to a block.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-30 23:18:31 +00:00
Axel Dörfler
793f542244 Added a comment about the outcome of a potential problem.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-30 23:12:31 +00:00
Axel Dörfler
c40fe37f0b * Reverted the changes r17693 made to vfs_get_vnode_cache(); instead, vm_create_vnode_cache()
will now grab a reference to the vnode as well if successful. This way, vfs_get_vnode_cache()
  now actually works how it should: it will now always grab a reference to the cache and
  its underlying vnode. This removes an extra reference to the vnode (and vm_cache) that
  got ignored before and prevented volumes to be unmounted (or file caches to be removed).
  Thanks to Korli for pointing this out.
* file_cache_create() is now aware of that extra vnode reference and releases it; unmounting
  volumes is now working again as it should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-30 23:09:04 +00:00
Axel Dörfler
96d67014ff Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-30 23:00:58 +00:00
Axel Dörfler
190aa14f19 * Use user_strlcpy() instead of this scary combination of strnlen() and user_memcpy().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-30 22:39:20 +00:00
Axel Dörfler
022567d3a0 Dumping semaphore info in the kernel debugger will now print the whole queue
of waiting threads by ID (instead of just the queue head and tail pointers).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18688 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-29 11:05:22 +00:00
Axel Dörfler
be0e738496 * send_signal_etc() now handles a pid_t of -1 specially, but not yet really correct
(that was part of the problem of bug #702).
* Fixed send_signal_etc() when you called it with a pid_t of zero: the signals should
  go to all teams in the calling team's group, not only to the team (for -1, we do
  the same for now).
* Made team_get_process_group_locked() public, and rewrote send_signal_etc() to use
  it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-29 01:41:16 +00:00
Axel Dörfler
567f38888f kill_thread() and friends are supposed to check the passed in thread_id or else
some signals could go to some group when a negative value was passed in.
This actually fixes bug #702 where SoundPlay obviously does a kill_thread(-1)
at the end (which accidently killed all userspace applications, including the
input_server, app_server, ...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-29 01:36:54 +00:00
Jérôme Duval
4e93a7f238 fixed some warnings
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18659 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-28 10:20:45 +00:00
Jérôme Duval
56e00b3afe tzoffset is in seconds
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18651 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-27 19:03:50 +00:00
Axel Dörfler
f8b41f8219 Moved functions around, so that the static private functions are at the top.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-24 23:41:54 +00:00
Axel Dörfler
6961cdf6f2 Process groups are no longer searched via their team/session, but by using a separate
hash. This also allows them to stay valid after the group leader died when there are
other teams left in it. This closes bug #1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-24 22:58:48 +00:00
Axel Dörfler
3e975f9210 Minor cleanup; renamed some global static variables to match our style guide.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-24 22:29:54 +00:00
Jérôme Duval
355efe3ec1 improve debug command vnode_cache: it now accepts a device arg
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-24 20:54:24 +00:00
Axel Dörfler
48096634af Enabled private BeOS syscalls for the build with GCC 4 as well for now, until
this issue has been solved in the code that needs them (which is the same as
the PPC version also does at this time).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-22 20:48:12 +00:00
Jérôme Duval
5ed5c96602 updated these files to glibc 2.3.5
hopefully it should fix bug #754


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18549 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-21 15:05:59 +00:00
Axel Dörfler
c33ac538c4 Semaphore could get interrupted by a pending signal, even if that signal was blocked.
This fixes the failure of the fork test 12-1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-21 12:02:18 +00:00
Axel Dörfler
26a9fcd6ab * set_alarm() now correctly returns the time left for the currently active
alarm, or 0 if there isn't any.
* setitimer() now also sets the previous timer values correctly, so that
  alarm() and ualarm() now return the correct values as well - this fixes
  the test fork_9-1 failing at alarm().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-20 22:44:53 +00:00
Axel Dörfler
505347b0b2 Threads are now removed from the hashtable earlier, so that a kill() following
a waitpid() can no longer succeed; this fixes the occasional fork 3-1 test failures.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18544 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-20 21:34:25 +00:00
Axel Dörfler
2b6a368811 wait_for_child() could eventually hang until another team exited (or forever if
it waited for a specific child), as B_RELEASE_ALL opened up a race condition between
looking for an existing death entry, and waiting for the dead children semaphore.
Now we're counting all waiting threads for teams and groups separately.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-20 21:27:12 +00:00
Stefano Ceccherini
152808170e Reverted the previous change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-18 10:18:10 +00:00
Stefano Ceccherini
08c1246909 In case of error, errno should be set to a positive value. Yeah, I know,
it's sick.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-18 09:40:12 +00:00
Stefano Ceccherini
c941d45cd5 oldSet shouldn't be changed in case of error. Thanks axel for noticing
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-18 09:37:32 +00:00
Stefano Ceccherini
0ce93ee730 the signal block mask is inherited by the child process on fork()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-18 08:26:37 +00:00
Stefano Ceccherini
a5a36fe421 the second parameter of sigprocmask() can be NULL
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-18 08:00:07 +00:00
Axel Dörfler
79dd3d935a * The parent/group dead semaphores are now released a bit earlier to make
wait_for_child() hanging less probable - there is a general problem with
  this code, though, as we need to have a dedicated free counter for the
  semaphore to remove all race conditions.
* Also, test fork_3-1 still sometimes fails because the thread is still
  available to the public for a short time, even after its death entry
  has been collected.
* Added a TODO in the code for these issues.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18529 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-17 21:45:37 +00:00
Axel Dörfler
73a56f1bac * wait_for_child() (the backend to waitpid()) did not work correctly in case you
wanted to wait for a specific child; it always assumed you had specified WNOHANG.
  This fixes the bug the fork_3-1 and fork_4-1 test applications reported. 3-1 still
  sometimes fails, but that's a different problem (to be solved later).
* Also, it could return B_BAD_THREAD_ID instead of the expected ECHILD (for waitpid()).
* There was a race condition between testing for a thread, and checking its death
  entry.
* wait_for_child() can now be interrupted in case it has to wait.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-17 21:40:55 +00:00
Axel Dörfler
d024bdc9e6 kill() is supposed to return ESRCH instead of B_BAD_THREAD_ID.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18527 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-17 19:59:44 +00:00
Jérôme Duval
44d5675324 KernelAddon and KernelStaticLibrary don't include kernel, kernel arch, boot platform headers anymore.
Fixed the build of most of targets using these rules. Though the build can be still broken, feel free to fix.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18521 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-17 12:18:11 +00:00
Axel Dörfler
0240ccffa0 Don't use <new.h> - there is <new> for you.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-11 20:08:51 +00:00
Axel Dörfler
01b2099116 Added __eieio() function to let etherpci build on PPC, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18489 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-11 19:47:00 +00:00
Axel Dörfler
36788b7119 * Added strptime() to the build again,
* also defined STD_INSPIRED again, which lets localtime.c add some non-POSIX
  behaviour for now (needed by strptime()) - we should find a better solution
  to this, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-07 16:45:33 +00:00
Jérôme Duval
6a6c43798f have ring_buffer built on non-haiku platforms
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-04 19:20:01 +00:00
Axel Dörfler
b526381437 Removed unused header as pointed out by Korli.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-03 22:24:03 +00:00
Axel Dörfler
21470984c8 Added utimes() implementation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-01 11:02:32 +00:00
Axel Dörfler
05c0dde554 Uh, the reason why ping did only work once, was because set_alarm() did not call
the existing syscall...
The second ping now ends in a kernel panic, though 8-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-26 13:19:52 +00:00
Oliver Tappe
b66ae2c9c8 - moved dumpBlock() into debug.c, renamed it to dump_block() and added it
to kernel-exports.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-25 19:46:36 +00:00
Bruno G. Albuquerque
bcf475ec65 Made our version of is_computer_on_fire() behave like the BeOS one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-25 00:26:03 +00:00
Axel Dörfler
3505a2a792 Moved gdb.h header file into debug directory, no other component needs to access it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17962 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-29 16:04:24 +00:00
Axel Dörfler
13e6b02018 * Removed some unused headers.
* Removed unused pools implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-29 15:24:40 +00:00
Axel Dörfler
4e26bc08b8 user_copy_strings_array() no longer puts 2k on the stack, but allocates a 16k
buffer to allow safe access of the user provided string - maybe we should
introduce a user_strdup() instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-29 15:23:34 +00:00
Axel Dörfler
89ae57ba77 Removed sysctl(), there is no need for this BSD-ish call.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-29 09:37:06 +00:00
Axel Dörfler
9150d65c83 Removed some unused old networking stuff, cleaned syscalls.c.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17946 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-28 14:54:58 +00:00
Axel Dörfler
fe7f3a2f1d Now supports symbolic links correctly, and no longer loads the same shared
library twice.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-27 00:07:42 +00:00
Axel Dörfler
0cd3c003d1 While investigating how our deals with doubled shared libs, I found two
issues:
* Our glue code was broken after all - it allowed Haiku apps to start under
  BeOS (and vice versa), but the initialization/termination functions were
  called with an invalid image ID - on *both* sides! As it turns out, the
  Be glue code did *something* with %ebx, but certainly didn't put the image
  ID in there, but just passed it on the stack, as we did before (just in
  the wrong order...). Therefore, the arch_call_init_term stuff is not
  necessary.
* When unloading add-ons, their termination functions were never called, as
  the image (for get_image_symbol()) was already made inaccessible, and
  therefore the symbol couldn't be found.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-26 22:09:13 +00:00
Jérôme Duval
577bebe552 pthread_exit has to be called on thread exit, it doesn't return, thus we don't care about the routine return code
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-22 10:00:17 +00:00
Axel Dörfler
f62d3b77aa Added a list_get_last_item() call - one day we should make most of them inline.
Or use the C++ list implementation where possible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17901 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-21 16:13:34 +00:00
Axel Dörfler
0ba0370464 Use B_MAX_SYMLINKS instead of SYMLINKS_MAX (which also fixes the build, btw).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17900 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-21 15:44:46 +00:00
Jérôme Duval
954f408f50 * PTHREAD_MUTEX_INITIALIZER inits to NULL, pthread_mutex_lock now call pthread_mutex_init to support this PTHREAD_MUTEX_INITIALIZER
* pthread_key_create and pthread_key_delete now manages correctly a list of key/destructor
* pthread_create now uses a private thread function to add a "on_exit_thread" call for destructors
* pthread_join now returns B_OK in every case, and, as a joinable thread could already be gone, wait_for_thread would not find it


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17895 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-21 14:07:34 +00:00
Axel Dörfler
7b3d36e5aa * BEntry::GetStat() and BNode::GetStat() used sizeof(struct stat) for the kernel
syscall, but they could not know if R5 code called them (in which case the stat
  size has a different size). We now always only return the R5 stat structure here.
  This fixes bug #420. We might want to find a different solution to this problem,
  though.
* Be got SYMLINK_MAX wrong - it's not the maximum number of links (that's SYMLOOP_MAX),
  but the maximum size of a symlink buffer. Added missing SYMLOOP_MAX and SYMLINK_MAX
  constants to limits.h.
* Fixes MAXSYMLINKS to use SYMLOOP_MAX, instead of SYMLINKS_MAX (which doesn't exist
  in POSIX specs, but we (intentionally) break source compatibility here).
* Reenabled the Haiku versions of stat(), fstat(), and lstat() when build for Haiku.
* Removed OpenBeOS namespace stuff from the files I touched.
* Removed superfluous StorageDefs.Private.h, whyever that ended up in a public header
  is beyond me.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-21 13:49:16 +00:00
Jérôme Duval
c345b8eb08 fix error return codes for posix compatibility
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-20 22:14:54 +00:00
Jérôme Duval
1f11178f97 added posix thread specific data functions
added a pthread_detach skeleton


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-20 12:27:46 +00:00
Jérôme Duval
a23efdfa79 added some pthread_* and pthread_attr_* naive functions
I mapped pthread_t to thread_id for simplicity


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17879 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-20 11:05:58 +00:00
Axel Dörfler
9f53e3dccf Fixed build for non-Haiku targets.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-16 14:32:05 +00:00
Axel Dörfler
cce6f8d05f * Changed the kernel build rules, so that the executables can have resources
files, too.
* Added a temporary icon for the kernel until Stephan comes up with a better
  one (hint hint!) :-))
* This even fixes bug #648.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17825 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-13 16:08:55 +00:00
Axel Dörfler
d51ce54011 * Added the opportunity to add temporary debug interrupt handlers for
arch dependent code (they will be removed as soon as someone else
  asks for these interrupt lines).
* Added an interrupt driven keyboard handler to the kernel that uses
  this technique. As a result, you can now press F12 to enter the kernel
  debugger before the input_server has been started, and Control-Alt-Delete
  should reboot the system (actually I did not test the latter yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-12 22:24:53 +00:00
Axel Dörfler
d367028c04 Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17801 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-12 21:53:00 +00:00
Axel Dörfler
2da9a41214 When calling debugger(), it will now (temporarily) dump a message to serial output
as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17760 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-07 15:11:39 +00:00
Axel Dörfler
8265e1210c Implemented mandatory file locking, BeOS style. BNode::Lock() and BNode::Unlock()
are now working as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-02 14:16:13 +00:00
Axel Dörfler
acac7c6834 _vm_map_file() did in fact not work correctly, but the main problem was
vfs_get_vnode_cache() which did not acquire an extra reference to the
cache_ref when the cache had to be created.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-01 18:21:21 +00:00
Axel Dörfler
a9fa017d82 map_backing_store() did not acquire a cache ref in case it created a private
mapping, but it connected the vm_cache objects, so if it failed later, and
thus called vm_cache_release_ref() the object could have been freed accidently.
Most uses of map_backing_store() explicetly acquired a cache_ref *after* the
call was successful, but _vm_map_file() did not do this.
_vm_map_file() might still not work correctly, though, need to have a closer
look at it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-01 18:14:59 +00:00
Axel Dörfler
3728e62e88 Unlike the ELF specs, BeOS ignores the path of shared objects specified by the DT_NEEDED
element. We now soften the rule that the absolute path should be used, and give libraries
another chance and search them in the standard search paths. This fixes bug #601 and lets
Becasso run on Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17669 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-31 15:59:42 +00:00
François Revol
84aae13f6d Fix null deref; include \0 when copying paths
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-31 00:01:01 +00:00