Commit Graph

2046 Commits

Author SHA1 Message Date
Peter Grehan
e45efebc97 Make the openfirmware getchar entry point non-blocking. This catches up
with jhb's 2005/05/27 loader multiple-console change.

Tested by: marius/sparc64, grehan/ofwppc
2008-02-06 22:04:28 +00:00
Giorgos Keramidas
82d16f31df Bump manpage date for rev 1.27
MFC after:	3 days
2008-01-16 07:00:55 +00:00
Giorgos Keramidas
b8b4c607d8 Document that loader(8) stops reading `loader.conf' when it
encounters a syntax error, and add a tip about adding first
the `vital' options and then experimental ones.

PR:		docs/119658
Submitted by:	Julian Stacey, jhs at berklix.org
2008-01-16 06:59:22 +00:00
Marcel Moolenaar
ed04c6bea1 "FreeBSD/Open Firmware/PowerPC ..." is confusing and non-standard.
Use "FreeBSD/powerpc Open Firmware ..." instead.
2007-12-26 19:15:58 +00:00
Bernd Walter
36782b8ef3 - remove code from oroginal file, which is not required on BWCT boards
- Be more chatty on startup, since we have enough code space on
  AT91RM9200
- init DS1672 charging
- init USART GPIO
2007-12-23 14:57:35 +00:00
Bernd Walter
fc29b8c535 BWCT boards uses two different SPI flash chips
check for both status codes
2007-12-23 14:46:30 +00:00
Doug Ambrisko
c609b15425 Allow negative values to be specified in the loader. 2007-12-19 17:06:32 +00:00
Marcel Moolenaar
6d86273c0a Remove file after being repocopied to ../ofw, where it lives on.
Repocopy by: simon@
2007-12-17 22:50:39 +00:00
Marcel Moolenaar
22f4c5e3d9 Build the OFW loader from its new location after the sources
were repocopied from ./loader to ./ofw.
2007-12-17 22:19:44 +00:00
John Baldwin
8ec770db87 Add a note to indicate that these files do borrow in part from mbr.s and
boot1.S

Requested by:	rnordier
2007-11-26 21:29:59 +00:00
Yoshihiro Takahashi
780e069c49 MFi386: revision 1.18
Add a trailing \0 to the read error string so that read errors don't print
  out two error messages.
2007-11-18 03:14:06 +00:00
John Baldwin
59e36e4730 Add a trailing \0 to the read error string so that read errors don't print
out two error messages.

MFC after:	3 days
2007-11-17 17:32:40 +00:00
Bjoern A. Zeeb
fc89eb3a4c Though we are currently not interested in the EDD3 flag,
Enhanced Disk Drive Specification Ver 3.0 defines that the version
of extension in AH would be 30h.
Correct the check for that to be >=30h instead of >3h.
MFC after:	2 months
2007-11-12 23:53:43 +00:00
Ruslan Ermilov
a10b45505a Document the per-arch default value of kern.maxbcache. 2007-11-08 11:59:38 +00:00
John Baldwin
8518d50a63 - Add constants for the different memory types in the SMAP table.
- Use the SMAP types and constants from <machine/pc/bios.h> in the boot
  code rather than duplicating it.
2007-10-28 21:23:49 +00:00
John Baldwin
fd6d060f0d Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE is
defined.  This lets each boot program choose which version of cgbase() it
wants to use rather than forcing ufsread.c to have that knowledge.

MFC after:	1 week
Discussed with:	imp
2007-10-26 21:02:31 +00:00
John Baldwin
150b476d94 Add . to the include path so that we follow the 'machine' symlink we create
during depend on amd64.

Reported by:	rwatson
2007-10-26 15:56:22 +00:00
Warner Losh
8d7b90cdd7 The arm boot code uses this function as well. Redefining cgbase()
saves about 500 bytes in the boot code.  While the AT91RM9200 has 12k
of space for the boot loader, which is more than i386's 8k, the code
generated by gcc is a bit bigger.

I've had this in p4 for about two years now.
2007-10-26 15:00:34 +00:00
Olivier Houchard
26989574c9 Fix signedness to make gcc happy. 2007-10-25 22:50:25 +00:00
John Baldwin
627457cd4a Break out of the I/O retry loop as soon as an I/O operation succeeds rather
than always retrying operations three times.

Submitted by:	nyan
2007-10-25 16:53:35 +00:00
Yoshihiro Takahashi
34b1e3506c MFi386: part of 1.52
Split the pc98_partition specific routine in bd_opendisk()
into bd_open_pc98().
2007-10-25 14:31:52 +00:00
Yoshihiro Takahashi
91dfd26985 MFi386: part of revision 1.51
Rework the read/write support in the bios disk driver some to cut down
  on duplicated code.
  - All of the bounce buffer and retry logic duplicated in bd_read() and
    bd_write() are merged into a single bd_io() routine that takes an
    extra direction argument.  bd_read() and bd_write() are now simple
    wrappers around bd_io().
2007-10-25 12:57:46 +00:00
Warner Losh
3e6468f751 Load the bytes into the EMAC's MAC address register in the proper
order.  The kernel used to shuffle them around to get things right,
but that was recently fixed.  This makes our boot loader match the
behavior of most other boot loaders for the atmel parts.  This bug was
inherited from the Kwikbyte loader that we started from.

This bug was discovered by Bj.ANvrn KNvnig back in June, but fell on the
floor.  He provided patches to the kernel, include backwards
compatibility options that were similar to Olivier's if_ate.c commit.
2007-10-25 07:05:38 +00:00
John Baldwin
f352a0d45f First cut at support for booting a GPT labeled disk via the BIOS bootstrap
on i386 and amd64 machines.  The overall process is that /boot/pmbr lives
in the PMBR (similar to /boot/mbr for MBR disks) and is responsible for
locating and loading /boot/gptboot.  /boot/gptboot is similar to /boot/boot
except that it groks GPT rather than MBR + bsdlabel.  Unlike /boot/boot,
/boot/gptboot lives in its own dedicated GPT partition with a new
"FreeBSD boot" type.  This partition does not have a fixed size in that
/boot/pmbr will load the entire partition into the lower 640k.  However,
it is limited in that it can only be 545k.  That's still a lot better than
the current 7.5k limit for boot2 on MBR.  gptboot mostly acts just like
boot2 in that it reads /boot.config and loads up /boot/loader.  Some more
details:
- Include uuid_equal() and uuid_is_nil() in libstand.
- Add a new 'boot' command to gpt(8) which makes a GPT disk bootable using
  /boot/pmbr and /boot/gptboot.  Note that the disk must have some free
  space for the boot partition.
  - This required exposing the backend of the 'add' function as a
    gpt_add_part() function to the rest of gpt(8).  'boot' uses this to
    create a boot partition if needed.
