Commit Graph

56 Commits

Author SHA1 Message Date
Maxim Sobolev
b53a1cf306 Don't pass error value pointer to g_read_data(9) at all if we don't
have any use of it.

Suggested by:	pjd
2005-11-30 22:15:00 +00:00
Maxim Sobolev
8a4a44b5aa Check for g_read_data(9) errors properly:
o The only indication of error condition is NULL value returned by
  the function;

o value pointed to by error argument is undefined in the case when
  operation completes successfully.

Discussed with: phk
2005-11-30 19:24:51 +00:00
Yoshihiro Takahashi
0bf2708b8c Merged from geom_mbr.c revisions 1.62 and 1.66.
- Implement a gctl handler and the verb "write MBR".
2005-07-15 15:29:45 +00:00
Yoshihiro Takahashi
612f970e46 Remove geometry translations here. 2005-03-30 12:59:54 +00:00
Poul-Henning Kamp
2221dbebce Pass the file->flags down to geom ioctl handlers.
Reject certain ioctls if write permission is not indicated.

Bump geom API version.

Reported by:	Ruben de Groot <mail25@bzerk.org>
2004-12-12 10:09:05 +00:00
Warner Losh
3bc18cb767 Add observations of the Linux98 and Grub/98 boot loaders. These
observations lead me to believe that the convetion for pc98 boot
loaders is to have a jump unstruction, followed by a string, followed
by code.  The jump usually doesn't have a nop after it and usually the
string is NUL terminated, but Grub/98 breaks both of these rules.

# I looked for, but failed to find the Minux boot blocks for PC-9801 port.
2004-11-30 09:40:11 +00:00
Warner Losh
696ac86f2c Reject tasting of this provider if the sector size isn't a multiple of
512.  If I had an audio cdrom in my cd player when I booted my system,
I'd get a panic from geom because you can't read 8192 bytes from an
audio cdrom.

Remove XXX comment about IPL1 and replace it with some information
from my soon to be published web page on the pc98 disk layout.  The
IPL1 test was the result of an observation of a disk with FreeBSD's
boot0 program.  It was testing part of an area what appears to be
reserved for a boot loader name, which comes after a jump over this
area.  I don't yet know if it is required to be any specific jump
instruction, or if the destination has to be location 11. [1]

[1] FreeBSD Press No. 13, page 115, poorly translated by myself.  The
picture there shows offset 8 as the destination of the jump, but
FreeBSD's boot0 program has three padding NULs after the IPL1 name and
uses a 16-bit 'jmp' instruction.
2004-11-30 08:00:14 +00:00
Søren Schmidt
39e6971cba Only do the geometry translations on ad* devices, other devices seems to
have their own way of life.
Those other devices translations should be moved here as well.
2004-10-08 21:27:27 +00:00
Søren Schmidt
6c35773729 Move the PC98 specific geometry "gunk" to geom_pc98.c where it belongs.
This also adds support for bigger disks on the controller I have access to,
and maybe others if I understood the adhoc methods used on those.

Those with more PC98 bigdrive controllers it is hereby invited to add/fix
support for those in geom_pc98.c and not using #ifdef PC98 all over the place.
2004-10-07 17:37:09 +00:00
Poul-Henning Kamp
5721c9c76a Tag all geom classes in the tree with a version number. 2004-08-08 07:57:53 +00:00
Poul-Henning Kamp
650ee351b3 Use default method initialization on geoms. 2004-08-08 06:49:07 +00:00
Poul-Henning Kamp
d2bae332d6 Remove the absolute count g_access_abs() function since experience has
shown that it is not useful.

Rename the relative count g_access_rel() function to g_access(), only
the name has changed.

Change all g_access_rel() calls in our CVS tree to call g_access() instead.

Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source
code compatibility.
2004-02-12 22:42:11 +00:00
Scott Long
774114995e Re-arrange and consolidate some random debugging stuff 2003-12-07 05:04:49 +00:00
Poul-Henning Kamp
497c334767 Simplify the ioctl handling in GEOM.
This replaces the current ioctl processing with a direct call path
from geom_dev() where the ioctl arrives (from SPECFS) to any directly
connected GEOM class.

