Commit Graph

1279 Commits

Author SHA1 Message Date
Benno Rice
0f9bb727a5 Fix up the DMA buffer allocation call. 2002-06-07 11:49:33 +00:00
Poul-Henning Kamp
080ef30b20 Add explicit dependency on ufsread.c 2002-06-05 12:30:45 +00:00
Poul-Henning Kamp
af53575a04 Remove UFS related #includes, they're read in ufsread.c now. 2002-06-05 12:12:25 +00:00
Poul-Henning Kamp
3795d538a8 Make sparc64 share ufsread.c with i386.
Sponsored by: DARPA & NAI Labs.
2002-06-05 12:00:53 +00:00
Poul-Henning Kamp
7cbccd7f79 Avoid entering IOCCC with a memcpy turned bcopy. 2002-06-05 11:56:12 +00:00
Poul-Henning Kamp
6b8fc95f49 Indent this file more like style(9).
Sponsored by: DARPA & NAI Labs.
2002-06-05 11:20:37 +00:00
Poul-Henning Kamp
833468e219 Preparation for UFS2 commit:
Factor the ufs reading code out of the i386/boot2 loader so it can
be reused by for instance sparc64.

Sponsored by: DARPA and NAI Labs.
2002-06-05 11:10:38 +00:00
Jens Schweikhardt
730a2da5de Fix a handful of typos and grammar bogons. No content changes.
Translators can ignore this commit.

MFC after:	2 weeks
2002-05-30 09:24:01 +00:00
Jens Schweikhardt
ece450c42f Fix a handful of typos and grammar bogons. No content changes.
Translators can ignore this commit.

MFC after:	2 weeks
2002-05-29 22:57:18 +00:00
Jake Burkholder
8c7b34b8a3 Add needed include of queue.h. Remove unneeded include of smp.h. 2002-05-29 19:38:49 +00:00
Jake Burkholder
35738638d6 Use a contrived 'tlb_entry' structure for passing the mappings for the
kernel text and data from the loader to the kernel, so that the tte format
is not part of the loader->kernel ABI.
2002-05-29 05:49:59 +00:00
Jake Burkholder
d9f2757eaa Sync with i386. The loader was being installed before the beforeinstall
target, which conventiently moved it to loader.old, leaving no loader.
2002-05-28 23:09:59 +00:00
Nick Hibma
44b279e2f6 Cosmetic change (align with other boot blocks):
CONSPEED -> COMSPEED

Approved by:	nyan
2002-05-26 10:11:17 +00:00
Gordon Tetlow
666df9ddf3 Add support for reading an additional loader configuration file. By default,
this is called /boot/nextboot.conf. This file is required to have it's first
line be nextboot_enable="YES" for it to be read. Also, this file is
rewritten by the loader to nextboot_enable="NO"<space> after it is read.
This makes it so the file is read exactly once. Finally, the nextboot.conf
is removed shortly after the filesystems are mounted r/w.

Caution should be taken as you can shoot yourself in the foot. This is only
the loader piece. There will be a tool called nextboot(8) that will manage
the nextboot.conf file for you. It is coming shortly.

Reviewed by:	dcs
Approved by:	jake (mentor)
2002-05-24 02:28:58 +00:00
Yoshihiro Takahashi
93bb160832 Fixed to conflict labels.
Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
2002-05-21 12:53:48 +00:00
Yoshihiro Takahashi
b827692436 MFi386: revision 1.22 2002-05-21 09:44:52 +00:00
Jake Burkholder
dafb594328 MD ficl files for sparc64. 2002-05-19 23:20:56 +00:00
Marcel Moolenaar
23c12a63cf o Remove namespace pollution from param.h:
-  Don't include ia64_cpu.h and cpu.h
   -  Guard definitions by  _NO_NAMESPACE_POLLUTION
   -  Move definition of KERNBASE to vmparam.h

o  Move definitions of IA64_RR_{BASE|MASK} to vmparam.h
o  Move definitions of IA64_PHYS_TO_RR{6|7} to vmparam.h

o  While here, remove some left-over Alpha references.
2002-05-19 04:42:19 +00:00
Marcel Moolenaar
06cb726431 An almost mechanical sweep to replace C++ style comments with C
style comments. This is not an attempt to conform to style(9).
Such has lower priority.
2002-05-19 03:17:22 +00:00
Poul-Henning Kamp
8d48b118f2 Fix one of the va_arg() with less than int sized type probelms. 2002-05-18 09:12:32 +00:00
Tom Rhodes
d394511de3 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
John Hay
c7c7cac2fb DEV_BSIZE lives in sys/param.h and not in machine/param.h anymore. 2002-05-15 11:32:53 +00:00
Ruslan Ermilov
122865286e Even more BBSIZE related breakage. 2002-05-14 13:30:45 +00:00
Yoshihiro Takahashi
8b20c954cb Fixed to build for GCC 3.1 2002-05-14 12:34:03 +00:00
Yoshihiro Takahashi
348df1aa25 Add -ffreestanding to CFLAGS. 2002-05-14 12:32:59 +00:00
Ruslan Ermilov
475ab3cda6 Align CLEANFILES with revision 1.25 changes. 2002-05-13 16:16:00 +00:00
Ruslan Ermilov
26aace39ab Fixed CLEANFILES after bsd.lib.mk sweep. 2002-05-13 15:48:05 +00:00
Ruslan Ermilov
46f8fdc34e Removed now unused INTERNALSTATICLIB.
INTERNALLIB now implies NOPIC and NOPROFILE.
Removed gratuitous NOMAN.
2002-05-13 11:09:07 +00:00
Ruslan Ermilov
2a53f3fb35 Major cleanup of bsd.lib.mk.
Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now means to build static library only and don't install
anything.  Added a NOINSTALLLIB knob for libpam/modules.  To not
build any library at all, just do not set LIB.
2002-05-13 10:53:24 +00:00
David E. O'Brien
21ab21338d Match the default newfs UFS block size. 2002-05-13 05:09:34 +00:00
Bruce Evans
e754a32842 Saved 176 bytes by compiling with -fno-guess-branch-probability. The
default of -fguess-branch-probablility causes time optimizations (?)
like rewriting `if (foo) x++;' as
`if (!foo) goto forth; back: ; ...; forth: x++; goto back;".  This is
pessimizes space especially well on i386's because one short branch
gets converted to 2 long ones.

Removed -fno-align-foo since it is implied by -Os.  Previous commit
messages seem to have overstated the new alignment bugs in gcc.  The
only case that affects boot2 is that -fno-align-functions (or
equivalently -falign-functions=1) actually gives -falign-functions=2.
This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1.
The default case where the optimization level is 1 and no alignment
options are given is more broken.  All alignments are minimal, modulo
the bug in FUNCTION_BOUNDARY.  This is caused by toplev.c setting
defaults too early.

