Commit Graph

274 Commits

Author SHA1 Message Date
John Baldwin
4b609f5564 Whitespace tweaks to make indentation consistent within this file and even
within a single function.
2004-01-15 18:36:48 +00:00
John Baldwin
9e8e07fcda - Print out line number in a panic message using %d rather than %p. Line
numbers aren't pointers.
- Add a __printflike() attribute to libstand's panic() prototype to catch
  such bogons in the future.
2004-01-15 18:35:32 +00:00
Ruslan Ermilov
9b7d991dd4 Removed duplicate SRCS. 2004-01-11 17:23:31 +00:00
Brian Feldman
e083cf16d9 Implement seeking to earlier offsets in gzipfs. This allows my loader
to e.g. correctly load all .ko.gz's I've tried, as opposed to messing
up trying to read section headers on some of them.
2003-12-10 16:10:34 +00:00
Peter Grehan
1841f22c30 PowerPC-conditional changes:
- include ashldi3.c/ashrdi3.c from libc for UFS 64-bit arith
 - pull in syncicache.c from libc, and define _STANDALONE for
   loader usage
2003-12-10 13:11:03 +00:00
Peter Wemm
62537aaa17 Preserve the constness of the value argument passed to env_setenv() as
it gets passed through the filter functions.
2003-10-26 04:04:12 +00:00
Ruslan Ermilov
743d5d518c mdoc(7): Properly mark C headers. 2003-09-10 19:24:35 +00:00
Ruslan Ermilov
bc80c08e61 bsd.lib.mk,v 1.143 no longer uses ld(1) directly to strip
symbols from intermediate object files, so these hacks to
get AMD64 compile are no longer needed.

Tested on:	sledge.FreeBSD.org
2003-06-30 19:08:49 +00:00
Peter Wemm
ebc5ba0efa Add amd64 build glue 2003-06-26 03:48:01 +00:00
Ruslan Ermilov
a14744f268 Restore bzip2(1) support in loader(8) after Peter's renames of
malloc() to Malloc(), and free() to Free(), in zalloc_malloc.c.
2003-04-25 06:44:56 +00:00
Robert Drehmel
5a1c2d4f62 Trust the code more than the comment(s) and correct some false
statements about pointer data type sizes, which spread probably
by copy-and-paste.
2003-04-12 07:36:44 +00:00
Peter Wemm
77ac203091 Sync up with kern/subr_prf.c. This adds %ll, %j, %q, %z, etc. 2003-04-06 05:25:48 +00:00
Philippe Charnier
0dc90c7a0d The .Fn function
The .Nm library
2003-03-24 15:56:36 +00:00
Marcel Moolenaar
9c73bdcf24 Fix a machine check abort caused by the EFI loader trying to open a
file in the NFS file system when the underlying device is not a
network device. A Sparc64 specific hack for this exact problem was
already present (nfs.c:1.9, tftp.c:1.10), but the problem is not
specific to Sparc64. The hack has been promoted to a non-i386 test
because on non-i386 architectures it's either impossible to have
non-network devices coexist in the same loader with the NFS FS, or
network and non-network device coexist and NFS filesystems can only
be used on top of network devices. I believe i386 pxeboot is where
this does not hold.

The root cause of this problem is in open.c where each file system
is tried until no more file systems exist or a file system returns
success. There's no notion of a list of valid file systems given
the underlying device and the non-existence of a file can cause
the invalid combination to be tried.
2003-03-03 00:58:47 +00:00
Matthew Dillon
914d31686b The zalloc pool's size calculation breaks if sbrk() does not return
contiguous chunks of memory.  It happens to do so in the bootstrap
code, but not necessarily in other places.
MFC after:	7 days
2002-12-19 23:23:20 +00:00
Jake Burkholder
7c6c018c0c Renamed the loader's zipfs to gzipfs. zipfs.c was repo-copied to gzipfs.c. 2002-12-19 19:34:59 +00:00
Ruslan Ermilov
8d5d039f80 Uniformly refer to a file system as "file system".
Approved by:	re
2002-12-12 17:26:04 +00:00
Ruslan Ermilov
db8993ce9e Capitalize ASCII code names.
Approved by:	re
2002-12-05 08:50:00 +00:00
Jake Burkholder
5afad5832a Update the second copy of libstand to deal with the new ufs2 superblock
format.  The one in sys/boot/libstand is not connected to the build.

