History log of /freebsd-9.3-release/sys/boot/i386/libi386/devicename.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 243243 18-Nov-2012 ae

MFC 239054,239057,239058,239060,239066,239067,239068,239070,239073,
239087,239088,239127,239210,239211,239230,239231,239232,239243,
239292,239293,239294,239325,240272,240273,240274,240275,240276,
240277,240335,240481,241023,241047,241053,241065,241068,241069,
241070,241164,241809,241876

239054:
Create the interface to work with various partition tables from the
loader(8). The following partition tables are supported: BSD label, GPT,
MBR, EBR and VTOC8.
239057:
Remove unused variables.
239058:
Introduce new API to work with disks from the loader's drivers.
It uses new API from the part.c to work with partition tables.
239060:
When GPT signature is invalid in the primary GPT header, then try to
read backup GPT header.
239066:
Add offset field to the i386_devdesc structure to be compatible with
disk_devdesc structure. Update biosdisk driver to the new disk API.
239067:
Remove unneeded flag.
239068:
Teach the ZFS use new partitions API when probing.
Note: now ZFS does probe only for partitions with type "freebsd-zfs"
and "freebsd".
239070:
Add simple test program that uses the partition tables handling code.
It is useful to test and debug how boot loader handles partition tables
metadata.
239073:
Bump USERBOOT_VERSION.
239087:
Add to the debug output the offset from the parent partitioning scheme.
239088:
Fix start offset calculation for the EBR partitions.
239127:
As it turned out, there are some installations, where BSD label
contains partitions with type zero. And it has worked.
So, allow detect these partitions.
239210:
Add more debug messages.
239211:
Add another debug message.
239230:
Unbreak booting from the true dedicated disks.
When we open the disk, check the type of partition table, that has
been detected. If this is BSD label, then we assume this is DD mode.
239231:
Remove colons from the debug message, device name returned by the
disk_fmtdev() already has the colons.
239232:
Restore the old behaviour. If requested partition is a BSD slice,
but d_partition isn't explicitly set, then try to open BSD label and its
first partition.
239243:
After r239066, reinitialize v86.ctl and v86.addr for int 13 EDD probing
in sys/boot/i386/libi386/biosdisk.c. Otherwise, when DISK_DEBUG is
enabled, the DEBUG() macros will clobber those fields, and cause the
probing to always fail mysteriously when debugging is enabled.
239292:
Explicitly terminate the string after strncpy(3).
239293:
Rework r239232 to unbreak ZFS detection on MBR slices.
239294:
Some BIOSes return incorrect number of sectors, make checks less
strictly, to do not lost some partitions.
239325:
Add comment why the code has been disabled.
240272:
Make struct uboot_devdesc compatible with struct disk_devdesc.
240273:
Use disk_fmtdev() and disk_parsedev() functions from the new DISK API.
240274:
Update uboot's disk driver to use new DISK API.
240275:
Build disk.c only when DISK_SUPPORT is enabled.
240276:
Update according to the change of struct uboot_devdesc.
240277:
Handle LOADER_NO_DISK_SUPPORT knob in the arm and powerpc ubldr.
240335:
Slightly reduce an overhead for the open() call in the zfsloader.
libstand(3) tries to detect file system in the predefined order,
but zfsloader usually is used for the booting from ZFS, and there is
no need to try detect several file system types for each open() call.
240481:
The MBR data is not necessarily aligned. This is a problem on ARM.
241023:
Make the loader a bit smarter, when it tries to open disk and the slice
number is not exactly specified. When the disk has MBR, also try to read
BSD label after ptable_getpart() call. When the disk has GPT, also set
d_partition to 255. Mostly, this is how it worked before.
241047:
Disable splitfs support, since we aren't support floppies for a long
time. This slightly reduces an overhead, when loader tries to open
file that doesn't exist.
241053:
Almost each time when loader opens a file, this leads to calling
disk_open(). Very often this is called several times for one file.
This leads to reading partition table metadata for each call. To
reduce the number of disk I/O we have a simple block cache, but it
is very dumb and more than half of I/O operations related to reading
metadata, misses this cache.