The inverse of the above is no longer supported.  This is the
situation were you have one or more intervening GEOM classes, for
instance a BSDlabel on top of a MBR or PC98.  If you want to issue
MBR or PC98 specific ioctls, you will need to issue them on a MBR
or PC98 providers.

This paves the way for inviting CD's, FD's and other special cases
inside GEOM.
2003-09-01 20:45:32 +00:00
David E. O'Brien
50b1faef38 Use __FBSDID().
Approved by:	phk
2003-06-11 06:49:16 +00:00
Poul-Henning Kamp
b77052e617 Remove unused variable.
Remove unneeded return;

Found by:       FlexeLint
2003-05-31 19:41:33 +00:00
Poul-Henning Kamp
f075585f67 Remove the G_CLASS_INITIALIZER, we do not need it anymore. 2003-05-31 16:59:27 +00:00
Poul-Henning Kamp
4f806d2428 Use g_slice_spoiled() not g_std_spoiled() 2003-05-02 06:34:51 +00:00
Yoshihiro Takahashi
4b4582a84c Remove DIOCGPC98 ioctl. 2003-05-01 14:40:16 +00:00
Yoshihiro Takahashi
50cf98ed97 - Move decoding pc98_partition function into geom_pc98_enc.c.
- Add encoding pc98_partition function.
2003-05-01 13:44:24 +00:00
Poul-Henning Kamp
8cd1535a24 Rename g_call_me() to g_post_event(), and give it a flag
argument to determine if we can M_WAITOK in malloc.
2003-04-23 20:46:12 +00:00
Poul-Henning Kamp
3924ad705e Time has run from the "run GEOM in userland" harness, and the new regression
test is built to test GEOM as running in the kernel.

This commit is basically "unifdef -D_KERNEL" to remove the mainly #include
related code to support the userland-harness.
2003-04-13 09:02:06 +00:00
Poul-Henning Kamp
0d3e96e39c Retire the "frontstuff" record keeping, it was no match for the
in-band meta-data of BSD labels and a more complex solution will be needed.
2003-04-12 08:41:26 +00:00
Poul-Henning Kamp
551e52efb8 With the magic sequence checks removed this class is downright dangerous
to have in your kernel since it indiscriminately attaches to anything
it is offered with a range of bogus partitions.

Stop this from happening by rejecting any label with negative numbers in
it.
2003-04-09 13:08:36 +00:00
Poul-Henning Kamp
2692cc08db Style issue: use do {...} while(0); for multi-exit section. 2003-04-09 08:56:26 +00:00
Poul-Henning Kamp
76c4109ebb #include <sys/endian.h> as needed. 2003-04-03 11:56:10 +00:00
Poul-Henning Kamp
d8cb8a5137 Use <sys/endian.h> instead of geom_enc.c for endianess-agnostification. 2003-04-03 11:36:53 +00:00
Poul-Henning Kamp
316aed030e Add handling for cancelled events in the g_call_me() methods. 2003-04-02 21:10:04 +00:00
Poul-Henning Kamp
afcbcfaed0 Change events to have an array of "void *" references, and give the
event posting functions varargs to fill these.

Attribute g_call_me() to appropriate g_geom's where necessary.

Add a flag argument to g_call_me() methods which will be used to signal
cancellation of events in the future.

