Commit Graph

334 Commits

Author SHA1 Message Date
tv 8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +00:00
jmc 2229499bfb Don't make clean and cleandir depend on the lib subdir. Just check for it's
existance before running the submake. This makes it possible to run a
make build (which runs cleandir before make obj) in a r/o source tree
2001-11-21 22:10:54 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
tv 4446c00002 Undefine DESTDIR; we don't want the special DESTDIR <bsd.lib.mk>
handling for kernel libraries.

XXX this build method should be replaced by something more sane
2001-11-14 21:59:31 +00:00
christos c89e803d30 Remove USB copyrights. The coff and elf loading code did not come with BSD4.4. 2001-11-09 19:27:25 +00:00
scw f1defc3543 To avoid backwards seeks on sequential devices (eq. QIC tapes), read all
the program headers in one operation into an internal buffer.
2001-11-09 18:31:08 +00:00
thorpej 0971f93345 Make the ELF loadfile routines byte-order independent when used in
a non-_STANDALONE environment (e.g. installboot(8)): internalize and
externalize the exec, program, and section headers as necessary.

Reviewed and OK'd by Christos.
2001-10-31 21:24:09 +00:00
thorpej a43b4351a8 Oops, committed wrong copy of file in previous revision. 2001-10-31 20:22:22 +00:00
thorpej 90aee7593a Add standalone 64-bit to/from {big,little}-endian routines. 2001-10-31 20:19:52 +00:00
thorpej e727e3f180 Split elf32 vs. elf64 handling in loadfile(), including support for
each separately and explicitly.  BOOT_ELF is now BOOT_ELF32 and
BOOT_ELF64, and ELFSIZE should no longer be defined in loadfile_machdep.h.
2001-10-31 17:20:45 +00:00
thorpej 4810d73020 Build the loadfile() a.out, ECOFF, and ELF back-ends as separate
objects.
2001-10-31 01:51:42 +00:00
thorpej 91626c3515 Split the exec formats included by loadfile() into separate files.
Primary goal: explcitly select which ELF format (elf32 or elf64) to
support for a cross tool which uses loadfile().
2001-10-30 23:51:03 +00:00
thorpej 74eebee33c Add standalone byte-swapping routines that don't require testing
the system's byte-order:
- host to {big,little}-endian {16,32}
- {big,little}-endian {16,32} to host

These are not intended to be used in libsa directly, but are rather
intended to be used by host tools which may use libsa routines (such
as loadfile()) which need to use explicit byte-ordering.
2001-10-30 23:35:33 +00:00
jdolecek a8fcba2901 Fix compilation on Alpha with ARP_DEBUG.
Fixes kern/6440 by R. C. Dowdeswell
2001-10-18 19:00:38 +00:00
minoura 12ea5d8238 Add changedisk_hook().
Machine-dependent code can eject the floppy to prompt the next volume in it.
(Or add another method in devsw?)
2001-09-28 15:15:24 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
tsutsui cf574991b8 Add a small version of memmove() for libsa.
Mostly identical with libsa/bcopy.c.
2001-09-02 07:04:16 +00:00
bjh21 acf574f63e When loading ELF, zero out:
The e_shstrndx field in the ELF header, since we don't load .shstrtab.
The sh_name field in each section header, for the same reason.
The sh_offset field for any section we don't load.