Some hacks in previous commits ar not needed now, but may as well be
kept until gcc is fixed.  The previous on in the Makefile saved 96
bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data
due to unrelated bloat in the alignment of large objects.  There aren't
even any options to control alignment of data.
2002-05-12 15:45:28 +00:00
David E. O'Brien
95cfc25d0d Back out last commit. I expect our bsd.*.mk gods to remove the need for
defining so many extra things in addition to INTERNALLIB.  We don't like
repetitive C code and we shouldn't for make code either.
2002-05-12 13:54:42 +00:00
Jake Burkholder
6cc8d3ac6b Attempt to not crash and burn on UltraSPARC III machines; the cpuid property
is named differently.
2002-05-11 22:05:22 +00:00
Peter Wemm
92948f4701 Save about 60 bytes by #define memcpy __builtin_memcpy and removing
the function we provided.  Restore the Keyboard: yes/no  printf for the
probe diagnostics.  We end up with 40 bytes free.
2002-05-11 21:49:39 +00:00
Peter Wemm
1333378a61 Reconnect boot2. I'm sure I'll regret this though. :-) 2002-05-11 21:41:03 +00:00
Peter Wemm
7a163a83da Use a crowbar and duct-tape to make boot2 fit again. This gets it down
to 4 bytes free.  I removed a printf (the Keyboard yes/no) since it is of
marginal value and sed'ed the generated asm output to remove the unwanted
aligns.  There's probably a better way to gain a few extra bytes than
losing the printf.  Shortening strings is probably a better option but this
should get us over the hurdle.
2002-05-11 21:39:59 +00:00
Jake Burkholder
d07160f401 Change the disk probing so that it will actually find disks other
than the first one on a controller, and work for secondary
controllers.
Due to the prom not having nodes for each disk, but a catch-all one,
we have to iterate over each device, trying to open it to determine
whether it is actually present.
Since probing this way takese some time (and spews some spurious
warnings), it should maybe be short-circuited if we use the
device we were booted from.
Implement lazy device probing, and correct slice/partiniton
handling in the ofwd_open() code. With this, I can now actually boot
a kernel from disk, and the loader does not create unnecessary
delays.

Submitted by:	tmm
2002-05-11 21:30:46 +00:00
David E. O'Brien
3bf8b9cee3 NOPIC, NOPROFILE, NOMAN, and INTERNALSTATICLIB are redundant when using
INTERNALLIB now.
2002-05-11 18:02:33 +00:00
David E. O'Brien
d1bdfb40fd -ffreestanding is the word.
(also resort some CFLAGS such that the more "important" value are first so
they are easier to see)
2002-05-10 09:26:35 +00:00
John Baldwin
88f0d73da4 - Axe -mpreferred-stack-boundary=2 as -Os turns this on by default.
- Axe -fdata-sections as turning it on or off makes no difference.  If
  it did make a difference it would serve to bloat boot2 even further with
  extra padding.
- Axe -fforce-addr.  This gets us 32 bytes so we are down to only being
  64-bytes over.

We still can't compile this with gcc 3.1.  The problem seems to be that
the -fno-align-foo options don't actually work.  Comparing the new and
old output it turns out that gcc is 4-byte padding all the functions and
labels and what not despite the passed in arguments thus adding the
unfortunate bloat to boot2.
2002-05-10 04:05:42 +00:00
David E. O'Brien
54fd053e6c We don't need bootinfo any more, and sparc64 doesn't have it anyways. 2002-05-10 01:20:37 +00:00
David E. O'Brien
07776d8fb2 Don't be redundant. 2002-05-10 01:06:52 +00:00
David E. O'Brien
7571ef5ae3 -ffreestanding is the word for /sys. 2002-05-10 00:53:45 +00:00
David E. O'Brien
708a23c342 Turn off boot2 -- it gained over 96 bytes dieting on the in-tree Gcc 3.1. 2002-05-10 00:52:00 +00:00
David E. O'Brien
f21450f69f Ficl doesn't build on sparc64. 2002-05-09 20:33:22 +00:00
David E. O'Brien
a89dc896b5 Partical style cleanup. 2002-05-09 17:47:25 +00:00
Josef Karthauser
1063e12617 Replace /kernel with /boot/kernel/kernel.
PR:		docs/37757
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
Wes Peters
8373917257 Rename the file used to specify the nextboot to make it clear that this
is a loader configuration file and can be used for more than just a
kernel name.

Submitted by:	Gordon Tetlow <gordont@gnf.org>
2002-04-26 22:32:15 +00:00
Daniel C. Sobral
1a923a14f4 A long, long time ago, msmith introduced vfs.root.mountfrom
loader variable, which let users specify the root mount point
the exact way one does after booting the kernel.

Let's take this opportunity to document it...
2002-04-26 20:52:59 +00:00
Wes Peters
1de372dcd4 Add a -k option to reboot to specify the kernel to boot next time
around.  If the kernel boots successfully, the record of this kernel
is erased, it is intended to be a one-shot option for testing
kernels.

This could be improved by having the loader remove the record of
the next kernel to boot, it is currently removed in /etc/rc immediately
after disks are mounted r/w.

I'd like to MFC this before the 4.6 freeze unless there is violent
objection.

Reviewed by:	Several on IRC
MFC after:	4 days
2002-04-26 07:31:04 +00:00
Yoshihiro Takahashi
27ecba3177 MFi386: revision 1.56 2002-04-25 13:31:27 +00:00
Yoshihiro Takahashi
f9ef610bd0 MFi386: revision 1.8 2002-04-25 13:28:10 +00:00
Jake Burkholder
127e8646b8 Split file system setup code out into a function called mount.
Implement vsnprintf.  Implement panic in terms of it.
2002-04-24 05:54:10 +00:00
Jake Burkholder
0d0c927680 Add support for loading files other than /boot/loader. Useful if you're
loader is screwed and you want loader.old.
Rewrite the scaled down printf so it actually works right, and add support
for more formats.
2002-04-24 04:27:49 +00:00
Jake Burkholder
3ff6556567 Add an exit function. 2002-04-24 02:50:59 +00:00
Jake Burkholder
083d8c5bab Add -Wno-unused. 2002-04-24 02:50:36 +00:00
Jake Burkholder
8c2f8986a6 memcpy, memset -> bcopy, bzero. 2002-04-24 02:24:32 +00:00
Jake Burkholder
4b487ad2ec Clean up elf loading to not make assumptions about the ordering of sections.
Don't load the symbol table; this is only needed for loading kernels and we
load the loader.
2002-04-24 02:10:35 +00:00
Jake Burkholder
e2b255fdea Remove xfsread. Just call fsread directly. 2002-04-24 01:47:05 +00:00
Jake Burkholder
912ceb7f18 Remove a bunch of unused variables, functions and macros. Allocate storage
statically instead of using a faked up malloc.
2002-04-24 01:40:54 +00:00
Marcel Moolenaar
77de753f65 Improve self-relocation:
o  We don't expect the PLT relocations to follow the .rela section
   anymore. We still assume that PLT relocations are long formed,
o  Document register usage,
o  Improve ILP,
o  Fix the FPTR relocation by creating unique OPDs per function.
   Comparing functions is valid now,
o  The IPLT relocation naturally handles the addend. Deal with it.
   We ignore the addend for FPTR relocations for now. It's not at
   all clear what it means anyway.

Fix ABI misinterpretation:
o  For Elf_Rela relocations, the addend is explicit and should not
   be loaded from the memory address we're relocating. Only do that
   for Elf_Rel relocations (ie the short form).
o  DIR64LSB is not the same as REL64LSB. DIR64LSB applies to a
   symbol (S+A), whereas REL64LSB applies to the base address (BD+A),
2002-04-21 08:49:47 +00:00
David E. O'Brien
34ef85ee3d o Use our own elf2aout now.
o Generalize a little.
2002-04-21 02:37:55 +00:00
Marcel Moolenaar
b226acefc2 Allocate sufficient pages to hold the bootinfo block and stop
hardwiring the location.
2002-04-19 06:43:09 +00:00
Ruslan Ermilov
2ecf206550 Install files via FILES, there's no reason to compare them before installing. 2002-04-17 16:56:36 +00:00
Ruslan Ermilov
092179f985 Really unbreak it this time (clean and install were still broken). 2002-04-17 15:33:40 +00:00
Yoshihiro Takahashi
0f8af5c368 MFi386: revision 1.7. 2002-04-15 13:44:00 +00:00
Ruslan Ermilov
2f42caa5de Unbreak this as well.
At the extra bonus of fixing the contents of the .depend file.

