Commit Graph

5459 Commits

Author SHA1 Message Date
François Revol
cf7f92c013 bootloader: Use stage2_args:arguments_count
The code probably doesn't work correctly yet though,
I believe only the last line will be taken into account.
2013-10-15 22:15:04 +02:00
François Revol
70b50f3865 bootloader: Set stage2_args:arguments_count when needed 2013-10-15 22:15:03 +02:00
François Revol
8fa75a8cca ARM: Add a fallback atomic_add() for bootloader
When ATOMIC_FUNCS_ARE_SYSCALLS atomic.S doesn't export it,
but it's used by packagefs.
2013-10-12 19:43:33 +02:00
Oliver Tappe
8b08992799 Implement shebang-fixup for /usr/bin/env to runtime_loader.
* silently replace invocations /usr/bin/env with /bin/env
2013-10-11 13:00:33 +02:00
Ingo Weinhold
28fcae227c Stage 1 boot loader: Load the first file matching haiku_loader*
This allows naming the boot loader package canoncically. Due to code
size limitations we cannot perform a more correct name check, but there
shouldn't be any other entries in the packages directory with a name
with "haiku_loader" prefix, anyway.
2013-10-10 00:40:10 +02:00
François Revol
c19c9e08ef libroot: Pass members to filter as on-target variable 2013-10-09 22:04:36 +02:00
François Revol
158604494b libroot: Style fix 2013-10-09 22:04:35 +02:00
Ingo Weinhold
066d508682 boot loader: Support loading haiku-*.hpkg
... i.e. properly canonically named Haiku system packages.
2013-10-09 03:48:25 +02:00
Ingo Weinhold
0262f55a51 boot loader heap: Remove left over debug variables 2013-10-09 03:48:25 +02:00
François Revol
4d5508263e libroot: Properly fix linking with libgcc without cmdline overflow
Instead of listing all the objects we want from the libgcc archive
we just make a copy of it and remove those we don't want, and link
to it.

This should allow returning MAXLINE in jam to a sane value.
2013-10-08 23:34:57 +02:00
Ingo Weinhold
ea4f2ac2dc boot loader: Optimize heap implementation
* Increase general allocation alignment from 4 to 8 byte. That was even
  incorrect.
* Use a splay tree instead of a singly linked list to manage the free
  chunks. That increases the size of the per-chunk structure to manage
  the free chunks, i.e. the of minimally allocatable memory size (from
  align(sizeof(void*)) to align(3 * sizeof(void*))), but make finding
  and inserting chunks much faster.

Fixes #10063 respectively improves the situation significantly.
2013-10-08 21:03:50 +02:00
Ingo Weinhold
e1b63b4fb8 boot loader: mount_file_systems(): Fix warning 2013-10-08 21:03:50 +02:00
Ingo Weinhold
33def4258e boot loader: bios IA32: Add optional timestamps to debug output 2013-10-08 21:03:49 +02:00
Ingo Weinhold
635d2ac485 Add some missing B_USER_*_DIRECTORY constants 2013-10-06 01:13:22 +02:00
Ingo Weinhold
de49e34927 Add symbol versioning for find_directory()
Should already have been done back when the semantics for the
B_COMMON_*DIRECTORY constants was changed.

Currently old and new version behave the same. So this is just a
contingency measure ATM.
2013-10-05 01:33:26 +02:00
Ingo Weinhold
c471444a33 find_directory(): Fix build 2013-10-05 01:33:26 +02:00
Ingo Weinhold
38fa81bf8f Remove B_COMMON*_DIRECTORY and kCommon*Directory constants
* This does intentionally break source compatibility, so that a review
  of concerned code is forced.
* Binary compatibility should be maintained in most cases. The values
  of the constants for the writable directories are now used for the
  writable system directories. The values for the non-writable
  directories are mapped to "/boot/system/data/empty/...", an empty or
  non-existent directory, so that they will simply be skipped in search
  paths. Only code that explicitly expects to find something in a
  B_COMMON_* directory, will fail.
2013-10-04 02:30:30 +02:00
Ingo Weinhold
45b3329d9f Fix incorrect uses of getpwuid_r()
The function's behavior was recently fixed to succeed, but return a NULL
pointer, when the entry was not found. Fixes a crash in this case.
2013-10-03 21:55:26 +02:00
Ingo Weinhold
4b7e219688 Remove /boot/common for good
* Remove support for the "common" installation location from packagefs,
  package kit, package daemon, package managers.