Approved by:	re
2002-12-03 16:25:29 +00:00
Marcel Moolenaar
798df0ed06 Add the libz derived files, added in the previous commit, to
CLEANFILES. We were not cleaning up after ourselves.
2002-10-19 02:23:09 +00:00
Mike Barcroft
89fdc4e117 Use the standardized CHAR_BIT constant instead of NBBY in userland. 2002-09-25 04:06:37 +00:00
Mike Barcroft
abbd890233 o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien
2002-08-21 16:20:02 +00:00
Scott Long
9fdff10aa0 Fix a typo in #if 0 code 2002-08-21 09:30:45 +00:00
Jake Burkholder
f739b33f57 Stash various networking paramters in the environment for the kernel
to pick up, ala pxe.
2002-07-31 20:17:06 +00:00
Peter Wemm
21a7fd75c3 Reimplement malloc/free debugging that includes the offending file:line
info.  This turned out to be rather useful on ia64 for tracking down
malloc/free problems.
Detect duplicate free()'s - otherwise these show up as a guard1 failure
and it looks like corruption instead of something simple like a second
free() where there shouldn't be.
Deal with libz using libc headers and not seeing the malloc/free stuff that
we provide in libstand.  Do similar nastiness to what is done for bzlib.

Tested on: i386, ia64 (compile, run)
2002-07-20 04:18:20 +00:00
Peter Wemm
a4e7b0c88f Add __printflike() to printf() and sprintf() prototypes. -ffreestanding
turns off gcc's builtin attributes for these functions and as a result
-Wformat does no checking. (argh)
2002-07-20 03:55:06 +00:00
Jake Burkholder
f9751ec2cd Add a hack (kludge?) to avoid trying to access files backed by disk
devices as though they were backed by network devices.
2002-07-07 23:01:36 +00:00
Jake Burkholder
439be3f790 Ficl wants _setjmp and _longjmp. No need for weak symbols either. 2002-07-07 18:04:45 +00:00
Peter Wemm
0c079d8c6f To avoid anybody else getting caught out, these two files are really
in /sys/boot/common and are actually used there.
2002-06-29 09:21:14 +00:00
Peter Wemm
08db6efa75 Update from NetBSD 1.3 -> 1.6. Most notable, rev 1.6:
"Make in_cksum work on little endian machines"