This commit should be a no-op.
2003-04-02 20:41:18 +00:00
Poul-Henning Kamp
c138fec0b5 Premptively change initializations of struct g_class to use C99
sparse struct initializations before we extend the struct with
new OAM related member functions.
2003-03-24 19:30:15 +00:00
Poul-Henning Kamp
72384683ad In userland case include <errno.h>, not <err.h>. This is needed to make
the src/tools/regression/geom stuff compile.
2003-01-06 20:05:45 +00:00
Yoshihiro Takahashi
404a379e4a Rename the dos_partition structure for pc98 to pc98_partition. 2003-01-04 08:50:48 +00:00
Yoshihiro Takahashi
05f0a5a323 MFMBR: Add ioctls for writing an IPL and a boot menu. 2003-01-03 07:13:36 +00:00
Poul-Henning Kamp
dd0879a966 Don't mangle geometry for pc98, this will happen in the ata driver. 2002-12-17 15:50:51 +00:00
Poul-Henning Kamp
a1d5f791fa Get rid of g_slice_addslice() and use g_slice_config() instead.
Tested with:	i386 + src/tools/regression/geom
2002-12-16 23:08:48 +00:00
Poul-Henning Kamp
0f9d3dba37 Constification and some s/int/u_int/ changes. 2002-12-16 22:33:27 +00:00
Søren Schmidt
8ba4488cea Add support for the PC98 platform to the ATA driver.
This mostly consists of functionality to serialize accesses to
the two ATA channels (which can also be used to "fix" certain
PCI based controllers).
Add support for Acard controllers.
Enable the ATA driver in PC98 GENERIC, and add device hints.
Update man page with latest support.

The PC98 core team has kindly provided me with a PC98
machine that made this all possible, thanks to all that
contributed to that effort, without that this would
probably newer have been possible..

Approved by: re@
2002-12-03 20:20:44 +00:00
Yoshihiro Takahashi
8a529159ad Save a slice name on the disk and print it at g_pc98_dumpconf(). 2002-11-17 13:56:37 +00:00
Yoshihiro Takahashi
962cf6f7bb Fix to support pc98.
It is mostly merged from MBR specific part.

Reviewed by:	phk
2002-11-07 16:42:37 +00:00
Poul-Henning Kamp
4b787a3959 Reject slices where begin == end.
Remove clause 3 from the license with NAI Labs consent.

Sponsored by:	DARPA & NAI Labs
2002-11-04 06:30:38 +00:00
Poul-Henning Kamp
b2758b2f23 Don't truncate on large disks. 2002-10-27 10:17:38 +00:00
Poul-Henning Kamp
077f9aa12e Make geom_mbr.c optional on PC98, use GEOM_MBR option to include it.
Disable check for supposedly magic "IPL1" string for PC98 labels, its
thaumaturgical power is in doubt.
2002-10-26 20:17:59 +00:00
Poul-Henning Kamp
3d5500fc51 Reduce the GEOM verbosity under bootverbose to something more sufferable.
This is not quite the set of information I would want, but the tree where
I have the "correct" version is messed up with conflicts.

Sponsored by:	DARPA & NAI Labs.
2002-10-25 20:09:45 +00:00
Poul-Henning Kamp
3f12caa180 Now that the sectorsize and mediasize are properties of the provider,
don't take the detour over the I/O path to discover them using getattr(),
we can just pick them out directly.

Do note though, that for now they are only valid after the first open
of the underlying disk device due compatibility with the old disk_create()
API.  This will change in the future so they will always be valid.

Sponsored by:   DARPA & NAI Labs.
2002-10-20 20:28:24 +00:00
Poul-Henning Kamp
48444d6262 Make the sectorsize a property of providers so we can include it in the XML
output.

Sponsored by:	DARPA & NAI Labs
2002-10-20 19:18:07 +00:00
Poul-Henning Kamp
14ac6812b9 Use %jd instead of %lld now that we have it. 2002-10-20 18:48:12 +00:00
Poul-Henning Kamp
4ae677009e Style, whitespace and lint fixes.
Sponsored by:	DARPA & NAI Labs.
2002-09-28 11:57:20 +00:00
Poul-Henning Kamp
5a6baf5457 Add the new g_slice_config() call, which can add/delete/change a slice,
with support for trying, doing and forcing.

This will eventually replace g_slice_addslice() which gets changed from
grabbing topology to requing it in this commit as well.

Sponsored by:   DARPA & NAI Labs.
2002-09-27 21:37:11 +00:00
Poul-Henning Kamp
f3bbbfe2df Correctly calculate size of PC98 slices.
Sponsored by:	DARPA & NAI Labs.
2002-09-27 20:56:21 +00:00
Poul-Henning Kamp
c51f3753df "Fix" printf format issues by using %j
Sponsored by:	DARPA & NAI Labs.
2002-09-13 11:41:25 +00:00