- Don't cripple cgbase() in the UFS boot code for /boot/gptboot so that
  it can handle a filesystem > 1.5 TB.
- /boot/gptboot has a simple loader (gptldr) that doesn't do any I/O
  unlike boot1 since /boot/pmbr loads all of gptboot up front.  The
  C portion of gptboot (gptboot.c) has been repocopied from boot2.c.
  The primary changes are to parse the GPT to find a root filesystem
  and to use 64-bit disk addresses.  Currently gptboot assumes that the
  first UFS partition on the disk is the / filesystem, but this algorithm
  will likely be improved in the future.
- Teach the biosdisk driver in /boot/loader to understand GPT tables.
  GPT partitions are identified as 'disk0pX:' (e.g. disk0p2:) which is
  similar to the /dev names the kernel uses (e.g. /dev/ad0p2).
- Add a new "freebsd-boot" alias to g_part() for the new boot UUID.

MFC after:	1 month
Discussed with:	marcel (some things might still change, but am committing
			what I have so far)
2007-10-24 21:33:00 +00:00
John Baldwin
2143962647 Rework the read/write support in the bios disk driver some to cut down
on duplicated code and support 64-bit LBAs for GPT.
- The code to manage an EDD or C/H/S I/O request are now in their own
  routines.  The EDD routine now handles a full 64-bit LBA instead of
  truncating LBAs to the lower 32-bits.  (MBRs and BSD labels only
  have 32-bit LBAs anyway, so the only LBAs ever passed down were 32-bit).
- All of the bounce buffer and retry logic duplicated in bd_read() and
  bd_write() are merged into a single bd_io() routine that takes an
  extra direction argument.  bd_read() and bd_write() are now simple
  wrappers around bd_io().
- If a disk supports EDD then always use it rather than only using it if
  the cylinder is > 1023.  Other parts of the boot code already do
  something similar to this.  Also, GPT just uses LBAs, so for a GPT disk
  it's probably best to ignore C/H/S completely.  Always using EDD when
  it is supported by a disk is an easy way to accomplish this.

MFC after:	1 week
2007-10-24 12:49:55 +00:00
Yoshihiro Takahashi
1c44b03ee9 MFi386: revision 1.50
Reindent the read/write code of bd_realstrategy() so it is more readable.
2007-10-24 12:03:48 +00:00
Yoshihiro Takahashi
18a60bb546 MFi386: revision 1.41
Slightly cleanup the 'bootdev' concept on x86 by changing the various
  macros to treat the 'slice' field as a real part of the bootdev instead
  of as hack that spans two other fields (adaptor (sic) and controller)
  that are not used in any modern FreeBSD boot code.
2007-10-24 11:54:04 +00:00
John Baldwin
08981e2f6d Reindent the read/write code of bd_realstrategy() so it is more readable.
MFC after:	1 week
2007-10-24 04:13:35 +00:00
John Baldwin
5c5b5d4607 Slightly cleanup the 'bootdev' concept on x86 by changing the various
macros to treat the 'slice' field as a real part of the bootdev instead
of as hack that spans two other fields (adaptor (sic) and controller)
that are not used in any modern FreeBSD boot code.

MFC after:	1 week
2007-10-24 04:03:25 +00:00
Yoshihiro Takahashi
51626c2003 Optimize for size on pc98. It enables to boot a kernel again.
I don't know what's wrong (loader, boot2 or others), but this change is
effective.

Tested by:	NAKAJI Hiroyuki
MFC after:	3 days
2007-10-15 14:20:24 +00:00
Paul Saab
671a6b8e9a Do not attempt to make an NFS rpc call if using tftp
PR:		kern/91720
Submitted by:	Ruben Kerkhof
2007-10-12 17:09:43 +00:00
David E. O'Brien
fb6e00667c Also boot *.debug if everything else fails.
Approved by:	re(gnn)
2007-10-04 18:29:52 +00:00
Ruslan Ermilov
2c822a5b73 Mention that autoboot_delay also accepts the "NO" value.
Approved by:	re (kensmith)
2007-09-26 08:38:25 +00:00
Warner Losh
eb2e7f82ff Don't pass RB_BOOTINFO to the kernel. There's no bootinfo actually
passed into the kernel, and the kernel will soon grow that ability on
arm.

Approved by: re@ (blanket)
2007-08-17 18:22:31 +00:00
Warner Losh
4ced8fb56a Use the .S version for now. I have a version optimized for size p4,
but I'm unsure of its provenance, so rather than add it here, revert
the migration to it.

