Commit Graph

307 Commits

Author SHA1 Message Date
christos a2c49bf69e Nuke local prototype for closeall(). Add a new define LIBSA_NO_CLOSE so that
we don't try to close files, if we are not using any other I/O.
1999-04-28 13:24:12 +00:00
christos 2da63ed66f cosmetic printf change 1999-04-28 09:12:24 +00:00
christos 0fdd24ecdc MI loadfile (used by i386, pmax and sparc shortly) 1999-04-28 09:08:50 +00:00
cgd 227295dad5 set lflag when printing pointers with %p 1999-04-20 23:04:17 +00:00
christos d15d073dcf add getopt prototype, and externs 1999-04-14 15:23:27 +00:00
drochner b7c510645f move "ls" utility from i386/stand/libsa here 1999-04-14 11:32:50 +00:00
ross 4634c0e3d4 libkern just got an inet_addr(), but it won't compile, no prototype. Cleanup...
* Add prototype to libkern.h.
* Remove the almost-identical-copy from libsa/net.[ch].
* Change its type back to the (wrong, but harmless) historical one. (u_long)
* Kill the XXX local prototype in nfs_bootparam.c
1999-04-12 01:05:01 +00:00
simonb fa38a5236c The "found" label is not used if ALLOC_FIRST_FIT is defined. 1999-04-11 04:02:37 +00:00
simonb 6db650781c Don't compile in sanity checks for old file systems if
LIBSA_NO_COMPAT_UFS is defined.
1999-04-01 05:27:54 +00:00
simonb 8f8c1f41d9 It's no use having a memcmp() that calls bcmp() if there's no bcmp() in
the SA library.  Basically copied from ../libkern with a few less #if's
and #include's.
1999-04-01 05:12:20 +00:00
simonb e46b652af6 bestsize is unused if ALLOC_FIRST_FIT is defined. 1999-04-01 02:41:08 +00:00
simonb ff2206f6df G/C UFS_NOSYMLINK, UFS_NOCLOSE and UFS_NOWRITE and use new LIBSA_NO_FS_*. 1999-03-31 07:43:39 +00:00
cgd 309213477a Make a bunch of backward-compatible changes to the boot blocks which allow
size to be reduced substantially.  (backward compatibility verified
by compiling one of the alpha boot blocks which uses all of the code
before and after, diffing the object files, and manually verifying that
the differences were 'correct'.  some differences were "unavoidable,"
it wanting to avoid a double-commit, because e.g. local variables which
were previously used were no longer used.)  a README which describes
supported options (or at least the ones mentioned below) is forthcoming.

add support for the preprocessor macro LIBSA_NO_TWIDDLE, which
  causes calls to twiddle() to be omitted if it's defined.
add support for the preprocessor macros:
	LIBSA_NO_FS_CLOSE
	LIBSA_NO_FS_WRITE
	LIBSA_NO_FS_SEEK
  which, if defined, cause the corresponding file system operations
  in the individual file system implementations to be omitted.  (note
  that all of those macros are not supported by all file systems at
  this point.  comments were added to individual file system files
  to indicate lack of support, and should be cleaned up later.  Backward
  compatibility options e.g. UFS_NOCLOSE, etc., are supported.)
