Commit Graph

127 Commits

Author SHA1 Message Date
Marcel Moolenaar
d6c0f33b57 Fix the freaddir implementation for the stand-alone interpreter.
Bug pointed out by: Jan Beich <jbeich@tormail.org>
2013-08-09 19:10:56 +00:00
Marcel Moolenaar
04ae0d7cc5 Fix the build of the testmain target. This target compiles a Forth
interpreter that can be run on the system and as such cannot be
compiled against libbstand. On the one hand this means we need to
include the usual headers for system interfaces that we use and
on the the other hand we can only use standard system interfaces.

While here, define local variables only when needed to make this
WARNS=2 clean on amd64.

PR:		172542
Obtained from:	peterj@
Pointed out by: Jan Beich <jbeich@tormail.org>
2013-08-01 18:06:58 +00:00
Marcel Moolenaar
68fd965f98 Add 2 builtin words for working with directories:
isdir?		( fd -- bool )
	freaddir	( fd -- ptr len TRUE | FALSE )

The 'isdir?' word returns `true' if the file descriptor is for a
directory and `false' otherwise.

The 'freaddir' word reads the next directory entry and if successful,
returns its name and 'true'. Otherwise 'false' is returned.

These words give the loader the ability to scan directories and read
files contained in them for 'rc.d'-like flexibility in handling which
modules to load and/or which tunables to set.

Obtained from:	Juniper Networks, Inc.
2013-07-10 21:37:50 +00:00
Tim Kientzle
a58e544f50 The CELL fields can be various integer types depending on the platform
(ARM uses 'int' and 'unsigned'; i386 uses 'long' and 'unsigned long'),
so we need explicit casts to long and unsigned long here to ensure
that the result matches the printf %ld and %lx specifiers.
2013-04-07 05:53:42 +00:00
Tim Kientzle
6f3d2cdd00 Fix two broken macros. 2013-04-07 05:40:49 +00:00
Rui Paulo
e19caad7b1 Build a 64 bit version of the FICL library. This is need for a 64 bit
EFI bootloader (amd64 only for now).

This is not yet connected to the build.
2012-12-21 05:22:14 +00:00
Andriy Gapon
881a94fab8 boot: use -march=i386 for both i386 and amd64 builds
.. so that consistent compilation algorithms are used for both
architectures as in practice the binaries are expected to be
interchangeable (for time being).
Previously i386 used default setting which were equivalent to
-march=i486 -mtune=generic.
The only difference is using smaller but slower "leave" instructions.

Discussed with:	jhb, dim
MFC after:	29 days
2012-10-20 16:57:23 +00:00
Andrey A. Chernov
283e000db4 Try to avoid all files dependence on the modification time of the large and
often modified directory created symbolic links points to - it cause
unnecessary full rebuilds each time make runs when directory is changed.
So do it only if symbolic link does not exists, which usually means that
objdir is clean anyway.

MFC after:      1 week
2012-07-26 10:10:54 +00:00
Rui Paulo
3da8dada52 Fix clang warnings. 2012-02-05 20:00:39 +00:00
Doug Rabson
9777aa3f12 Add a version of the FreeBSD bootloader which can run in userland, packaged
as a shared library. This is intended to be used by BHyVe to load FreeBSD
kernels into new virtual machines.
2011-06-30 16:08:56 +00:00
Rebecca Cran
6bccea7c2b Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
Dimitry Andric
3ab20ac1f5 On i386 and amd64, consistently use the following options whenever we
want to avoid using any "advanced" CPU features:

  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
2011-01-05 22:24:33 +00:00
Dimitry Andric
d5cfdc2521 Remove an empty .if/.endif pair from sys/boot/ficl/Makefile that I
forgot to cleanup in the last commit.
2011-01-05 22:12:06 +00:00
Dimitry Andric
8959d1a543 In lib/libstand, sys/boot/ficl and sys/boot/zfs, -mno-sse3 should also
be used for amd64, not just for i386.
2011-01-05 22:00:37 +00:00
Warner Losh
343bc19749 MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH (which simplifies some powerpc/powerpc64 ifs) 2010-08-23 01:43:47 +00:00
Nathan Whitehorn
67167531f0 Provide support in loader for booting 64-bit PowerPC kernels. Like amd64,
64-bit PowerPC kernels are loaded by a 32-bit loader, since nearly all
powerpc64 firmwares execute in 32-bit mode.
2010-07-12 00:49:22 +00:00
Brian Somers
7100efb738 Add a missing prototype
PR:		145232
Submitted by:	gcooper
MFC after:	1 week
2010-06-20 08:03:06 +00:00
Warner Losh
962cd8ffd7 Add basic mips support. This has been compile tested only. 2009-02-19 18:52:31 +00:00
Rafal Jaworowski
0ed948780c Initial support of loader(8) for ARM machines running U-Boot.
This uses the common U-Boot support lib (sys/boot/uboot, already used on
FreeBSD/powerpc), and assumes the underlying firmware has the modern API for
stand-alone apps enabled in the config (CONFIG_API).