Introduce new cache layer to resolve this problem. It is independent
and doesn't need initialization like bcache, and will work by default
for all loaders which use the new DISK API. A successful disk_open()
call to each new disk or partition produces new entry in the cache.
Even more, when disk was already open, now opening of any nested
partitions does not require reading top level partition table.
So, if without this cache, partition table metadata was read around
20-50 times during boot, now it reads only once. This affects the booting
from GPT and MBR from the UFS.
241065:
Fix disk_cleanup() to work without DISK_DEBUG too.
241068:
Reduce the number of attempts to detect proper kld format for the amd64
loader.
241069:
Remember the file format of the last loaded module and try to use it for
next files.
241070:
Fix the style.
241164:
Replace all references to loader_callbacks_v1 with loader_callbacks.
241809:
Add the flags parameter to the disk_open() function and DISK_F_NOCACHE
flag, that disables the caching of partition tables metadata.
Use this flag for floppies in the libi386/biosdisk driver.
241876:
When loader tries to open GPT partition, but partition table is not GPT,
then try automatically detect an appropriate partition type.


# 237766 29-Jun-2012 avg

MFC r235329,235343,235361,235364: zfsboot/zfsloader: support accessing
filesystems within a pool


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 189588 09-Mar-2009 jhb

- Make it possible to disable GPT support by setting LOADER_NO_GPT_SUPPORT
in make.conf or src.conf.
- When GPT is enabled (which it is by default), use memory above 1 MB and
leave the memory from the end of the bss to the end of the 640k window
purely for the stack. The loader has grown and now it is much more
common for the heap and stack to grow into each other when both are
located in the 640k window.

PR: kern/129526
MFC after: 1 week


# 185029 17-Nov-2008 pjd

Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.

This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

Allows regular users to perform ZFS operations, like file system
creation, snapshot creation, etc.

- L2ARC

Level 2 cache for ZFS - allows to use additional disks for cache.
Huge performance improvements mostly for random read of mostly
static content.

- slog

Allow to use additional disks for ZFS Intent Log to speed up
operations like fsync(2).

- vfs.zfs.super_owner

Allows regular users to perform privileged operations on files stored
on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

Not all the flags are supported. This still needs work.

- ZFSBoot

Support to boot off of ZFS pool. Not finished, AFAIK.

Submitted by: dfr

- Snapshot properties

- New failure modes

Before if write requested failed, system paniced. Now one
can select from one of three failure modes:
- panic - panic on write error
- wait - wait for disk to reappear
- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

Just quota and reservation properties, but don't count space consumed
by children file systems, clones and snapshots.

- Sparse volumes

ZVOLs that don't reserve space in the pool.

- External attributes

Compatible with extattr(2).

- NFSv4-ACLs

Not sure about the status, might not be complete yet.

Submitted by: trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from: OpenSolaris


# 181282 04-Aug-2008 cperciva

Dereferencing uninitialized pointers considered harmful. Prior to this
commit, calling i386_parsedev(..., X, ...) where X is "ad", "bge", or
any other disk or network device name without a unit number, would
result in dereferencing whatever happened to be on the stack where the
variable "cp" is stored.

Found by: LLVM/Clang Static Checker


# 172940 24-Oct-2007 jhb