add support for the preprocessor macro LIBSA_NO_FS_SYMLINK, which
  removes support for symbolic links from the file system support
  functions.  (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_FS_SINGLECOMPONENT which
  removes all subdirectory and symlink support from the file system
  support functions.  (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_NO_FD_CHECKING, which
  causes code relating to libsa file descriptor checks (e.g. range
  checking and checking that a file descriptor is valid) to be
  omitted if it's defined.
add support for the preprocessor macro LIBSA_NO_RAW_ACCESS, which
  causes code relating to raw device access to be omitted if it's
  defined.
change some structure copies to use bcopy() instead.  that way
  use of bcopy vs. memcpy() can easily be selected by
  LIBSA_USE_MEMCPY.  (without changes like these, you could end up
  having both bcopy() and memcpy() included.  eventually, all
  calls to bcopy should be changed to calls to memcpy() or memmove()
  as appropriate -- hopefully never the latter -- with an option to
  use bcopy instead.)
add support for the preprocessor macro LIBSA_NO_DISKLABEL_MSGS, which
  causes disklabel() to return '1' as msg rather than a string.  Can
  be used if the boot blocks don't care about the string, and need to
  save the space.
add support for the preprocessor macro LIBSA_SINGLE_FILESYSTEM, which
  if defined causes all of the file system switch code to be removed.
  Its value should be the name of the file system supported by the
  boot block, e.g. "ufs" for the FFS file system.  calls to the
  file system functions open, close, etc., which were previously
  done through a function switch are then done via direct invocation
  of <fs>_open, <fs>_close, etc. (e.g. ufs_open, ...).
add support for the preprocessor macro LIBSA_SINGLE_DEVICE, which
  does the equivalent of LIBSA_SINGLE_FILESYSTEM but for the device
  switch table.  Device entry pointes are expected to be named
  <dev>foo, e.g. the 'strategy' routine used when LIBSA_SINGLE_DEVICE
  is set to 'disk' is diskstrategy.
make ufs.c f_nindir array be unsigned ints.  the fact that it was signed
  caused ufs.c to require signed division routines (which were otherwise
  unnecessary for a small boot block).
1999-03-31 01:50:25 +00:00
cgd e5ce91e0f3 replace memcpy() implementation (which just called bcopy()) with
a small implementation of memcpy().  libsa memcpy() wouldn't
do the right thing if LIBSA_USE_MEMCPY was defined, and the whole
point of that define is to get rid of either bcopy() or memcpy().
(cloned from the bcopy() code.)
1999-03-31 01:39:16 +00:00
cgd 8aa0c52d66 #undef bcopy, so that this will still compile if LIBSA_USE_MEMCPY is defined 1999-03-30 22:03:47 +00:00
cgd 9d06bcdcfe Add bzero.c, errno.c, and memset.c to SRCS 1999-03-30 22:02:39 +00:00
cgd 9ce004e069 add simple (small) implementations of memset and bzero. the versions
in libkern are fine for the kernel, but the versions here are smaller
and in libsa the point is size.
1999-03-30 22:01:15 +00:00
cgd 1611da0c3c move errno to its own file; if you just need errno, you don't need dev.c's fns 1999-03-30 21:59:58 +00:00
dbj 82347ce33e Changes to compile the next68k bootblocks with
egcs -Wpointer-arith -Wstrict-prototypes
This closes pr 6653
1999-03-26 15:41:38 +00:00
simonb 5d23f12467 Don't call f_dev->dv_close if it's a null pointer when an open() call
fails.
1999-03-26 03:16:15 +00:00
simonb 9913b7202b Revert SA_NOPUTCHAR - the pmax was the only port using it and the new
pmax bootblocks provide a putchar().
1999-03-23 22:25:31 +00:00
kim cc6ca72465 Made this compile:
- fifth arg to recvtftp should be size_t (not ssize_t)
- the path is passed tftp_makereq as a part of the handle structure
1999-02-28 00:57:07 +00:00
christos dd247aa44e Add missing prototypes for static functions. 1999-02-26 22:46:32 +00:00
ross 91d91ef1b2 XXX include libkern.h for strlen() XXX 1999-02-25 20:21:08 +00:00
drochner 0633616d7a build tftp filesystem, rearrange .ifdef slightly so that network stuff
is not built if ${SA_INCLUDE_NET} is not set
1999-02-24 19:31:03 +00:00
drochner 03497d6478 move TFTP filesystem from i386/stand/libsa here, it is mi 1999-02-24 19:24:56 +00:00
simonb e7d831fa31 Define bzero()/bcopy() in terms of memset()/memcpy() if LIBSA_USE_MEMSET
or LIBSA_USE_MEMCPY is defined.  Most everything pulls in stand.h so
this should cover ports that only use memset/memcpy but still want to
pull in as much as possible from sys/lib/libsa.
1999-02-22 10:08:42 +00:00
simonb 99c7714a77 Drop support for symlinks of UFS_NOSYMLINK is defined.
Don't compile in ufs_close/ufs_write if UFS_NOCLOSE/UFS_NOWRITE is defined.
Remove trailing whitespace.
1999-02-22 07:59:09 +00:00
simonb f60844a657 Use printf() instead of putchar() if SA_NOPUTCHAR is defined (for the
pmax).
Also don't include stdarg.h/varargs.h - we don't use them here.
1999-02-22 07:53:52 +00:00
pk bae33b3ad6 Split the printf variants into separate files. 1999-02-13 20:56:57 +00:00
lukem dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
drochner ccc6fbda81 Add some #ifdef SUPPORT_LINUX code which specifies a BOOTP tag to pass
a command line for that kernel.
Minor sizeof() sanity.
1999-02-12 10:56:18 +00:00
drochner 836a315463 We can't prototype exit() publically because it might take an argument or
not, depending on the port-specific environment.
Separate panic() and exit() so that the mi/default panic() can be used
without conflicting with a local exit() definition, move exit(void)
prototype to the default exit() implementation.
Closes PR bin/6990 by Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE>.
1999-02-12 10:51:28 +00:00
drochner ee57895586 That got broken in KNFifying. 1999-02-12 10:44:07 +00:00
pk ac01ce3a75 sprintf() now produces a return value, like the standard counterpart does.
Also, implement vsprintf(), snprintf() and vsnprintf().
1999-02-11 14:32:00 +00:00
pk eee0165e87 Add missing prototypes. 1999-02-11 09:10:43 +00:00
pk 08f1cf6408 Add missing prototypes and KNF the lot. 1999-02-11 09:09:06 +00:00
kleink 22fc60a59a Separate the userland and libsa errno declarations from <sys/errno.h> into
their canonical places.
1999-01-12 03:08:14 +00:00
he 02cf5984b5 Retry ustarfs_cylinder_read after disk change, apparently required on i386. 1998-12-19 19:24:32 +00:00
matt 2e00799098 Conditionalize include of <lib/libkern/libkern.h> with _STANDALONE (like
libsa/nfs.c does).  Fixes VAX libsa build problem.
1998-10-30 16:56:30 +00:00
bad 34f348a9e4 Work around gcc warning. 1998-10-15 18:01:49 +00:00
ross 0450169fae 1. Avoid snarfing label areas unless necessary; read with monotonically
increasing block numbers and don't reread cylinder 0.

2. Recognize the USTAR.... meta-info file...kind of like a super-block,
   it makes the volume size and label info programmable.
1998-10-15 01:11:46 +00:00
ross 4d17a0bfee Reserve an 8K label area on every disk, not just the first. Rewrite the block
addressing and disk changing code. Separate disk addressing into three layers.
(virtual: ustar format space spanning volumes, logical: format space relative
to current volume, and physical: standard meaning). Compute a checksum of the
disk 0 8k label area, and define a label for disk 2, 3.... Detect incorrect
disk changing order and attempt to recognize our disk 0 from its checksum.
1998-10-05 04:56:36 +00:00
ross f7ef9b367f tfs -> ustarfs 1998-09-24 05:23:33 +00:00
ross aeccd73ce4 Remove memset() prototype. 1998-09-22 20:29:03 +00:00
ross 141a463d8f Prototype memset(). 1998-09-22 00:37:08 +00:00
ross 05330db703 Make sure ctags(1) indexes oopen(). 1998-09-22 00:36:45 +00:00
ross 71ddd906d4 Add tfs.c to SRCS. 1998-09-22 00:36:01 +00:00
ross fb0dcdaee2 Add `tfs', a USTAR-format FS, featuring fast floppy loads, 5% better
space efficiency, and (the real reason) multiple-volume files.
1998-09-22 00:35:15 +00:00
lukem c9db84ecc9 distclean is a synonym for cleandir 1998-09-05 15:15:14 +00:00
is 4c3784857e back out last change 1998-07-27 15:10:05 +00:00
is aaa6d634aa write prototype: void * -> const void *.
[Else the Amiga bootblock can't be built.]
1998-07-27 06:17:49 +00:00
gwr 5afda96fca Be quiet if bootparamd gives us an empty gateway spec.
(which is quite normal).  Just make noise if it was
missing, which explains the very long timeout...
(Would be nice if sendrecv said "retrying...")
1998-06-29 20:25:59 +00:00
gwr e655461e32 Add support for "%p" format (easy). 1998-06-16 19:10:15 +00:00
gwr d63354072c When the gateway bootparam is missing, be clear about that
in the error message instead of showing zero or nothing.
1998-06-16 19:08:10 +00:00
drochner 8b4cd5f3da egcs -Wall -Werror 1998-05-14 18:08:58 +00:00
drochner 2cca6a1757 -catch zero and broadcast IP addresses sent by a DHCP server
-KNF
1998-04-24 18:50:23 +00:00
ross 331fee623e Sweep up some miscellaneous leftover lite2 integration shrapnel. 1998-03-01 07:15:39 +00:00
drochner 642cbc64e2 Always set own IP address to 0.0.0.0 before BOOTP or DHCP. 1998-02-16 11:10:54 +00:00
cgd 26d7b63bd3 make sure that LORDER, TSORT, AR, NM, RANLIB, and SIZE are correctly
and consistently set when doing kernel library builds.
1998-02-07 00:11:29 +00:00
thorpej 60c3299e3e Fix some debugging printf formats. 1998-01-23 19:27:44 +00:00
perry 1a80fd799d RCSID Police. 1998-01-05 19:19:41 +00:00
scottr d8f027887d If the send routine returns an error (-1), wait and retry using the same
backoff mechanism we use for receiving the response.  This is particularly
helpful when we have transient errors on transmit, e.g. a very busy
network or router.
1997-12-26 22:41:30 +00:00
gwr 2031003c9b Oops - forgot to set netmask=smask 1997-12-10 20:38:37 +00:00
gwr ecd43c7870 Request the "gateway" parameter and use its contents
to determine our gateway and subnet mask, consistent
with what is done by nfs_mountroot.
1997-12-10 20:19:00 +00:00
lukem 3acbcabd91 use COPTS instead of CFLAGS (entry currently commented out) 1997-10-26 22:08:38 +00:00
cjs 4b97411a80 Change sd.transparent to sd.compressed, so that we default to non-
compressed mode when we zero out the structure. Check_header() now
does not force us to uncompressed mode if we read no data (EOF);
it leaves the default, so that if we check at the end of a file,
we don't set the file to uncompressed mode and blow up later lseeks
on it.
1997-10-18 22:27:15 +00:00
thorpej 176a81b2c5 Copyright assigned to The NetBSD Foundation. 1997-10-05 18:37:01 +00:00
drochner b65a5212c3 Save some bytes by keeping the number of byteswaps minimal.
Allow to switch off UDP checksum generation and check via compile time
option (for the really desperade).
1997-09-17 16:30:51 +00:00
drochner 74c59c27a2 Keep a copy of the original BOOTP bp_siaddr field, in case we want to
use it later for TFTP.
1997-09-17 16:25:29 +00:00
drochner 9f58a1a9bb fix printf() format warnings in debug output 1997-09-17 16:24:00 +00:00
drochner 93bb01fe6d -Wall fixes 1997-09-06 13:57:14 +00:00
drochner 616ee86daf -add DHCP support - this option also extends the vendor extension area
to 312 bytes (The classical 64 bytes are likely to be too small if a
  rootpath is transferred.)
-make CMU vendor extension support optional
-remove code handling domain name/server (unneeded for boot code)
- -Wall fixes in debug code
1997-09-06 13:55:56 +00:00
drochner 25c68ee4f2 Remove this relict, it's not needed anymore. 1997-07-22 17:51:51 +00:00
drochner bcf29dc4be Don't use "if_ether.h", it's not used. 1997-07-22 17:50:37 +00:00
drochner 64cd693ada Don't use private copy of old netinet/if_ether.h.
Use <net/if_ether.h> for ethernet specific definitions, and insert private
definitions for ARP if needed. (The new ARP macros in <net/if_arp.h> are
not used because they create larger code, and we really don't need more
than ethernet/ip support here.)
1997-07-07 15:52:49 +00:00
drochner a8ac47dd1b Fix syntax error which appeared #ifdef DEBUG ("end[]").
Simplify the heap location stuff.
1997-07-04 18:47:25 +00:00
drochner d9fbb6e1eb Catch errors from underlying reads, ie where oread() returns -1.
(Original code used fread() which never returns -1, so this case was
not handled.)
1997-07-04 18:45:11 +00:00
thorpej fee80fcee9 - Fix ZMAGIC image loading.
- Deal with stripped kernels.
- Let machine-dependent code frob the start address.
- General cleanup.
From Matthias Pfaller <matthias@netbsd.org>
1997-06-28 07:17:56 +00:00
drochner a1d00666ac Allow to define the location of the heap at runtime #if HEAP_VARIABLE.
That helps to test libsa code in user space.
1997-06-26 19:17:40 +00:00
drochner 96dde15c3f Don't define STANDALONE here, it is not used by sys/lib/libsa code.
Port dependant code depending on it must define it in its own Makefile.
1997-06-26 19:14:53 +00:00
drochner ed2ca9f1fa Avoid user space headers for standalone programs.
Don't use sys/lib/libkern or sys/lib/libz if not standalone
 (ie, user space test programs).
1997-06-26 19:11:30 +00:00
thorpej a2694f54d8 Don't run off the end of the format string if the caller botched for
format modifier.  Pointed out by Daniel G. Pouzzner in PR #2633.
1997-06-26 06:20:30 +00:00
drochner f504cf88e8 Conditionally compile without symlink support (#ifdef NFS_NOSYMLINK).
Saves 708 bytes (i386). (close pr misc/3335)
1997-06-16 20:47:11 +00:00
drochner bc7d1ebcfb Don't #include <string.h>, needed prototypes are in libkern.h. 1997-06-13 14:32:24 +00:00
drochner a0c4d8cb61 Add prototype for strerror(). 1997-06-13 14:30:44 +00:00
drochner 319cc90118 -Wall fixes 1997-06-13 14:29:50 +00:00
drochner 8347a7476f Bring prototypes into scope. 1997-06-13 14:28:52 +00:00
cjs 7a66732d34 Back out BUILDDIR and NOINSTALL changes. 1997-05-31 21:21:13 +00:00
cjs 75380e08a1 Use new NOINSTALL option for libraries that are used only during the build
of a program, and not installed into the final system.
1997-05-30 01:55:09 +00:00
mycroft 185b24dd5b Use libinstall::, not install:, to prevent instaling LIB. 1997-05-07 16:20:26 +00:00
is 07b064e02e New ARP system, supports IPv4 over any hardware link.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
1997-03-15 18:09:08 +00:00
gwr 4478e618ee Fix a warning. 1997-03-14 21:03:43 +00:00
gwr 2cf7613010 Sun RPC/bootparams always enabled (No -DSUN_BOOTPARAMS needed)
Add SUPPORT_BOOTP (and global try_bootp) to allow MD code to
determine whether BOOTP is used (compile-time and run-time).
Thanks to Matthias Drochner for the SUPPORT_BOOTP ideas.
Copyright asigned to The NetBSD Foundation.
1997-03-14 20:34:48 +00:00
gwr 8f0295e7f0 Moved here (via repository copy) so they are more easily shared.
I did not add them to the library, but rather compile them where
the netboot program is built so I can add -DSUN_BOOTPARAMS, etc.
1997-03-11 18:23:55 +00:00
cgd 72a6422a5e allow includers to specify library-specific CPP flags via ${LIB}MISCCPPFLAGS 1997-02-16 21:25:18 +00:00
leo 2242daf790 Initialize 'bestf' to make this compile again with -Wall. 1997-02-16 13:02:59 +00:00
thorpej 9a6b12944d In close(), if the file descriptor was used for writing, don't free
data structures that weren't allocated.  Fix sanity-checked
by Matthias Drochner.
1997-02-04 18:38:20 +00:00
thorpej 63930d7db4 Add some debugging code to free(), to catch frees before the
start of the heap and beyond the end of the heap (if a heap limit
is defined).
1997-02-04 18:36:33 +00:00
pk 01bd8a8ca8 Initialize `f_offset'. 1997-01-28 09:41:03 +00:00