Commit Graph

60 Commits

Author SHA1 Message Date
Ithamar R. Adema
0a163b65c7 ARM: define bootloader stack in linker script
This removes the need for the whole HAIKU_BOARD_LOADER_STACK_BASE
sing and dance, since it is always included in the bootloader binary
itself.
2014-09-07 20:56:14 +02:00
François Revol
eecde8e37c Merge branch 'master' into sam460ex 2013-04-21 01:34:20 +02:00
Pawel Dziepak
db1ca60528 runtime_loader: randomize position of runtime_loader
* make runtime_loader a dynammically linked object
 * add kernel support for loading user images that need to be relocated
 * load runtime_loader at random address
2013-04-16 02:29:05 +02:00
François Revol
2441f3ed90 PPC: add debug sections to the linked kernel
Seems to be needed for gdb.
2013-02-23 18:25:36 +01:00
Alexander von Gluck IV
bbe04a83e0 Rpi: Fix build of Raspberry Pi.
* Raspberry Pi is broken now after
  the other recent arm work... needs
  more investigation.
* Comment out stage2 header as it
  links to headers with c++ code.
  Need to verify entry.s can call
  c++ code (I think it's mangled to
  the assembly or something)
* Fix naming of code entry to match
  other arm code.
2012-11-24 07:49:04 -06:00
Ithamar R. Adema
2beda3bb5b ARM/runtime_loader: add stub to make it compile 2012-11-22 20:09:09 +01:00
Alex Smith
11c9f9a1d6 Merge branch 'master' into x86_64
Conflicts:
	build/jam/FloppyBootImage
	build/jam/OptionalBuildFeatures
	build/jam/OptionalPackages
	headers/private/shared/cpu_type.h
	src/bin/ps.c
	src/bin/sysinfo.cpp
	src/kits/tracker/PoseView.cpp
	src/preferences/appearance/DecorSettingsView.cpp
	src/preferences/virtualmemory/Settings.cpp
	src/servers/input/AddOnManager.cpp
	src/servers/input/InputServer.cpp
	src/servers/input/InputServerMethod.cpp
	src/system/boot/Jamfile
	src/system/boot/platform/raspberrypi_arm/mmu.cpp
	src/system/boot/platform/u-boot/arch/arm/Jamfile
	src/system/kernel/arch/x86/arch_cpu.cpp
	src/system/kernel/arch/x86/arch_thread.cpp
	src/system/kernel/cache/block_cache.cpp
	src/system/kernel/vm/VMAnonymousCache.cpp
2012-11-18 14:02:07 +00:00
Alexander von Gluck IV
1946d374f2 rPi: Update boot process for later Pi firmwares
* The bootprocess is better documented now.
  Put technical info in linker script, user info
  into info.txt
2012-09-09 21:10:16 -05:00
Alex Smith
12b3e8a8a0 Support x86_64 in the runtime loader.
* Added x86_64 linker script and relocation code.
* Some 64-bit safety fixes to the heap code.
* Added runtime_loader, libroot and bash to the x86_64 image. The boot
  script will be launched, but will panic shortly after because fork
  is broken.
2012-07-28 17:00:52 +01:00
Alex Smith
6f6d78e877 Cleaned up ELF64 address handling.
* platform_allocate_elf_region() is removed, it is implemented in platform-
  independent code now (ELF*Class::AllocateRegion). For ELF64 it is now
  assumed that 64-bit addresses are mapped in the loader's 32-bit address space
  as (address - KERNEL_BASE_64BIT + KERNEL_BASE).
* mapped_delta field from preloaded_*_image removed, now handled compile-time
  using the ELF*Class::Map method.
* Also link the kernel with -z max-page-size=0x1000, removes the need for
  2MB alignment on the data segment (not going to map the kernel with large
  pages for the time being).