Only netbooting is supported at the moment.

Obtained from:	Marvell, Semihalf
2008-10-14 10:11:14 +00:00
Yoshihiro Takahashi
51626c2003 Optimize for size on pc98. It enables to boot a kernel again.
I don't know what's wrong (loader, boot2 or others), but this change is
effective.

Tested by:	NAKAJI Hiroyuki
MFC after:	3 days
2007-10-15 14:20:24 +00:00
Jung-uk Kim
5bf7a61bb3 Update to FICL 3.03 (the last release before FICL4 rewrite).
The relevant changes for FreeBSD (excerpt from the release note):

  * Newly implemented CORE EXT words: CASE, OF, ENDOF, and ENDCASE. Also
    added FALLTHROUGH, which works like ENDOF but jumps to the instruction
    just after the next OF.
  * Bugfix: John-Hopkins locals syntax now accepts | and -- in the comment
    (between the first -- and the }.)
  * Bugfix: Changed vmGetWord0() to make Purify happier. The resulting
    code is no slower, no larger, and slightly more robust.
2007-03-23 22:26:01 +00:00
Ruslan Ermilov
2d78e8c5f1 Add -march=i386 to fix amd64 build by generating the same code
as i386 would do.
2006-09-28 10:02:04 +00:00
Warner Losh
c3dec0b20d Copy powerpc ficl files sysdep files (maybe we need a common one) 2006-08-18 21:41:43 +00:00
John Baldwin
906d6c0eb1 Remove Alpha bits for ficl. 2006-05-12 04:07:42 +00:00
Andrey A. Chernov
63ecaee8d6 Add -mno-sse3 for prescott/nocona 2005-07-15 12:22:14 +00:00
David E. O'Brien
2ba8e9a61b Ensure GCC does not use FP registers in integer code.
I really don't like cluttering up the compiler invocation,
but this bigger hammer will fix reported problems for now.
2005-05-31 18:13:29 +00:00
Scott Long
a63e88df60 Instead of just not defining a bunch of words when TESTMAIN is set, provide
stubs that at least handle the stack correctly.  This makes it much easier to
experiment with loader scripts from userland.
2004-11-30 11:35:30 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Marcel Moolenaar
fa1fc9094a Part 2 of fixing the boot code: gcc 3.4 fixes.
The whole problem seems to be size. Which is odd, because it is said
that size doesn't matter. Anyway... Add -Os to strategic places in the
makefile to have the final loader be as mall as possible. This seems
to be enough to make it work. For now... I think something is more
fundamentally wrong; or something more fundamental is wrong. Potato,
potaato.
2004-08-22 06:24:59 +00:00
Ruslan Ermilov
7e39a38ec9 Untangle building of AMD64 boot code.
Tested on:	amd64 (sledge)
2004-02-07 08:10:07 +00:00
Peter Grehan
b91af74a2c Disable floating point on PowerPC for the ficl library. 2003-12-10 09:10:54 +00:00
Peter Grehan
b42c229790 Define 'arch-powerpc' 2003-12-10 09:09:38 +00:00
Peter Grehan
f60761de00 FICL system-dependent files for powerpc. Taken from the i386 versions,
which were the most relevant.
2003-12-10 09:05:08 +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
062b3e0c77 Build on amd64. Yes, I know this isn't particularly nice. 2003-06-26 03:51:57 +00:00
Yoshihiro Takahashi
c2098cc1ad Set arch-pc98 env to true for pc98. 2003-06-08 03:11:16 +00:00
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
Scott Long
f1757c6ee7 Make ficl work on sparc64. The assumption that int == long == void * is
very pervasive in this code.  This fixes a few of those assumptions and
band-aids over some others.

Tested on: ia32 alpha sparc64

Reviewed by:	peter jake (in concept)
2002-08-31 01:04:53 +00:00
Scott Long
7effdac07a Fix for stand-alone compiling
Reviewed by:	mini
2002-08-21 09:28:00 +00:00
Jake Burkholder
dafb594328 MD ficl files for sparc64. 2002-05-19 23:20:56 +00:00
Tom Rhodes
d394511de3 More s/file system/filesystem/g 2002-05-16 21:28:32 +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
David E. O'Brien
a89dc896b5 Partical style cleanup. 2002-05-09 17:47:25 +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
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
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
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