aboutsummaryrefslogtreecommitdiff
path: root/sys/boot
Commit message (Collapse)AuthorAgeFilesLines
* Fix buffer overflow in sys/boot/common/util.c's printf(), when printingDimitry Andric2011-08-081-1/+1
| | | | | | | | | | | | large (>= 10^10) numbers. In theory, 20 characaters should be enough, but bump the buffer to 32 characters, so we have some room for the future. Reviewed by: pjd Approved by: re (kib) Notes: svn path=/head/; revision=224722
* Document the tftp.blksize variable added in src/lib/libstand/tftp.c.Craig Rodrigues2011-07-251-0/+5
| | | | | | | | Approved by: re (kib) Requested by: maxim Notes: svn path=/head/; revision=224408
* Note that the "kernel" variable in loader.conf is the name of a directoryJohn Baldwin2011-07-201-2/+5
| | | | | | | | | | | | | containing a kernel under /boot and that it's default value is "kernel" not "/boot/kernel/kernel". PR: docs/158992 Reported by: Wayne Mitchell wayne.mitchell.iz at gmail Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=224228
* When building some of the boot loaders with clang, and DEBUG_FLAGS orDimitry Andric2011-07-173-0/+7
| | | | | | | | | | | | | | CFLAGS having '-g' in it, clang outputs several assembly directives that are too new for our version of binutils. Therefore, assemble the resulting .s files with clang instead. A more general solution can be implemented when a GNU as-compatible driver for clang's integrated assembler appears. Reported by: dougb Notes: svn path=/head/; revision=224131
* Add support for booting PS3s from disk. This is still a little hackish untilNathan Whitehorn2011-07-1614-23/+1092
| | | | | | | | | | | | | | we can find a way to get the information from petitboot or to guess it, so the current algorithm is: 1. See if ps3disk3p1 (first GPT slice on OtherOS partition) exists, and if so try to boot it. 2. Otherwise, netboot. Submitted by: glevand <geoffrey.levand at mail dot ru > Notes: svn path=/head/; revision=224106
* Since r219452 the alignment of __dmadat has changed, revealing that fsread()Marius Strobl2011-07-111-31/+35
| | | | | | | | | | | | | bogusly casts its contents around causing alignment faults on sparc64 and most likely also on at least powerpc. Fix this by copying the contents bytewise instead as partly already done here. Solving this the right way costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86 there are still some bytes left there though, and an acceptable hack which tricks the compiler into only using a 2-byte alignment instead of the native one when accessing the contents turned out to even take up more space that. Notes: svn path=/head/; revision=223938
* - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries fromMarius Strobl2011-07-021-25/+63
| | | | | | | | | | | | | | | | | | | | | | the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Notes: svn path=/head/; revision=223719
* Fix r223695 to compile on architectures which don't use the MBR scheme; wrapMarius Strobl2011-07-012-6/+17
| | | | | | | | the MBR support in the common part of the loader in #ifdef's and enable it only for userboot for now. Notes: svn path=/head/; revision=223712
* Add a version of the FreeBSD bootloader which can run in userland, packagedDoug Rabson2011-06-3032-4/+4633
| | | | | | | | as a shared library. This is intended to be used by BHyVe to load FreeBSD kernels into new virtual machines. Notes: svn path=/head/; revision=223695
* Revert the entry point label to 'start' to unbreak the build.John Baldwin2011-06-272-3/+3
| | | | | | | Pointy hat to: jhb Notes: svn path=/head/; revision=223611
* - Remove the fake BPB from zfsldr. zfsldr doesn't support booting fromJohn Baldwin2011-06-272-82/+31
| | | | | | | | | | | | | | | | | floppies, so it will not be used as the start of an emulated floppy image on a bootable CD which is what the fake BPB was used for. - Only check that EDD packet mode is available once at the start of zfsldr rather than for each disk sector now that we read data in one sector at a time. As a result, collapse the remaining bits of read up into nread and rename nread to read. - Restore a return at the end of putstr that I removed in the previous revision. Tested by: Henri Hennebert (earlier version) MFC after: 1 week Notes: svn path=/head/; revision=223597
* As with EFI, OFW and U-Boot etc only compile FDT support on thoseMarius Strobl2011-06-253-4/+8
| | | | | | | architectures that actually use it. Notes: svn path=/head/; revision=223539
* The recent change to increase the zfsboot size to 64k made a few BIOSesJohn Baldwin2011-06-231-62/+63
| | | | | | | | | | | | | | | | | | | | | | | | | unhappy (probably they don't handle crossing the 64k boundary, etc.). Fix this by changing zfsldr to use a loop reading from the disk one sector at a time. To avoid trashing the saved copy of the MBR which is used for disk I/O, read zfsboot2 at address 0x9000. This has the advantage that BTX no longer needs to be relocated as it is read into the correct location. However, the loop to relocate zfsboot2.bin can now cross a 64k boundary, so change it to use relative segments instead. (This will need further work if zfsboot2.bin ever exceeds 64k.) While here, stop storing a relocated copy of zfsldr at 0x700. This was only used by the xread hack which has recently been removed (and even that use was dubious). Also, include the BIOS error code as hex when reporting read errors to aid in debugging. Much thanks to Henri Hennebert for patiently testing various iterations of the patch as well as fixing the zfsboot2.bin relocation to use relative segments. MFC after: 1 week Notes: svn path=/head/; revision=223477
* Minimize backward seeks when trying to load ELF relocatable modules.Alexander Kabaev2011-06-191-7/+30
| | | | | | | | | Some of loader filesystems are very ill equipped to handle seeking backwards within the file. Namely, tftp requires trasfer to be restarted from the start of the file every time we go backwards. Notes: svn path=/head/; revision=223295
* Fix clang warnings.Ben Laurie2011-06-181-1/+1
| | | | | | | Approved by: philip (mentor) Notes: svn path=/head/; revision=223262
* Revert changes to this file in r222417. This unconditionally enabled theNathan Whitehorn2011-06-151-4/+1
| | | | | | | | | | boot menu on all platforms, which breaks loader completely on at least powerpc for reasons that are not understood yet. Reviewed by: Devin Teske Notes: svn path=/head/; revision=223109
* Upgrade our copy of llvm/clang to r132879, from upstream's trunk.Dimitry Andric2011-06-121-1/+1
| | | | Notes: svn path=/head/; revision=223017
* o Bump the EFI loader version to 3.1.Marcel Moolenaar2011-06-073-3/+68
| | | | | | | | o Add the about, pbvm and reboot commands. o Trim the banner (suppress maker and date). Notes: svn path=/head/; revision=222799
* Add ia64_sync_icache() and use it to make the I-cache coherentMarcel Moolenaar2011-06-074-1/+55
| | | | | | | | after loading the kernel's text segment. The kernel will do the same for loaded modules, so don't worry about that. Notes: svn path=/head/; revision=222798
* mdoc: fix markupUlrich Spörlein2011-06-021-1/+1
| | | | Notes: svn path=/head/; revision=222599
* Include forgotten framework changes to get some of the new menu files ↵Julian Elischer2011-05-303-2/+5
| | | | | | | | | installed correctly on non x86/amd systems. pointy-hut to devin Notes: svn path=/head/; revision=222472
* Add some missing files. Without we hang in the OF prompt asking for screen.4th.Andreas Tobler2011-05-291-0/+1
| | | | | | | Approved by: nwhitehorn (mentor) Notes: svn path=/head/; revision=222450
* New boot loader menus from Devin Teske.Julian Elischer2011-05-2828-285/+3099
| | | | | | | | | | | Discussed on hackers and recommended for inclusion into 9.0 at the devsummit. All support email to devin dteske at vicor dot ignoreme dot com . Submitted by: dteske at vicor dot ignoreme dot com Reviewed by: me and many others Notes: svn path=/head/; revision=222417
* Disconnect sun4v architecture from the three.Attilio Rao2011-05-143-72/+3
| | | | | | | | | | | | Some files keep the SUN4V tags as a code reference, for the future, if any rewamped sun4v support wants to be added again. Reviewed by: marius Tested by: sbruno Approved by: re Notes: svn path=/head/; revision=221869
* a whitespace nitAndriy Gapon2011-05-071-1/+1
| | | | | | | | Reminder from: kib MFC after: 4 days Notes: svn path=/head/; revision=221601
* a whitespace nitAndriy Gapon2011-05-071-1/+1
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=221593
* Fine-tune llvm optimization for sys/boot/i386/boot2, which shaves offDimitry Andric2011-05-051-1/+2
| | | | | | | | | some more bytes from the final boot2 image. Submitted by: rdivacky Notes: svn path=/head/; revision=221506
* Fix corner case where the size is a power of two.Marcel Moolenaar2011-05-031-1/+1
| | | | Notes: svn path=/head/; revision=221356
* Clang r130700 can now compile sys/boot/i386/boot2 with room to spare.Dimitry Andric2011-05-021-3/+6
| | | | Notes: svn path=/head/; revision=221348
* Turn PBVM page table entries into PTEs so that they can be insertedMarcel Moolenaar2011-04-302-11/+22
| | | | | | | | | into the TLB as-is. While here, have ia64_platform_alloc() return ~0UL on failure. Notes: svn path=/head/; revision=221269
* Due to space constraints, the UFS boot2 and boot1 use an evil hack whereJohn Baldwin2011-04-284-129/+33
| | | | | | | | | | | | boot2 calls back into boot1 to perform disk reads. The ZFS MBR boot blocks do not have the same space constraints, so remove this hack for ZFS. While here, remove commented out code to support C/H/S addressing from zfsldr. The ZFS and GPT bootstraps always just use EDD LBA addressing. MFC after: 2 weeks Notes: svn path=/head/; revision=221177
* Remove all object files during 'make clean'.Andrey V. Elsukov2011-04-212-2/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=220924
* MFi386: revisions 220389 and 220392Yoshihiro Takahashi2011-04-161-13/+13
| | | | | | | | | - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Notes: svn path=/head/; revision=220685
* Add basic support for the Marvell Orion TS-7800.Philip Paeps2011-04-151-0/+161
| | | | | | | Submitted by: Kristof Provost <kristof -at- freebsd.org> Notes: svn path=/head/; revision=220653
* Remove the now defunct kern.ipc.nmbufs tunable.Sergey Kandaurov2011-04-131-1/+0
| | | | | | | | PR: kern/132497 (part) MFC after: 1 week Notes: svn path=/head/; revision=220594
* Move getc() body before xgetc() so gcc does not emit a warning about functionRoman Divacky2011-04-061-9/+9
| | | | | | | | | having no body. Approved by: jhb Notes: svn path=/head/; revision=220392
* Mark getc() as inline, this has no effect on gcc but helps clang.Roman Divacky2011-04-061-1/+1
| | | | | | | Approved by: jhb Notes: svn path=/head/; revision=220389
* MFi386: revision 220337Yoshihiro Takahashi2011-04-051-0/+1
| | | | | | | Build boot2 with -mregparm=3. Notes: svn path=/head/; revision=220361
* Build boot2 with -mregparm=3, ie. pass upto 3 arguments via registers.Roman Divacky2011-04-043-10/+12
| | | | | | | | | | | | | | This modifies CFLAGS and tweaks sio.S to use the new calling convention. The sio_init() and sio_putc() prototypes are modified so that other users of this code know the correct calling convention. This makes the code smaller when compiled with clang. Reviewed by: jhb Tested by: me and Freddie Cash <fjwcash gmail com> Notes: svn path=/head/; revision=220337
* Fix a long standing bug where file_load() passes down the global loadaddrMarcel Moolenaar2011-04-041-1/+1
| | | | | | | | | | | to the l_load() method in the file_formats structure, while being passed an address as an argument (dest). With file_load() calling arch_loadaddr() now, this bug is a little bit more significant. Spotted by: nyan@ (nice catch!) Notes: svn path=/head/; revision=220332
* Use the new arch_loadaddr I/F to align ELF objects to PBVM pageMarcel Moolenaar2011-04-036-51/+135
| | | | | | | | | | | | | | | | | | | | | boundaries. For good measure, align all other objects to cache lines boundaries. Use the new arch_loadseg I/F to keep track of kernel text and data so that we can wire as much of it as is possible. It is the responsibility of the kernel to link critical (read IVT related) code and data at the front of the respective segment so that it's covered by TRs before the kernel has a chance to add more translations. Use a better way of determining whether we're loading a legacy kernel or not. We can't check for the presence of the PBVM page table, because we may have unloaded that kernel and loaded an older (legacy) kernel after that. Simply use the latest load address for it. Notes: svn path=/head/; revision=220313
* Add 2 new archsw interfaces:Marcel Moolenaar2011-04-035-30/+55
| | | | | | | | | | | | | | | | | 1. arch_loadaddr - used by platform code to adjust the address at which the object gets loaded. Implement PC98 using this new interface instead of using conditional compilation. For ELF objects the ELF header is passed as the data pointer. For raw files it's the filename. Note that ELF objects are first considered as raw files. 2. arch_loadseg - used by platform code to keep track of actual segments, so that (instruction) caches can be flushed or translations can be created. Both the ELF header as well as the program header are passed to allow platform code to treat the kernel proper differently from any additional modules and to have all the relevant details of the loaded segment (e.g. protection). Notes: svn path=/head/; revision=220311
* Revert rev 165325. The arch_maphint interface hasn't been in use forMarcel Moolenaar2011-04-032-48/+0
| | | | | | | more than 4 years. Notes: svn path=/head/; revision=220290
* Make the ski loader functional again after the previous set of changes.Marcel Moolenaar2011-04-032-31/+31
| | | | Notes: svn path=/head/; revision=220283
* MFi386: the part of 219452Yoshihiro Takahashi2011-03-241-14/+10
| | | | | | | | | - bunch of variables are turned into uint8_t. - the setting and reading of "fmt" in load() is removed. - buf in printf() is made static to save space. Notes: svn path=/head/; revision=219960
* The size of zfsboot2 grown up to 64 Kbytes in r219089.Andrey V. Elsukov2011-03-162-2/+2
| | | | | | | | | Increase NSECT up to 128 sectors too. Reviewed by: jhb, pjd Notes: svn path=/head/; revision=219703
* Set control flags in putc(). This should fix zfsboot hangs in drvread().Andrey V. Elsukov2011-03-161-0/+1
| | | | | | | | | PR: kern/153552 Reviewed by: jhb MFC after: 1 week Notes: svn path=/head/; revision=219702
* MFaltix:Marcel Moolenaar2011-03-1613-141/+413
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Pre-Boot Virtual Memory (PBVM) to the loader. PBVM allows us to link the kernel at a fixed virtual address without having to make any assumptions about the physical memory layout. On the SGI Altix 350 for example, there's no usuable physical memory below 192GB. Also, the PBVM allows us to control better where we're going to physically load the kernel and its modules so that we can make sure we load the kernel in memory that's close to the BSP. The PBVM is managed by a simple page table. The minimum size of the page table is 4KB (EFI page size) and the maximum is currently set to 1MB. A page in the PBVM is 64KB, as that's the maximum alignment one can specify in a linker script. The bottom line is that PBVM is between 64KB and 8GB in size. The loader maps the PBVM page table at a fixed virtual address and using a single translations. The PBVM itself is also mapped using a single translation for a maximum of 32MB. While here, increase the heap in the EFI loader from 512KB to 2MB and set the stage for supporting relocatable modules. Notes: svn path=/head/; revision=219691
| * Merge svn+ssh://svn.freebsd.org/base/head@219680Marcel Moolenaar2011-03-151-0/+1
| |\ | | | | | | | | | Notes: svn path=/projects/altix/; revision=219681
| * | Round the size, not the top address. This makes the code lessMarcel Moolenaar2011-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | sensitive to compiler bugs (32-bit truncation). Notes: svn path=/projects/altix/; revision=219657