2012-06-25 13:00:50 +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
6296722bc0 Fixed incorrect link address in kernel linker script. 2012-06-16 11:20:05 +01:00
Alex Smith
0d916c34c4 x86_64: added linker script for the kernel.
* Based on the x86 one, changes made to match the default GCC x86_64 linker
  script and correct kernel load address added.
* Not tested yet as the kernel doesn't fully compile.
2012-06-11 12:49:14 +01:00
Alex Smith
07b33113a3 Merge branch 'master' into x86_64 2012-06-11 12:01:35 +01:00
Alex Smith
65ad1ba320 Made it possible to build the bootloader when targetting x86_64.
* x86_64 is using the existing *_ia32 boot platforms.
* Special flags are required when compiling the loader to get GCC to compile
  32-bit code. This adds a new set of rules for compiling boot code rather
  than using the kernel rules, which compile using the necessary flags.
* Some x86_64 private headers have been stubbed by #include'ing the x86
  versions. These will be replaced later.
2012-05-26 21:47:27 +01:00
François Revol
134ef79db0 U-Boot: add some sections to the ppc ldscript
* it seems ld creates most of them anyway, taken from the openfirmware script.
2012-05-24 21:20:14 +02:00
François Revol
61d7e75709 U-Boot ppc: Add missing sections to ldscript
* it seems we missed some sections that exist on ppc, add them.
* resulting binary runs a little further in QEMU but still screws up.
2012-05-17 23:52:35 +02:00
François Revol
4ab5d2f998 U-Boot: Add a ppc ldscript
* mostly copied from the ARM one
2012-05-17 19:15:58 +02:00
François Revol
6f19b90aca Fix linking in static ctors
* It seems we also need to call them in the .init_array section.
2012-05-15 19:16:52 +02:00
Alexander von Gluck IV
27d3324651 rpi: Rework linker script
* Add some missing stuff, be more exact with
  stack and fill with 0xBEBEBEBE
* Ensure .init_array is called with .ctors to ensure
  static constructors are called.
2012-05-15 10:33:12 -05:00
Alexander von Gluck IV
5426ff9347 system loader: Initial work on new rasberrypi_arm loader
* Used routerboard loader as a base skel
* May just be temporary if u-boot ever gets Raspberry Pi
  support
2012-05-01 16:57:58 -05:00
François Revol
68aea33966 Try another load address for PPC CFE loader.
This is the address the OpenFirmware is loaded to by CFE on the Amiga X-1000.
Doesn't seem to help much though.
2012-01-05 01:03:28 +01:00
François Revol
478dc9887e PPC: Preliminary untested boot support for Common Firmware Environment
CFE is used in the upcoming Amiga X-1000 dualcore PPC board.
* Largely inspired by the OF and U-Boot code.
* Still largely stubbed out.
* The loader builds but I don't have a machine to test it. Anyone interested?
2011-11-14 01:31:50 +01:00
Ithamar R. Adema
36fa904ede Fix aligment of data segment, by moving our ARM ldscript closer to the X86 one. This restores
the state of the ARM port to booting all the way up to the idle thread again.

However, will still need to investigate why we need the PHDRS magic, likely due to improper
setup of the ARM toolchain. If anyone has ideas, please let me know!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-13 23:17:29 +00:00
François Revol
788565c49a Copy the Atari bootloader ldscript.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38930 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-10 14:10:49 +00:00
Stephan Aßmus
5d80127809 Patch by Andreas Faerber:
* Fix a typo in the comments: unintialized -> uninitialized.

Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34857 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-02 10:21:09 +00:00
Stephan Aßmus
745b2d9db7 Patch by Andreas Faerber:
* Fix duplicate assignment which is probably a merging artifact.

