Commit Graph

531 Commits

Author SHA1 Message Date
gson
d1298fd2a7 If a bootxx program already happened to be a multiple of 512 bytes in
length before padding, the shell command to conditionally pad it to
a multiple of 512 bytes returned a nonzero exit status, causing the
build to fail.
2003-10-15 03:49:57 +00:00
dsl
ca9f17c96d Add bsd.obj.mk so these directories get their own obj directory (for the
library objects shared by their subdirectories).
Needed when the obj directory isn't a parent of the subdirectories obj directory
2003-10-13 06:56:47 +00:00
lukem
e076c47767 Instead of defining TERSE_ERROR by default (due to space constraints),
define NO_LBA_CHECK.  bootxx_msdos still needs TERSE_ERROR because its
BPB is larger than the default.
2003-10-13 06:15:00 +00:00
lukem
af93a5c749 The reserved space for the BIOS Parameter Block (BPB) only needs to be for
FAT16 (11+51) except when booting from FAT{12,16,32}, which needs FAT32 (11+79).
We still reserve the BPB for non-bootxx_msdos PBR bootblocks because
they may be installed as a floppy boot record (and those need a BPB).

Remove some redundant wording in an error messsage, saving 6 bytes.
2003-10-13 06:08:28 +00:00
dsl
ab073a34f8 Move lib/crt/start_rom.S to a more sensible location. 2003-10-09 10:56:13 +00:00
dsl
44ac426707 Use real_to_prot (etc) from stand/lib.
Add a patchable header for boot parameters (eg console type).
2003-10-09 10:36:26 +00:00
dsl
3d4b6a197d Pick up X86_BOOT_MAGIC_* from bootblock.h
Move boot_params.S to lib (seems useful to use it in pxeboot).
2003-10-09 10:29:39 +00:00
dsl
6f9f3c64a7 Move start_pxe.S to a more sensible place 2003-10-09 09:42:25 +00:00
dsl
977fe7c488 Change the way the shared lib directory is handled.
Should now work if ${.OBJDIR} = ${.CURDIR}/obj.
2003-10-08 18:51:50 +00:00
dsl
cabc1ae936 Need to explicitly create directory behing symlink.
Clean share lib directory.
2003-10-08 18:38:43 +00:00
dsl
2ae753f095 Only build the libraries once, 2003-10-08 18:20:15 +00:00
dsl
c8b26967a8 These files are not used by the new boot code. 2003-10-08 13:10:20 +00:00
dsl
c86f86e53a BSSTART was only used for the (now depracated) old stand/biosboot code. 2003-10-08 13:06:30 +00:00
lukem
8ff09e8ecf Remove the unused "hardcode the blocks of /boot" versions /boot and
i386-MD installboot.
They haven't been enabled for a while, keeping them here is just
confusing, and they're still going to be in the CVS repo attic...
2003-10-08 04:43:28 +00:00
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
lukem
420f3b76ba Replace BP_* with I386_BP_FLAGS_*, for consistency with other stuff in
<sys/bootblock.h>
(CONSDEV_ should be converted as well, but that's more intrusive...)
2003-10-06 05:24:54 +00:00
fvdl
60ae17c7ae Fix signed/unsigned warnings. 2003-08-31 22:40:13 +00:00
fvdl
06298770b0 Add another -DBOOT_ELF64 for amd64. 2003-08-30 20:38:58 +00:00
fvdl
ee4b42342e Add -DBOOT_ELF64 for amd64. 2003-08-30 18:25:07 +00:00
fvdl
8ea680bb14 Add -m elf_i386 (for amd64) to LD. 2003-08-30 15:24:41 +00:00
fvdl
e8b1f4f135 Add -m elf_i386 to ${LD}, not ${LDFLAGS}, since bsd.lib.mk doesn't
include ${LDFLAGS} when using ld -x on an object file.

XXX what's the point of these ld -x rules anyway?
2003-08-30 15:15:01 +00:00
dsl
677dd78600 Placate people who insist on using non-standard disk layouts by adding
a valid MBR entry for partition 3 (covering the first 15 sectors) into the
end of the partition boot code.
2003-08-30 13:33:55 +00:00
dsl
fc94061686 Further fallout from making 'path' arg to 'ufs_open' 'constchar *'.
There may be fallout in other builds....
2003-08-18 15:47:41 +00:00
dsl
744ee27288 Try looking RF_PROTECTED_SECTORS further down the partition if /boot
cannot be found.
Lets the system boot directly from a rad set.
2003-08-12 10:03:03 +00:00
dsl
221f1dff47 Some systems (esp. those with a Promise IDE controller card) seem to
destroy %dl (drive number) across the 'disk reset' command.
Preserve %dl across that call and all registers across the disk reads.
Reorder the code to remove some long conditional jumps to save space.
2003-08-09 20:57:45 +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
dsl
e33c0fa9eb Dont need jmpl, ljmp or jmp is fine. 2003-08-05 15:14:49 +00:00
dsl
0be64684b7 Some bios manage to load the mbr code to 7c0:0 (instead of 0:7c00) especially
when loading from CDROM.  Change so we don't care what %cs is.
Adjust code layout so that anyone who feels so inclinded can use this for
the mbr code.  Note that mbr slot 0 overlays a data area that must be zero
when this is read from the pbr.
2003-08-05 13:41:52 +00:00
mrg
fcd3befc1c labels needs statements 2003-07-27 07:09:17 +00:00
mrg
3cfc71fc33 rewrite an undefined assignment 2003-07-27 07:04:46 +00:00
mrg
fcbce53483 #undef takes just a name, no params 2003-07-27 07:02:18 +00:00
dsl
3e0a1a7085 No longer build biosboot*.sym and installboot. 2003-07-26 08:45:12 +00:00
dsl
a2401126fe Report actual $MACHINE (so it will be amd64, not i386)
and filesystem type (could be useful)
in primary bootstrap banner message.
2003-07-25 21:16:01 +00:00
lukem
66173dd5f9 NOxxx= variables should appear first 2003-07-10 11:30:43 +00:00
dsl
1943909639 Support booting from a netbsd partition in the MBR extended partition. 2003-07-07 13:32:42 +00:00
dsl
48046920d6 Fix copyright - it got mangled earlier.
Added a mention of Wolfgang Solfrank - there are probably only comments left
from the much older mbr.S that he contributed.
(Wolfgang pointed out the mangled copyright, but doesn't object to the removal
of the Tools GmbH one.)
2003-07-02 14:35:51 +00:00
simonb
ad51219ae3 Make this work without a populated destdir:
machine and x86 symlinks.
 Include from right places.
 Don't depend on LIBCRT0,etc.

Also for the bootxx programs, keep the ELF object during the build
process.
2003-07-01 13:36:59 +00:00
thorpej
221d313d7c Allow SOURCES to be overridden. 2003-06-30 17:54:06 +00:00
thorpej
7401047528 Add a way to force (at compile time) use of int13 extensions. 2003-06-25 04:21:51 +00:00
tron
64e5c9eb7c Remove "lib" directory in "cleandir" target. 2003-06-24 09:38:35 +00:00
martin
cd7023a3eb Backout previous, this file is not affected by kernel options. 2003-06-23 14:48:37 +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
thorpej
84b00019df Comment out DEBUG_MEMSIZE. 2003-05-24 03:38:58 +00:00
dsl
341c4563e3 Incorrect sector number passed to boot1 in floppy (no mbr) case 2003-05-15 08:50:53 +00:00
dsl
f9bb4eea5d Build my new i386 bootcode 2003-05-12 14:48:56 +00:00
dsl
18e1c04d74 Don't override PROG from subdir Makefile
Install into /usr/mdec
2003-05-12 14:35:54 +00:00
dsl
5ba5335a38 Install into /usr/mdec 2003-05-12 14:34:55 +00:00
dsl
0e9fdbb612 Remove some unused defines 2003-05-12 14:33:49 +00:00
fvdl
e5ad654753 Silence a gcc 3 warning about a 'x = ++x % foo' construct. 2003-05-09 00:16:55 +00:00
fvdl
daea75d74a installboot is compiled in native mode on amd64, unlike the other
things around here. Hence, the machine/ include dir must actually
point to its own.
2003-05-09 00:11:26 +00:00