First cut at support for booting a GPT labeled disk via the BIOS bootstrap
on i386 and amd64 machines. The overall process is that /boot/pmbr lives
in the PMBR (similar to /boot/mbr for MBR disks) and is responsible for
locating and loading /boot/gptboot. /boot/gptboot is similar to /boot/boot
except that it groks GPT rather than MBR + bsdlabel. Unlike /boot/boot,
/boot/gptboot lives in its own dedicated GPT partition with a new
"FreeBSD boot" type. This partition does not have a fixed size in that
/boot/pmbr will load the entire partition into the lower 640k. However,
it is limited in that it can only be 545k. That's still a lot better than
the current 7.5k limit for boot2 on MBR. gptboot mostly acts just like
boot2 in that it reads /boot.config and loads up /boot/loader. Some more
details:
- Include uuid_equal() and uuid_is_nil() in libstand.
- Add a new 'boot' command to gpt(8) which makes a GPT disk bootable using
/boot/pmbr and /boot/gptboot. Note that the disk must have some free
space for the boot partition.
- This required exposing the backend of the 'add' function as a
gpt_add_part() function to the rest of gpt(8). 'boot' uses this to
create a boot partition if needed.
- Don't cripple cgbase() in the UFS boot code for /boot/gptboot so that
it can handle a filesystem > 1.5 TB.
- /boot/gptboot has a simple loader (gptldr) that doesn't do any I/O
unlike boot1 since /boot/pmbr loads all of gptboot up front. The
C portion of gptboot (gptboot.c) has been repocopied from boot2.c.
The primary changes are to parse the GPT to find a root filesystem
and to use 64-bit disk addresses. Currently gptboot assumes that the
first UFS partition on the disk is the / filesystem, but this algorithm
will likely be improved in the future.
- Teach the biosdisk driver in /boot/loader to understand GPT tables.
GPT partitions are identified as 'disk0pX:' (e.g. disk0p2:) which is
similar to the /dev names the kernel uses (e.g. /dev/ad0p2).
- Add a new "freebsd-boot" alias to g_part() for the new boot UUID.

MFC after: 1 month
Discussed with: marcel (some things might still change, but am committing
what I have so far)


# 163897 01-Nov-2006 marcel

Extend struct devdesc with a unit field, called d_unit. Promote the
device (kind) specific unit field to the common field. This change
allows a future version of libefi to work without requiring anything
more than what is defined in struct devdesc and as such makes it
possible to compile said version of libefi for different platforms
without requiring that those platforms have identical derivatives
of struct devdesc.


# 146697 27-May-2005 jhb

Fix a warning by adding a missing 'const'.

MFC after: 1 week


# 119482 25-Aug-2003 obrien

Use __FBSDID().
Also some minor copyright style cleanups.


# 86091 05-Nov-2001 jhb

Add a device driver for the BIOS device for CD-ROM's booted via El Torito
no emulation mode. Unlike other BIOS devices, this device uses 2048 byte
sectors. Also, the bioscd driver does not have to worry about slices
or partitions.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 39673 26-Sep-1998 dfr

* Add old UFS compatibility code to alpha/boot1.
* Fix a raft of warnings, printf and otherwise.
* Allocate the correct amount in mod_searchmodule to prevent an overflow.
* Fix the makefiles so they work outside my home directory (oops).


# 39662 25-Sep-1998 msmith

The BIOS can't perform a floppy operation where the destination crosses
a physical 64k boundary. Allocate a bounce buffer for such a transaction.


# 38466 21-Aug-1998 msmith

This commit was generated by cvs2svn to compensate for changes in r38465,
which included commits to RCS files with non-trunk default branches.


# 38465 21-Aug-1998 msmith

This is the new unified bootstrap, sometimes known previously as the
'three-stage' bootstrap.
There are a number of caveats with the code in its current state:
- The i386 bootstrap only supports booting from a floppy.
- The kernel and kld do not yet know how to deal with the extended
information and module summary passed in.
- PnP-based autodetection and demand loading of modules is not implemented.
- i386 ELF kernel loading is not ready yet.
- The i386 bootstrap is loaded via an ugly blockmap.

On the alpha, both net- and disk-booting (SRM console machines only) is
supported. No blockmaps are used by this code.

Obtained from: Parts from the NetBSD/i386 standalone bootstrap.