Commit Graph

42619 Commits

Author SHA1 Message Date
Alex Smith
8846189866 Handle 64-bit load addresses for ELF64 images in the bootloader.
The ELF loader now uses a new platform function, platform_allocate_elf_region,
which returns 2 addresses: the real load address and an address where the
region is mapped in the loader's address space. All of the ELF loading code
has been changed to access the load region through the mapped address rather
than the addresses contained in the ELF image. The ELF64 version of
platform_allocate_elf_region on x86 uses the existing MMU code, which maps
everything at 0x80000000, but returns the correct 64-bit address. The long
mode switch code will just set up the 64-bit address space with everything
remapped at the correct address.
2012-06-24 22:57:48 +01:00
Alex Smith
f6a3444449 Added x86_64 ELF64 relocation functions for the bootloader. All that's left to do now is handle the 64-bit load address properly. 2012-06-24 19:22:33 +01:00
Alex Smith
c2656eb9bd Improved elf_load_image() a bit.
After enabling BOOT_SUPPORT_ELF64 on x86 the x86 kernel could no longer be
booted because too many kernel_args allocations were taking place and filling
kernel_args_ranges. This was because for each image load it would check if
the image is ELF64, fail and fall back to ELF32 (each ELF64 check allocated
a preloaded_image). Changed elf_load_image() so that it only tries both when
loading the kernel image, and then for modules it will only try the same ELF
class as the kernel image.
2012-06-24 17:58:22 +01:00
Alex Smith
035825cdfc Align the start of the kernel .data to a 2MB boundary, prevents ld from merging the text and data PHDRs. 2012-06-24 17:19:48 +01:00
Alex Smith
acda52f5e9 Fixes for other platforms. 2012-06-24 15:48:03 +01:00
Ingo Weinhold
69a8b95491 FixedWidthPointer: Fix ==/!= operators, remove OtherType casts
* FixedWidthPointer:
  - operators ==/!=: Change second operand type from void* to const
    Type*. Also add non-const version to resolve ambiguity warning when
    comparing with non-const pointer.
  - Add Pointer() getter.
  - Remove templatized cast operators. They are nice for casting the
    pointer directly to another pointer type, but result in ambiguity.
* Make preloaded_image::debug_string_table non-const. Avoids clashes of
  the const and non-coast FixedWidthPointer comparison operators. A
  cleaner (but more verbose) solution would be to spezialize
  FixedWidthPointer for const types.
2012-06-24 15:26:00 +01:00
Alex Smith
ccadfaeeb5 Changed the boot ELF code to use templates and added ELF64 support.
The actual implementation of the ELF loading methods have been put into
an ELFLoader template class that takes a single template parameter, which
is a structure containing all the necessary ELF typedefs. It's a bit
verbose, but I thought it was a neater solution than using a bunch of
standalone functions with a huge number of template parameters. There is
no change to code outside of elf.cpp, the ELF32/ELF64 differences are
handled internally.
2012-06-23 12:05:16 +01:00
Alex Smith
3a2a3367dc Support static_cast on FixedWidthPointer. 2012-06-22 19:55:38 +01:00
Alex Smith
f124497815 Added an ELF64 version of preloaded_image.
* There is now 2 structures, preloaded_elf32_image and preloaded_elf64_image,
  which both inherit from preloaded_image.
* For now I've just hardcoded in use of preloaded_elf32_image, but the
  bootloader ELF code will shortly be converted to use templates which use
  the appropriate structure. The kernel will be changed later when I add
  ELF64 support to it.
* All kernel_args data is now compatible between 32-bit and 64-bit kernels.
2012-06-22 19:24:51 +01:00
Alex Smith
62d36f9833 Removed the addr_t conversion operators from FixedWidthPointer which makes comparison against NULL work properly. 2012-06-22 18:22:11 +01:00
Alex Smith
474aa3b76e Added ELF64 headers, common ELF32 and ELF64 definitions moved to elf_common.h. 2012-06-22 12:54:41 +01:00
Alex Smith
6b87898af5 Code style fixes. 2012-06-22 11:56:55 +01:00
Alex Smith
17e407e945 Proper implementation of arch_kernel.h for x86_64. 2012-06-22 10:53:08 +01:00
Alex Smith
1651dd72d9 Merge branch 'master' into x86_64 2012-06-21 19:48:43 +01:00
Alex Smith
17a3389882 Remove phys_addr_range, just use addr_range for both virtual and physical address ranges (as requested by Ingo). 2012-06-21 19:48:03 +01:00
Alex Smith
5915eeb461 Some improvements to the previous changes made to vfs_boot.cpp suggested by Ingo. 2012-06-21 19:45:36 +01:00
Alex Smith
d8efc6caf6 Changes to kernel_args to make it identical for x86 and x86_64.
* Added a FixedWidthPointer template class which uses 64-bit storage to hold
  a pointer. This is used in place of raw pointers in kernel_args.