Approved by: re@ (blanket)
2007-08-09 05:16:55 +00:00
Warner Losh
229af622b8 MFp4:
Add support for the CENTIPAD board (http://www.harerod.de/centipad/index.html)
	(which is a very cool, very small ARM board)
Add support for KB9202B (it has different memory)
Make BOOT_FLAVOR settable
Minor cleanup nits

Approved by: re@
2007-07-13 14:27:05 +00:00
Rong-En Fan
534046e301 - Remove UMAP filesystem. It was disconnected from build three years ago,
and it is seriously broken.

Discussed on:   freebsd-arch@
Approved by:	re (mux)
2007-06-25 05:06:57 +00:00
Marius Strobl
aa785996fd - Make better use of the global chosen, memory and mmu handles instead
of obtaining them over and over again and pretending we could do
  anything useful without them (for chosen this includes adding a
  declaration and initializing it in OF_init()).
- In OF_init() if obtaining the memory or mmu handle fails just call
  OF_exit() instead of panic() as the loader hasn't initialized the
  console at these early stages yet and trying to print out something
  causes a hang. With OF_exit() one at least has a change to get back
  to the OFW boot monitor and debug the problem.
- Fix OF_call_method() on 64-bit machines (this is a merge of
  sys/dev/ofw/openfirm.c rev 1.6).
- Replace OF_alloc_phys(), OF_claim_virt(), OF_map_phys() and
  OF_release_phys() in the MI part of the loader with wrappers around
  OF_call_method() in the sparc64. Beside the fact that they duplicate
  OF_call_method() the formers should never have been in the MI part
  of the loader as contrary to the OFW spec they use two-cell physical
  addresses.
- Remove unused functions which are also MD dupes of OF_call_method().
- In sys/boot/sparc64/loader/main.c add __func__ to panic strings as
  different functions use otherwise identical panic strings and make
  some of the panic strings a tad more user-friendly instead of just
  mentioning the name of the function that returned an unexpected
  result.
2007-06-17 00:17:15 +00:00
Marius Strobl
555f163cd2 - Remove dupe and unused declarations and prototypes.
- Add missing prototypes.
- Define global variables not used outside of this module as static.
- Replace some outdated hard-coded functions names in panic strings
  with __func__.
- Fix some style(9) bugs.
2007-06-16 21:46:15 +00:00
Marius Strobl
7d62dd366b Sync the styles of sys/boot/ofw/libofw/openfirm.c and
sys/dev/ofw/openfirm.c with themselves, with each-other
and with style(9).
2007-06-16 21:38:04 +00:00
Hidetoshi Shimokawa
97995404be MFp4: add FireWire/dcons support in loader for i386/amd64.
It is disabled by default. You need to put
LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf
and rebuild loader to enable it.
(cd /sys/boot/i386 && make clean && make && make install)

You can find a short introduction of dcons at
http://wiki.freebsd.org/DebugWithDcons
2007-05-29 14:35:57 +00:00
Marcel Moolenaar
9beb1d0779 Have the processor defer all faults and exceptions for control
speculative loads. This at least makes control speculative loads
work. In the future we should analyze which faults/exceptions
we want to handle rather than defer to avoid having to call the
recovery code when it's not strictly necessary.
2007-05-27 19:02:47 +00:00
Jung-uk Kim
bf5a3266f7 Use lower cases for UUID string to conform RFC4122 and ISO/IEC-9834-8:2005. 2007-05-21 18:48:18 +00:00
Alexander Kabaev
12c95a2554 Tweak inlining parameters a little. Add warning to tell us if function
we declared as inline can not be inlined.
2007-05-19 05:07:47 +00:00
Stephane E. Potvin
c085f6bbf6 Add documentation for the vm.kmem_size_min and vm.kmem_size_max tunables.
Approved by: njl (mentor, blanket)
2007-05-09 02:37:58 +00:00
John-Mark Gurney
7f2f71862f fixup talk of kern.maxswzone... It's been 32MB for almost 5 years now...
and only supports just over 7GB of swap...

Sound a bit more professional..

Inspired by:	Marc G. Fournier
MFC After:	3 days
2007-05-05 17:36:42 +00:00
Pawel Jakub Dawidek
151db24af1 Add zfs_load here.
Reminded by:	bmah
2007-04-09 22:09:09 +00:00
Pawel Jakub Dawidek
1868634782 Always try to load zpool.cache instead of trying to find good place to
document it. When there is no such file, it's invisible for the user.
2007-04-09 00:04:54 +00:00
Yoshihiro Takahashi
55ccb0b485 Fix build. 2007-04-07 13:37:45 +00:00
KATO Takenori
f2a081cfe4 Added the IPLware 3.33 support.
- Added magic numbers to pretend the NEC original program version
    2.70.
  - Added string display routine with Shift-JIS code support.
  - Added three nop instructions at start1 in start.s since the
    installaer of the IPLware put 'call $0x09ab' instruction.
  - Put the near return instruction at 0x9ab in selector.s.

Since the Shit-JIS display routine must be located at 0x1243, the
linker script file (ldscript) is applied.
2007-04-07 08:37:04 +00:00
Alexander Kabaev
7d80a3b493 pc98 boot2 is compiled with _KERNEL defined, and that makes non-static
bootinfo variable declaration visible. It conflicts with static
declaration in this file. Declare variable as globally visible in
order to resolve the conflict.
2007-04-06 20:50:24 +00:00
Warner Losh
cf5bdd4446 Loop on sdcard init. This helps if one hasn't plugged in the card
fast enough, or there's other issues that cause the first try to fail.
2007-04-02 20:26:04 +00:00
Warner Losh
bc5676e30c RTC_TIMR's RTC_SEC field is BCD. That makes it unsuitable for
GetSeconds().  Instead, use CRTR register shifted right 15.  This
gives us a range of 32 seconds we can do for timeout.

Shift to using == rather than < or > for calculating the timeout,
since if we can't read the ST_CTRT register twice in a second we have
even bigger problems to worry about, and == deals with the 'wrap'
issue.

This lets me type at the boot2 prompt again!  Woo Hoo!

Bogusness noticed by: tisco
Pointy Hat to: That silly imp guy
2007-03-28 22:40:37 +00:00
Warner Losh
d63927b199 Since we're about to set ST_RTMR to 1 to increase the accuracy of the
CRTR register to be 1/32768th of a second in init, we don't need to do
it here.
2007-03-28 22:38:01 +00:00
Warner Losh
304d0536ab All SD cards have a block size of 512. The READ_BL_LEN field in the
CSD is usually 512 (well, 9), but for 2GB (and the rogue 4GB SD cards)
it is 1024 (or 2048 for 4GB).  This value doesn't work for the block
read commands (which really want 512).  Hardcode 512 for those.  This
may break really old MMC cards that don't have a 512 block size (I've
never seen one: make my day and send me one :-), but since the MMC
side of the house is currently broken, it should only have the effect
that 2GB (and non-conforming 4GB) SD cards will work.

My 'non-conforming' 4GB SD card also works now too.  The
non-conforming 4GB SD cards were sold for a while before the SD
association was worried they would be (a) incompatible (different FAT
flavor on them) and (b) confusing for the new SDHC standard and
cracked down on suppliers' bogus use of the SD trademark...
2007-03-28 22:31:32 +00:00
Warner Losh
89e75021fa Various buglets fixed (from submitter):
The changes to getstr() is so that the character that is
	passed in to it, is also processed just as the rest. I also
	removed one of the getc() calls otherwise you loose every
	second character.

	I also changed the strcpy of kname, so that it only happens if
	kname is '\0'. This is so that one can pass a kernel in
	through /boot.config.

	The last change to boot2.c is in parse(). If you tried to type
	a kernel name to boot, the first character was lost, the arg--
	fix that.

Submitted by: jhay
2007-03-28 21:18:45 +00:00
Warner Losh
5a8da39aa7 Fix problem where memcmp would return true in the case where the
character after the character that was the same.

Submitted by: jhay
2007-03-28 21:15:50 +00:00
Warner Losh
a480291907 Fix off by one error in length of the string.
Submitted by: jhay
2007-03-28 21:12:43 +00:00
Thomas Quinot
9068c00114 Fix setting of serial port speed. A junk value was passed in AX when
bioscom is called to set up serial port parameters because COMSPEED
was treated as an address instead of an immediate value, causing
serial port parameters to never be set.