Not really my day.
2002-04-12 15:49:30 +00:00
Peter Wemm
31c41f1b1e Bandaid for a buffer overrun in the module searching code. When breaking
up the module_path string, we would walk one past the end of the buffer.
This hurting ia64 originally, but it was probably also happening on i386
occasionally as well.  The effects were usually harmless, it would add
bogus "binary" search directories to the places it actually looked for
files.
2002-04-11 10:00:44 +00:00
Peter Wemm
2ab188f529 Finally fix loader completely for IA64. efifs_stat() wasn't setting
the S_IFREG bit for regular files.  This caused the path search code to
skip it when it finally did find the kernel (after the common/module.c
buffer overrun bug was fixed)
2002-04-11 09:50:11 +00:00
Pierre Beyssac
2b9592079f Code cleanup, no functional change.
Patch adapted from PR.

PR:		i386/36015
Submitted by:	thomas@cuivre.fr.eu.org
MFC after:	1 week
2002-04-11 09:21:10 +00:00
Daniel C. Sobral
231b8f199f Upgrade FICL to 3.02. Forgot this one, sorry.
PR:		36308
Submitted by:	dcs
2002-04-09 20:59:34 +00:00
Daniel C. Sobral
be88b71603 Upgrade to FICL version 3.02. Anything wrong is my fault, everything right is
due Jon Mini.

PR:		36308
Submitted by:	Jon Mini <mini@haikugeek.com>
MFC after:	4 weeks
2002-04-09 17:45:28 +00:00
Jake Burkholder
bb75d97e13 Fix another unsigned long used to index the symbol table which should be
Elf_Hashelt.
2002-04-09 00:05:46 +00:00
Peter Wemm
c21ab46789 We must not let install(1) strip loader.efi when installing it, or the
resulting binary will be damaged and no longer work.
2002-04-07 04:27:50 +00:00
Peter Wemm
1e7e1ea54d Set BINDIR 2002-04-07 04:26:42 +00:00
Peter Wemm
f3693129ce Add loader bootforth infrastructure and install it. 2002-04-07 04:25:45 +00:00
Peter Wemm
01c0b884af Make it a bit closer to the EFI build and tie up some loose ends. 2002-04-06 04:33:53 +00:00
Peter Wemm
e91ab65ef6 Try and tidy up some very loose ends with paths to various libraries etc. 2002-04-06 04:29:36 +00:00
Peter Wemm
402e50591a Do not add the ficl/alpha subdir to the ia64 include path. Try ficl/ia64
instead.
2002-04-06 04:16:58 +00:00
Peter Wemm
5459842c5e Do not assume that ${OBJCOPY} variable exists. It was hidden by the
fact that the 'ia64-make' wrapper explicitly set it.
2002-04-06 04:11:46 +00:00
Peter Wemm
93b4f334b6 Use the correct elf hash table entry type. This matches a similar fix
in the kernel side of things some time ago.  The hash table entries are
always 32 bits wide, even on 64 bit machines.
2002-04-06 04:09:42 +00:00
Peter Wemm
a6d81d83a2 Fix self hosted loader building. When you use a self configured gcc, it
detects and uses the gas section merge support.  As a result, a whole bunch
of new sections arrive, including .rodata.str1.8, which was not included
in our custom ldscript.ia64.  The result was a loader binary that EFI
rejected.

While here, collect the loader shell commands linker set and include it
in the data area rather than having its own section.

/boot/loader.efi was the last holdout for having a 100% self built ia64
system.
2002-04-06 03:39:22 +00:00
Peter Wemm
65a0653eb7 Use a relative path to libstand.. /usr/src/lib/libstand may not exist
or may have the wrong header files.
2002-04-04 06:04:38 +00:00
Thomas Moestl
bc3c153560 Do not use semi-fixed TLB slots for the 4M kernel pages any more. 2002-04-02 17:10:15 +00:00
Thomas Moestl
2c94cd1ba0 1.) Rename locore.s to locore.S (by repocopy), to be able to remove
special-case make rule
2.) Cleanups, remove superfluous expicit rules, add -nostdlib to LDFLAGS,
    remove -X and -g, remove -g from CFLAGS
3.) Add BINDIR
4.) Build install the loader help file, add an empty help.sparc64
5.) Change the default configuration to only support booting from disk
6.) Get libofw.a from a path relative ${.OBJDIR}, not ${.CURDIR}

Submitted by:	jake (1 - 5), obrien (6)
2002-04-02 17:08:37 +00:00
Thomas Moestl
ad68ab89e2 Add support for booting from CD-ROM. Make it possible to enable UFS
support using make arguments.
2002-04-01 23:28:35 +00:00
Thomas Moestl
163f47b1ec 1.) Produce a boot1 disklabel template of the format disklabel(8) expects.
2.) Clean up and change over to using bsd.prog.mk

Submitted by:	jake (2)
2002-04-01 22:57:51 +00:00
Marcel Moolenaar
16ed9fd6bb Only install the help file if we can find it. Use ${BASE}.help
in both the condition and for the install. We expect to find
the help file in ${.OBJDIR}.
2002-03-31 20:48:13 +00:00
Marcel Moolenaar
cd2c8e3ef6 Pass the address of the bootinfo block to the kernel in register
r8. Keep it at the hardwired address for now. Bump the version.
2002-03-30 23:52:34 +00:00
Marcel Moolenaar
c459265de7 Pass the physical address of the bootinfo block to the kernel in
register r8. We continue to write the bootinfo block at the same
hardwired address, because the kernel still expects it there.
It is expected that future kernels use register r8 to get to the
bootinfo block and don't depend on the hardwired address anymore.

Bump the loader version once again due to the interface change.
2002-03-30 23:00:05 +00:00
Yoshihiro Takahashi
bd30f72967 MFi386: revision 1.55 2002-03-30 11:18:30 +00:00
Marcel Moolenaar
a918e110c4 Add a quick and dirty way to determine where we're loaded from. We
only care if it's network or not at this time. If we're loaded from
the network, we set currdev (=loaddev) so that the kernel is loaded
from the network as well. In all other cases we initialize to disk.
This makes netbooting more convenient and can easily be enhanced to
do more elaborate checking.
2002-03-30 07:32:08 +00:00
Marcel Moolenaar
4e357dbc58 The EFI loader has been improved a lot since it was first added.
Most significantly (from an interfacing point of view) is the
support for the FPSWA pointer passing. Even though that was added
4 months ago, it's probably not a bad idea to bump the version
number to reflect this.
2002-03-30 04:54:54 +00:00
Marcel Moolenaar
7608f7cb80 Fix the initialization of the protocol:
o  Query the state field of the protocol mode to determine whether
   we need to start and/or initialize the protocol. When we're
   loaded across the network, the protocol has already been started
   and is already initialized. When no networking has happened yet,
   we have to start and initialize the protocol ourselves.
o  After initialization, we have to set the receive filters. Not
   doing this results in a deaf interface. We set the unicast and
   broadcast filters. Multicast may not be supported. This specific
   change fixes the problem we had that we could not netboot if
   the loader was started from the EFI shell.
o  To help future debugging, add a function that dumps the current
   mode of the interface. It's conditional on EFINET_DEBUG.