* Rename the B_COMMON_*_DIRECTORY constants referring to writable
  directories to B_SYSTEM_*_DIRECTORY.
* Remove/adjust the use of various B_COMMON_*_DIRECTORY constants.
  I'm sure some occurrence still remain. They can be adjusted when the
  remaining B_COMMON_*_DIRECTORY constants are removed.
2013-10-03 21:52:25 +02:00
Ingo Weinhold
ded25be197 runtime loader: 64-bit ktrace output fixes 2013-10-03 21:52:25 +02:00
Ingo Weinhold
f73f5d4c42 Initial changes to remove /boot/common
* find_directory() and hard-coded paths use /boot/system instead of
  /boot/common.
* The build system creates the writable directories in /boot/system
  instead of /boot/common.
* The build system no longer installs any packages in /boot/common.
2013-10-03 21:52:25 +02:00
Jérôme Duval
a2a5b28214 Fixed x86_64 broken build introduced in hrev46161. 2013-10-01 23:31:04 +02:00
Sam Toyer
97d6f117e3 Add s_tanhl.c to x86 jamfile
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2013-10-01 19:48:55 +02:00
Sam Toyer
2a6a28e4bb Add s_ldexpl.c to x86 jamfile
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2013-10-01 19:48:53 +02:00
Sam Toyer
894dfa1e75 Add glibc ilogbl implemenation
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2013-10-01 19:48:52 +02:00
Pawel Dziepak
ffd5393620 kernel/util: Make exit() available in bootloader as well 2013-10-01 19:31:48 +02:00
Pawel Dziepak
7aecb0b276 kernel/util: Make exit() available in kernel mode
Since we are using libraries originally intendent for user mode in kernel
mode providing them with some userland functions is inevitable. This
particular patch is to make zlib happy and able to call exit() when
its debug assertions fails.
2013-10-01 15:51:07 +02:00
François Revol
68bccdf6b4 M68K: More gcc options fixes 2013-09-30 04:21:41 +02:00
François Revol
4046c49f88 M68K: Account for extra parameter to create_area_etc()
Would have been nice to also fix 68k code... just sayin.
2013-09-30 04:15:27 +02:00
François Revol
835545cfd1 M68K: drop dupplicate strlen
Seems we have our own now.
2013-09-30 04:09:27 +02:00
François Revol
f7d6c2f8e5 M68K: Switch to new gcc options for specifying cpu
Latest gcc converts the old ones to the new ones anyway...
including when passing to gas, which of course is not new enough,
so we have to also force gcc to pass the old one around in one case.
2013-09-30 04:02:21 +02:00
François Revol
5e0e2739c9 ARM: work around too many libgcc objects when linking libroot
jam fails in execve() trying to run the command due to
a too large arguments list because of the many objects in libgcc.

We split them into two intermediate objects,
then we link them to libroot.
2013-09-30 00:37:06 +02:00
François Revol
f9ab70a1d1 Guard the __sync_* atomic helper with __ARM__
I didn't notice I was adding to a generic file.
2013-09-29 22:43:34 +02:00
François Revol
c436d67da4 ARM: Add note about updating libstdc++
The __sync_fetch_and_add_4() helper is deprecated in newer GCC,
and should be droped when we update libstdc++.
2013-09-29 21:02:11 +02:00
François Revol
75453edc01 ARM: Add a C version of __sync_fetch_and_add_4()
It just calls atomic_add().