PR:		i386/110828
Reviewed by:	jhb
MFC after:	2 weeks
2007-03-26 21:56:13 +00:00
Jung-uk Kim
5bf7a61bb3 Update to FICL 3.03 (the last release before FICL4 rewrite).
The relevant changes for FreeBSD (excerpt from the release note):

  * Newly implemented CORE EXT words: CASE, OF, ENDOF, and ENDCASE. Also
    added FALLTHROUGH, which works like ENDOF but jumps to the instruction
    just after the next OF.
  * Bugfix: John-Hopkins locals syntax now accepts | and -- in the comment
    (between the first -- and the }.)
  * Bugfix: Changed vmGetWord0() to make Purify happier. The resulting
    code is no slower, no larger, and slightly more robust.
2007-03-23 22:26:01 +00:00
Jung-uk Kim
2be4e4713a Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
KATO Takenori
8a44b47598 - Moved the uninitialized variables from the data to the bss section.
- Fixed typos in comment.
2007-03-17 05:30:03 +00:00
Warner Losh
ae65af401c Remove vestiges of very specific fpga support for my company's board.
It isn't relevant to FreeBSD as a whole, breaks the build, and isn't
even needed for my company's boards anymore...

MFC After: 2 weeks
2007-03-15 03:31:49 +00:00
Yoshihiro Takahashi
a0c908882c MFi386: revision 1.17.
Fix the cdboot twiddle display.
2007-03-04 04:53:17 +00:00
Remko Lodder
54084306cd Fix the cdboot twiddle display.
I created and tested this with a custom FreeSBIE cd-image.

PR:		i386/96452
Submitted by:	Yuichiro Goto <y7goto at gmail dot com>
MFC after:	3 days
Approved by:	imp (mentor)
2007-02-23 21:07:44 +00:00
Warner Losh
6ae9968c9a Document the init_chroot and init_script variables.
# I didn't check the markup too closely, so doc people, please check

Submitted by: Oliver Fromme
2007-02-04 06:35:10 +00:00
Maxim Konovalov
85cc83bafb o Wrap long lines. 2007-01-14 13:55:43 +00:00
Maxim Konovalov
6a81042b94 o Typo: note -> node.
PR:		misc/107906
Submitted by:	Alex Keda
MFC after:	3 days
2007-01-14 13:51:35 +00:00
Maxim Konovalov
7ffe3d57f0 o Move the comment to the correct place.
PR:		misc/107904
MFC after:	3 days
2007-01-14 12:20:31 +00:00
Marius Strobl
dc73f9b150 Garbage collect the code for auto-loading modules based on ISAPNP IDs,
which is #if'ed out since nearly eight years, along with its outdated
database.

Agreed by:	ru (some months ago)
2007-01-07 22:25:45 +00:00
Warner Losh
6be1e1ff38 MFp4: differences for bwct ethernet attachment 2006-12-20 18:26:37 +00:00
Warner Losh
452f9afb5e MFp4: Differences in flash part for bwct. need a more generic way to cope. 2006-12-20 18:25:16 +00:00
Warner Losh
a9295f4074 MFp4: Add timeout to eeprom access for lame eeprom that go awol 2006-12-20 18:19:52 +00:00
Warner Losh
a082bf6243 MFp4: bwct memory size and PLL parameters 2006-12-20 18:18:24 +00:00
Warner Losh
b0785d970d MFp4: bwct boot rom is different. need a more generic way to cope long term. 2006-12-20 18:16:49 +00:00
Warner Losh
1962e68df3 MFp4: Delay a second or two after the upload before printing Done.
Add an automatic reset for remote operational luvin' goodness.
2006-12-20 17:50:02 +00:00
Warner Losh
ea705f59a6 MFp4: bwct is a new board choice. 2006-12-20 17:47:54 +00:00
Kip Macy
2d74924b65 add an interface for passing the entire kernel size up front to the
loader so that it can memory can be allocated aligned at the beginning of
the desired large page
2006-12-18 07:35:14 +00:00
Pyun YongHyeon
c431ce80f0 Add an entry for the msk(4) module. 2006-12-13 02:48:22 +00:00
John Baldwin
44496fb5f2 Ignore any breakpoint instructions (int 3) we encounter in vm86 mode
rather than treating them as a fatal exception and halting.  At least one
storage BIOS (some newer mpt(4) parts) have a breakpoint instruction in
their disk read routine.

MFC after:	3 days
2006-12-06 17:45:35 +00:00
Yaroslav Tykhiy
8eb4aedee6 Note that not all architectures use sendfile(2) buffers;
refer to the respective manpage for details.

MFC after: 3 days
2006-11-29 05:53:25 +00:00
Kip Macy
1862415c25 remove CDDL derive hcall.S 2006-11-23 21:29:50 +00:00
Marcel Moolenaar
56d881b917 Remove LDR_LOG2_PGSZ, ia64_pgtbl and ia64_pgtblsz. They are part of
a WIP and not used yet.
2006-11-19 20:04:11 +00:00
Ruslan Ermilov
8d594a3fb5 Remove an unused variable. 2006-11-16 13:32:30 +00:00
Warner Losh
f358fbffa9 Mfp4: Remove mci_device.c. It should have been removed when it was
merged ito sd-card.c, but this is an imperfect world.
2006-11-16 00:55:24 +00:00
Warner Losh
e2302bcc3d Move to using a common arm_init.S. These things are more similar than
different at this point.
2006-11-16 00:53:28 +00:00
Warner Losh
a2288572aa MFp4: Don't fix the size at 8k, and some minor cleanups. andre@ contributed
to fixing this problem.
2006-11-16 00:49:50 +00:00
Warner Losh
b9f3efc87a MFp4: Improvements, including the ability to download to an arbitrary
part of the spi flash.
2006-11-16 00:48:53 +00:00
Warner Losh
1920635c8e Tweaks for better boot flavor support. 2006-11-16 00:48:04 +00:00
Warner Losh
88009adfcf Mfp4: We no longer need ee.h included here. 2006-11-16 00:47:31 +00:00
Warner Losh
f31202e5dd MFp4: boot2 should now build 2006-11-09 20:45:22 +00:00
Warner Losh
338cfe36cf MFp4: boot on KB9202 correctly. Also, reduce the size of the SD/MMC driver
somewhat.
2006-11-09 20:32:36 +00:00
Warner Losh
ee9a71cdf5 MFp4: Support KB9202 booting better 2006-11-09 20:23:51 +00:00
Warner Losh
9b1ab45dc1 Fix typo 2006-11-09 20:08:46 +00:00
Warner Losh
e2a7a4c11c MFp4: Make boot2 work on Kwikbyte KB9202 boards. 2006-11-09 20:07:26 +00:00
Warner Losh
c2c2926f9e MFp4: Merge a slightly more generic build infrastructure. 2006-11-09 19:58:14 +00:00
Warner Losh
728ba3929d MFp4: Remove bogus \r 2006-11-09 19:55:25 +00:00
Yoshihiro Takahashi
9c412a61a0 Add a stub of bios_addsmapdata(). PC98 does not have BIOS SMAP. 2006-11-09 08:28:02 +00:00
Yoshihiro Takahashi
0765091d0e MFi386: revisions from 1.39 to 1.43. 2006-11-09 08:05:51 +00:00
Marcel Moolenaar
0463b4a2fb Major rework of the ia64 loaders. The two primary objectives are:
1. Make libefi portable by removing ia64 specific code and build
   it on i386 and amd64 by default to prevent regressions. These
   changes include fixes and improvements over previous code to
   establish or improve APIs where none existed or when the amount
   of kluging was unacceptably high.