This means the kernel has some chance of knowing what it's being given.  It
also means that the behaviour of old kernels with new loaders should be
deterministic (if not terribly useful: they still can't find the symbol
table).
2001-07-31 22:11:57 +00:00
bjh21 30f144749a G/C "off", since it was just tracking the difference between maxp and elfp. 2001-07-31 21:09:52 +00:00
bjh21 67a82e1d4e Fix a small memory leak when counting the size of the symbol table (shp was
ALLOC'ed if (LOAD_SYM|COUNT_SYM), but FREEd if (LOAD_SYM)).
2001-07-31 20:03:03 +00:00
bjh21 1a35da3617 When loading an ELF kernel, don't load all the STRTAB sections. Instead, just
load those STRTAB sections that are referenced by a SYMTAB that we're loading.

The main advantage of this is that (at least with the binaries output by my
ARM ELF linker) this removes the need to seek backwards through the file, which
is a big win when loading a gzipped kernel.

While we're here, don't allocate space for string tables we don't load.
2001-07-31 19:20:29 +00:00
fvdl 3350f68f80 Avoid warnings about uninitialised usage. 2001-07-19 18:55:38 +00:00
wiz 1bc6d2cee9 Fix typo (`information' has an 'r'). 2001-07-19 16:13:00 +00:00
christos 366971a414 Back out previous. The booter will need to find the symbol table itself,
as explained in the code.
2001-07-13 17:43:23 +00:00
christos 6711e49228 From Nigel Pearson: Make SYMS and NSYMS work on ELF.
The MacOS booter needs them.
2001-07-13 17:17:12 +00:00
thorpej 23a3a54650 libkern.h now has the ctype routines. 2001-04-05 04:39:02 +00:00
hubertf 267271c1b2 Explain some SA_* options - reading compressed kernels, netboot
Useful for stripping down bootcode.
2001-03-31 09:45:11 +00:00
sommerfeld 5348dfb6ac Have recursive make invocations depend on the .MAKE pseudo-target so
make knows to handle them specially.
2000-12-05 17:01:19 +00:00
tsutsui 99d2177add Don't try to load a.out header if there is no space for it before text. 2000-12-03 02:53:04 +00:00
simonb cdfbd303f9 Fix tyop in comment. 2000-11-26 03:31:20 +00:00
tsutsui 071bf9bca9 Don't print "]" if loading kernel does not have symbol table. 2000-11-11 09:25:12 +00:00
matt c4e14613b2 dos_unmount is only is dos_close is present but so conditionalize it like
dos_close.
2000-11-09 01:55:31 +00:00
matt 6c15ee2986 avoid pointer addition on void pointers 2000-11-08 19:38:12 +00:00
thorpej 29b685b9f0 Introduce a way for boot programs to modify the behavior of
bootp().  Add a BOOTP_PXE flag which causes bootp() to send
"PXEClient" in the DHCP class field.

Derived from similar code in FreeBSD.
2000-11-02 03:22:23 +00:00
thorpej abf350ddcf Sprinkle some const -- gets things out of the .data segment, which
is important in the i386 boot blocks (grmumble).
2000-11-02 00:34:51 +00:00
thorpej 904d7ceb3c Add a standalone MS-DOS file system reader package, lifted
from FreeBSD, and modified use NetBSD's already-existing
MS-DOS file system data structure definitions, rather than
defining our own.
2000-11-02 00:25:05 +00:00
ragge aeb756f1b5 Add define NO_MID_CHECK that avoids checking of the a.out mid field. 2000-11-01 14:23:04 +00:00
thorpej 9516ee90da Split the UDP routines out of net.c. 2000-10-25 01:49:55 +00:00
takemura c6304c954b Add LIBSA_RENAME_PRINTF to solve conflict with prototype definition of
printf() and etc in header files of Windows CE native compiler.
2000-10-21 13:48:06 +00:00
lukem 2a5013bcd3 show "press return" instead of "type return", since it's a key name and
not the actual word...
2000-10-02 23:35:54 +00:00
castor 5e29a96b48 Make standalone in_cksum work on little-endian machines, too, courtesy of
Jeff Smith, <jeffs@geocast.com>.
2000-03-31 19:55:09 +00:00
augustss 1279e67b6e Kill some more register declarations. 2000-03-30 12:19:46 +00:00
drochner f458367b3f cosmetics: remove double semicolon, whitespace 2000-02-03 19:53:03 +00:00
cgd fbf9177d1b provide stat() and fstat() here for standalone programs' use 2000-02-03 02:00:31 +00:00
tsutsui 11c8f56d48 Revert STRIPPROG -> STRIP 2000-02-01 05:25:24 +00:00
tsutsui e61f177ab1 STRIP -> STRIPPROG 2000-01-19 16:29:54 +00:00
hannken 2b8c4ea32e Fix IS_DATA and IS_TEXT. PF_X and PF_W are valid on p_pflags, not p_ptype. 1999-12-29 11:08:02 +00:00
simonb a09d3191a0 Remove leading '/' from pathnames, using same logic as ufs.c. Allows new
style (but not yet committed) pmax bootblocks to open "/boot.pmax" on an
ISO image.  Same problem reported for NFS by Jason Thorpe.
1999-11-23 12:20:53 +00:00
thorpej ee03a4e035 Backout my libsa changes. 1999-11-13 21:29:12 +00:00
thorpej 36ff5d93e8 Backout my libsa changes. 1999-11-13 21:17:56 +00:00