Commit graph

1669 commits

Author SHA1 Message Date
John Baldwin b5fd832d94 Use PTOV() to convert physical addresses to appropriate virtual addresses
in the loader when searching for the ACPI RSDP.  (The loader runs in a flat
mode with va 0 == pa 0xa000.)
2006-04-25 18:42:22 +00:00
Warner Losh 7ea1357336 MFp4:
Make getc(0) polling (this has the happy side effect of saving
	8 bytes in the generated code).
2006-04-21 13:58:51 +00:00
Warner Losh 69f5220b21 MFp4: Loop forever getting characters... A kludge for now. 2006-04-21 13:56:26 +00:00
Warner Losh 750f97a294 MFp4: Integrate support for building tag support for linux booting. 2006-04-21 13:51:47 +00:00
Warner Losh 0cef210b08 MFp4:
Init eeprom here now that we don't init the eeprom in arm_init.s
	and read in the second 8k of the data.
	Tweak formatting.
2006-04-21 13:44:58 +00:00
Warner Losh ca2c5ec68f Move from arm_init.s -> .S. #ifdef linux vs freebsd defaults for the
boot loader (linux booting helps regression testing).  No repo copy
because of limited history.
2006-04-21 13:40:26 +00:00
Warner Losh 9b062675f0 MFp4: formatting nits and minor style changes that likely won't matter. 2006-04-21 07:45:57 +00:00
Warner Losh acc47bab5b Allow one to enable building tags. Check the size of the boot imag. 2006-04-21 07:41:36 +00:00
Warner Losh ac1e0174a6 MFp4:
On the KB9202 go ahead and enable the flash controller so the boot
loader can access the parallel flash.
2006-04-21 07:29:14 +00:00
Warner Losh 42ed626f87 MFp4:
Make this compile, assuming that you have linux installed in a
sensible place.  tag_list is disabled by default, since we don't
distribute linux, but it is desirable to allow the boot loader to boot
Linux or FreeBSD (mostly for testing).
2006-04-21 07:19:22 +00:00
Warner Losh 9ac58632a3 MFp4:
Minor diffs to reduce diffs to p4.
2006-04-21 07:12:12 +00:00
Warner Losh fe51f25d3f spi flash updating boot loader. upload this file for the recovery
xmodem download.  Then download the image you want in the flash.
This will burn the image into the flash.  You must then reset the
unit and the new flash image will be used for booting...
2006-04-21 06:51:08 +00:00
Warner Losh 776524db7d iic eeprom updating boot loader. upload this file for the recovery
xmodem download.  Then download the image you want in the eeprom.
This will burn the image into the eeprom.  You must then reset the
unit and the new eeprom image will be used for booting...
2006-04-21 06:48:52 +00:00
Warner Losh ecade1c5b5 Add boot0iic and boot0spi. These are 'shortcut' boot loaders designed
to replace either a bad iic eeprom with one you download with xmodem,
or likewise with a spi flash.
2006-04-21 06:43:32 +00:00
Warner Losh ae78672c56 MFp4 (checkpoint of work in progress):
o Use a directory layout that is more akin to the i386 boot layout.
o Create a libat91 for library routines that are used by one or more
  of the boot loaders.
o Create bootiic for booting from an iic part.
o Create bootspi for booting from an spi part.
o Optimize the size of many of these routines (especially emac.c).  Except
  for the emac.c optimizations, all these have been tested.
o eliminate the inc directory, libat91 superceeds it.
o Move linker.cfg up a layer to allow it to be shared.
2006-04-19 17:16:49 +00:00
Warner Losh 78fd9f198c Fix style nit noticed by bde. 2006-04-15 02:51:53 +00:00
Warner Losh e43d852f65 Add commented out define for TSC board's boot0. 2006-04-13 17:44:05 +00:00
Warner Losh e439ab9afe MFp4:
For 32-bit SDRAM systems, enable D16 to D31 in the PIO controller.
Otherwise they read back as 0xffff.

Shave 8 bytes from the object size by using AT91C_BASE_PIOA directly
and by not assigning PIO_BSR to 0 in the DBGU init.  That's a nop in
two ways (everything defaults to peripheral A, and writing 0 changes
nothing).
2006-04-13 17:39:34 +00:00
Warner Losh 8015f1dbb8 Merge from p4:
Many places used #define FOO ((unsigned int) 0x23) where a simpler
#define FOO 0x23u would have sufficed.  This practice is overly
verbose and has the disadvantage that you can't say

	#if FOO == BAR
	#endif