This would explain a few things. :-)
2002-06-29 09:00:47 +00:00
Kirk McKusick
1c85e6a35d This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@freebsd.org>
2002-06-21 06:18:05 +00:00
Maxim Sobolev
70225aabb7 Correct bswap64() prototype.
Submitted by:	glewis
MFC after:	1 day
		(assuming that there is re's approval)
2002-06-03 19:04:10 +00:00
Jens Schweikhardt
81c4f30f7f Remove a URL from the middle of the BSD copyright (a clicko? a pasto?).
Fix typos:
s/evironment/environment
s/cont/const
s/_lonjmp/_longjmp

MFC after:  3 weeks
2002-06-02 10:05:55 +00:00
Ian Dowse
95431d3d42 Use an explicitly-sized type instead of daddr_t for on-disk block
numbers.
2002-05-19 10:50:38 +00:00
Poul-Henning Kamp
4c4bb98266 UFS indirect blocks are size u_int32_t, not daddr_t 2002-05-18 09:07:12 +00:00
Poul-Henning Kamp
fd3eff9c02 Add __divdi3() and __moddi3() to libstand. We will need them for UFS2.
Sponsored by:	DARPA & NAI Labs.
2002-05-13 13:31:20 +00:00
Poul-Henning Kamp
ab4f4196a9 #include <sys/disklabel.h> to get BBSIZE. 2002-05-12 20:58:18 +00:00
Ruslan Ermilov
c7b111cba8 Added new bsd.incs.mk which handles installing of header files
via INCS.  Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files.  Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1.  Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

	kerberos5/lib/libtelnet/Makefile
	lib/libbz2/Makefile
	lib/libdevinfo/Makefile
	lib/libform/Makefile
	lib/libisc/Makefile
	lib/libmenu/Makefile
	lib/libmilter/Makefile
	lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD.  Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".
2002-05-12 16:01:00 +00:00
David E. O'Brien
8321eb62f6 libstand needs _setjmp/_longjmp for FICL.
Submitted by:	jake
2002-04-13 22:09:53 +00:00
David E. O'Brien
168ca73831 Use -ffreestanding. It is REQUIRED by GCC 3.1 on all architectures.
I don't like putting this very-GCC centric option here; but no one as given
a better idea of handling it.

Reviewed by:	jhb
2002-04-09 20:38:29 +00:00
David E. O'Brien
1c47b73286 Break the sparc64 build. I expect those that complained about this commit
to fix the sparc64 case to their liking.
2002-04-09 05:34:22 +00:00
David E. O'Brien
5447d21d05 sparc64 grew _setjmp/_longjmp. 2002-04-08 20:46:07 +00:00
David E. O'Brien
ae9b2dab02 Use -ffreestanding. 2002-04-08 20:45:44 +00:00
David E. O'Brien
69160b1eb7 Remove __P() usage. 2002-03-21 23:54:04 +00:00
David E. O'Brien
be04b6d190 Remove 'register' keyword. 2002-03-21 23:39:28 +00:00
Maxim Sobolev
0414cddfc8 Kill debugging printf() slipped into my last commit.
Noticed by:		jhb
Hall of shame entry:	sobomax
2002-03-21 07:31:48 +00:00
Peter Wemm
2794bddccf Add -ffreestanding to CFLAGS for ia64. This should probably be global
like on the kernel.
2002-03-19 12:03:05 +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
Mike Barcroft
d846855da8 o Don't require long long support in bswap64() functions.
o In i386's <machine/endian.h>, macros have some advantages over
  inlines, so change some inlines to macros.
o In i386's <machine/endian.h>, ungarbage collect word_swap_int()
  (previously __uint16_swap_uint32), it has some uses on i386's with
  PDP endianness.

Submitted by:	bde

o Move a comment up in <machine/endian.h> that was accidentially moved
  down a few revisions ago.
o Reenable userland's use of optimized inline-asm versions of
  byteorder(3) functions.
o Fix ordering of prototypes vs. redefinition of byteorder(3)
  functions, so that the non-GCC (libc asm) case has proper
  prototypes.
o Add proper prototypes for byteorder(3) functions in <sys/param.h>.
o Prevent redundant duplicate prototypes by making use of the
  _BYTEORDER_PROTOTYPED define.
o Move the bswap16(), bswap32(), bswap64() C functions into MD space
  for platforms in which asm versions don't exist.  This significantly
  reduces the complexity of some things at the cost of duplicate code.

Reviewed by:	bde
2002-03-09 21:02:16 +00:00
Thomas Moestl
90ce56c287 Add the following functions/macros to support byte order conversions and
device drivers for bus system with other endinesses than the CPU (using
interfaces compatible to NetBSD):

- bwap16() and bswap32(). These have optimized implementations on some
  architectures; for those that don't, there exist generic implementations.
- macros to convert from a certain byte order to host byte order and vice
  versa, using a naming scheme like le16toh(), htole16().
  These are implemented using the bswap functions.
- stream bus space access functions, which do not perform a byte order
  conversion (while the normal access functions would if the bus endianess
  differs from the CPU endianess).

htons(), htonl(), ntohs() and ntohl() are implemented using the new
functions above for kernel usage. None of the above interfaces is currently
exported to user land.

Make use of the new functions in a few places where local implementations
of the same functionality existed.

Reviewed by:	mike, bde
Tested on alpha by:	mike
2002-02-27 17:16:18 +00:00
Mike Barcroft
fd8e4ebc8c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
Bruce Evans
c973d5e76c Fixed world breakage in previous commit. The generated headers are in
the current directory which is rarely ${.CURDIR}.
2002-02-02 00:20:32 +00:00
Maxim Sobolev
de78df64c7 Complete bzip2-1.0.2 import.
MFC in:		14 days
2002-02-01 16:33:40 +00:00
John Baldwin
7244e93850 We support writing to at least one filesystem now.
PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:04:28 +00:00
John Baldwin
126a0854a7 Add support for overwriting the existing contents of a file to the UFS
driver in libstand.  This specifically does not expand or truncate files
since the filesystem may be dirty or inconsistent.

PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:03:10 +00:00
Alfred Perlstein
25993d3a47 Back out my 'fix', resid is different for strategy than for write 2001-11-30 06:24:34 +00:00
Alfred Perlstein
58cbb07307 Make the same fix for writes to RAW objects. 2001-11-30 05:59:47 +00:00
Alfred Perlstein
fd19a949b4 write should return the number of bytes written, not 0 on success.
Submitted by: Jonathan Mini <mini@haikugeek.com>
PR: kern/32350
2001-11-30 05:54:30 +00:00
John Baldwin
a577b96977 - Change the f_isdir field of struct file to be a flags field and two
new flags: F_ROOTDIR and F_RR (Rock Ridge present).
- Cache the SUSP LEN_SKP parameter in struct file as well.
- If we open() '/', then force a read of the directory's contents so we
  can examine the directory record of '.' to see if Rock Ridge is present.
- If Rock Ridge extensions are present, lookup Rock Ridge names in
  readdir().
2001-11-06 22:31:10 +00:00
John Baldwin
417dee22b4 - Add a simple SUSP parser.
- Use the SUSP parser to detect Rock Ridge (RRIP) extensions and to look
  up alternate names when opening files.
2001-11-06 19:59:19 +00:00
John Baldwin
d917674e85 Switch to using ANSI function declarations and add missing function
prototypes.  I'm tired of getting stupid bugs from changing function
parameters and not getting warnings from the compiler when I goof it up.
2001-11-06 17:13:05 +00:00
Mike Barcroft
762e881bab Make the output from assert() look more like the example in the C99
standard.

Requested by:	bde
2001-10-29 07:07:25 +00:00
Mike Barcroft
cb5f460523 Only provide function information in compile environments that support
the C99 variable __func__ and never for C++.  Provide a more meaningful
example in the assert(3) manual.

Reviewed by:	asmodai, bde
2001-10-27 20:11:10 +00:00
Peter Wemm
3f5f44ebe8 Remove the -I../libc/${MACHINE_ARCH} that was there solely for
the #include "DEFS.h" that was only used on i386 (which has been fixed).
2001-10-26 21:20:23 +00:00
Peter Wemm
9d91d74d2b Change #include "DEFS.h" to <machine/asm.h>. 2001-10-25 01:30:54 +00:00
Jeroen Ruigrok van der Werven
d4c54c0c46 Add __FBSDID.
Change __assert() function to print failing function name.
This makes us C99 conforming.
2001-10-24 18:12:43 +00:00
Robert Drehmel
f048d52363 Make this Makefile suitable for sparc64. 2001-10-15 14:27:37 +00:00
Robert Drehmel
8a56180f76 Define the types iaddr_t and saddr_t for sparc64. 2001-10-15 13:50:47 +00:00
Bruce Evans
6eabd84580 Compensate for "Compensate for header dethreading" by backing it out. 2001-10-10 17:48:44 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov
00ba66fcf2 mdoc(7) police: markup nits. 2001-10-01 12:52:24 +00:00
Matthew Dillon
e74b6a84ce Add __FBSDID()s to libstand 2001-09-30 22:28:01 +00:00
Maxim Sobolev
13b21828a8 Add support for loading bzip2-compressed filesystems. Among other things
this would allow to load bzip2-compressed kernels/modules from the loader(8)
(support for that will be committer separately).

MFC after:	1 month
2001-09-18 13:01:12 +00:00
Doug Rabson
d66de00d95 Remove bogus implementation of _setjmp/_longjmp 2001-09-03 14:19:02 +00:00
Kris Kennaway
af42d47866 Check for malloc failure in a couple of cases
MFC after:	2 weeks
2001-09-03 05:57:06 +00:00
John Polstra
719077d1be Fix a bug in lseek which caused the loader to fail on some gzipped
kernels.  The error message was "elf_loadexec: cannot seek".

Libstand maintains a read-ahead buffer for each open file, so that
it can read in chunks of 512 bytes for greater efficiency.  When
the loader tries to lseek forward in a file by a small amount, it
sometimes happens that the target file offset is already in the
read-ahead buffer.  But the lseek code simply discarded the contents
of that buffer and performed a seek directly on the underlying
file.  This resulted in an attempt to seek backwards in the file,
since some of the data has already been read into the read-ahead
buffer.  Gzipped data streams cannot seek backwards, so an error
was returned.

This commit adds code which checks to see if the desired file offset
is already in the read-ahead buffer.  If it is, the code simply
adjusts the buffer pointer and length, thereby avoiding a reverse
seek on the gzipped data stream.

I incorporated a suggestion from Matt Dillon which saved a little
bit of code in this fix.

Reviewed by:	dillon, gallatin, jhb
2001-08-29 23:33:22 +00:00
Andrew Gallatin
c18092b2fb Bail if we go beyond the directory size, not just if we hit it.
Certain ISO fs's (like the one for 4.4-RC1 disc1 on alpha)
trigger this, and we end up opening a null file name.  This causes us to get
a false match for "kernel.ko" when it does not exist.
2001-08-23 17:08:26 +00:00
Ruslan Ermilov
753d686d34 mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
Ruslan Ermilov
8af1452cf8 Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
Mark Peek
44af2e3166 Make include file consistent with the rest of libstand. 2001-07-31 15:49:50 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Mike Heffner
646bd49ed1 Reset errno so that subsequent TFTP requests don't fail after the
first failure.

PR:		misc/25502
MFC after:	2 weeks
2001-06-30 21:39:09 +00:00
Mike Smith
a5af32a054 Correct the returned UDP datagram length. See the PR for a more comprehensive
description of the fix.

PR:		misc/25503
Submitted by:	Jim Browne <jbrowne@jbrowne.com>
MFC after:	1 week
2001-05-28 22:27:06 +00:00
Mike Smith
dc46262eaa The shortest valid TFTP packet is 4 bytes, not 8.
PR:		misc/25503
Submitted by:	Jim Browne <jbrowne@jbrowne.com>
MFC after:	1 week
2001-05-28 22:25:44 +00:00
Daniel C. Sobral
1d7d62d1e0 Replace functional bugs of ctypish functions in libstand with style
bugs.

reviewed by:	bde
MFC after:	1 week
2001-05-14 16:49:20 +00:00
Mark Murray
51bf9b8a50 Compensate for header dethreading. 2001-05-01 09:37:01 +00:00
Mike Smith
688ad9f336 Unbreak world by defining isalnum() for libstand consumers. 2001-04-29 19:06:57 +00:00
Andrew Gallatin
481184b805 fix cd9660 to work on files larger than ISO_DEFAULT_BLOCK_SIZE and unbreak
cdboot on alphas (which has been broken since just after 4.0-RELEASE)

submitted by: jlemon
2001-04-07 23:48:46 +00:00
Ruslan Ermilov
4a558355e5 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
Doug Rabson
a8c60cbef4 A quick and dirty port of libstand to ia64. 2001-03-06 16:11:36 +00:00
Ruslan Ermilov
bb1f93d519 Prepare for mdoc(7)NG. 2001-02-22 15:03:09 +00:00
Daniel C. Sobral
e94b7789ae Correct the prototype for pager_output(). 2001-02-22 10:58:30 +00:00
Kris Kennaway
07cd02bf4e Silence -Wnon-const-format 2001-02-18 04:51:47 +00:00
Jeroen Ruigrok van der Werven
2fa72ea7d4 Fix typo: compatability -> compatibility.
Compatability is not an existing english word.
2001-02-06 12:05:58 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Ruslan Ermilov
c5083414f8 mdoc(7) police: removed leading whitespaces that are not inside
Bd/Ed; these hardly degrade the quality of the produced output.
2001-01-19 14:15:40 +00:00
Ruslan Ermilov
4263595653 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
Ruslan Ermilov
ed40311694 mdoc(7) police: removed history info from the .Os FreeBSD call. 2000-12-14 11:52:05 +00:00
Paul Saab
3894088f17 When TFTP tries to open a file, it is expecting struct open_file
member f_devdata to be a pointer to a socket number.  When currdev
is "pxe", that assumption is correct.  When currdev is "disk*", that
assumption is incorrect.

Submitted by:	Jim Browne <jbrowne@jbrowne.com>
2000-12-08 05:02:12 +00:00
Benno Rice
a2a9c8c79e Disable the end guard for now.
The test for failing the end guard was always triggering (and was reported as
such in compiler warnings).  This is a temporary band-aid until I can work
out what's really going on.

Reviewed by:	obrien
2000-11-10 06:15:24 +00:00
Benno Rice
2ef2c53036 Make setjmp work our way, as opposed to NetBSD's.
This file needs commenting still.

Submitted by:	luoqi
Reviewed by:	obrien
2000-11-10 06:10:28 +00:00
Benno Rice
71bb073d45 Don't always enable debugging for the network device code.
Reviewed by:	obrien
2000-11-10 06:06:55 +00:00
Paul Saab
3d122d8e2c Honor the ip address given in the root-path dhcp option.
PR:	21743
Submitted by:	Brian Candler <B.Candler@pobox.com>
2000-11-05 14:55:09 +00:00
David E. O'Brien
26d9c22460 Inital PowerPC loader build support.
Submitted by:	Benno Rice <benno@jeamland.net>
2000-10-10 13:22:41 +00:00
David E. O'Brien
8bbe68c46b Fix the embeded VCS ID for FreeBSD vs. NetBSD. 2000-10-10 13:15:26 +00:00
David E. O'Brien
f308707531 Architecture-specific setjump()/longjmp() bits for the PowerPC
needed by the loader.

Submitted by:	Benno Rice <benno@jeamland.net>
Obtained from:	NetBSD (Wolfgang Solfrank <ws@@tools.de>)
2000-10-10 13:11:47 +00:00
Paul Saab
2ead0fa6d7 IN_CLASS*() macros assume host order and s_addr is network byte
order, so we must convert them to host order.
2000-09-20 18:16:20 +00:00
Poul-Henning Kamp
fc87418be0 Turn dkcksum() into an __inline function.
Change its type to u_int_16_t.
2000-09-16 13:43:00 +00:00
Paul Saab
4d3367540c Backout last commit. It was wrong.. *sigh* 2000-09-10 01:17:47 +00:00
Paul Saab
6b9a6703e9 include string.h to silence a warning. 2000-09-10 01:10:15 +00:00
Mike Smith
6910d080a2 Expose the NFS root node, so that an evil consumer can use it to get the
NFS filehandle for the root mount.
2000-09-05 22:11:41 +00:00
Mike Smith
ba20acfdb2 Implement readahead buffering for non-raw files. This drastically improves
the efficiency of byte-by-byte read operations on filesystems not already
supported by the block cache (especially NFS).

This should be a welcome change for users booting via PXE, as the loader
now reads its startup files almost instantly, instead of taking tens of
seconds.
2000-09-05 09:52:50 +00:00
Peter Wemm
06a3891a49 Make libstand compile 2000-09-03 11:29:18 +00:00
Peter Wemm
6d93919795 Add the -mpreferred-stack-boundary=2 option to reduce code bloat. We
compile the kernel with this.
2000-08-11 23:18:37 +00:00
Paul Saab
646cf5017b Add support to send the string 'PXEClient' as the Vendor class
identifier to the DHCP server.  Now you can check for this string
in your dhcp configuration to decide whether you will hand out a
lease to the client or not.
2000-08-11 08:36:17 +00:00
John Baldwin
13ba80d4ce Cleanup warnings by adding missint prototypes, removing unneeded duplicate
prototypes, and adding in several 'const's.  Also, add some missing
$FreeBSD$'s.

Found by:	BDECFLAGS
2000-08-03 09:08:29 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Peter Wemm
c536ef83f0 Fix the real problem that broke the Alpha loader this last week. It
was not the fault of the module code, nor FICL.  The malloc code requires
sbrk() to return addresses that were at least 16 byte aligned.  If the
Alpha loader happened to be 8 byte but not 16 byte aligned in length, then
you would get a zfree() panic at startup.

Incidently, this affected the i386 loader as well, and explains why
the static heap changed things and why jlemon had trouble when the bss
was not ending at a multiple of 8 bytes.

My fix is to 16 byte align it on all arches, even though the x86 version
only required 8 byte alignment (struct MemNode is smaller there).  We could
page align it if we wanted to be paranoid, but it isn't presently necessary.
2000-05-12 22:43:20 +00:00
Peter Wemm
72c520e887 We compile expressly on the alpha with -mno-fp-regs - so do not use them
explicitly here. This was the original cause of instruction faults on
the Alpha in loader. (not this code, but the same problem in libficl.a)
2000-05-12 21:48:54 +00:00
Paul Saab
d76f1a8cca Fix comment. 2000-05-06 04:50:09 +00:00
Paul Saab
db667a40a5 Add readdir support to the NFS filesystem in libstand. 2000-05-01 15:03:52 +00:00
Paul Saab
f12d45d9d6 Do not attempt to free a nfs node if it is the root node. The root
node is statically allocated and is not guarded, so free will panic
in nfs_close.
2000-05-01 10:53:21 +00:00
Jonathan Lemon
efb8ff8532 Add a readdir function to the loader fsops vector, and implement the
functionality for some of the filesystesms.
2000-04-29 20:47:10 +00:00
Jonathan Lemon
ee8d82ce9f Add ext2fs support to the loader. 2000-04-29 20:44:07 +00:00
Paul Saab
6450dd3cb4 Add a cleanup function. This is needed for PXE where you should
shutdown the UNDI and unload the stack.
2000-04-20 00:06:15 +00:00
Paul Saab
b1875374d3 Break out sendudp and readudp from net.c. This is for PXE, so it
can use its own UDP interface.
2000-04-08 01:18:04 +00:00
Sheldon Hearn
c6ff3a1bf7 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-02 09:14:21 +00:00
David E. O'Brien
f8c1abb102 trailing white space removal. 2000-01-18 07:43:12 +00:00
David E. O'Brien
c35874acaa Add two new functions cd9660_readfile() & cd9660_readdir(), which
cd9660_read() now uses to read CDROMs.  With these changes FreeBSD/Alpha
can now boot from a bootable CDROM.

Submitted by:	dfr
2000-01-18 07:37:10 +00:00
Peter Wemm
c447342094 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 05:07:58 +00:00
Peter Wemm
317b1ddf87 Use the ctype.h version of isascii() - it doesn't loose precision and think
that 0x100 (int) is an ascii character.

Submitted by:	bde
1999-12-28 11:48:23 +00:00
Peter Wemm
59e1f32482 Tidy up some loose ends. nullfs_read/write were returning the wrong value.
Fix some ctype problems - isascii() caused a warning if fed an unsigned
char - it's always > 0 and libstand is compiled with -Wall.
Missing prototype/include in printf.c
1999-12-27 08:45:14 +00:00
Peter Wemm
0fbac2a6c5 longjumperror() and abort() don't exist in libstand.. Don't test
for a condition we can't handle (like the x86 longjmp).  This was
highlighted by attempting to build FICL into the alpha loader.
1999-11-24 13:54:46 +00:00
Doug Rabson
04d5308a6b Change toupper/tolower so that they don't give a bogus answer if the
argument is already upper/lower.
1999-09-11 17:54:37 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Warner Losh
dcb0ae4ed8 More egcs warning fixes:
o use braces to avoid potentially ambiguous else
	o don't default to type int (and also remove a useless register
	  modifier).
	o Use parens around assignment values used as truth values.
	o Remove unused function.