2. Increase the amount of sharing between the efi and ski loaders
   to improve maintainability of the loaders and simplify making
   changes to the loader-kernel handshaking in the future.

The version of the efi and ski loaders are now both changed to 1.2
as user visible improvements and changes have been made.
2006-11-05 22:03:04 +00:00
Marcel Moolenaar
aa08c7e56e Make this compile on EFI32. The EFI_PHYSICAL_ADDRESS type is always
64-bit, even when sizeof(void *) is 32-bit.
2006-11-03 04:19:31 +00:00
Marcel Moolenaar
11f8548a0d Properly calculate the checksum of the APIC table. 2006-11-03 04:04:19 +00:00
Ruslan Ermilov
000a0f2a71 Unbreak compile with ELF_VERBOSE defined, and fix format warnings. 2006-11-02 17:52:43 +00:00
Ruslan Ermilov
593bbd2195 Revert the last change. Masking only 2 MSBs of the virtual address
to get the physical address doesn't work for all values of KVA_PAGES,
while masking 8 MSBs works for all values of KVA_PAGES that are
multiple of 4 for non-PAE and 8 for PAE.  (This leaves us limited
with 12MB for non-PAE kernels and 14MB for PAE kernels.)

To get things right, we'd need to subtract the KERNBASE from the
virtual address (but KERNBASE is not easy to figure out from here),
or have physical addresses set properly in the ELF headers.

Discussed with:	jhb
2006-11-02 17:28:38 +00:00
Marcel Moolenaar
6576695766 Sync the EFI headers with version 1.10.14.62 of the Intel sample EFI
implementation. This re-introduces C99 style comments that previously
were replaced by original C comments.
2006-11-02 02:42:48 +00:00
Marcel Moolenaar
932d8c46a2 Extend struct devdesc with a unit field, called d_unit. Promote the
device (kind) specific unit field to the common field. This change
allows a future version of libefi to work without requiring anything
more than what is defined in struct devdesc and as such makes it
possible to compile said version of libefi for different platforms
without requiring that those platforms have identical derivatives
of struct devdesc.
2006-11-02 01:23:18 +00:00
Marcel Moolenaar
5cae408f81 Don't unconditionally compile-in the bcache code. It's only used on
i386/amd64 and pc98. Remove useless calls to bcache_init() from the
ia64 and sparc64 loaders, as well as from the OFW common code.
2006-11-02 00:26:45 +00:00
Marcel Moolenaar
ac2bbfc8cf o Make sure to clear f->f_devdata if d_dev->dv_open() fails. It
would otherwise cause devclose() to free() the memory again.
o  Refactor devopen() so that it's more readable.
2006-11-02 00:02:22 +00:00
Ruslan Ermilov
da6d4298b7 Because the BTX mini-kernel now uses flat memory mode and clients
are no longer limited to a virtual address space of 16 megabytes,
only mask high two bits of a virtual address.  This allows to load
larger kernels (up to 1 gigabyte).  Not masking addresses at all
was a bad idea on machines with less than >3G of memory -- kernels
are linked at 0xc0xxxxxx, and that would attempt to load a kernel
at above 3G.  By masking only two highest bits we stay within the
safe limits while still allowing to boot larger kernels.

(This is a safer reimplmentation of sys/boot/i386/boot2/boot.2.c
rev. 1.71.)

Prodded by:	jhb
Tested by:	nyan (pc98)
2006-10-29 14:50:58 +00:00
Ruslan Ermilov
50159fa216 Adopt comments borrowed from aout_freebsd.c. 2006-10-26 20:04:22 +00:00
Ruslan Ermilov
5a20bc0d54 Restore support for -c and -d that were treacherously murdered in
rev. 1.58.  (This only costs us four bytes.)

Prodded by:	bde
MFC after:	3 days
2006-10-26 19:41:02 +00:00
Ruslan Ermilov
5098c00abe Back out rev. 1.71 as it breaks directly loading (i386) kernels.
OK'ed by:	jhb
PR:		i386/96430, i386/104709
MFC after:	3 days
2006-10-26 19:15:54 +00:00
Warner Losh
ecaaf14497 Don't descend into at91 until we sort out the boot loader issues more generally 2006-10-23 00:05:28 +00:00
Warner Losh
ea8c4b451e MFp4: default to not loading the fpga 2006-10-21 22:51:21 +00:00
Warner Losh
7a7404e61a MFp4: Update to smaller code footprint. 2006-10-21 22:44:26 +00:00
Warner Losh
5c58ee12d5 MFp4: Move to smaller code footprint. 2006-10-21 22:43:39 +00:00
Warner Losh
9c99b493ea MFp4: Move to smaller code. This was somehow forgotten before. 2006-10-21 22:43:07 +00:00
Warner Losh
f8b97a442a There's no fpga.c, so omit it. 2006-10-20 16:57:30 +00:00
Warner Losh
184ed5f988 MFp4:
Massive update.  The highlights:
	o dramatically cut memory usage by writing better, less intertwingled
	  code.
	o implement booting off mmc/sd cards (sd only tested one at the moment)
	o start to split out board specific stuff for boot2.
2006-10-20 09:12:05 +00:00
Ruslan Ermilov
675e8ac08c Replace a rarely used "depuration" with "debugging".
PR:		docs/85127
Submitted by:	Gary W. Swearingen (partially)
MFC after:	3 days
2006-10-13 20:48:17 +00:00
Kip Macy
6e0c768ca7 more sun4v fallout - missed add
Approved by: rwatson (mentor)
2006-10-09 07:00:59 +00:00
Kip Macy
a9928b2f58 unbreak sparc64 loader build
re-add accidentally deleted asi value
remove sun4v only header include