because the extra "unsigned int" tokens choke cpp's little brain.
Migrate to the latter style to allow use in preprocessor statements.
The two are the same semantically anyway in a C context (at least for
the uses they are put to presently, C gurus can explain to me how they
differ).
2006-04-13 17:34:23 +00:00
Warner Losh 3de060b996 Need at91rm9200_lowlevel.h for SDRAM_BASE definition. 2006-04-13 17:31:02 +00:00
Warner Losh 6e8aee768a Common register definition for AT91RM9200 2006-04-12 21:23:36 +00:00
Warner Losh e06ca69b2f Recovery boot loader for the AT91 family of processors. Download it
via xmodem to the DBGU port when the AT91 comes up in recovery mode.
The recovery loader will then load your program via xmodem into SDRAM
at 1MB which can do its things.  It needs to be tweaked to the
specific board one is using, but it fits in < 1kB (all of Atmel's ARM
products have at least 8kb of SRAM that I can tell, so this should
work for them all).

Parts of this code were provided by Kwikbyte with copyright
specifically disclaimed.  I heavily modified it to act as a recovery
loader (before it was a bootstrap loader) and to optimize for size
(before I started the size was closer to 8k).

Bootstrap loaders for SPI and IIC to follow.
2006-04-12 21:22:44 +00:00
Maxim Sobolev e101181393 Merge in timeout into A20-enable routine from cdboot/boot1.
MFC after:	1 day
2006-04-11 20:53:49 +00:00
John Baldwin 31062da1b0 Drop the gateA20() function in the loader as it is unused. All the other
boot loaders that load the loader already handle A20.  In fact, they are
required to do so in order to setup the environment that btxldr expects.
2006-04-11 20:11:30 +00:00
John Baldwin a115c84d58 Minor whitespace tweak. 2006-04-11 20:09:42 +00:00
John Baldwin 3793634041 Tweak comment. 2006-04-11 17:36:08 +00:00
John Baldwin 70e040dfcf Use the proper condition to determine that we matched an filename.
Otherwise, we could match on a filename that had the wrong last character
(such as /boot/loaded instead of /boot/loader).

PR:		kern/95625
Submitted by:	Oliver Fromme <olli@secnetix.de>
MFC after:	1 month
2006-04-11 17:26:54 +00:00
Maxim Sobolev cd86367a5a When enabling A20 put upper limit on amount of time we wait for the keyboard
controller to get ready (65K x ISA access time, visually around 1 second).
If we have wait more than that amount it's likely that the hardware is a
legacy-free one and simply doesn't have keyboard controller and doesn't
require enabling A20 at all.

This makes cdboot working for MacBook Pro with Boot Camp.

MFC after:	1 day
2006-04-11 04:39:29 +00:00
Scott Long c2e1d5d04c Remove the USB keyboard hack now that KBDMUX is enabled by default. Allow
it to be disabled if Safe Mode is selected.
2006-03-31 21:36:17 +00:00
Ruslan Ermilov e1fe3dba5c Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
Jung-uk Kim 07b4d1cc39 Export SMBIOS serial numbers by default. To turn it off, use
'BOOT_HIDE_SERIAL_NUMBERS' knob.

Suggested by:	ceri
2006-03-14 19:02:00 +00:00
Jung-uk Kim 1c9e617c34 Micro-optimize invalid UUID check. 2006-03-10 23:33:27 +00:00
Jung-uk Kim 65796b26b3 - Implement serial numbers, UUID, and asset tag (turned off by default).
Use 'BOOT_SENSITIVE_INFO=YES' variable to turn them on.
- Use 'uint*_t' instead of 'u_int*_t', correct compilation warnings, and
update copyright while I am here.
2006-03-09 22:49:44 +00:00
Marcel Moolenaar 383bd4fd1e Remove ELF dynamic tag definitions that aren't used. Ideally,
those that are used should come from <machine/elf.h>.
2006-01-18 18:49:25 +00:00
Marcel Moolenaar 853b7411b6 s/R_IA64_/R_IA_64_/g as per the ia64 psABI. 2006-01-17 21:03:22 +00:00
Marius Strobl e4846391da In moduledir_readhints() cast the value returned by sizeof() to ssize_t
when checking whether it's greater than a struct stat st_size in order
to also catch the case when st_size is -1. Previously this check didn't
trigger on sparc64 when st_size is -1 (as it's the case for a file on
a bzipfs, TFTP server etc.), causing the content of the linker hints
file to be copied to memory referenced by a null-pointer.

