Commit Graph

43 Commits

Author SHA1 Message Date
Peter Wemm
e89db70811 Fix printf format errors 2002-07-20 03:52:18 +00:00
Peter Wemm
914ecdc8ea Work around some nasty bugs on the [beta] Itanium2's E1000 UNDI driver.
Bug#1: The GetStatus() function returns radically different pointers that
do not match any packets we transmitted.  I think it might be pointing to
a copy of the packet or something.  Since we do not transmit more than
one packet at a time, just wait for "anything".

Bug#2: The Receive() function takes a pointer and a length.  However, it
either ignores the length or otherwise does bad things and writes outside
of ptr[0] through ptr[len-1].  This is bad and causes massive stack
corruption for us since we are receiving packets into small buffers on
the stack.  Instead, Receive() into a large enough buffer and bcopy the
data to the requested area.
2002-07-20 03:51:53 +00:00
Peter Wemm
92caa29d8e Add boot_serial and boot_multicons variables to set RB_SERIAL and
RB_MULTIPLE since this seems to be the easiest way to add these flags
for non-forth loaders etc.
2002-06-20 06:29:42 +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
Ruslan Ermilov
46f8fdc34e Removed now unused INTERNALSTATICLIB.
INTERNALLIB now implies NOPIC and NOPROFILE.
Removed gratuitous NOMAN.
2002-05-13 11:09:07 +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
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
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
Marcel Moolenaar
b226acefc2 Allocate sufficient pages to hold the bootinfo block and stop
hardwiring the location.
2002-04-19 06:43:09 +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
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
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
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
127d4e90b0 o Don't include sys/cdefs.h 2002-03-28 07:07:45 +00:00
Peter Wemm
efcbdfb72b Add EFI write support to loader 2002-03-19 23:05:33 +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
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
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
Doug Rabson
65601f6da8 Fix typo in comment. 2001-10-11 13:47:20 +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
1271403685 * Flesh out elf_exec and bootinfo.
* Add EFI network support.
2001-09-22 19:10:56 +00:00
Doug Rabson
f066622bdd Add getsecs() for the libstand network code. 2001-09-22 18:33:09 +00:00
Doug Rabson
81d63063b1 Add a twiddle meter when reading from files. Gives me something to look
at when a kernel is loading from a floppy.
2001-09-22 18:31:02 +00:00
Doug Rabson
327b34100f Add ELF backend to the build. 2001-09-14 08:27:49 +00:00
Doug Rabson
f19fa0b627 Make this do the right thing (mostly). We should still reserve the pages
that the kernel loads into using the EFI AllocatePages call.
2001-09-14 08:26:00 +00:00
Doug Rabson
f77b61980e Add a libstand filesystem for accessing EFI native filesystems. 2001-09-07 08:51:48 +00:00
Doug Rabson
b827e60e65 Reformat. 2001-09-07 08:49:47 +00:00
Doug Rabson
76897a893f Merge linker set relocations with the rest. 2001-09-05 13:36:41 +00:00
David E. O'Brien
a1881c1e89 This Intel derived file uses C++ style comments.
(I'll be we know which compiler and platform they developed this on...)
Minimally change them to C89 comments to make GCC happy.  (this is kinda funny
as the file has piece derived from FreeBDS 3.2)

Also fix FreeBSD id style.
2001-06-16 05:58:54 +00:00
David E. O'Brien
c38fe280a8 Fix FreeBSD id style. 2001-06-16 05:56:13 +00:00
David E. O'Brien
16aaa88017 style(9) 2001-06-16 05:55:32 +00:00
David E. O'Brien
cb38c47462 style(9) + fix FreeBSD id's. 2001-06-16 02:12:36 +00:00
Doug Rabson
faf8077790 Move the first section up one page. The firmware bogusly uses the first
page of the image to load section headers and if we let the text section
start at zero, it corrupts the section table when its loaded. With this
change, the loader gets as far as the 'ok' prompt.
2001-06-10 13:39:10 +00:00
Doug Rabson
35ca79092b Remove a 'return' statement which I put in while I was trying to debug
the startup code.
2001-06-10 13:36:00 +00:00
Doug Rabson
fd3e14e915 First approximation of an ia64 EFI loader. Not functional. 2001-06-09 16:49:51 +00:00