Commit Graph

42 Commits

Author SHA1 Message Date
Warner Losh
2db4f48c6a Make both UFS1 and UFS2 fit on the same boot blocks. These are a
subset of Peter's patchs that are believed to be safe.

Makefile tweaks:
o -fomit-frame-pointer
o Change default to building both UFS1 and UFS2 bootblocks.

Lots of boot2 tweaks:
o lookup is only ever called with kname, so use it directly.
o inline memsize
o getstr are only ever called with cmd, so hardware that.
o tweaks to the parsing code to test after the conversion rather than
  before since we tested after anyways.
o eliminate support for %x in printf.
o eliminate a few bytes in printfs.
o Tweak the boot banner.
o eliminate support for wd and "  " devices (I might add wd back to
  keep bde happy).
o eliminate support for a few arguments.

This takes us from -162 bytes free to 67 bytes free.

I've tested this only on a few systems, so be careful when updating to
this change.

Submitted by: peter, imp, ian
2002-12-17 21:10:34 +00:00
Poul-Henning Kamp
a3b5a4369c Employ the unused bytes after the disklabel in the second sector. This makes
it possible to make UFS1_ONLY and UFS2_ONLY versions which fit inside the
traditional 16 sectors.

Remove assorted now unneeded hackery.

UFS1_AND_UFS2 still needs another 150 bytes to work, and that is probably
not within our reach, ever.
2002-12-14 19:44:13 +00:00
John Baldwin
66648a06a0 Revert MEM_USR back to 0xa000 for BTX clients. Instead, adjust boot2
to run at 0xc000 by changing its virtual start address from 0x1000 to
0x2000.

Tested by:	phk
2002-10-08 18:19:02 +00:00
Poul-Henning Kamp
c80ba0ad1b Now that ufsread.c doesn't do 64bit divide remainder operations,
don't bother with libkern.

Sponsored by:	DARPA & NAI Labs.
2002-10-08 15:49:35 +00:00
Brian Feldman
3cfeca5326 Reinstate rev 1.36 with an important line that got missed. Note this
also improves the "random undocumented offsets into various memory
spaces" a little bit.
2002-10-08 12:09:16 +00:00
Poul-Henning Kamp
a201162d71 Unbreak boot2 by backing out rev 1.36 to Makefile, which does not
work as advertised:

	bang# pwd
	/bang/src/sys/boot/i386/boot2
	bang# make clean >& /dev/null
	bang# cvs -q update -r 1.35 Makefile >& /dev/null
	bang# make >& /dev/null
	bang# cat /usr/obj/`pwd`/boot2.h
	#define XREADORG 0x725
	bang# cvs -q update -r 1.36 Makefile > & /dev/null
	bang# make clean > & /dev/null
	bang# make > & /dev/null
	bang# cat /usr/obj/`pwd`/boot2.h
	#define XREADORG 0x25
	bang#
2002-10-08 07:52:28 +00:00
Brian Feldman
6c598ff615 Correct a bug in adding 0x700 to a number. 2002-10-07 22:21:16 +00:00
Poul-Henning Kamp
15cfc1833c Conditionalize the number of sectors loaded by boot1.s on UFS1/UFS12.
Conditionalize the "XX bytes left" checks reference on UFS1/UFS12.

Conditionally build the necessary 64bit math for boot2 if UFS12.

Sponsored by:	DARPA & NAI Labs.
2002-10-07 21:36:06 +00:00
Poul-Henning Kamp
b410146034 Change the comment character from # to // in boot1.s and run
it through CPP so we can conditionalized things.