Approved by: rwatson (mentor)
Reviewed by: jmg
2006-10-09 05:59:04 +00:00
Kip Macy
0209c79363 add sun4v support to the sparc64 boot loader
Approved by: rwatson (mentor)
Reviewed by: jmg
Tested by: kris, dwhite, and jmg
2006-10-09 04:43:07 +00:00
Pav Lucistnik
1cd46fae01 - Update URL of Intel documentation
Submitted by:	Rob <spamrefuse@yahoo.com> on freebsd-doc
MFC after:	3 days
2006-10-07 10:39:34 +00:00
John Baldwin
ce34bd6bca - Fix a couple of improper uses of leal in the previous space saving
commits.  For some reason I thought the scale factor was a shift count
  rather than the multiplicand (that is, I thought leal (%eax,%edx,4) was
  going to generate %eax + %edx << 4 rather than %eax + %edx * 4).  What
  I need is to multiply by 16 to convert a real-mode (seg, offset) tuple
  into a flat address.  However, the max multiplicand for scaled/index
  addressing on i386 is 8, so go back to using a shl and an add.
- Convert two more inter-register mov instructions where we don't need to
  preserve the source register to xchg instructions to keep our space
  savings.

Tested by:	Ian FREISLICH if at hetzner.co.za
MFC after:	1 week
2006-10-05 15:30:51 +00:00
Ariff Abdullah
f545d39274 Add module loading option for Intel High Definition Audio Controller
- snd_hda(4)
2006-10-01 14:58:30 +00:00
Alexander Leidinger
5fb623adda Add snd_envy24ht and remove the snd_ak4* module. 2006-09-30 18:07:26 +00:00
Ruslan Ermilov
cab4aede58 Fix WARNS=2 warnings. 2006-09-29 20:57:38 +00:00
Ruslan Ermilov
6dcf625c41 Fix most of the WARNS=2 warnings. 2006-09-29 20:27:41 +00:00
John Baldwin
f3088510e2 Oops, add return values for the smap command function. We must have the
warnings set weird or something because gcc didn't warn about this at all.

Submitted by:	ru
2006-09-29 20:07:16 +00:00
John Baldwin
d64e328e3c Tweak the code to handle intercepting BIOS calls to int 0x15 to shave
another 16 bytes off of BTX (and thus boot2):
- Compare against the value of %eax that is saved on the stack instead of
  loading it into %eax (which requires saving the current %eax on the
  stack).
- Use %ch to examine the keyboard flag state in the BIOS to see if
  Ctrl-Alt-Del is pressed instead of %al so we don't have to save %eax on
  the stack anymore.

