Commit Graph

102 Commits

Author SHA1 Message Date
lukem
1c33b4e6a4 Overhaul MBR handling (part 1):
<sys/bootblock.h>:
    *	Added definitions for the Master Boot Record (MBR) used by
	a variety of systems (primarily i386), including the format
	of the BIOS Parameter Block (BPB).
	This information was cribbed from a variety of sources
	including <sys/disklabel_mbr.h> which this is a superset of.

	As part of this, some data structure elements and #defines
	were renamed to be more "namespace friendly" and consistent
	with other bootblocks and MBR documentation.
	Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
    *	Deprecated in favor of <sys/bootblock.h> (the latter is more
	"host tool" friendly).

amd64 & i386:
    *	Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
	be consistent with the naming convention of the msdosfs tools.

    *	Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
	and it's confusing to have two functionally equivalent bootblocks,
	especially given that "ufs" has multiple meanings (it could be
	a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

    *	Rework pbr.S (the first sector of bootxx_*):
	    +	Ensure that BPB (bytes 11..89) and the partition table
		(bytes 446..509) do not contain code.
	    +	Add support for booting from FAT partitions if BOOT_FROM_FAT
		is defined.  (Only set for bootxx_msdos).
	    +	Remove "dummy" partition 3; if people want to installboot(8)
		these to the start of the disk they can use fdisk(8) to
		create a real MBR partition table...
	    +	Compile with TERSE_ERROR so it fits because of the above.
		Whilst this is less user friendly, I feel it's important
		to have a valid partition table and BPB in the MBR/PBR.

    *	Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
	with other platforms.

    *	Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
    	we can boot off FAT partitions.

    *	Crank version of /usr/mdec/boot to 3.1, and fix some of the other
	entries in the version file.

installboot(8) (i386):
    *	Read the existing MBR of the filesystem and retain the BIOS
    	Parameter Block (BPB) in bytes 11..89 and the MBR partition
	table in bytes 446..509.  (Previously installboot(8) would
	trash those two sections of the MBR.)

mbrlabel(8):
    *	Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
	to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
2003-10-08 04:25:43 +00:00
simonb
970b12080e Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
2003-10-08 01:40:22 +00:00
simonb
a35e8c4a16 Cast through (void *) to appease gcc3.
XXX1 - why does this "type-punned pointer" warning only affect little-
       endian MIPS and not big-endian MIPS?!
XXX2 - too much duplicated code.
2003-09-26 16:00:28 +00:00
simonb
1d558954a5 Add "ULL" to large constant; keeps gcc331 happy. 2003-09-26 10:34:41 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
thorpej
063033a023 Since everyone uses clock_subr.c (or should, if they don't currently),
list it in conf/files instead of in every port's files.*.
2003-07-27 01:17:37 +00:00
simonb
460c3dca02 Reflect reality a little better. 2003-07-18 05:18:19 +00:00
lukem
ed51729135 __KERNEL_RCSID() 2003-07-15 02:54:31 +00:00
simonb
91dc378d5c Hardwire physmem to 32MB if not called from CFE.
This should be a kernel config option, but for now is enough to get
a sbmips GENERIC kernel running under a simulator.
2003-07-06 12:14:50 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
simonb
0ddc5a67fd KNF nit. 2003-05-29 02:22:51 +00:00
thorpej
e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
dsl
d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
ragge
d8c8fa8111 Add pseudo-device ksyms. 2003-04-26 14:10:04 +00:00
ragge
69a66687f8 Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
2003-04-26 11:05:05 +00:00
bouyer
aec10dd80c Nake return values from bounds_check_with_label() conform to the man
page: -1 for error, 0 for EOF, 1 otherwise. Inspired by an OpenBSD commit
message, pointed out by Miod Vallat in private mail.
vax/mba/hp.c: check return value <= 0, not < 0 to be concistent with how
other places handle return values from bounds_check_with_label().
2003-04-16 15:00:59 +00:00
christos
b9f9db3ca2 Bye Bye UCONSOLE 2003-04-10 22:06:51 +00:00
he
23113d90b1 Obey the LIBSA_NO_TWIDDLE define; don't include a reference to twiddle()
if it's defined.  This brings the size of bootxx_ffs under it's limit again.
2003-04-05 19:00:59 +00:00
thorpej
c9228c8ddd Use PAGE_SIZE rather than NBPG. 2003-04-02 04:17:50 +00:00
simonb
0a30e5fb17 Fix a grammatical nit. 2003-03-22 14:26:41 +00:00
drochner
7349f5c301 "bootparam" specific variables are defined in libsa/bootparam.c now. 2003-03-19 17:21:41 +00:00
simonb
a06ca06a19 Spell 'strategy' correctly. 2003-03-19 03:05:43 +00:00
drochner
20b8952600 cope with removal of this sick NENTS macro from libsa/netif.h 2003-03-13 13:59:11 +00:00
perseant
eab869e1c0 Make BRIDGE_IPF an option, and document it. Add it (commented) to GENERIC.
Let brconfig tell whether the bridge is using the ipfilter hook, or not.
2003-02-27 19:22:36 +00:00
simonb
3a93f29238 Update for LFSv2 support. Ports that have "bootxx_lfs"-style
bootblocks currently only support LFSv2, but the second level
"boot" program supports both LFS versions.
2003-02-23 23:23:07 +00:00
cgd
afc03f9fe6 fix spacing on Broadcom license. 2003-02-11 23:48:21 +00:00
cgd
cc51cff619 Update to consistently use Broadcom GPL-compatible license on all SiByte code. 2003-02-07 17:52:08 +00:00
cgd
8a6b8c3b72 Update to consistently use Broadcom GPL-compatible license on all SiByte code. 2003-02-07 17:38:48 +00:00
nakayama
e3e4805068 Replace machine/rnd.h with more appropriate name to share it
with cycle counter based microtime in kern/kern_microtime.c.
2003-02-05 13:57:50 +00:00
simonb
9c7531221b Use a 32-bit daddr_t so that lib/libsa/{ufs,lfs}.c don't pull in 64
bit divide and modulus library routines that break the tight space
constraints on bootblocks on these platforms.

May not be the final solution, but gets bootblocks building again.
2003-02-01 23:58:48 +00:00
thorpej
f91b0bb3f2 Merge the nathanw_sa branch. 2003-01-18 06:23:28 +00:00
lukem
4bb41ae2f2 Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile.  Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
2003-01-06 17:40:18 +00:00
thorpej
95fa2e148a Use aprint_normal() for cfprint routines. 2003-01-01 01:57:51 +00:00
simonb
6a5e492b57 Remove the explicit `makeoptions MACHINE_ARCH="mipse{b,l}"' for kernel
builds and use the endianness of the toolchain being used to determine
the endianness of the kernel.
2002-12-09 22:54:09 +00:00
lukem
0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
cgd
afa17e6b22 go back to being big-endian by default; was clobbered in last commit 2002-11-23 02:35:39 +00:00
simonb
a3458d769a Add "options MIPS64_SB1". 2002-11-15 01:03:53 +00:00
cgd
a9ff9eb14c to catch up with the recent gcc compiler driver changes, add -mno-abicalls
to AFLAGS.  In CFLAGS, remote -mno-half-pic (unneeded), and add -msoft-float
(needed for gcc 3.3).
2002-11-12 19:34:40 +00:00
simonb
96c9d84cda Add support for the ST M41T81 RTC found on pass 2 swarm boards.
XXX: Much of this should live in arch/sbmips instead of arch/mips/sibyte.
XXX: These should be replaced with MI SMBus drivers one day.
2002-11-12 01:22:25 +00:00
simonb
8243c6f1d3 s/bcopy/memcpy/ 2002-11-12 00:49:08 +00:00
simonb
e60e871a8e Fix the end-of-kernel calculation when we don't have a valid bootinfo
structure.  From Chris Demetriou.
2002-11-12 00:47:10 +00:00
cgd
686bcfad92 add stand to subdir list 2002-11-09 06:50:59 +00:00
cgd
f4cc396bbc loadfile_machdep.h implementation, needed by boot blocks.
copied verbatim from NetBSD/prep.
2002-11-09 06:22:22 +00:00
cgd
c188bc0cbd first cut at NetBSD/sbmips bootstrap programs, cloned from NetBSD/alpha's
and then modified to work with CFE as the firmware.
2002-11-09 06:20:37 +00:00
cgd
608942eb92 support passing in kernel symbols from a boot loader. GC some bogus
boot option handling.
2002-11-09 05:49:30 +00:00
cgd
2946df94fb GC IKOS kernel option (never complete in these sources anyway) 2002-11-09 05:36:49 +00:00
cgd
49c87f0804 update to latest CFE API code 2002-11-08 19:35:38 +00:00
cgd
cd8d5b3c92 default to big-endian, so that the kernel config matches the default
endianness chosen by build.sh for "-m sbmips".
2002-11-08 19:34:59 +00:00
simonb
3338dd4bd0 Fix fallout from gehenna-devsw merge. 2002-11-01 05:47:23 +00:00
elric
5ab71e20b0 Added commented out cgd(4)s to GENERIC configs. 2002-10-14 18:39:22 +00:00