Sponsored by:	DARPA & NAI Labs
2002-10-07 20:56:09 +00:00
Poul-Henning Kamp
5765b4ef72 Move the definition of UFS1_ONLY into the Makefiles where it belongs.
Sponsored by:	DARPA & NAI Labs.
2002-10-07 08:09:20 +00:00
Ruslan Ermilov
d2893b161b Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
2002-07-29 09:40:17 +00:00
Poul-Henning Kamp
cb37d870a6 Revert the part of Kirks UFS2 commit which added divdi3.c and moddi3.c
to libi386, this issue was resolved already in a cleaner way.
2002-06-21 11:00:00 +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
Poul-Henning Kamp
080ef30b20 Add explicit dependency on ufsread.c 2002-06-05 12:30:45 +00:00
Poul-Henning Kamp
833468e219 Preparation for UFS2 commit:
Factor the ufs reading code out of the i386/boot2 loader so it can
be reused by for instance sparc64.

Sponsored by: DARPA and NAI Labs.
2002-06-05 11:10:38 +00:00
Ruslan Ermilov
475ab3cda6 Align CLEANFILES with revision 1.25 changes. 2002-05-13 16:16:00 +00:00
Bruce Evans
e754a32842 Saved 176 bytes by compiling with -fno-guess-branch-probability. The
default of -fguess-branch-probablility causes time optimizations (?)
like rewriting `if (foo) x++;' as
`if (!foo) goto forth; back: ; ...; forth: x++; goto back;".  This is
pessimizes space especially well on i386's because one short branch
gets converted to 2 long ones.

Removed -fno-align-foo since it is implied by -Os.  Previous commit
messages seem to have overstated the new alignment bugs in gcc.  The
only case that affects boot2 is that -fno-align-functions (or
equivalently -falign-functions=1) actually gives -falign-functions=2.
This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1.
The default case where the optimization level is 1 and no alignment
options are given is more broken.  All alignments are minimal, modulo
the bug in FUNCTION_BOUNDARY.  This is caused by toplev.c setting
defaults too early.

Some hacks in previous commits ar not needed now, but may as well be
kept until gcc is fixed.  The previous on in the Makefile saved 96
bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data
due to unrelated bloat in the alignment of large objects.  There aren't
even any options to control alignment of data.
2002-05-12 15:45:28 +00:00
Peter Wemm
7a163a83da Use a crowbar and duct-tape to make boot2 fit again. This gets it down
to 4 bytes free.  I removed a printf (the Keyboard yes/no) since it is of
marginal value and sed'ed the generated asm output to remove the unwanted
aligns.  There's probably a better way to gain a few extra bytes than
losing the printf.  Shortening strings is probably a better option but this
should get us over the hurdle.
2002-05-11 21:39:59 +00:00
John Baldwin
88f0d73da4 - Axe -mpreferred-stack-boundary=2 as -Os turns this on by default.
- Axe -fdata-sections as turning it on or off makes no difference.  If
  it did make a difference it would serve to bloat boot2 even further with
  extra padding.
- Axe -fforce-addr.  This gets us 32 bytes so we are down to only being
  64-bytes over.

We still can't compile this with gcc 3.1.  The problem seems to be that
the -fno-align-foo options don't actually work.  Comparing the new and
old output it turns out that gcc is 4-byte padding all the functions and
labels and what not despite the passed in arguments thus adding the
unfortunate bloat to boot2.
2002-05-10 04:05:42 +00:00
David E. O'Brien
7571ef5ae3 -ffreestanding is the word for /sys. 2002-05-10 00:53:45 +00:00
John Baldwin
b0606ca15f Add in a hack to support IBM "El Torito" CD-ROM booting BIOS's which expect
the first sector of the emulated floppy to contain a valid MS-DOS BPB that
it can modify.  Since boot1 is the first sector of boot.flp, this resulted
in the BIOS overwriting part of boot1: specifically the function used to
read in sectors from the disk.