o  To help in runtime problems, emit a diagnostic message when we
   could not initialize the protocol properly.
2002-03-30 04:50:52 +00:00
Marcel Moolenaar
c61a2c84f0 Don't blindly dereference f->f_devdata as if it's always a pointer to
an efi_devdesc structure. When we're netbooting, f->f_devdata holds
the address of the network socket variable. Dereferencing this caused
some very unpredictable behaviour, including proper functioning.
So, as a sanity check, we first make sure f->f_dev points to our
own devsw. If not, the open will fail before we use f->f_devdata.

This solves the netboot hangs I invariably got whenever I used the
latest toolchain to compile the EFI loader.
2002-03-30 01:36:03 +00:00
Marcel Moolenaar
9423456018 o Make efinet_put a blocking call by waiting for the protocol
layer to signal transmission of the packet. This resolves the
   problem I'm seeing that an immediate call to net->Receive
   after calling net->Transmit returns EFI_DEVICE_ERROR. This
   condition seems to be sufficiently persistent that BOOTP and
   RARP fail.
o  While here, unify all functions to have 'nif' defined. Some
   have it as arguments. The others now have them as locals. We
   now always get the protocol interface by using the 'nif' var.

The current status of netbooting is that even though we now reliably
have BOOTP working (again), opening a file (ie loading a kernel)
across the network causes the loader to hang. I'm working on that now.
2002-03-29 23:10:15 +00:00
Marcel Moolenaar
ede9f03a1a Fix the beforeinstall target. We install ${PROG}.help if loader.help
exists, otherwise we install it anyway. I interpret this as a very
high desire to install ${PROG}.help. Alas, ${PROG}.help doesn't exist
at the moment and neither does loader.help, so in practice this just
doesn't work, no matter how you interpret it. The compromise is to
install ${PROG}.help IFF it exists. I realize we lost creativity with
this commit, but style should have been preserved, AFAICT :-)
2002-03-29 22:53:56 +00:00
David E. O'Brien
10d23bba69 Needs a.out support built into the loader. 2002-03-28 19:09:44 +00:00
Marcel Moolenaar
127d4e90b0 o Don't include sys/cdefs.h 2002-03-28 07:07:45 +00:00
Marcel Moolenaar
95c0f344ee o Add -L${DESTDIR}${LIBDIR} on the link line for -lstand.
o  Add -j .dynstr to objcopy. This makes .efi binaries work
   when built with a 3.x based toolchain.
2002-03-28 06:58:46 +00:00
Marcel Moolenaar
b0d9287123 Duplicate the logic used elsewhere to define LIBSTAND. 2002-03-28 06:52:10 +00:00
David E. O'Brien
77dfe39221 was repocopied to ../boot1 2002-03-28 02:56:05 +00:00
David E. O'Brien
20d9715213 Apparently either gcc or ld, in their infinite wisdom, want to
put a bunch of crap before the code in .text.  Since the firmware
doesn't seem to honour the a.out entry point, we need to include
a little assmbler file which jumps to where we want to be in C.

Submitted by:	jake
2002-03-28 02:41:52 +00:00
David E. O'Brien
0ce1fc3fc3 Opps, bootblock component is no more. 2002-03-28 01:41:23 +00:00
David E. O'Brien
8e5b3e7b5b sparc64 is an ofw consumer. 2002-03-28 01:37:10 +00:00
David E. O'Brien
ef313bf935 Not all platforms have and want a.out format support. 2002-03-28 01:28:21 +00:00
David E. O'Brien
8fa3779837 Add a Makefile for sparc64 at this level. 2002-03-28 01:01:43 +00:00
Pierre Beyssac
038148d678 Add option -n to i386 boot2 to disallow boot interruption by keypress.
PR:		i386/36016
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
Reviewed by:	rnordier
MFC after:	1 week
2002-03-23 19:40:27 +00:00
Alfred Perlstein
03d1b8bc94 Remove __P. 2002-03-20 08:00:54 +00:00
Peter Wemm
efcbdfb72b Add EFI write support to loader 2002-03-19 23:05:33 +00:00
Peter Wemm
1d7914a5bd Add -ffreestanding to avoid printf/puts/putchar conversions 2002-03-19 10:51:57 +00:00
Peter Wemm
436122c232 Boot from efifs first. 2002-03-19 10:50:41 +00:00
Peter Wemm
9b6a75edb3 gcc-3.1 likes to have extra { } around the internal array initializers in
the GUID templates.
2002-03-19 10:50:09 +00:00
Maxim Sobolev
fb74e5f595 Add splitfs vfs layer into libstand, which allows loading big kernels and
modules split across several physical medias. Following is how it works:

The splitfs code, when asked to open "foo" looks for a file "foo.split"
which is a text file containing a list of filenames and media names, e.g.

	foo.aa "Kernel floppy 1"
	foo.ab "Kernel floppy 2"
	foo.ac "Kernel and modules floppy"

For each file segment, the process is:

- try to open the file
- prompt "Insert the disk labelled <whatever> and press any key..."
- try to open the file
- return error if file could not be located

RE team is free to use this feature in the upcoming 5.0-DP1.

Reviewed by:	msmith, dcs
2002-03-17 12:18:05 +00:00
Ruslan Ermilov
3a3c44ac20 mdoc(7) police: fix a typo and markup. 2002-03-15 15:12:10 +00:00
Ruslan Ermilov
9662d32c73 Implement -m and -p loader(8) "boot" command options in boot2.
(This is more useful for 4.x where boot blocks can still load
kernels, modulo the PR kern/17422.)
2002-03-13 11:03:36 +00:00
Ruslan Ermilov
3e444868c4 Further document "console" (nullconsole). 2002-03-13 10:55:22 +00:00
Maxim Sobolev
5616599331 CG superfluous prototype. 2002-03-10 22:33:04 +00:00
Robert Drehmel
aa22cb469c Change every occurrence of "bootblock" into "boot1" after
the repo-move from "src/sys/boot/sparc64/bootblock".
2002-03-05 16:39:36 +00:00
Robert Drehmel
83ea6c23b5 - Fix seeking for offsets requiring more than 32 bits.
- Add sanity checks to lookup().
 - Implement the 'l' modifier in printf().

Submitted by:	tmm
2002-03-05 11:22:43 +00:00
Alfred Perlstein
63c6b757ab Support for USB fm radio.
Submitted by: David Yeske <dyeske@yahoo.com>
2002-03-04 03:51:21 +00:00
Jake Burkholder
dd4af53607 Catch up to change in tte format.
Forgetten by:	jake
Submitted by:	tmm
2002-03-01 06:17:28 +00:00
Yoshihiro Takahashi
28a90658c4 Add -D_KERNEL to CFLAGS for ntohl(). 2002-02-28 10:08:23 +00:00
Robert Drehmel
4d79812a7c - Fix indentation and return statements to conform to style(9).
- Use the __FBSDID macro.
 - Fix some warnings.

Submitted by:	obrien (partly)
2002-02-26 10:05:20 +00:00
Bruce Evans
0c6ec4aca0 Declare time(not3) instead of depending on namespace pollution 3 layers
deep in <stand.h> to eventually include <time.h> to declare the user
version.

This is not quite the right place to declare it, but <stand.h> would
be worse because time() is very MD so it isn't in libstand.