MFC after:	1 week
2006-09-28 19:42:10 +00:00
John Baldwin
4b9657e974 Optimize the int 15/87 handler for space to shave another 16 bytes off of
BTX (and thus boot2):
- Don't bother saving %eax, %ebx, or %ecx as it is not necessary.
- Use a more compact sequence to load the base value out of a GDT entry
  by loading the contiguous low 24 bits into the upper 24 bits of %eax,
  loading the high 8 bits into %al, and using a ror to rotate the bits
  (2 mov's and a ror) rather than loading the pieces in smaller chunks
  (3 mov's and a shl).
- Use movzwl + leal instead of movl + movw + shll + addl.
- Use 'xchgl %eax,%foo' rather than 'movl %eax,%foo' for cases where
  it's ok to trash %eax.  xchgl %eax, foo is a 1-byte opcode whereas the
  mov is a 2-byte opcode.
- Use movzwl rather than xorl + movw.

MFC after:	1 week
2006-09-28 19:38:02 +00:00
John Baldwin
c4f7c44bb3 Add an 'smap' command that dumps out the BIOS SMAP.
MFC after:	1 week
2006-09-28 19:07:13 +00:00
John Baldwin
64786948cc Ignore a sub-topic match if it is inside the command description.
Otherwise, merge-help can get confused by a command description that
includes a word that starts with a capital S.

MFC after:	1 week
2006-09-28 19:06:20 +00:00
John Baldwin
add92b34d1 A couple of simple tweaks that trim BTX by 6 bytes. Since BTX is
16-byte aligned within boot2 however, this actually trims boot2 by 16
bytes.
2006-09-28 16:30:36 +00:00
Ruslan Ermilov
2d78e8c5f1 Add -march=i386 to fix amd64 build by generating the same code
as i386 would do.
2006-09-28 10:02:04 +00:00
John Baldwin
3ea944faa0 Emulate moving cr0, cr2, cr3, or cr4 into any i386 general register
rather than just emulating mov cr0, eax.  This fixes some Compaq/HP BIOS
with DMA (as the BIOS tried to read cr3 so it could translate addresses
if paging was enabled).

MFC after:	1 week
2006-09-27 19:32:26 +00:00
Tor Egge
a1e363f256 Add mnt_noasync counter to better handle interleaved calls to nmount(),
sync() and sync_fsync() without losing MNT_ASYNC.  Add MNTK_ASYNC flag
which is set only when MNT_ASYNC is set and mnt_noasync is zero, and
check that flag instead of MNT_ASYNC before initiating async io.
2006-09-26 04:15:59 +00:00
Ruslan Ermilov
b0e014af29 - Include <sys/reboot.h> to get the RB_* defines.
- Make the PROBE_KEYBOARD option better resemble the -P option in
  boot2, i.e., if keyboard isn't present then boot with both
  RB_SERIAL and RB_MULTIPLE set.

Reviewed by:	jhb
2006-09-05 19:28:03 +00:00
Ruslan Ermilov
23471380b5 Make the default "init_path" value breakable, so it fits on the
screen's width, thus eliminating a groff(1) warning.

Suggested by:	marck
2006-08-20 09:31:17 +00:00
Warner Losh
c3dec0b20d Copy powerpc ficl files sysdep files (maybe we need a common one) 2006-08-18 21:41:43 +00:00
Warner Losh
1e99975d1f Build at91 2006-08-18 21:37:27 +00:00
Warner Losh
7127c5f8f5 Support compiling as part of world 2006-08-18 20:26:54 +00:00
Christian Brueffer
b988495e7b Wordsmithing on the ixgb(4) and mxge(4) descriptions.
Suggested by:	ru (ixgb)
2006-08-18 19:03:28 +00:00
Christian Brueffer
a4ec0f47af Add more modules, correct alphabetical order. 2006-08-18 17:48:17 +00:00
Dmitry Morozovsky
6bf0d59557 kern.ipc.nmbclusters is sysctl, not compile-time option. Change Dv to Va.
Touch .Dd.

Pointed out by:	ru
MFC after:	1 week
2006-08-18 10:15:01 +00:00
Dmitry Morozovsky
86ddfd1205 Remove references to NMBCLUSTERS which is obsoleted.
PR:		100427
Approved by:	maxim
MFC after:	1 week
2006-08-18 08:03:06 +00:00
Warner Losh
aade86560a MFp4: changes since .s -> .S rename. Use correct header for size 2006-08-17 00:14:32 +00:00
Warner Losh
fc96acb9c7 MFp4: First cut at making spi and/or sd card booting work, needs work 2006-08-16 23:39:58 +00:00
Warner Losh
a2d68f2284 MFp4:
Tidy up a bit.  Make sure that the burned image matches the downloaded
one.
2006-08-16 23:18:07 +00:00
Warner Losh
5faf79cd4c MFp4:
Simplify life a little for such a simple program.
2006-08-16 23:14:52 +00:00
Christian Brueffer
03af12c1ac Several updates:
- Added missing file system/network/sound module entries
- Removed obsolete network module entries
- Capitalized (Fast|Gigabit) Ethernet

MFC after:	1 week
2006-08-14 18:04:01 +00:00
Warner Losh
100d8ed79b MFp4: Integrate a boatload of bug fixes from p4. We're right on the
8k boundary with this program still.

   text    data     bss     dec     hex filename
   7925       4    4476   12405    3075 bootiic.out

so we have like 293 bytes left before we have to play games.  There
may be ways to reduce that somewhat, but they start to be very board
specific.
2006-08-10 19:55:52 +00:00
Warner Losh
8440b5885d MFp4:
Reach over into the arm tree to grab some at91 definitions.
Better warnings
Lots of build tweaks
2006-08-10 18:22:56 +00:00
Warner Losh
20311a8e46 MFp4: remove obsolete files 2006-08-10 18:19:45 +00:00
Warner Losh
87ad01e6e3 MFp4:
Remove obsolete files in list
	Add spi flash reading routines
2006-08-10 18:14:35 +00:00
Warner Losh
d4a46cca62 MFp4: Numerous changes from p4 to try to improve tftp downloading,
reduce code footprint, etc.  While some problems still remain, the
reliability of tftp is much improved.
2006-08-10 18:11:22 +00:00
Warner Losh
cabd3e547a MFp4: consolidate #include files down to lib.h 2006-08-10 18:07:49 +00:00
Warner Losh
592c5848a6 MFp4: These will migrate to the boot specific directories because they
are too hard to share between the different boot loaders.
2006-08-10 18:07:01 +00:00
Warner Losh
98de821987 MFp4: Make it clearer that the address passed to the eeprom routines is
really an offset within the eeprom device, and not a IIC address.
2006-08-10 18:03:50 +00:00
Warner Losh
7492b55513 MFp4: Catchup with migration of some defines. 2006-08-10 18:02:27 +00:00
Warner Losh
5c35a13adf MFp4: Tweaks for our board. 2006-08-10 17:59:22 +00:00
Warner Losh
b51b3172ba MFp4: Increase character timeout to 10. Make it a #define for easier
changes in the future.  This helps with getting started and to
overcome the really sucky level of granuality this timeout has in
getc.  A timeout of 1 means 'wait until top of next second' rather
than 'wait for at least a second'.
2006-08-10 17:54:51 +00:00
Warner Losh
a1f26cebf0 Don't need to special case arm here anymore 2006-08-10 06:29:43 +00:00
Warner Losh
2e6c020cf2 Add a dummy makefile to keep build happy 2006-08-10 06:29:15 +00:00
Yaroslav Tykhiy
776fc0e90e Commit the results of the typo hunt by Darren Pilgrim.
This change affects documentation and comments only,
no real code involved.

PR:		misc/101245
Submitted by:	Darren Pilgrim <darren pilgrim bitfreak org>
Tested by:	md5(1)
MFC after:	1 week
2006-08-04 07:56:35 +00:00
Andrey A. Chernov
cfb1b19a60 Add snd_emu10kx_load 2006-07-26 12:59:42 +00:00
Pyun YongHyeon
68fbfb9241 Add an entry for the stge(4) module.
While I'm here remove a stale wx(4) entry which was removed 4 years,
9 months ago.
2006-07-25 01:02:22 +00:00
Warner Losh
08586b224d Don't descend into ${MACHINE} on the arm platforms. 2006-06-18 17:44:40 +00:00
Ian Dowse
9c0ce099e6 Increment the disk block offset after writing, not before. This
fixes filesystem corruption when nextboot.conf is located after
cylinder 1023. The bug appears to have been introduced at the time
bd_read was copied to create bd_write.

PR:		bin/98005
Reported by:	yar
MFC after:	1 week
2006-05-31 09:05:49 +00:00
Marius Strobl
07399d81d8 - Replace the entry for the no longer existing lnc(4) module with an
entry for the replacement le(4) module.
- Add an entry for the gem(4) module.
- Remove gratuitous whitespace in the description of the hme(4) entry.
2006-05-14 19:04:12 +00:00
Yoshihiro Takahashi
33cf0c5194 Add a bootable CD support. 2006-05-14 07:26:02 +00:00
John Baldwin
be5d6589e0 Remove more Alpha bits from the boot code including fixing several
stale comments.
2006-05-12 04:09:53 +00:00
John Baldwin
906d6c0eb1 Remove Alpha bits for ficl. 2006-05-12 04:07:42 +00:00
John Baldwin
67ab9fd759 First pass at removing Alpha kernel support. 2006-05-11 22:25:28 +00:00
Yoshihiro Takahashi
b42bfe1947 Fix build (s:pc98/cbus/cbus.h:pc98/pc98/pc98_machdep.h:)
Pointyhat to:	nyan
2006-05-09 14:20:17 +00:00
John Baldwin
cde0d87b26 Restore the pre-5.x behavior of only beeping if the user makes a bad
selection and not always beeping on startup.  The two bytes for the extra
'jmp' instruction were obtained by removing recognition of BSD/OS
partitions.

Requested by:	many
Tested by:	subset of many
Head nod:	imp, keramida
MFC after:	2 weeks
2006-05-03 13:43:46 +00:00
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
Yoshihiro Takahashi
94ac50dbcb MFi386: Enable beastie.4th. 2005-10-30 15:59:08 +00:00
Scott Long
fe8388fec2 Add back some bits. 2005-10-30 05:41:42 +00:00
Scott Long
aa845d2dc1 Replace loader_color with loader_logo 2005-10-30 05:36:23 +00:00
Marius Strobl
3727af6a8b - Add a workaround for the fact that OFW doesn't guarantee that
devices can be opened multiple times simultaneously but we're
  expected to be able to do so by the rest of the loader.
  This fixes booting from disks attached to the on-board SCSI
  controller of Sun Ultra 1 (previously this triggered a trap)
  and probably also of AX1115 boards.
- While here, remove unused variables and add empty lines where
  style(9) requires such.

Tested on:	powerpc (grehan), sparc64
MFC after:	1 month
2005-10-25 12:51:49 +00:00
Marius Strobl
79aae78c89 In ofw_parsedev() check the return value of malloc() and protect
against a NULL pointer dereference when ofw_parsedev() is called
with a NULL path argument.

Tested on:	powerpc (grehan), sparc64
2005-10-25 12:49:56 +00:00
Marius Strobl
89189a9d8e Use an ihandle_t to store the instance handle of an opened device
instead of a phandle_t (package handle). Since both are typedefed
to unsigned int, this is more or less cosmetic.
2005-10-20 11:14:34 +00:00
Marius Strobl
e3ad728cf2 Remove unused variables. 2005-10-20 10:39:09 +00:00
Jung-uk Kim
529bc4bf80 Export processor socket information. New environment variables are:
smbios.socket.enabled:		number of enabled sockets
smbios.socket.populated:	number of populated sockets
2005-10-18 20:03:31 +00:00
Maxim Sobolev
a9c76d92d2 Re-implement rev.1.76 with respect to the code size. 2005-10-16 20:22:36 +00:00
Maxim Sobolev
6267ee870d Backout previous commit - for some reason it overflows space constrains on
amd64. Better version will follow.
2005-10-16 19:49:44 +00:00
Maxim Sobolev
50d89fc56a Add new option `q', which makes second stage loader quiet unless autoboot
is disabled or fails.

MFC after:	1 week
2005-10-16 01:55:35 +00:00
Yoshihiro Takahashi
f51b0ce0ee MFi386: revision 1.33.
> Cause all flags passed by boot2 to set the respective loader(8)
  > boot_* variable.  The end effect is that all flags from boot2
  > are now passed to the kernel.
2005-09-30 13:24:14 +00:00
Ruslan Ermilov
fddd9c1d2f Cause all flags passed by boot2 to set the respective loader(8)
boot_* variable.  The end effect is that all flags from boot2
are now passed to the kernel.
2005-09-22 15:14:13 +00:00
Ruslan Ermilov
4750e08f7b Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE:
"boot_dfltroot", "boot_mute", and "boot_pause" respectively.
2005-09-22 15:06:58 +00:00
Ruslan Ermilov
5272ce4796 - RBX_MASK wasn't updated when RB_PAUSE was changed from 0x40000
to 0x100000 in rev. 1.67.

- NOPT wasn't updated (decremented) in previous revision.
2005-09-22 11:20:33 +00:00
Yoshihiro Takahashi
42244f27c2 Remove EPSON PC-386 note A/W/AE/WR support. 2005-09-14 12:39:06 +00:00
Yoshihiro Takahashi
abf04270da MFi386: revision 1.11. 2005-09-13 08:29:03 +00:00
Yoshihiro Takahashi
090559c76e MFi386: revisions 1.10 and 1.11.
- Add '-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3' to CFLAGS.
2005-09-13 08:27:38 +00:00
Gleb Smirnoff
a3a90a725c net.graph.ngqfreemax has been deprecated. 2005-08-31 10:51:55 +00:00
Ian Dowse
4832a19173 Add a "comconsole_speed" loader variable that can be used to change
the serial console speed (i386 and amd64 only). If the previous
stage boot loader requested a serial console (RB_SERIAL or RB_MULTIPLE)
then the default speed is determined from the current serial port
speed. Otherwise it is set to 9600 or the value of BOOT_COMCONSOLE_SPEED
at compile time.

This makes it possible to set the serial port speed once in
/boot.config and the setting will propagate to boot2, loader and
the kernel serial console.
2005-08-18 01:39:43 +00:00
Ian Dowse
a00a259113 Add the ability to specify the boot2 serial console speed in
/boot.config or on the "boot:" prompt line via a "-S<speed>" flag,
e.g. "-h -S19200". This adds about 50 bytes to the size of boot2
and required a few other small changes to limit the size impact.
This changes only affects boot2; there are further loader changes
to follow.
2005-08-18 00:42:45 +00:00
Marius Strobl
1b279bfb52 - Change the code that determines whether to use a serial console and
which serial device to use in that case respectively to not rely on
  the OFW names of the input/output and stdin/stdout devices. Instead
  check whether input and output refers to the same device and is of
  type serial (uart(4) was already doing this) and for the fallback
  to a serial console in case a keyboard is the selected input device
  but unplugged do the same for stdin and stdout in case the input
  device is nonexistent (PS/2 and USB keyboards) or has a 'keyboard'
  property (RS232 keyboards). Additionally also check whether the OFW
  did a fallback to a serial console in the same way in case the
  output device is nonexistent. While at it save on some variables
  and for sys/boot/sparc64/loader/metadata.c move the code in question
  to a new function md_bootserial() so it can be kept in sync with
  uart_cpu_getdev_console() more easily.
  This fixes selecting a serial console and the appropriate device
  when using a device path for the 'input-device' and 'output-device'
  OFW environment variables instead of an alias for the serial device
  to use or when using a screen alias that additionally denotes a
  video mode (like e.g. 'screen:r1024x768x60') but no keyboard is
  plugged in (amongst others). It also makes the code select a serial
  console in case the OFW did the same due to a misconfiguration like
  both 'input-device' and 'output-device' set to 'keyboard' or to a
  nonexisting device (whether the OFW does a fallback to a serial
  console in case of a misconfiguration or one ends up with just no
  console at all highly depends on the OBP version however).
- Reduce the size of buffers that only ever need to hold the string
  'serial' accordingly. Double the size of buffers that may need to
  hold a device path as e.g. '/pci@8,700000/ebus@5/serial@1,400000:a'
  exceeds 32 chars.
- Remove the package handle of the '/options' node from the argument
  list of uart_cpu_getdev_dbgport() as it's unused there and future
  use is also unlikely.

MFC after:	1 week
2005-08-15 20:58:36 +00:00
Kirill Ponomarev
a0eeda33e8 Add if_arl_load, if_axe_load, if_aue_load, if_cs_load, if_cue_load,
if_hme_load, if_nve_load, if_rue_load, if_udav_load to Networking
Drivers section.

Submitted by:	matteo
2005-08-07 09:41:53 +00:00