Submitted by:	Mark Peek <mark@whistle.com>
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
PR:		i386/26382
Obtained from:	NetBSD, OpenBSD (the example BPB)
MFC after:	1 month
2001-07-31 19:50:09 +00:00
Robert Nordier
816aa3c0b5 Unset MAINTAINER. 2001-07-21 14:32:47 +00:00
Robert Nordier
ce6a6a0f90 Set MAINTAINER. 2000-10-02 17:23:16 +00:00
John Baldwin
cbf3fb883e Add in support for EDD to support large disks via LBA. This uses a
method similar to that of the loader to avoid potentially breaking older
drives in that we only use EDD if the desired cylinder is > 1023.
2000-06-26 22:57:16 +00:00
John Baldwin
638bac9fc0 Clean up all of the 16-bit assembly code in the x86 bootstrap to work
with the new binutils.  Now that we have a decent assembler, all the old
m4 macros are no longer needed.  Instead, straight assembly can be used
since as(1) now understands 16-bit addressing, branches, etc.  Also,
several bugs have been fixed in as(1), allowing boot0.s to be further
cleaned up.
2000-05-23 12:18:49 +00:00
John Baldwin
2cb6d95d48 Add a missing dependency: boot2 depends on the BTX kernel. 2000-04-11 14:49:13 +00:00
David E. O'Brien
c8e02dfe73 Add -fdata-sections, which is a new GCC 2.95 optimization. Remove
-fschedule-insns as it wasn't such a big win with 2.95 after all.

Add the *BIG* win "-mpreferred-stack-boundary=2" optimiztion submitted by
Dima.  GCC 2.95 ensures the stack frame is always properly [opitimally]
aligned by surrounding every function call by code simular to
"addl $-12, %esp" / "addl $12, %esp".  Here we need the reduction in space,
with speed not an issue.
1999-11-15 04:23:40 +00:00
David E. O'Brien
73de3d0ff7 Turn on the -fforce-addr and -fschedule-insns optimizations. Adding
either one gives us an additional 32 bytes of additional space available
when using EGCS 1.1.2.  With GCC 2.95.2 -fforce-addr gives us 12 more bytes,
and adding -fschedule-insns gives us an additional 4 bytes.
1999-11-13 23:08:46 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Robert Nordier
50d57a133e Reintroduce LBA (cyl > 1023) support in the bootblocks, enabled by
means of a build option.
1999-07-20 01:19:23 +00:00
Robert Nordier
bf0eae60c5 Optimize better for space.
Thanks to: jdp
1999-04-05 07:24:51 +00:00
Robert Nordier
c03fa7f977 Use etc/make.conf settings for serial port and speed.
Submitted by: rvb
Reviewed by: bde
1999-01-10 14:48:05 +00:00
Robert Nordier
9888bdcd29 boot1: Eliminate EDD detection and optional use of disk packet
interface.  Do some general consistency fixes and space optimizations.
Use of some freed-up space to defend against possible BIOS misfeatures.

boot2: Revise disk read interface to provide for boot1 changes.  Free
up space for this.
1998-11-08 15:36:35 +00:00
Robert Nordier
548bf5dd17 Make use of BIOS int 0x13 extensions configurable, and disabled
by default.
1998-11-05 20:52:25 +00:00
Robert Nordier
1a8efde980 Make serial port, data format, and bps configurable. 1998-10-20 20:20:48 +00:00
Robert Nordier
67ac585edf Fix path to sio.s 1998-10-15 22:08:13 +00:00
Robert Nordier
da55c91100 Add serial, dual, and probe-keyboard support. 1998-10-15 20:04:21 +00:00
Robert Nordier
ee2e4f9b32 Fix btx include path. 1998-10-14 01:53:56 +00:00
Robert Nordier
59ea046e5d Include <bsd.prog.mk>. Add install target (to /boot for now). 1998-10-14 00:24:16 +00:00
Robert Nordier
fd4afc6487 Change to a 15-sector boot2.
Refine slice-handling.
1998-10-13 21:35:42 +00:00
Robert Nordier
8f65b6a695 Don't use an absolute path to objcopy.
Noticed by: Scott Mace <smace@intt.org>
1998-10-13 18:29:18 +00:00
Robert Nordier
4d8eda2252 New boot blocks: support for /boot/loader; a.out & ELF; cyl > 1023;
multiple 0xa5 slices; etc.
1998-10-12 21:16:26 +00:00