PR:		91231
MFC after:	1 week
2006-01-12 13:18:49 +00:00
Yoshihiro Takahashi 6fa7cb4445 MFi386: revisions 1.34 and 1.36. 2005-12-21 06:10:42 +00:00
Yoshihiro Takahashi 8b891b8d17 MFi386: revision 1.8. 2005-12-21 06:09:47 +00:00
Yoshihiro Takahashi 2d908c8204 MFi386: revision 1.46. 2005-12-21 06:09:09 +00:00
Maxim Sobolev e4f5866fd5 For the cases when loading bzip2-compressed kernels enabled use last
3MB of physical memory for heap instead of range between 1MB and 4MB.
This makes this feature working with PAE and amd64 kernels, which are
loaded at 2MB. Teach i386_copyin() to avoid using range allocated by
heap in such case, so that it won't trash heap in the low memory
conditions.

This should make loading bzip2-compressed kernels/modules/mfs images
generally useable, so that re@ team is welcome to evaluate merits
of using this feature in the installation CDs.

Valuable suggestions by:	jhb
2005-12-21 02:17:58 +00:00
Maxim Sobolev 90ec8e27c3 Unbreak pc98 after my last changes to i386. 2005-12-20 08:54:30 +00:00
Maxim Sobolev f668cd5df7 If LOADER_BZIP2_SUPPORT is defined allocate heap in the 1MB-4MB range to
provide enough room for decompression (up to 2.5MB is necessary). This
should be safe to do since we load i386 kernels after 8MB mark now, so
that 16MB is the minimum amount of RAM necessary to even boot FreeBSD.

This makes bzip2-support  practically useable.
2005-12-19 09:26:42 +00:00
Maxim Sobolev 915dad0e92 Long-long time ago, when the trees were large and memory expensive amount of
memory directly available to loader(8) and friends was limited to 640K on i386.
Those times have passed long time ago and now loader(8) can directly access
up to 4GB of RAM at least theoretically. At the same time, there are several
places where it's assumed that malloc() will only allocate memory within
first megabyte.

Remove that assumption by allocating appropriate bounce buffers for BIOS
calls on stack where necessary.

This allows using memory above first megabyte for heap if necessary.
2005-12-19 09:00:11 +00:00
Marcel Moolenaar 757686b115 Make our ELF64 type definitions match standards. In particular this
means:
o  Remove Elf64_Quarter,
o  Redefine Elf64_Half to be 16-bit,
o  Redefine Elf64_Word to be 32-bit,
o  Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o  Use Elf_Size in MI code to abstract the difference between
   Elf32_Word and Elf64_Word.
o  Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks
2005-12-18 04:52:37 +00:00
Ariff Abdullah 964e14b04a Add kernel module loading option for snd_atiixp(4). 2005-12-01 03:10:12 +00:00
Ruslan Ermilov 4e9e907d63 -mdoc sweep. 2005-11-18 10:36:29 +00:00
Ruslan Ermilov 15be1e4be0 Catch up with loader_color -> loader_logo and document beastie_disable. 2005-11-15 21:26:49 +00:00
Pawel Jakub Dawidek d941425873 Rename GEOM class kernel module g_md.ko to geom_md.ko for consistency
with the rest.

mdconfig.c:	Simplify mdmaybeload() function.
mdioctl.h:	Removed (now unused) #define.
loader.conf:	Sort GEOM classes properly.

OK'ed by:	phk
2005-11-11 11:31:23 +00:00
Pawel Jakub Dawidek 62e698b51d Add more GEOM classes to defaults/loader.conf. Add references to manual
pages to those already present.

Reviewed by:	brueffer
2005-11-11 10:48:30 +00:00
Ruslan Ermilov 6e7a7ba194 Consistently use OPT_* macros to test/set boot options. 2005-11-03 07:35:36 +00:00