Reviewed by: obrien and chuckr
1999-04-25 22:29:30 +00:00
John Polstra
d7e19a1d6a Don't build with -g. The a.out egcs can't handle it at the moment.
This seems to have snuck back into the Makefile in an unrelated
commit (rev. 1.8).
1999-04-22 15:47:21 +00:00
Daniel C. Sobral
8871c529f8 Remove float-point dependency from i386's version of setjmp()/longjmp(). 1999-02-12 17:22:30 +00:00
Daniel C. Sobral
64b0ea0c05 Copy _setjmp.S from libc in preparation for loader-specific version. 1999-02-12 17:20:19 +00:00
Jordan K. Hubbard
ff834009ea Oops. Missed this in the last commit.
Submitted by: Daniel C. Sobral <dcs@newsguy.com>
1999-02-01 12:32:37 +00:00
Mike Smith
a79658408c POSIX introduced optreset to deal with multiple invocations
of getopt (as in, multiple input lines :). This is documented in the
man page and is used in the code, but unistd.h and stand.h do not
declare it. Incidentally, it prevents me fixing a bug in loader's
code... :-)

PR:		misc/9373
Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-11 06:01:29 +00:00
Peter Wemm
49a35712aa Remove stray .endif from previous commit (I hope this is right) 1998-11-04 12:49:31 +00:00
Mike Smith
400a056059 Don't need this one anymore. 1998-11-04 07:40:05 +00:00
Mike Smith
b8ffd2a51c Well I never. Seems like _setjmp()/_longjmp() are just what the doctor
ordered.  This brings the Alpha back to parity, and should bring us
BootForth on both platforms.

Submitted by:	John Birrell (jb@freebsd.org)
1998-11-04 07:39:53 +00:00
Mike Smith
1add1a81da Improve the quality of isspace() to match expectations. This should make
the Ficl interpreter read its softwords array OK.
1998-11-04 07:04:00 +00:00
Mike Smith
797ed6379a Don't try to build (nonexistent) Alpha setjmp until we have one. 1998-11-04 00:32:08 +00:00