This patch was also a requirement for a working PPC KDL prompt. I didn't
apply the patches in order... Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34856 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-02 10:19:05 +00:00
Jonas Sundström
8e8130d1f0 Adding routerboard_mipsel platform stubs and linker script.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-22 01:48:18 +00:00
François Revol
639b8a4905 [GSoC] [ARM] Patch by Johannes Wischert.
This seems to work around the dynamic segment having a huge file size in headers, it must also be in the data segment...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 01:15:18 +00:00
François Revol
3f366cdc39 [ARM]
Don't forget the ELF header else we end up loading at 0x7fff8000...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 01:10:19 +00:00
François Revol
d9c434dc91 [ARM]
Use the same trick as for m68k (r26536) to get separate text & data segments for the kernel, though this should really not be needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 00:18:25 +00:00
François Revol
79cf966c2c [ARM]
Add unwind symbols to the kernel too... not sure it goes here though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 17:36:42 +00:00
François Revol
0e20032995 [ARM]
Move the unwind data out of the bss section, it broke bss init which ended up erasing real data and making dprintf do weird things...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 12:48:33 +00:00
François Revol
e4b608db5b [ARM]
Missed this one in previous commit: remove board.ld include as we now give LD the address directly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 16:25:02 +00:00
François Revol
feb750d331 [ARM]
- consolidate board specific definitions into build/jam/board/*/BoardSetup to avoid duplicating address values everywhere,
	- add various addresses, boot script, custom C/C++ flags and SD card definition,
	- not sure BoardSetup is included at the best place though,
	- replaced board-specific ldscript with passing the loader address directly to LD from BoardSetup,
- added haiku.mmc target which generates an mmc/SD card image with a FAT partition with the files needed to boot for the board, should later be integrated with haiku.image with the BFS partition offset passed to bfs_shell, requires apt:sfdisk,mtools on GNU/Linux,
- added some more rules, one to build a script for the SD image,
- fake a NetBSD loader for now, U-Boot doesn't know haiku, and we'll need a way to pass the tgz image and RAM size, we'll either use standlone way (usual C argv[]) or the NetBSD args,
- style fixes,
- 80 cols, /me pets Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32284 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 16:12:35 +00:00
François Revol
e3db8e35e3 [ARM]
Temporary (?) solution to linking the loader: generate symbols needed by the unwinding code, which should actually not be used since we disable exceptions...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-11 03:21:29 +00:00
François Revol
71c5ee196b [ARM]
Remove debug leftover.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32208 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 16:12:02 +00:00
François Revol
e60a2810f6 [ARM]
Include board-specific file from the u-boot ldscript, to allow linking to different load addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32207 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 16:02:34 +00:00
François Revol
1f4fe94583 [GSoC] [ARM] Patch by Johannes Wischert.
LD scripts for u-boot based bootloader and the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-27 16:21:20 +00:00
François Revol
f080e026b9 Merge in all .text.Z* sections back to .text...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28619 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-12 00:14:07 +00:00
François Revol
9f8e918d80 The .dynamic section should be both part of the data and dynamic segments!
This makes the kernel loadable by the bootloader, which does load it, and all the modules \o/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26558 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-22 00:46:07 +00:00
François Revol
3c5029f112 Turned out the generated kernel_m68k had a single PT_LOAD segment (RWE) instead of separate text and data like every other single binary, and everything on other platforms. This works around it by forcing sections to separate headers. It's still beyong me why I have to do this here, ld should do it on its own. Anyone has a clue ?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-21 00:36:31 +00:00
François Revol
b45b3d7dcb - move prg ldscript where it belongs.
- added rule for boot .prg, no need to do it by hand :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26099 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-23 13:32:28 +00:00
François Revol
a85b351d4e Use the x86 kernel.ld as model instead of ppc. Thsi makes kernel_m68k link \o/
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26098 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-23 11:01:46 +00:00
François Revol
ea788fff0c Our ld script is actually closer to the x86 one... this should work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23530 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-15 15:00:00 +00:00
François Revol
9b6eca61e0 The correct platform is "atari_m68k".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23524 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-14 21:55:29 +00:00
François Revol
56b8edd4e3 ld scripts for m68k.
Actually mostly untouched ppc from r22648.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22651 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 00:00:32 +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
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
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