Many places in the boot sources still get the user version using only
1 layer of pollution (#include <sys/time.h>.  Some pollute themselves
directly (#include <time.h>).  But the boot Makefiles are too broken
to enable warnings for redeclarations.
2002-02-25 04:31:25 +00:00
Bruce Evans
fa883367ab Removed mounds of unused variables. 2002-02-25 03:45:09 +00:00
Jake Burkholder
4aaca88542 Keep track of the ttes used to map the kernel and pass them to it as loader
metadata.  Modify tlb handling functions to take a tte, instead of virtual
address, physical address and flags.
2002-02-23 11:06:37 +00:00
Jake Burkholder
90774cfa30 Add -ffreestanding to CFLAGS. 2002-02-23 04:36:15 +00:00
Jake Burkholder
3c5ef798a0 Add make variables for fs support and propagate them to CFLAGS. Put
-ffreestanding in CFLAGS.  Remove unnecessary LDFLAGS.
2002-02-23 04:35:28 +00:00
Jake Burkholder
23b93fc323 Fix test for != 0 that should be > 0. 2002-02-23 04:33:15 +00:00
Jake Burkholder
c2ef11f244 Check the return values of index() and don't dereference it if its null;
the path may not have a ':' in it.  The mac address property is called
mac-address for sparc64.  Don't allocate a dma buffer for sparc64 either.
2002-02-23 04:31:30 +00:00
Jake Burkholder
0c7065ad98 #if 0 more bootinfo stuff. 2002-02-23 04:13:02 +00:00
Jake Burkholder
d112f7bd5b Fix fs support ifdefs. Add tftp support. Add physical and virtual
watchpoint support for debugging (under LOADER_DEBUG).  Claim the
physical and virtual addresses used to map the kernel from the prom;
we map it ourselves behind the scenes though.  Add a reboot command.

Submitted by:	tmm
2002-02-23 04:04:30 +00:00
Jake Burkholder
20dc3b11c5 Allocate a frame on our initial stack so that it doesn't run off into
random memory.  Disable interrupts while loading the tlb.

Submitted by:	tmm
2002-02-23 03:38:18 +00:00
Jake Burkholder
acfdfd647b Add OF_claim_virt() and OF_release_phys().
Submitted by:	tmm
2002-02-23 03:36:04 +00:00
Jake Burkholder
4f265afbc1 Include <machine/metadata.h>. 2002-02-23 03:33:39 +00:00
Chad David
8c09f6fb1f Document the hw.physmem kernel environment variable.
Reviewed by:	alfred
2002-02-21 05:15:52 +00:00
Robert Drehmel
2649cfd7fd - Remove unneeded variable.
- Remove change for my local configuration that slipped in with
   the last commit; I am having problems booting when multiple SCSI
   disks are attached, so I will change this part as soon as I find
   a solution, anyway.
2002-02-15 13:22:09 +00:00
Robert Drehmel
0259c50ec2 This file is now unneeded. 2002-02-15 13:11:00 +00:00
Robert Drehmel
6d41f1a9db - Do not include a NetBSD header as it is not needed anymore.
- Remove two constants that were needed in conjuction with the
   NetBSD disklabel header.  Use the FreeBSD equivalents.
   To boot from NetBSD/sparc64 partitions, define LABELOFFSET to
   be 128.
 - Do not use the complete open firmware path to filter out cdrom drives.
   No path containing "cdrom" is detected as a disk now.
 - Simplify some code.
2002-02-15 13:09:34 +00:00
Robert Drehmel
c119807ba8 Add the FreeBSD/sparc64 bootblock and its make file. 2002-02-15 12:49:20 +00:00
Yoshihiro Takahashi
3b8a3187c8 Expand COMBRD(x) macro. 2002-02-01 14:48:44 +00:00
Maxim Sobolev
21367f05ab CG hard sentence breaks.
Submitted by:	ru
2002-01-23 09:35:55 +00:00
Maxim Sobolev
dcd7d9b7b7 Allow dump device be configured as early as possible using loader(8) tunable.
This allows obtaining crash dumps from the panics occured during late stages
of kernel initialisation before system enters into single-user mode.

MFC after:	2 weeks
2002-01-21 01:16:11 +00:00
Ian Dowse
3db327c495 Cut more than 500 bytes off the size of the alpha boot1 by adding
a simple version of bcopy() so we avoid picking up the overly-complex
implementation in libc (via libstand). This is not necessary on
-current, but RELENG_4 has apparently just exceeded the 15-sector
limit for boot1.

Reviewed by:	wilko
2002-01-18 21:54:02 +00:00
Yoshihiro Takahashi
8df8626ebd Added kgzldr for pc98.
crt.s is based on btx.s.
2002-01-18 09:00:38 +00:00
Ian Dowse
870fb18bc1 Oops, the previous revision (1.35) broke booting from floppies
because the buffers we use could end up spanning a 64k boundary.
Unfortunately it causes too much bloat (228 -> 72 bytes free) to
just reinstate the old malloc() function.

Instead, define a structure that contains all 4 buffers which must
not cross 64k boundaries. We allocate a 64k-aligned instance in
main() using the magic that was in the old boot2 malloc() function.
This brings the free space down to 168 bytes, but that is still
better than it was before revision 1.35 (136 bytes).

Reported by:	Mike Brancato <funnyguy@digitalsmackdown.net>
Pointy-hat to:	iedowse
2002-01-17 22:39:19 +00:00
Ian Dowse
e9f9046337 Make the i386 boot2 fully blocksize-agnostic, as has already been
done with boot1 on the alpha. We use 4k buffers regardless of the
actual filesystem block size.

Remove the simple malloc() implementation, as it is no longer used.
2002-01-14 19:39:19 +00:00
Ian Dowse
52e85481fd Make the alpha boot1 work on filesystems that have a block size
larger than 8k. We now use 4k buffers regardless of the filesystem
block size, so there is no longer a static limit.

Simply increasing the buffer size from 8k to 16k as done on the
i386 doesn't work on the alpha, probably because it causes us
to overshoot boot1's 48k runtime memory limit.

Tested by:	naddy
2002-01-11 16:14:34 +00:00
John Baldwin
6ebf6db56e Catch the netboot version up to the main loader. This is pretty bogus.
All the alpha loaders should use the same version file.  Also, we might
should merge the various loaders (cdboot, loader, netboot) into one loader
that can boot off of disks, CD's, and network devices.  The version bump
is needed so the FICL scripts won't bomb out thinking that the netboot
binary is too old.
2002-01-11 00:09:59 +00:00
John Baldwin
83f4b92050 Unrevert revision 1.12. Revision 1.14 backed this out saying it was
backing out the 1024 sector boot0, but revision 1.12 had nothing to do with
that.  Instead, it documented various compile time options for boot0 and
allowed them to be overridden via make.conf or options on the make
command line.
2002-01-10 21:40:33 +00:00
Ian Dowse
7e9c85d4ce Increase BSIZEMAX from 8k to 16k, so that we can reliably boot from
filesystems with 16k blocks.
2002-01-09 15:46:17 +00:00
John Baldwin
db283fd6d5 Don't turn on RB_CDROM if the rootdev is a BIOS cd device for now as this
breaks when cdboot is used with an MFS root.
2002-01-04 07:59:27 +00:00
Robert Drehmel
c9f26ad128 Avoid having the text and data sections merged into one program
header table entry by removing the -N flag from the LDFLAGS.
2001-12-28 22:12:38 +00:00
Jim Mock
1bbfa941ef Add missing snd_ich_load entry.
Noticed by:	will
MFC after:	2 days
2001-12-20 09:14:45 +00:00
Ruslan Ermilov
34a5940b8c mdoc(7) police: remove hard sentence break which I didn't
submit to Jonathan Mini.
2001-12-14 09:06:11 +00:00
Yoshihiro Takahashi
c47b0cd2c6 MFi386: revision 1.35 (Add support for writing to BIOS disks) 2001-12-12 13:47:04 +00:00
John Baldwin
0889b9be41 - Add 'fwrite' and 'fseek' words for writing to and seeking on files.
- Change the 'fopen' keyword to accept a mode parameter.  Note that this
  will break existing 4th scripts that use fopen.  Thus, the loader
  version has been bumped and loader.4th has been changed to check for a
  sufficient version on i386 and alpha.  Be sure that you either do a full
  world build or install or full build and install of sys/boot after this
  since loader.old won't work with the new 4th files and vice versa.

PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:49:34 +00:00
John Baldwin
4543c86ece Add support for writing blocks to the loader's disk cache.
PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:10:00 +00:00
John Baldwin
3c3a6fe0e0 Add support for writing to BIOS disks.
PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:08:10 +00:00
Guido van Rooij
28703190c5 Add new boot flag to i386 boot: -p.
This flag adds a pausing utility. When ran with -p, during the kernel
probing phase, the kernel will pause after each line of output.
This pausing can be ended with the '.' key, and is automatically
suspended when entering ddb.

This flag comes in handy at systems without a serial port that either hang
during booting or reser.
Reviewed by:	(partly by jlemon)
MFC after:	1 week
2001-12-10 20:02:22 +00:00
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Robert Watson
63ea1e904c o Expand list of tunables documented in loader.8 to include kern.maxusers,
since other related tunables were also documented here.  Add a cross
  reference to tuning(7) for information on setting this value
  appropriately.
2001-12-07 18:05:24 +00:00
Dag-Erling Smørgrav
cb36afb649 The entry for the 'set' command no longer has a list of variables.
PR:		32454
Submitted by:	Gary W. Swearingen <swear@blarg.net>
MFC after:	3 days
2001-12-04 12:01:00 +00:00
Daniel C. Sobral
b31463c915 Remove unused filed.
PR:		kern/32395
Submitted by:	Jonathan Mini <mini@haikugeek.com>
2001-12-03 12:07:05 +00:00
Murray Stokely
3bbde73c29 Fix typo.
PR:		32455
Submitted by:	"Gary W. Swearingen" <swear@blarg.net>
2001-12-03 06:00:24 +00:00
Daniel C. Sobral
605f755d8a Waits for a keypress before rebooting on panic.
PR:		kern/32351
Submitted by:	Jonathan Mini <mini@haikugeek.com>
MFC after:	1 week
2001-11-28 14:00:36 +00:00
Robert Watson
6758206539 Document the "console" setting in loader.conf, suggesting vidconsole
or comconsole.
2001-11-27 20:37:40 +00:00
Robert Watson
17a4793a19 o Add 'kern.maxusers' to the list of commented out sample tunable
variables, since that can now be tuned at boot-time without a
  recompile.
2001-11-26 03:49:59 +00:00
John Baldwin
1a301f73dc Bump the CD boot loader up to 1.1 so that the FICL upgrade a while back
will not fail thinking that the loader version is stale.  This lets us
use the Forth code on the CD now.
2001-11-21 23:16:26 +00:00
David E. O'Brien
03820e7a36 Upper case the FreeBSD loader prompt.
On OFW based machines, it is just too confusing having the firmware and
OS loader giving the same prompt.  This is a nice compromise that 99% of the
users on non-OFW platforms will probably not even notice.
2001-11-19 17:30:26 +00:00
Peter Wemm
24ffe931b9 Lookup the EFI_FPSWA driver and pass the interface pointer through to the
kernel before we call ExitBootServices().  I've typed the definitions
in efifpswa.h from the Intel FPSWA manual (urk).
2001-11-19 07:09:47 +00:00
Peter Wemm
de76c8189e Remove bootinfo.bi_kernel. It isn't used by the kernel. struct bootinfo
should go away on ia64, we should be loader metadata based since that is
the only way we can boot (loader, skiload).
2001-11-19 07:05:10 +00:00
Peter Wemm
a812f645bc Fix a dependency violation, same as in libefi/elf_freebsd.c a while back. 2001-11-19 06:59:53 +00:00
Peter Wemm
8e92224a8a This is used in C, not C++. functions with no args have func(void) in our
kernel.
2001-11-19 06:58:14 +00:00
Yoshihiro Takahashi
608f31f640 MFi386: revisions from 1.26 to 1.30. 2001-11-17 13:58:04 +00:00
Yoshihiro Takahashi
b9c5c179c3 MFi386: revision 1.12 2001-11-17 13:57:32 +00:00
Ian Dowse
7b9716bad2 Fix a number of misspellings of "dependency" and "dependencies" in
comments and function names.

PR:		kern/8589
Submitted by:	Rajesh Vaidheeswarran <rv@fore.com>
2001-11-16 21:08:40 +00:00
Bill Fenner
ce20386909 Initialize first to -1; this will create a (nearly) empty file on failure,
instead of looping until the disk is full.  This kind of failure can
especially happen when a version of awk that doesn't support POSIX
character classes is used.

Submitted by:	David Wolfskill <david@catwhisker.org>
2001-11-07 17:53:25 +00:00
John Baldwin
6a50ba658c Remove a few more debugging bits and turn on twiddle output while reading
from the CD.  This turns off the dual console output to COM1.
2001-11-07 01:20:33 +00:00
Mitsuru IWASAKI
1611ea8727 Add S4BIOS sleep (BIOS hibernation) and DSDT overriding support.
- Add S4BIOS sleep implementation.  This will works well if MIB
   hw.acpi.s4bios is set (and of course BIOS supports it and hibernation
   is enabled correctly).
 - Add DSDT overriding support which is submitted by takawata originally.
   If loader tunable acpi_dsdt_load="YES" and DSDT file is set to
   acpi_dsdt_name (default DSDT file name is /boot/acpi_dsdt.aml),
   ACPI CA core loads DSDT from given file rather than BIOS memory block.
   DSDT file can be generated by iasl in ports/devel/acpicatools/.
 - Add new files so that we can add our proposed additional code to Intel
   ACPI CA into these files temporary.  They will be removed when
   similar code is added into ACPI CA officially.
2001-11-06 15:00:30 +00:00
Yoshihiro Takahashi
5cb7d2f699 MFi386: sys/boot/i386/loader/main.c revision 1.25 2001-11-06 12:31:56 +00:00
Yoshihiro Takahashi
748c552f0e MFi386: sys/boot/i386/libi386/Makefile revision 1.21 2001-11-06 12:31:05 +00:00
John Baldwin
4c3bb58384 - If we are booted via cdboot, use bc_add() to instantiate the cd0 device
from the loader.
- Cleanup extract_currdev() some and add support for setting the currdev
  to cd0 when booted via cdboot.
2001-11-05 19:03:01 +00:00
John Baldwin
6514d92792 Hook up the bioscd driver and the cd9660 filesystem. 2001-11-05 18:59:13 +00:00
John Baldwin
0322b80600 Add a device driver for the BIOS device for CD-ROM's booted via El Torito
no emulation mode.  Unlike other BIOS devices, this device uses 2048 byte
sectors.  Also, the bioscd driver does not have to worry about slices
or partitions.
2001-11-05 18:58:33 +00:00
John Baldwin
9248a89d0b Add a DEVT_CD type for CD drivers. 2001-11-05 18:51:47 +00:00
John Baldwin
0a0fed8681 Trim all the extra debugging output including hexdumps, debug messages,
etc.  The only bit of debugging left is performing dual output to both
the screen and COM1.  Also, the twiddle is still disabled since it seems
to do weird things to the serial dump.  cdboot now has 880 bytes to spare.
2001-11-04 03:51:59 +00:00
John Baldwin
f941b4c14e Axe the old cdldr. 2001-11-04 03:28:10 +00:00
John Baldwin
6bbbde38ca Use the new cdboot instead of cdldr. 2001-11-04 03:27:06 +00:00
John Baldwin
5af9115c77 This is a new CD bootstrap utility designed to replace cdldr. According
to the El Torito standard for CD booting, a CD may boot in "No emulation"
mode without using a floppy image.  In this mode, the BIOS loads a program
off of the CD into memory and creates a BIOS device using 2048 byte sectors
for the CD.  According to the standard, this program can be up to 0xFFFF
virtual (512-byte) sectors long.  The old cdldr depended on this by having
the BIOS load the entire loader and the small cdldr stub as one binary
similar to pxeboot so that cdldr didn't have to read the CD to find the
loader.  However, the NT no emulation loader just uses 1 disk sector
(4 virtual sectors), so it seems that at least some BIOS writers just did
enough to get NT to boot by only loading 1 sector and ignoring the sector
count.  Thus, while cdldr should have worked in theory, it doesn't in
practice.  This replacment fits entirely in 1 sector and includes simple
ISO 9660 support.  It looks for /boot/loader on the CD and loads it up
using the BIOS.  This allows us to not have to depend on the limited size
of floppy images but use a full GENERIC kernel for CD-ROM installs in the
future, among other things.

This version of cdboot is a bit bloated as it includes some useful
debugging routines that people can pull to use in other x86 assembly
modules.  Even with all the debugging cruft, we still have 272 bytes to
spare.
2001-11-04 03:24:16 +00:00
John Baldwin
f0699bb775 Print out 'foo devices:' as the line before displaying a group of
devices in 'lsdev' output rather than printing out a pointer to the
print function since the user really could care less about the pointer
value.  Perhaps this was intended to be a debugging printf?
2001-11-04 02:58:39 +00:00
John Baldwin
dfd89d691e Whoops, missed these bits in the previous commit. 2001-11-03 22:21:21 +00:00
John Baldwin
580d63df68 Add support for sending messages to the serial console which is helpful
when debugging boot problems.  It is not on by default but is enabled via
the BTX_SERIAL variable.  The port and speed can be set via the same
variables used by boot2 and the loader.
2001-11-03 22:09:30 +00:00
John Baldwin
0535c2bbad Add support for outputting multiple lines when dumping memory during the
register dump.  Change the default to bump 2 lines of output (32 bytes)
instead of 1 line (16 byte).
2001-11-03 21:53:46 +00:00
John Baldwin
5eef06c222 Add support for trace traps by returning from them just as for breakpoint
traps rather than halting.  Ideally, we should avoid printing the
'BTX halted' message for debug register dumps.
2001-11-03 21:42:25 +00:00
John Baldwin
25895accd8 Output a newline at the end of a dump so that there are blank lines between
dumps when using breakpoints or tracing.
2001-11-03 21:40:47 +00:00
David E. O'Brien
5daeec1454 Revert rev 1.3 which moved us away from POSIX character classes.
The community feels our base AWK must handle them.
2001-11-03 01:35:07 +00:00
David E. O'Brien
09a4374e6d Revert rev 1.7 which moved us away from POSIX character classes.
The community feels our base AWK must handle them.
2001-11-03 01:33:12 +00:00
Mike Barcroft
0ac2d551f2 o Add new header <sys/stdint.h>.
o Make <stdint.h> a symbolic link to <sys/stdint.h>.
o Move most of <sys/inttypes.h> into <sys/stdint.h>, as per C99.
o Remove <sys/inttypes.h>.
o Adjust includes in sys/types.h and boot/efi/include/ia64/efibind.h
  to reflect new location of integer types in <sys/stdint.h>.
o Remove previously symbolicly linked <inttypes.h>, instead create a
  new file.
o Add MD headers <machine/_inttypes.h> from NetBSD.
o Include <sys/stdint.h> in <inttypes.h>, as required by C99; and
  include <machine/_inttypes.h> in <inttypes.h>, to fill in the
  remaining requirements for <inttypes.h>.
o Add additional integer types in <machine/ansi.h> and
  <machine/limits.h> which are included via <sys/stdint.h>.

Partially obtain from:	NetBSD
Tested on:		alpha, i386
Discussed on:		freebsd-standards@bostonradio.org
Reviewed by:		bde, fenner, obrien, wollman
2001-11-02 18:05:43 +00:00
Yoshihiro Takahashi
716d0f6c04 Fixed sioreg.h path. 2001-11-02 15:15:09 +00:00
David E. O'Brien
2273086d55 Substitute "[:space:]" with the character constants it expands to.
This was a silent 'failure' when using Bell-Labs awk.

Submitted by:	David Wolfskill <david@catwhisker.org>
2001-11-01 19:14:16 +00:00
David E. O'Brien
3a167df8c3 Bell-Labs AWK does not support POSIX "bracket expressions" (POSIXese for
"character classes", basically).  So change them to their character
representation.

Submitted by:	David Wolfskill <david@catwhisker.org>
2001-11-01 07:16:35 +00:00
Peter Wemm
ce4c60d38d Fix the ILLEGAL fdisk table that is there for supporting "dangerously
dedicated" mode.  This was specifying that there are 256 (illegal!)
heads on the disk.  If bioses store that in a byte, and it gets truncated
to 0, then that almost certainly causes the infamous divide-by-zero
nightmare.

This is also most likely the reason why the Thinkpad T20/A20 series
were locking up when FreeBSD was installed.  This is also the most likely
reason why a boot1 being present causes an IA64 box to lock up at boot.
(removing the "part4" stuff from boot1.s fixes the IA64 boxes and would
most likely have fixed the T20/A20 and some TP600E series thinkpads)
2001-11-01 06:19:32 +00:00
Jake Burkholder
8be89d4719 Add code to copy the enironment and loader metadata into kernel space. 2001-10-30 06:37:36 +00:00
Jake Burkholder
a237ed036e Add definitions for network support, doesn't work yet.
Pass the right arguments to the kernel.
Replace magic numbers with symbolic constants.
Pass the real openfirmware entry point to OF_init.
2001-10-30 06:31:45 +00:00
Jake Burkholder
073e92a52c Use ENTRY() for defining functions in asm.
Remove asm functions to call the openfirmware and kernel entry points;
we can just call them directly.
Don't use the stack pointer for an intermediate result in setx.
Put the stack in the bss.
2001-10-30 06:27:34 +00:00
Jake Burkholder
eea923d7f8 Make the openfirmware entry point function pointer non-static so that it
can be passed to the kernel.
2001-10-30 06:23:32 +00:00
Marcel Moolenaar
997313be99 Set RB_MULTIPLE (multiple console support) if the kernel is booted
with the -D flag.
2001-10-29 01:11:40 +00:00
Ruslan Ermilov
ff0c93cc0e Just use ${MACHINE}, it's already special-casing pc98. 2001-10-25 09:05:47 +00:00
Doug Rabson
4abfff1e2e Call ExitBootServices and disable interrupts before we start hacking
the VM registers. This ought to make things slightly more reliable here.
2001-10-25 08:53:39 +00:00
Doug Rabson
7d5af294dc Add the two sections used for PLT entries to the text and sdata sections
respectively. This makes IPLTLSB relocations work properly (these are
generated for weak symbols, particularly for _longjmp).
2001-10-25 08:50:14 +00:00
Doug Rabson
88f5f7ac50 Try to get the self-relocator to work with IPLTLSB relocations. Doesn't
work right though - I can't figure out why.
2001-10-24 20:14:49 +00:00
Jonathan Lemon
22dc069c24 Set RB_MULTIPLE (multiple console support) if the kernel is booted
with the -D flag.
2001-10-23 20:27:48 +00:00
Jonathan Lemon
c80bd6e378 Allow the RBX_DUAL flag to appear in bootinfo. 2001-10-23 20:27:05 +00:00
Yoshihiro Takahashi
aa0abed214 Use a array to convert from a attribute for AT to one for PC98.
(merged from sys/pc98/pc98/scvtbpc98.c)
2001-10-17 15:15:01 +00:00
Yoshihiro Takahashi
f49ccfe990 Merged from sys/boot/i386/libi386/vidconsole.c revisions 1.16, 1.17 and 1.18. 2001-10-17 14:41:50 +00:00
Yoshihiro Takahashi
2967d8485e fix style(9) 2001-10-17 14:17:11 +00:00
Yoshihiro Takahashi
60e0796757 Merged from sys/boot/i386/loader/Makefile revision 1.54. 2001-10-17 14:13:36 +00:00
Robert Drehmel
aa5bde88b1 Add a prototype for OF_alloc_phys. 2001-10-15 14:43:38 +00:00
Robert Drehmel
8414482077 Fix some warnings. 2001-10-15 14:40:36 +00:00
Robert Drehmel
2727d8ffc8 Add the FreeBSD/sparc64 boot loader source files. 2001-10-15 14:35:39 +00:00
Robert Drehmel
7081e52987 Make the ofw_reg structure and ofw_alloc_heap 64-bit save. 2001-10-15 12:16:20 +00:00
Robert Drehmel
fc06896610 Add a Makefile for the sparc64 boot loader. 2001-10-15 10:36:35 +00:00
Robert Drehmel
d729d0aa31 Do not include openfirm.h; it is now included by libofw.h. 2001-10-15 09:52:38 +00:00
Robert Drehmel
66631c00de - Use the cell_t type definition for Open Firmware arguments in
combination with requisite casts as this avoids fatal side
   effects on 64-bit architectures.
 - Add the OF_alloc_phys function.
2001-10-15 09:51:09 +00:00
Robert Drehmel
1da9b140b7 - Fill dummy functions with code to read from disk using Open
Firmware.
 - Add a temporary disklabel header to boot off a NetBSD/sparc64
   partition.  This file can be deleted when we have got a FCode
   bootblock.

The disklabel header was obtained from NetBSD.
2001-10-15 09:35:40 +00:00
Robert Drehmel
7ff1bab73b - Include openfirm.h for phandle_t.
- Add some necessary members to the ofwdisk structure.
 - Add a prototype for ofw_parseofwdev.
2001-10-15 09:28:07 +00:00
Robert Drehmel
cdfc68815b Add a function for parsing an Open Firmware boot path into the
ofw_devdesc structure.
2001-10-15 09:25:30 +00:00
Robert Drehmel
8716f26121 - Add an ifdef guard.
- Use unsigned types for the (32-bit) Open Firmware device handles
   to avoid sign extension on 64-bit architectures.
 - Add a standard type definition for Open Firmware arguments.
2001-10-15 09:02:03 +00:00
Doug Rabson
65601f6da8 Fix typo in comment. 2001-10-11 13:47:20 +00:00
Marcel Moolenaar
8daca20f62 s/alpha/${MACHINE_ARCH}/g 2001-10-08 01:41:45 +00:00
Benno Rice
225845627b Whitespace fixes. 2001-10-07 13:27:27 +00:00
Benno Rice
a6bfff4582 Add new files needed by previous commit. 2001-10-07 13:24:56 +00:00
Benno Rice
cae2c81dc2 Mega-patch for OpenFirmware loader support.
- Flesh out ofw_readin routine.
- Add OpenFirmware load and exec routines.
- Make sure memory allocation for the kernel is done correctly.
- Change the way the heap is allocated so as to make it easier to deallocate
  when we hand over.
- Add a command to print memory maps similar to the one for ia64.

With this patch, I can now load and hand over to a kernel on my iMac.  There
are some problems with OpenFirmware routines failing after the hand over that
still need to be addressed.
2001-10-07 13:22:25 +00:00
John Baldwin
69ad5bdd3f Whitespace fixes. 2001-10-04 10:18:00 +00:00
Kazutaka YOKOTA
82fe828980 Fix the ANSI color escape sequence \E[m.
- Corretly map the ansi color number to a PC BIOS color.
- Handle multiple arguments to the escape sequence.
2001-10-02 13:11:35 +00:00
Kazutaka YOKOTA
4238458ba2 Fix the local macro: isvisible().
- The space char (0x20) IS a visible char :-)
2001-10-02 09:13:07 +00:00
Mike Silbersack
0742c2bb67 grammar fix: to -> too 2001-10-01 23:41:13 +00:00
Kazutaka YOKOTA
b827a63aa6 Fix the function CD(): "Clear to the end of the screen".
- When the video BIOS is called to clear the region (x, y)-(79, 24)
  (by scrolling), the slashed region in Fig.1 is cleared.  CD() is
  supposed to clear the region shown in Fig.2.
        x                 x
    +-------+         +-------+
    |       |         |       |
   y|   ////|        y|   ////|
    |   ////|         |///////|
    |   ////|         |///////|
    +-------+         +-------+
      Fig.1             Fig.2

- Don't move the cursor during this operation.
2001-10-01 11:48:02 +00:00
Kazutaka YOKOTA
6c8e596705 This is white-space only change. No functional difference.
- Be consistent about placing spaces around keywords and
  operators; don't mix statements like "if(A==B)" and "if (X == Y)",
  "return(0)" and "return (-1)", "P=10" and "Q = 0", etc.

- Consitently indent lines. It's not good to indent by 8 columns
  in one part of the file, and by 4 columns in the other part.
2001-10-01 11:42:25 +00:00
Peter Wemm
4d7552180d Make this 'make obj' safe 2001-09-26 00:13:08 +00:00
Doug Rabson
5f802bfc9f Calculate the valid flag for ITRs and DTRs correctly. Also fix a couple
of minor problems and remove some debugging code.
2001-09-25 19:44:19 +00:00
Doug Rabson
9164a3125a Add commands to dump the itrs and dtrs. 2001-09-24 19:39:34 +00:00
Doug Rabson
bc14d41c7e Return the mapkey which EFI gave us when we read the memory map - we need
it to call ExitBootServices.
2001-09-24 19:37:44 +00:00
Doug Rabson
6544e18249 Tidy up a little - don't try to print anything or enable interrupts after
we start changing translation registers. Also, call ExitBootServices
before we jump into the kernel.
2001-09-24 19:36:45 +00:00
Doug Rabson
6dd44dacaa Pick up pal.s from the kernel sources. 2001-09-24 19:31:44 +00:00
Doug Rabson
0f34719cf5 Add commands to dump the configuration tables and the SAL System Table. 2001-09-23 10:28:01 +00:00
Doug Rabson
e565888bc5 Add EFI network support. 2001-09-22 19:12:30 +00:00
Doug Rabson
1271403685 * Flesh out elf_exec and bootinfo.
* Add EFI network support.
2001-09-22 19:10:56 +00:00