No need for the asm version, it doesn't need to depend on defines.
2013-09-29 19:46:41 +02:00
François Revol
735ec4c018 ARM: Add longjmp_return.c to the libroot built
Linking was failing with undefined reference to __longjmp_return.
2013-09-29 04:03:09 +02:00
Ingo Weinhold
81291304ad Merge remote-tracking branch 'haiku/master' into package-management
Conflicts:
	build/jam/BuildSetup
	build/jam/HaikuImage
	build/jam/board/sam460ex/BoardSetup
	build/jam/board/verdex/BoardSetup
	data/catalogs/apps/icon-o-matic/fr.catkeys
	src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp
	src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp
	src/apps/debugger/files/FileManager.cpp
	src/apps/debugger/files/FileManager.h
	src/apps/debugger/user_interface/gui/inspector_window/MemoryView.cpp
	src/apps/haiku-depot/MainWindow.cpp
	src/apps/haiku-depot/MainWindow.h
	src/apps/haiku-depot/Model.cpp
	src/apps/haiku-depot/PackageInfo.h
	src/apps/haiku-depot/PackageInfoListener.h
	src/apps/haiku-depot/PackageInfoView.cpp
	src/apps/haiku-depot/PackageInfoView.h
	src/apps/haiku-depot/PackageListView.cpp
	src/apps/haiku-depot/PackageListView.h
	src/system/kernel/arch/arm/arch_timer.cpp
	src/system/libroot/os/arch/arm/atomic.S
	src/tools/translation/bitsinfo/Jamfile
	src/tools/translation/bmpinfo/Jamfile
	src/tools/translation/tgainfo/Jamfile
2013-09-27 01:55:45 +02:00
Jérôme Duval
1bc85a38d5 libroot: spawn_thread() now creates a detached pthread.
* __pthread_destroy_thread() will in turn free the pthread_thread object.
* this fixes a leak of 2072 bytes on each thread construction/destruction
and #9945. MediaExtractor spawns a thread on construction, which leaked
its pthread_thread object on destuction.
2013-09-26 21:30:59 +02:00
Pawel Dziepak
afaa6ed4b3 x86[_64]: Randomize initial stack pointer on alternative signal stacks
If the alternate signal stack is used randomize the initial stack
pointer in the same way it is randomized on "normal" thread stacks.
Also, update MINSIGSTKSZ value so that regardless of where the new
stack pointer points to there is at least 4k of stack left.
2013-09-21 21:52:13 +02:00
Ithamar R. Adema
e7c330c6f3 ARM: improve error output, fix iframe reporting. 2013-09-19 03:15:06 +02:00
Ithamar R. Adema
1847d8c486 ARM: user_memcpy/memset/strlcpy: fix my horrible ARM assembly
Turns out I was way to green (and tired) last year to code this properly...
now they finally work and the kernel is a lot more stable for it.
2013-09-18 22:20:17 +02:00
Ingo Weinhold
de15b85e5c getgr{nam,gid}[_r](): Fix retrieving group members 2013-09-18 16:33:16 +02:00
Ingo Weinhold
fb8a9c4710 getpw{nam,uid}[_r]: Fix return value behavior
... when the user is not found.
2013-09-18 16:33:16 +02:00
Ingo Weinhold
222fb7a91a getgrgid_r()/getgrname_r(): Fix group not found return value 2013-09-18 16:33:16 +02:00
Ingo Weinhold
9a85313bc6 X86PagingStructuresPAE: Zero fPageDirPointerTable in constructor
... and use it as a guard in the destructor. Fixes crash when running
out of memory and Init() is not called.
2013-09-18 16:33:15 +02:00
Ithamar R. Adema
501b24c63b ARM: kernel: Make 32/64-bit atomics work for ARMv5/6
Support for 64-bit atomic operations for ARMv7+ is currently stubbed
out in libroot, but our current targets do not use it anyway.

We now select atomics-as-syscalls automatically based on the ARM
architecture we're building for. The intent is to do away with
most of the board specifics (at the very least on the kernel side)
and just specify the lowest ARMvX version you want to build for.

This will give flexibility in being able to distribute a single
image for a wide range of devices, and building a tuned system
for one specific core type.
2013-09-18 05:03:18 +02:00
Ingo Weinhold
6dee6653c2 When switching to PAE don't copy not needed PTEs
Now we check whether the virtual address corresponding to the PTE lies
in an allocated virtual address range. This fixes a cause of #8345:
The assertion would trigger when such an entry was encountered. There
might be other causes that trigger the same assertion, though.
2013-09-18 00:42:45 +02:00
Ingo Weinhold
372a666344 X86VMTranslationMapPAE: Add some ktracing for page (un)mapping 2013-09-18 00:42:45 +02:00
Ingo Weinhold
6508ce9f52 X86VMTranslationMapPAE::Map(): More info in assert 2013-09-18 00:42:44 +02:00
Ingo Weinhold
bcb7463650 arch_vm_translation_map_early_map(): Fix debug output 2013-09-18 00:42:44 +02:00