* Added __attribute__((packed)) to kernel_args and all structures contained
  within it. This is necessary due to different alignment behaviour for
  32-bit and 64-bit compilation with GCC.
* With these changes, kernel_args will now come out the same size for both
  the x86_64 kernel and the loader, excluding the preloaded_image structure
  which has not yet been changed.
* Tested both an x86 GCC2 and GCC4 build, no problems caused by these changes.
2012-06-21 18:02:23 +01:00
Matt Madia
55713eef96 Updated URL's for WifiFirmwareScriptData. Fixes #8645. 2012-06-20 22:11:33 -04:00
Jérôme Duval
24df347e9c Patch by X512 for Icon-O-Matic.
* support HVIF icons and SVG images in rdef

Signed-off-by: Stephan Assmus <superstippi@gmx.de>
2012-06-20 19:57:24 +02:00
Alex Smith
192af9e0af Changed addr_range to use uint64.
I've tested this change on x86, causing no issues. I've checked over the code
for all other platforms and made the necessary changes and to the best of my
knowledge they should also still work, but I haven't actually built and
tested them. Once I've completed the kernel_args changes the other platforms
will need testing.
2012-06-20 14:11:24 +01:00
Alex Smith
93cb9538be Don't store a KMessage in kernel_args for the boot volume, only the buffer address/size.
Pointers in kernel_args are going to be changed to unconditionally use 64-bit
storage (to make kernel_args compatible with both the x86 and x86_64 kernels).
KMessage stores a pointer to its buffer, however since KMessage is used
outside of the boot code it is undesirable to change it to use 64-bit storage
for the pointer as it may add additional overhead on 32-bit builds. Therefore,
only store the buffer address and size and then construct a KMessage from
those in the kernel.
2012-06-20 11:53:47 +01:00
Alex Smith
7417d5ed8d Made the bootloader search for both kernel_x86 and kernel_x86_64 when built for x86 or x86_64. 2012-06-20 10:44:38 +01:00
Alex Smith
cfd1c1802f Add -march=pentium to boot {CC,C++}FLAGS on x86_64, prevents GCC from generating SSE code. 2012-06-19 21:54:40 +01:00
Alex Smith
7c488bff70 Modified the floppy boot image target so that it can be used to build an x86_64 boot image.
* set_haiku_revision doesn't currently support ELF64, don't use a
  revisioned kernel image on x86_64 for now.
* Don't try to build add-ons for x86_64 yet.
2012-06-19 21:36:13 +01:00
Alex Smith
e114f50ddd Fixed bootloader build under x86_64. 2012-06-19 20:38:53 +01:00
Axel Dörfler
d6e44a2a3a Fixed BootLoaderTest build and debug build. 2012-06-18 21:52:30 +02:00
Axel Dörfler
90f510906d When the value hint mode is active, keep it active.
* Ie. when a different value is pressed, the hint is now being shown for
  the new value instead of turning of the value hints.
2012-06-18 21:52:29 +02:00
Matt Madia
2269db99ce Updated VL-Gothic fonts to version 20120618. Fixes #8642 2012-06-17 19:32:23 -04:00
Matt Madia
2c28c98d32 Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-06-17 16:31:54 -04:00
Matt Madia
a8c2e97934 Removed dead code.
As the downloadable files are now hosted on haiku-files.org and the user is
presented the Intel license at the beginning of the script, the  function
OpenIntelFirmwareWebpage is unneeded.
2012-06-17 16:29:38 -04:00
Matt Madia
e8fc340a30 Prevent removing permissions on a wifi firmware's subdirs.
Prior to this /boot/system/data/firmware/broadcom43xx/b43-fwcutter would
have its w+x bits removed.
2012-06-17 16:24:41 -04:00
Matt Madia
174bc1dca0 Host wifi firmware related files on haiku-files.org 2012-06-17 15:49:44 -04:00
Axel Dörfler
7b2ba07326 The size control now actually sets the size instead of the offset.
* SizeSlider::MaxPartitionSize() also now returns the size instead of the end
  offset.
* Renamed CreateParamsPanel::_UpdateTextControl() to _UpdateSizeTextControl().
* Removed code duplication, and instead just call _UpdateSizeTextControl()
  twice.
* Minor other cleanup.
2012-06-17 20:04:39 +02:00
Axel Dörfler
2ffea8e8a3 Minor cleanup, no functional change. 2012-06-17 20:04:37 +02:00
Niels Sascha Reedijk
21c0a9529b Update translations from Pootle 2012-06-17 16:28:06 +02:00
Rene Gollent
a663e90506 Fix #8640.
- Automatic whitespace cleanup.
- Remove no longer exposed show/hide time setting. The methodology for
  saving it on exit was broken anyways, since it relied on the current
  show/hide state of the time view, which would be hidden if the deskbar
  was currently in Autohide mode.
2012-06-16 16:45:28 -04:00
Philippe Saint-Pierre
919d3b7601 Pulse deskbar replicant couldn't be removed. Fixes #4244. 2012-06-16 14:08:53 -04:00
Alex Smith
6296722bc0 Fixed incorrect link address in kernel linker script. 2012-06-16 11:20:05 +01:00
Alex Smith
043c61dde5 Added stub versions of everything needed to build the kernel.
The whole kernel now builds and there are no undefined references when
linking, I just need to fix some strange relocation errors I'm getting
(probably a problem with the linker script) and then I'll have a kernel
image.
2012-06-15 22:50:59 +01:00
Alex Smith
146f966921 Fixed a mistake in 11d3892, changed a parameter type to addr_t that shouldn't have been changed. 2012-06-15 22:31:24 +01:00
Alex Smith
8c0e3c951a Add -mno-red-zone to the kernel CCFLAGS/C++FLAGS.
The red zone is a 128-byte area below the stack pointer specified by the
AMD64 ABI that can be used by leaf functions for their stack frame without
modifying the stack pointer. It is guaranteed not to be modified by signal
handlers. This cannot be used in kernel mode code, as an interrupt handler
could overwrite it, so stop GCC from generating code that uses it.
2012-06-15 20:05:25 +01:00
Alex Smith
73f27ecd3a Implementations of some libroot functions for x86_64.
These are the functions required by the kernel. These are all full
implementations except for system_time(), which will be implemented later.
2012-06-15 19:57:21 +01:00
Alex Smith
f4f0f79b66 Merge branch 'master' into x86_64 2012-06-15 16:10:53 +01:00
Alex Smith
82b4b37172 Added a TODO in to say that {,u}int64 should be changed to long on x86_64. 2012-06-15 16:09:25 +01:00
Alex Smith
4be4fc6b1f More 64-bit compilation/safety fixes. 2012-06-15 16:04:20 +01:00
Alexander von Gluck IV
e949483f2c mesa: Remove no longer needed patch
* Commited upstream to Mesa in:
  http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb3054c849d84
2012-06-14 08:19:33 -07:00
Alex Smith
40e20c1076 Added gensyscalls headers for x86_64. 2012-06-14 14:18:50 +01:00
Alex Smith
11d3892d28 Changed ICI data argument types from uint32 to addr_t.
Since ICI arguments are used to send addresses in some places, uint32 is
not sufficient on x86_64. addr_t still refers to the same type as uint32
(unsigned long) on other platforms, so this change only really affects
x86_64.
2012-06-14 13:06:55 +01:00
Alex Smith
ced5037133 Merge branch 'master' into x86_64 2012-06-13 17:47:34 +01:00
Alex Smith
f76bc433e1 Added some x86_64 system/kernel headers and kernel Jamfiles.
* Not all of these headers are correct yet, just adding what's necessary
  to get things to compile for the time being.
2012-06-13 17:45:22 +01:00