diff options
author | phk <phk@FreeBSD.org> | 2002-03-17 18:53:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-03-17 18:53:58 +0000 |
commit | 460894ff2e1f555ee5434d55ae38eccb388034d8 (patch) | |
tree | 3562b9335baf056db57654225a5719a56ba8bc35 /tools/regression/geom | |
parent | cc6d626788c6448dae7abd98f475be73ffc73109 (diff) | |
download | FreeBSD-src-460894ff2e1f555ee5434d55ae38eccb388034d8.zip FreeBSD-src-460894ff2e1f555ee5434d55ae38eccb388034d8.tar.gz |
Add the GEOM regression test framework.
This is a set of userland shims in which GEOM can be run through simple
tests.
The simulation of kernel synchronization primitives is very primitive
and consequently some times tests will fail because of races.
Data/ contains a number of files in XML format which describe the
key sectors for a number of disk images
This is a very handy tool for people developing GEOM methods. The
"simdisk" method can be told to read from a "real disk" and afterwards
dump the accessed sectors in XML format for further use.
I hope future method writes will see the benefit of this test
collection and add to it when they write methods for GEOM.
You will need ports/textproc/expat for the XML parser.
Sponsored by: DARPA, NAI Labs.
Diffstat (limited to 'tools/regression/geom')
69 files changed, 9091 insertions, 0 deletions
diff --git a/tools/regression/geom/ConfCmp/ConfCmp.c b/tools/regression/geom/ConfCmp/ConfCmp.c new file mode 100644 index 0000000..9dc86d9 --- /dev/null +++ b/tools/regression/geom/ConfCmp/ConfCmp.c @@ -0,0 +1,312 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <ctype.h> +#include <sys/stat.h> +#include <sys/mman.h> +#include <sys/queue.h> +#include <sys/sbuf.h> +#include <err.h> +#include "xmlparse.h" + +struct node { + LIST_HEAD(, node) children; + LIST_ENTRY(node) siblings; + struct node *parent; + char *name; + struct sbuf *cont; + struct sbuf *key; +}; + +struct mytree { + struct node *top; + struct node *cur; + int indent; +}; + +struct ref { + LIST_ENTRY(ref) next; + char *k1; + char *k2; +}; + +LIST_HEAD(, ref) refs = LIST_HEAD_INITIALIZER(&refs); + +static struct node * +new_node(void) +{ + struct node *np; + + np = calloc(1, sizeof *np); + np->cont = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sbuf_clear(np->cont); + np->key = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sbuf_clear(np->key); + LIST_INIT(&np->children); + return (np); +} + +static void +indent(int n) +{ + + printf("%*.*s", n, n, ""); +} + +static void +StartElement(void *userData, const char *name, const char **atts __unused) +{ + struct mytree *mt; + struct node *np; + + mt = userData; + mt->indent += 2; + np = new_node(); + np->name = strdup(name); + sbuf_cat(np->key, name); + sbuf_cat(np->key, "::"); + np->parent = mt->cur; + LIST_INSERT_HEAD(&mt->cur->children, np, siblings); + mt->cur = np; +} + +static void +EndElement(void *userData, const char *name __unused) +{ + struct mytree *mt; + struct node *np; + + mt = userData; + + mt->indent -= 2; + sbuf_finish(mt->cur->cont); + LIST_FOREACH(np, &mt->cur->children, siblings) { + if (strcmp(np->name, "name")) + continue; + sbuf_cat(mt->cur->key, sbuf_data(np->cont)); + break; + } + sbuf_finish(mt->cur->key); + mt->cur = mt->cur->parent; +} + +static void +CharData(void *userData , const XML_Char *s , int len) +{ + struct mytree *mt; + const char *b, *e; + + mt = userData; + b = s; + e = s + len - 1; + while (isspace(*b) && b < e) + b++; + while (isspace(*e) && e > b) + e--; + if (e != b) + sbuf_bcat(mt->cur->cont, b, e - b + 1); +} + +static struct mytree * +dofile(char *filename) +{ + XML_Parser parser; + struct mytree *mt; + struct stat st; + int fd; + char *p; + int i; + + parser = XML_ParserCreate(NULL); + mt = calloc(1, sizeof *mt); + mt->top = new_node(); + mt->top->name = "(top)"; + mt->top->parent = mt->top; + mt->cur = mt->top; + sbuf_finish(mt->top->key); + sbuf_finish(mt->top->cont); + XML_SetUserData(parser, mt); + XML_SetElementHandler(parser, StartElement, EndElement); + XML_SetCharacterDataHandler(parser, CharData); + fd = open(filename, O_RDONLY); + if (fd < 0) + err(1, filename); + fstat(fd, &st); + p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); + i = XML_Parse(parser, p, st.st_size, 1); + munmap(p, st.st_size); + close(fd); + XML_ParserFree(parser); + sbuf_finish(mt->top->cont); + if (i) + return (mt); + else + return (NULL); +} + +static void +print_node(struct node *np) +{ + printf("\"%s\" -- \"%s\" -- \"%s\"\n", np->name, sbuf_data(np->cont), sbuf_data(np->key)); +} + +static void +sort_node(struct node *np) +{ + struct node *np1, *np2; + int n; + + LIST_FOREACH(np1, &np->children, siblings) + sort_node(np1); + do { + np1 = LIST_FIRST(&np->children); + n = 0; + for (;;) { + if (np1 == NULL) + return; + np2 = LIST_NEXT(np1, siblings); + if (np2 == NULL) + return; + if (strcmp(sbuf_data(np1->key), sbuf_data(np2->key)) > 0) { + LIST_REMOVE(np2, siblings); + LIST_INSERT_BEFORE(np1, np2, siblings); + n++; + break; + } + np1 = np2; + } + } while (n); +} + +static int +refcmp(char *r1, char *r2) +{ + struct ref *r; + + LIST_FOREACH(r, &refs, next) { + if (!strcmp(r1, r->k1)) + return (strcmp(r2, r->k2)); + } + r = calloc(1, sizeof(*r)); + r->k1 = strdup(r1); + r->k2 = strdup(r2); + LIST_INSERT_HEAD(&refs, r, next); + return (0); +} + +static int compare_node2(struct node *n1, struct node *n2, int in); + +static int +compare_node(struct node *n1, struct node *n2, int in) +{ + int i; + struct node *n1a, *n2a; + + i = strcmp(n1->name, n2->name); + if (i) + return (i); + if (!strcmp(n1->name, "ref")) + i = refcmp(sbuf_data(n1->cont), sbuf_data(n2->cont)); + else + i = strcmp(sbuf_data(n1->cont), sbuf_data(n2->cont)); + if (i) + return (1); + n1a = LIST_FIRST(&n1->children); + n2a = LIST_FIRST(&n2->children); + for (;;) { + if (n1a == NULL && n2a == NULL) + return (0); + if (n1a != NULL && n2a == NULL) + return (1); + if (n1a == NULL && n2a != NULL) + return (1); + i = compare_node2(n1a, n2a, in + 2); + if (i) + return (1); + n1a = LIST_NEXT(n1a, siblings); + n2a = LIST_NEXT(n2a, siblings); + } + return (0); +} + +static int +compare_node2(struct node *n1, struct node *n2, int in) +{ + int i; + + i = compare_node(n1, n2, in); + if (i) { + printf("1>"); + indent(in); + print_node(n1); + printf("2>"); + indent(in); + print_node(n2); + } + return (i); +} + + + +int +main(int argc, char **argv) +{ + struct mytree *t1, *t2; + int i; + + setbuf(stdout, NULL); + setbuf(stderr, NULL); + if (argc != 3) + errx(1, "Usage: %s file1 file2", argv[0]); + + t1 = dofile(argv[1]); + if (t1 == NULL) + errx(2, "XML parser error on file %s", argv[1]); + sort_node(t1->top); + t2 = dofile(argv[2]); + if (t2 == NULL) + errx(2, "XML parser error on file %s", argv[2]); + sort_node(t2->top); + i = compare_node(t1->top, t2->top, 0); + return (i); +} + diff --git a/tools/regression/geom/ConfCmp/Makefile b/tools/regression/geom/ConfCmp/Makefile new file mode 100644 index 0000000..3ddb9c2 --- /dev/null +++ b/tools/regression/geom/ConfCmp/Makefile @@ -0,0 +1,27 @@ +# $FreeBSD$ + +PROG= ConfCmp +SRCS+= ConfCmp.c +SRCS+= subr_sbuf.c +VPATH+= /sys/kern +NOOBJ= youbet +WARNS= 2 +CFLAGS+= -g -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -static +# Uncomment for ElectricFence +#LDADD += -lefence -L/usr/local/lib + +# Stuff for XML +LDADD += -L/usr/local/lib -lexpat +CFLAGS += -I/usr/local/include/xml + +NOMAN= yeah +CLEANFILES += _* + +.include <bsd.prog.mk> + +test: ${PROG} + rm -f _* *.core + ./${PROG} a1.conf a1a.conf + if ./${PROG} a1.conf a1b.conf > /dev/null 2>&1 ; then exit 1 ; fi + if ./${PROG} a1.conf a1c.conf > /dev/null 2>&1 ; then exit 1 ; fi + if ./${PROG} a1.conf a1d.conf > /dev/null 2>&1 ; then exit 1 ; fi diff --git a/tools/regression/geom/ConfCmp/a1.conf b/tools/regression/geom/ConfCmp/a1.conf new file mode 100644 index 0000000..94171cd --- /dev/null +++ b/tools/regression/geom/ConfCmp/a1.conf @@ -0,0 +1,414 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x80712c0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bfd00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3d</name> + <rank>4</rank> + <consumer> + <ref>0x80b9500</ref> + <geom><ref>0x80bfd00</ref></geom> + <provider><ref>0x80bf880</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3c</name> + <rank>4</rank> + <consumer> + <ref>0x80b94c0</ref> + <geom><ref>0x80bfc80</ref></geom> + <provider><ref>0x80bf800</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9480</ref> + <geom><ref>0x80bfc00</ref></geom> + <provider><ref>0x80bf780</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9440</ref> + <geom><ref>0x80bfb80</ref></geom> + <provider><ref>0x80bf600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x80b9400</ref> + <geom><ref>0x80bfb00</ref></geom> + <provider><ref>0x80bf480</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x80b93c0</ref> + <geom><ref>0x80bfa80</ref></geom> + <provider><ref>0x80bf400</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9380</ref> + <geom><ref>0x80bfa00</ref></geom> + <provider><ref>0x80bf380</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf980</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x80b9340</ref> + <geom><ref>0x80bf980</ref></geom> + <provider><ref>0x80bf300</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf900</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9300</ref> + <geom><ref>0x80bf900</ref></geom> + <provider><ref>0x80bf280</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf680</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <consumer> + <ref>0x80b9280</ref> + <geom><ref>0x80bf680</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf500</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80b9200</ref> + <geom><ref>0x80bf500</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf180</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80b9180</ref> + <geom><ref>0x80bf180</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80b9080</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b90c0</ref> + <geom><ref>0x80b9080</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071280</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071260</ref> + <name>MBR-method</name> + <geom> + <ref>0x80b9100</ref> + <method><ref>0x8071260</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80b9140</ref> + <geom><ref>0x80b9100</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf100</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf080</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf000</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80712a0</ref> + <name>BSD-method</name> + <geom> + <ref>0x80bf700</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b92c0</ref> + <geom><ref>0x80bf700</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf880</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3d</name> + <config> + <index>3</index> + <length>6488104960</length> + <seclength>12672080</seclength> + <offset>10682408960</offset> + <secoffset>20864080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf800</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3c</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf780</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3a</name> + <config> + <index>0</index> + <length>2097152000</length> + <seclength>4096000</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf580</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b9240</ref> + <geom><ref>0x80bf580</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf600</ref> + <geom><ref>0x80bf580</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2c</name> + <config> + <index>2</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf200</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b91c0</ref> + <geom><ref>0x80bf200</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf480</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>2066973184</length> + <seclength>4037057</seclength> + <offset>1153465856</offset> + <secoffset>2252863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf400</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>629177856</offset> + <secoffset>1228863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf380</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf300</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>104889856</offset> + <secoffset>204863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf280</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>104857600</length> + <seclength>204800</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80711c0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80b9000</ref> + <method><ref>0x80711c0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b9040</ref> + <geom><ref>0x80b9000</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/ConfCmp/a1a.conf b/tools/regression/geom/ConfCmp/a1a.conf new file mode 100644 index 0000000..01110f3 --- /dev/null +++ b/tools/regression/geom/ConfCmp/a1a.conf @@ -0,0 +1,414 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x90712c0</ref> + <name>DEV-method</name> + <geom> + <ref>0x90bfd00</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s3d</name> + <rank>4</rank> + <consumer> + <ref>0x90b9500</ref> + <geom><ref>0x90bfd00</ref></geom> + <provider><ref>0x90bf880</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bfc80</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s3c</name> + <rank>4</rank> + <consumer> + <ref>0x90b94c0</ref> + <geom><ref>0x90bfc80</ref></geom> + <provider><ref>0x90bf800</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bfc00</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s3a</name> + <rank>4</rank> + <consumer> + <ref>0x90b9480</ref> + <geom><ref>0x90bfc00</ref></geom> + <provider><ref>0x90bf780</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bfb80</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s2c</name> + <rank>4</rank> + <consumer> + <ref>0x90b9440</ref> + <geom><ref>0x90bfb80</ref></geom> + <provider><ref>0x90bf600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bfb00</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x90b9400</ref> + <geom><ref>0x90bfb00</ref></geom> + <provider><ref>0x90bf480</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bfa80</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x90b93c0</ref> + <geom><ref>0x90bfa80</ref></geom> + <provider><ref>0x90bf400</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bfa00</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x90b9380</ref> + <geom><ref>0x90bfa00</ref></geom> + <provider><ref>0x90bf380</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bf980</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x90b9340</ref> + <geom><ref>0x90bf980</ref></geom> + <provider><ref>0x90bf300</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bf900</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x90b9300</ref> + <geom><ref>0x90bf900</ref></geom> + <provider><ref>0x90bf280</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bf680</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <consumer> + <ref>0x90b9280</ref> + <geom><ref>0x90bf680</ref></geom> + <provider><ref>0x90bf100</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bf500</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x90b9200</ref> + <geom><ref>0x90bf500</ref></geom> + <provider><ref>0x90bf080</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90bf180</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x90b9180</ref> + <geom><ref>0x90bf180</ref></geom> + <provider><ref>0x90bf000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x90b9080</ref> + <method><ref>0x90712c0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x90b90c0</ref> + <geom><ref>0x90b9080</ref></geom> + <provider><ref>0x90b9040</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x9071280</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x9071260</ref> + <name>MBR-method</name> + <geom> + <ref>0x90b9100</ref> + <method><ref>0x9071260</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x90b9140</ref> + <geom><ref>0x90b9100</ref></geom> + <provider><ref>0x90b9040</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x90bf100</ref> + <geom><ref>0x90b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x90bf080</ref> + <geom><ref>0x90b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x90bf000</ref> + <geom><ref>0x90b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x90712a0</ref> + <name>BSD-method</name> + <geom> + <ref>0x90bf700</ref> + <method><ref>0x90712a0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x90b92c0</ref> + <geom><ref>0x90bf700</ref></geom> + <provider><ref>0x90bf100</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x90bf880</ref> + <geom><ref>0x90bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3d</name> + <config> + <index>3</index> + <length>6488104960</length> + <seclength>12672080</seclength> + <offset>10682408960</offset> + <secoffset>20864080</secoffset> + </config> + </provider> + <provider> + <ref>0x90bf800</ref> + <geom><ref>0x90bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3c</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + <provider> + <ref>0x90bf780</ref> + <geom><ref>0x90bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3a</name> + <config> + <index>0</index> + <length>2097152000</length> + <seclength>4096000</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x90bf580</ref> + <method><ref>0x90712a0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x90b9240</ref> + <geom><ref>0x90bf580</ref></geom> + <provider><ref>0x90bf080</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x90bf600</ref> + <geom><ref>0x90bf580</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2c</name> + <config> + <index>2</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x90bf200</ref> + <method><ref>0x90712a0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x90b91c0</ref> + <geom><ref>0x90bf200</ref></geom> + <provider><ref>0x90bf000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x90bf480</ref> + <geom><ref>0x90bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>2066973184</length> + <seclength>4037057</seclength> + <offset>1153465856</offset> + <secoffset>2252863</secoffset> + </config> + </provider> + <provider> + <ref>0x90bf400</ref> + <geom><ref>0x90bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>629177856</offset> + <secoffset>1228863</secoffset> + </config> + </provider> + <provider> + <ref>0x90bf380</ref> + <geom><ref>0x90bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + <provider> + <ref>0x90bf300</ref> + <geom><ref>0x90bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>104889856</offset> + <secoffset>204863</secoffset> + </config> + </provider> + <provider> + <ref>0x90bf280</ref> + <geom><ref>0x90bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>104857600</length> + <seclength>204800</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x90711c0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x90b9000</ref> + <method><ref>0x90711c0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x90b9040</ref> + <geom><ref>0x90b9000</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/ConfCmp/a1b.conf b/tools/regression/geom/ConfCmp/a1b.conf new file mode 100644 index 0000000..46f423b --- /dev/null +++ b/tools/regression/geom/ConfCmp/a1b.conf @@ -0,0 +1,414 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x80712c0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bfd00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3d</name> + <rank>4</rank> + <consumer> + <ref>0x80b9500</ref> + <geom><ref>0x80bfd00</ref></geom> + <provider><ref>0x80bf880</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3c</name> + <rank>4</rank> + <consumer> + <ref>0x80b94c0</ref> + <geom><ref>0x80bfc80</ref></geom> + <provider><ref>0x80bf800</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9480</ref> + <geom><ref>0x80bfc00</ref></geom> + <provider><ref>0x80bf780</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9440</ref> + <geom><ref>0x80bfb80</ref></geom> + <provider><ref>0x80bf600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x80b9400</ref> + <geom><ref>0x80bfb00</ref></geom> + <provider><ref>0x80bf480</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x80b93c0</ref> + <geom><ref>0x80bfa80</ref></geom> + <provider><ref>0x80bf400</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9380</ref> + <geom><ref>0x80bfa00</ref></geom> + <provider><ref>0x80bf380</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf980</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x80b9340</ref> + <geom><ref>0x80bf980</ref></geom> + <provider><ref>0x80bf300</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf900</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9300</ref> + <geom><ref>0x80bf900</ref></geom> + <provider><ref>0x80bf280</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf680</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <consumer> + <ref>0x80b9280</ref> + <geom><ref>0x80bf680</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf500</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80b9200</ref> + <geom><ref>0x80bf500</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf180</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80b9180</ref> + <geom><ref>0x80bf180</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80b9080</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b90c0</ref> + <geom><ref>0x80b9080</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071280</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071260</ref> + <name>MBR-method</name> + <geom> + <ref>0x80b9100</ref> + <method><ref>0x8071260</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80b9140</ref> + <geom><ref>0x80b9100</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf100</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf080</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf000</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80712a0</ref> + <name>BSD-method</name> + <geom> + <ref>0x80bf700</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b92c0</ref> + <geom><ref>0x80bf700</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf880</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3d</name> + <config> + <index>3</index> + <length>6488104960</length> + <seclength>12672080</seclength> + <offset>10682408960</offset> + <secoffset>20864080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf800</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3c</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf780</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3a</name> + <config> + <index>0</index> + <length>2097152000</length> + <seclength>4096000</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf580</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b9240</ref> + <geom><ref>0x80bf580</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf600</ref> + <geom><ref>0x80bf580</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2c</name> + <config> + <index>2</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf200</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b91c0</ref> + <geom><ref>0x80bf200</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf480</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>2066973184</length> + <seclength>4037057</seclength> + <offset>1153465856</offset> + <secoffset>2252863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf400</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>629177856</offset> + <secoffset>1228863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf380</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf300</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>104889856</offset> + <secoffset>204863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf280</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>104857600</length> + <seclength>204800</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80711c0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80b9000</ref> + <method><ref>0x80711c0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b9041</ref> + <geom><ref>0x80b9000</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/ConfCmp/a1c.conf b/tools/regression/geom/ConfCmp/a1c.conf new file mode 100644 index 0000000..1b5a2b9 --- /dev/null +++ b/tools/regression/geom/ConfCmp/a1c.conf @@ -0,0 +1,414 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x80712c0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bfd00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3d</name> + <rank>4</rank> + <consumer> + <ref>0x80b9500</ref> + <geom><ref>0x80bfd00</ref></geom> + <provider><ref>0x80bf880</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3c</name> + <rank>4</rank> + <consumer> + <ref>0x80b94c0</ref> + <geom><ref>0x80bfc80</ref></geom> + <provider><ref>0x80bf800</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9480</ref> + <geom><ref>0x80bfc00</ref></geom> + <provider><ref>0x80bf780</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9440</ref> + <geom><ref>0x80bfb80</ref></geom> + <provider><ref>0x80bf600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x80b9400</ref> + <geom><ref>0x80bfb00</ref></geom> + <provider><ref>0x80bf480</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x80b93c0</ref> + <geom><ref>0x80bfa80</ref></geom> + <provider><ref>0x80bf400</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9380</ref> + <geom><ref>0x80bfa00</ref></geom> + <provider><ref>0x80bf380</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf980</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x80b9340</ref> + <geom><ref>0x80bf980</ref></geom> + <provider><ref>0x80bf300</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf900</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9300</ref> + <geom><ref>0x80bf900</ref></geom> + <provider><ref>0x80bf280</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf680</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <consumer> + <ref>0x80b9280</ref> + <geom><ref>0x80bf680</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf500</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80b9200</ref> + <geom><ref>0x80bf500</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf180</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80b9180</ref> + <geom><ref>0x80bf180</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80b9080</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b90c0</ref> + <geom><ref>0x80b9080</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071280</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071260</ref> + <name>MBR-method</name> + <geom> + <ref>0x80b9100</ref> + <method><ref>0x8071260</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80b9140</ref> + <geom><ref>0x80b9100</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf100</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf080</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf000</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80712a0</ref> + <name>BSD-method</name> + <geom> + <ref>0x80bf700</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b92c0</ref> + <geom><ref>0x80bf700</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf880</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3d</name> + <config> + <index>3</index> + <length>6488104960</length> + <seclength>12672080</seclength> + <offset>10682408960</offset> + <secoffset>20864080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf800</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3c</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf780</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3a</name> + <config> + <index>0</index> + <length>2097152000</length> + <seclength>4096000</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf580</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b9240</ref> + <geom><ref>0x80bf580</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf600</ref> + <geom><ref>0x80bf580</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2c</name> + <config> + <index>2</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf200</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b91c0</ref> + <geom><ref>0x80bf200</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf480</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>2066973184</length> + <seclength>4037057</seclength> + <offset>1153465856</offset> + <secoffset>2252863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf400</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>629177856</offset> + <secoffset>1228863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf380</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf300</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>104889856</offset> + <secoffset>204863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf280</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>104857600</length> + <seclength>204800</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80711c0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80b9000</ref> + <method><ref>0x80711c0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b9040</ref> + <geom><ref>0x80b9000</ref></geom> + <mode>r0w0e1</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/ConfCmp/a1d.conf b/tools/regression/geom/ConfCmp/a1d.conf new file mode 100644 index 0000000..a9063c5 --- /dev/null +++ b/tools/regression/geom/ConfCmp/a1d.conf @@ -0,0 +1,414 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x80712c0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bfd00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3d</name> + <rank>4</rank> + <consumer> + <ref>0x80b9500</ref> + <geom><ref>0x80bfd00</ref></geom> + <provider><ref>0x80bf880</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3c</name> + <rank>4</rank> + <consumer> + <ref>0x80b94c0</ref> + <geom><ref>0x80bfc80</ref></geom> + <provider><ref>0x80bf800</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9480</ref> + <geom><ref>0x80bfc00</ref></geom> + <provider><ref>0x80bf780</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9440</ref> + <geom><ref>0x80bfb80</ref></geom> + <provider><ref>0x80bf600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x80b9400</ref> + <geom><ref>0x80bfb00</ref></geom> + <provider><ref>0x80bf480</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa80</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x80b93c0</ref> + <geom><ref>0x80bfa80</ref></geom> + <provider><ref>0x80bf400</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa00</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9380</ref> + <geom><ref>0x80bfa00</ref></geom> + <provider><ref>0x80bf380</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf980</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x80b9340</ref> + <geom><ref>0x80bf980</ref></geom> + <provider><ref>0x80bf300</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf900</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9300</ref> + <geom><ref>0x80bf900</ref></geom> + <provider><ref>0x80bf280</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf680</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <consumer> + <ref>0x80b9280</ref> + <geom><ref>0x80bf680</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf500</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80b9200</ref> + <geom><ref>0x80bf500</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf180</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80b9180</ref> + <geom><ref>0x80bf180</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80b9080</ref> + <method><ref>0x80712c0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b90c0</ref> + <geom><ref>0x80b9080</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071280</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071260</ref> + <name>MBR-method</name> + <geom> + <ref>0x80b9100</ref> + <method><ref>0x8071260</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80b9140</ref> + <geom><ref>0x80b9100</ref></geom> + <provider><ref>0x80b9040</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf100</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf080</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf000</ref> + <geom><ref>0x80b9100</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80712a0</ref> + <name>BSD-method</name> + <geom> + <ref>0x80bf700</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b92c0</ref> + <geom><ref>0x80bf700</ref></geom> + <provider><ref>0x80bf100</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf880</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3d</name> + <config> + <index>3</index> + <length>6488104960</length> + <seclength>12672080</seclength> + <offset>10682408960</offset> + <secoffset>20864080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf800</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3c</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf780</ref> + <geom><ref>0x80bf700</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3a</name> + <config> + <index>0</index> + <length>2097152000</length> + <seclength>4096000</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf580</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b9240</ref> + <geom><ref>0x80bf580</ref></geom> + <provider><ref>0x80bf080</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf600</ref> + <geom><ref>0x80bf580</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2c</name> + <config> + <index>2</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf200</ref> + <method><ref>0x80712a0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b91c0</ref> + <geom><ref>0x80bf200</ref></geom> + <provider><ref>0x80bf000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf480</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>2066973184</length> + <seclength>4037057</seclength> + <offset>1153465856</offset> + <secoffset>2252863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf400</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>629177856</offset> + <secoffset>1228863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf380</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf300</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>104889856</offset> + <secoffset>204863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf280</ref> + <geom><ref>0x80bf200</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>104857600</length> + <seclength>204800</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80711c0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80b9000</ref> + <method><ref>0x80711c0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b9040</ref> + <geom><ref>0x80b9000</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</namf> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/ConfCmp/a2.conf b/tools/regression/geom/ConfCmp/a2.conf new file mode 100644 index 0000000..7423066 --- /dev/null +++ b/tools/regression/geom/ConfCmp/a2.conf @@ -0,0 +1,436 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071280</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bfd00</ref> + <methodref>0x8071280</methodref> + <name>ad0s3d</name> + <rank>4</rank> + <consumer> + <ref>0x80b9500</ref> + <geomref>0x80bfd00</geomref> + <providerref>0x80bf880</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc80</ref> + <methodref>0x8071280</methodref> + <name>ad0s3c</name> + <rank>4</rank> + <consumer> + <ref>0x80b94c0</ref> + <geomref>0x80bfc80</geomref> + <providerref>0x80bf800</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfc00</ref> + <methodref>0x8071280</methodref> + <name>ad0s3a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9480</ref> + <geomref>0x80bfc00</geomref> + <providerref>0x80bf780</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb80</ref> + <methodref>0x8071280</methodref> + <name>ad0s2c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9440</ref> + <geomref>0x80bfb80</geomref> + <providerref>0x80bf600</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfb00</ref> + <methodref>0x8071280</methodref> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x80b9400</ref> + <geomref>0x80bfb00</geomref> + <providerref>0x80bf480</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa80</ref> + <methodref>0x8071280</methodref> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x80b93c0</ref> + <geomref>0x80bfa80</geomref> + <providerref>0x80bf400</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bfa00</ref> + <methodref>0x8071280</methodref> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x80b9380</ref> + <geomref>0x80bfa00</geomref> + <providerref>0x80bf380</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf980</ref> + <methodref>0x8071280</methodref> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x80b9340</ref> + <geomref>0x80bf980</geomref> + <providerref>0x80bf300</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf900</ref> + <methodref>0x8071280</methodref> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x80b9300</ref> + <geomref>0x80bf900</geomref> + <providerref>0x80bf280</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf680</ref> + <methodref>0x8071280</methodref> + <name>ad0s3</name> + <rank>3</rank> + <consumer> + <ref>0x80b9280</ref> + <geomref>0x80bf680</geomref> + <providerref>0x80bf100</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf500</ref> + <methodref>0x8071280</methodref> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80b9200</ref> + <geomref>0x80bf500</geomref> + <providerref>0x80bf080</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bf180</ref> + <methodref>0x8071280</methodref> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80b9180</ref> + <geomref>0x80bf180</geomref> + <providerref>0x80bf000</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80b9080</ref> + <methodref>0x8071280</methodref> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b90c0</ref> + <geomref>0x80b9080</geomref> + <providerref>0x80b9040</providerref> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071240</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071220</ref> + <name>MBR-method</name> + <geom> + <ref>0x80b9100</ref> + <methodref>0x8071220</methodref> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80b9140</ref> + <geomref>0x80b9100</geomref> + <providerref>0x80b9040</providerref> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf100</ref> + <geomref>0x80b9100</geomref> + <mode>r0w0e0</mode> + <name>ad0s3</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf080</ref> + <geomref>0x80b9100</geomref> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80bf000</ref> + <geomref>0x80b9100</geomref> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071260</ref> + <name>BSD-method</name> + <geom> + <ref>0x80bf700</ref> + <methodref>0x8071260</methodref> + <name>ad0s3</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b92c0</ref> + <geomref>0x80bf700</geomref> + <providerref>0x80bf100</providerref> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf880</ref> + <geomref>0x80bf700</geomref> + <mode>r0w0e0</mode> + <name>ad0s3d</name> + <config> + <index>3</index> + <length>6488104960</length> + <seclength>12672080</seclength> + <offset>10682408960</offset> + <secoffset>20864080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf800</ref> + <geomref>0x80bf700</geomref> + <mode>r0w0e0</mode> + <name>ad0s3c</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf780</ref> + <geomref>0x80bf700</geomref> + <mode>r0w0e0</mode> + <name>ad0s3a</name> + <config> + <index>0</index> + <length>2097152000</length> + <seclength>4096000</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf580</ref> + <methodref>0x8071260</methodref> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b9240</ref> + <geomref>0x80bf580</geomref> + <providerref>0x80bf080</providerref> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf600</ref> + <geomref>0x80bf580</geomref> + <mode>r0w0e0</mode> + <name>ad0s2c</name> + <config> + <index>2</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80bf200</ref> + <methodref>0x8071260</methodref> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80b91c0</ref> + <geomref>0x80bf200</geomref> + <providerref>0x80bf000</providerref> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bf480</ref> + <geomref>0x80bf200</geomref> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>2066973184</length> + <seclength>4037057</seclength> + <offset>1153465856</offset> + <secoffset>2252863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf400</ref> + <geomref>0x80bf200</geomref> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>629177856</offset> + <secoffset>1228863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf380</ref> + <geomref>0x80bf200</geomref> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf300</ref> + <geomref>0x80bf200</geomref> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>104889856</offset> + <secoffset>204863</secoffset> + </config> + </provider> + <provider> + <ref>0x80bf280</ref> + <geomref>0x80bf200</geomref> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>104857600</length> + <seclength>204800</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071180</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80b9000</ref> + <methodref>0x8071180</methodref> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b9040</ref> + <geomref>0x80b9000</geomref> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> +<mesh> + <method> + <ref>0x8071280</ref> + <name>DEV-method</name> + </method> + <method> + <ref>0x8071240</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071220</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8071260</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071180</ref> + <name>SIMDISK-method</name> + </method> +</mesh> diff --git a/tools/regression/geom/Data/disk.critter.ad0.xml b/tools/regression/geom/Data/disk.critter.ad0.xml new file mode 100644 index 0000000..9e93b24 --- /dev/null +++ b/tools/regression/geom/Data/disk.critter.ad0.xml @@ -0,0 +1,178 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + This image contains the MBR and disklabel sectors from my Asus M1300 + laptop. + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <sector> + <offset>0</offset> + <hexdata> + fc31c08ec08ed88ed0bc007cbe1a7cbf1a06b9e601f3a4e9008a31f6bbbe07b1 + 04382f74087f7885f6757489de80c310e2ef85f67502cd1880fa80720b8a3675 + 0480c68038f272028a1489e78a74018b4c02bb007c80feff753283f9ff752d51 + 53bbaa55b441cd13722081fb55aa751af6c10174155b666a0066ff740806536a + 016a1089e6b80042eb055b59b80102cd1389fc720f81bffe0155aa750cffe3be + bc06eb11bed406eb0cbef306eb07bb0700b40ecd10ac84c075f4ebfe496e7661 + 6c696420706172746974696f6e207461626c65004572726f72206c6f6164696e + 67206f7065726174696e672073797374656d004d697373696e67206f70657261 + 74696e672073797374656d000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008001 + 0100a50fffff3f00000041295402000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>512</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>32768</offset> + <hexdata> + 5745568205000000616430733100000000000000000000000000000000000000 + 0000000000000000000200003f0000001000000067970000f003000041295402 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000574556824fa608000020000000200000000020003f00000000040000 + 07081600000020003f0020000000000001000000412954023f00000000000000 + 00000000418984003fa0cf01000400000708160000a00f003f00400000040000 + 07081600000080003fa04f000004000007081600000060003fa0cf0000040000 + 070816000000a0003fa02f010004000007081600000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>64512</offset> + <hexdata> + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>1073806336</offset> + <hexdata> + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + </hexdata> + </sector> + <sector> + <offset>1598094336</offset> + <hexdata> + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + </hexdata> + </sector> + <sector> + <offset>2147548160</offset> + <hexdata> + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>2671836160</offset> + <hexdata> + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffff00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.empty.flp.xml b/tools/regression/geom/Data/disk.empty.flp.xml new file mode 100644 index 0000000..88c603a --- /dev/null +++ b/tools/regression/geom/Data/disk.empty.flp.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + An empty floppy disk + </comment> + <sectorsize>512</sectorsize> + <mediasize>1474560</mediasize> + <fwsectors>18</fwsectors> + <fwheads>2</fwheads> + <fwcylinders>80</fwcylinders> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.far.ad0.xml b/tools/regression/geom/Data/disk.far.ad0.xml new file mode 100644 index 0000000..0a8d3ca --- /dev/null +++ b/tools/regression/geom/Data/disk.far.ad0.xml @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + A Windows laptop. + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <sector> + <offset>0</offset> + <hexdata> + 33c08ed0bc007cfb5007501ffcbe1b7cbf1b065057b9e501f3a4cbbebe07b104 + 382c7c09751583c610e2f5cd188b148bee83c610497416382c74f6be10074eac + 3c0074fabb0700b40ecd10ebf2894625968a4604b4063c0e7411b40b3c0c7405 + 3ac4752b40c64625067524bbaa5550b441cd1358721681fb55aa7510f6c10174 + 0b8ae0885624c706a106eb1e886604bf0a00b801028bdc33c983ff057f038b4e + 25034e02cd137229be4607813efe7d55aa745a83ef057fda85f67583be2707eb + 8a9891529903460813560ae812005aebd54f74e433c0cd13ebb8000080093521 + 5633f656565250065351be1000568bf45052b800428a5624cd135a588d641072 + 0a4075014280c702e2f7f85ec3eb74496e76616c696420706172746974696f6e + 207461626c65004572726f72206c6f6164696e67206f7065726174696e672073 + 797374656d004d697373696e67206f7065726174696e672073797374656d0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000008bfc1e578bf5cb00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 0100a05304263f00000092d80800805401260befbf730cd90800340a88000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>512</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.flat.da1.xml b/tools/regression/geom/Data/disk.flat.da1.xml new file mode 100644 index 0000000..2302a7c --- /dev/null +++ b/tools/regression/geom/Data/disk.flat.da1.xml @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + This image contains an interesting setup: there is an MBR+BSD + but also another BSD at sector one which is valid but bogus. + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <fwsectors>0</fwsectors> + <fwheads>0</fwheads> + <fwcylinders>0</fwcylinders> + <sector> + <offset>0</offset> + <hexdata> + fc31c08ec08ed88ed0bc007cbe1a7cbf1a06b9e601f3a4e9008a31f6bbbe07b1 + 04382f74087f7885f6757489de80c310e2ef85f67502cd1880fa80720b8a3675 + 0480c68038f272028a1489e78a74018b4c02bb007c80feff753283f9ff752d51 + 53bbaa55b441cd13722081fb55aa751af6c10174155b666a0066ff740806536a + 016a1089e6b80042eb055b59b80102cd1389fc720f81bffe0155aa750cffe3be + bc06eb11bed406eb0cbef306eb07bb0700b40ecd10ac84c075f4ebfe496e7661 + 6c696420706172746974696f6e207461626c65004572726f72206c6f6164696e + 67206f7065726174696e672073797374656d004d697373696e67206f70657261 + 74696e672073797374656d000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008001 + 0100a5feffff3f0000003a612302000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>512</offset> + <hexdata> + 5745568204000000534541474154452053543331383433360000000000000000 + 000000000000000000020000000800000100000072440000000800000004fb00 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682e29908000020000000200000002001000000000000040000 + 07081000000008000020010000000000010000000004fb000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000e0f100002009000004000007081000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>32256</offset> + <hexdata> + eb1b9090161f666a005150065331c088f0506a1089e5e8c7008d6610cbfc31c9 + 8ec18ed98ed1bc007c89e6bf0007fec5f3a5beee7d80fa80722cb601e86700b9 + 0100bebe8db601807c04a57507e319f60480751483c610fec680fe0572e949e3 + e1be8b7deb5231d289160009b610e83500bb00908b770a01debf00b0b900ac29 + f1f3a429f930c0f3aae80300e98113fae464a80275fab0d1e664e464a80275fa + b0dfe660fbc3bb008c8b44088b4c0a0ee853ff732abe867de81c00be907de816 + 0030e4cd16c70672043412ea0000ffffbb0700b40ecd10ac84c075f4b401f9c3 + 52b408cd1388f55a72f580e13f74edfa668b460852660fb6d96631d266f7f388 + eb88d54330d266f7f388d75a663dff030000fb774486c4c0c80208e8409188fe + 28e08a660238e0720288e0bf0500c45e0450b402cd135b730a4f741c30e4cd13 + 93ebeb0fb6c30146087303ff460ad0e3005e052846027788c32ef6069908800f + 8479ffbbaa5552b441cd135a0f826fff81fb55aa0f8564fff6c1010f845dff89 + eeb442cd13c35265616400426f6f7400206572726f720d0a0080909090909090 + 9090909090909090909090909090909090909090909090909090909090900000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000100a5ffffff0000000050c3000055aa + </hexdata> + </sector> + <sector> + <offset>32768</offset> + <hexdata> + 5745568204000000646131733100000000000000000000000000000000000000 + 0000000000000000000200003f000000ff000000b8080000c13e00003a612302 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000005745568233c408000020000000200000000000000000000000000000 + 0000000000800c003f800c0000000000010000003a6123023f00000000000000 + 000000000000000000000000000000000000000000800c003f00000000040000 + 07081600000020003f00190000040000070816003a61ea013f00390000040000 + 0708160000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.kern.flp.xml b/tools/regression/geom/Data/disk.kern.flp.xml new file mode 100644 index 0000000..6640c48 --- /dev/null +++ b/tools/regression/geom/Data/disk.kern.flp.xml @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + A FreeBSD kern.flp image. + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <sector> + <offset>0</offset> + <hexdata> + eb1b9090161f666a005150065331c088f0506a1089e5e8c7008d6610cbfc31c9 + 8ec18ed98ed1bc007c89e6bf0007fec5f3a5beee7d80fa80722cb601e86700b9 + 0100bebe8db601807c04a57507e319f60480751483c610fec680fe0572e949e3 + e1be8b7deb5231d289160009b610e83500bb00908b770a01debf00b0b900ac29 + f1f3a429f930c0f3aae80300e98113fae464a80275fab0d1e664e464a80275fa + b0dfe660fbc3bb008c8b44088b4c0a0ee853ff732abe867de81c00be907de816 + 0030e4cd16c70672043412ea0000ffffbb0700b40ecd10ac84c075f4b401f9c3 + 52b408cd1388f55a72f580e13f74edfa668b460852660fb6d96631d266f7f388 + eb88d54330d266f7f388d75a663dff030000fb774486c4c0c80208e8409188fe + 28e08a660238e0720288e0bf0500c45e0450b402cd135b730a4f741c30e4cd13 + 93ebeb0fb6c30146087303ff460ad0e3005e052846027788c32ef6069908800f + 8479ffbbaa5552b441cd135a0f826fff81fb55aa0f8564fff6c1010f845dff89 + eeb442cd13c35265616400426f6f7400206572726f720d0a0080909090909090 + 9090909090909090909090909090909090909090909090909090909090900000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000100a5ffffff0000000050c3000055aa + </hexdata> + </sector> + <sector> + <offset>512</offset> + <hexdata> + 5745568200000000666431343430000000000000000000000000000000000000 + 00000000000000000002000012000000020000005000000024000000400b0000 + 00000000000000002c0101000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682286903000020000000200000400b00000000000000020000 + 00080000400b0000000000000002000000080000400b00000000000000020000 + 0708060000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.msdos.ext.xml b/tools/regression/geom/Data/disk.msdos.ext.xml new file mode 100644 index 0000000..6e6613e --- /dev/null +++ b/tools/regression/geom/Data/disk.msdos.ext.xml @@ -0,0 +1,513 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + A MSDOS 6.22 disk with maximal number of extended partitions. + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <sector> + <offset>0</offset> + <hexdata> + fa33c08ed0bc007c8bf45007501ffbfcbf0006b90001f2a5ea1d060000bebe07 + b304803c80740e803c00751c83c610fecb75efcd188b148b4c028bee83c610fe + cb741a803c0074f4be8b06ac3c00740b56bb0700b40ecd105eebf0ebfebf0500 + bb007cb8010257cd135f730c33c0cd134f75edbea306ebd3bec206bffe7d813d + 55aa75c78bf5ea007c0000496e76616c696420706172746974696f6e20746162 + 6c65004572726f72206c6f6164696e67206f7065726174696e67207379737465 + 6d004d697373696e67206f7065726174696e672073797374656d000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008001 + 010006fe7f043f00000086fa3f000000410505fe7f38c5fa3f0034bf0c000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2146798080</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410501fe7f053f000000823e00000000410605fe7f06c13e0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2155023360</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410601fe7f063f000000823e00000000410705fe7f07827d0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2163248640</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410701fe7f073f000000823e00000000410805fe7f0843bc0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2171473920</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410801fe7f083f000000823e00000000410905fe7f0904fb0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2179699200</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410901fe7f093f000000823e00000000410a05fe7f0ac5390100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2187924480</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410a01fe7f0a3f000000823e00000000410b05fe7f0b86780100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2196149760</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410b01fe7f0b3f000000823e00000000410c05fe7f0c47b70100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2204375040</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410c01fe7f0c3f000000823e00000000410d05fe7f0d08f60100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2212600320</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410d01fe7f0d3f000000823e00000000410e05fe7f0ec9340200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2220825600</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410e01fe7f0e3f000000823e00000000410f05fe7f0f8a730200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2229050880</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410f01fe7f0f3f000000823e00000000411005fe7f104bb20200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2237276160</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411001fe7f103f000000823e00000000411105fe7f110cf10200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2245501440</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411101fe7f113f000000823e00000000411205fe7f12cd2f0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2253726720</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411201fe7f123f000000823e00000000411305fe7f138e6e0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2261952000</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411301fe7f133f000000823e00000000411405fe7f144fad0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2270177280</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411401fe7f143f000000823e00000000411505fe7f1510ec0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2278402560</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411501fe7f153f000000823e00000000411605fe7f16d12a0400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2286627840</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411601fe7f163f000000823e00000000411705fe7f1792690400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2294853120</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411701fe7f173f000000823e00000000411805fe7f1853a80400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2303078400</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411801fe7f183f000000823e00000000411905fe7f1914e70400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2311303680</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411901fe7f193f000000823e00000000411a05fe7f1ad5250500c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2319528960</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411a01fe7f1a3f000000823e00000000411b05fe7f1b96640500c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>2327754240</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411b01fe7f1b3f000000823e0000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000055aa + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.msdos.flp.xml b/tools/regression/geom/Data/disk.msdos.flp.xml new file mode 100644 index 0000000..d057d1a --- /dev/null +++ b/tools/regression/geom/Data/disk.msdos.flp.xml @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + A MSDOS floppy image. + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <sector> + <offset>0</offset> + <hexdata> + eb3c904d53444f53352e30000201010002e000400bf009001200020000000000 + 0000000000002911053b114e4f204e414d45202020204641543132202020fa33 + c08ed0bc007c1607bb780036c5371e561653bf3e7cb90b00fcf3a4061fc645fe + 0f8b0e187c884df9894702c7073e7cfbcd13727933c03906137c74088b0e137c + 890e207ca0107cf726167c03061c7c13161e7c03060e7c83d200a3507c891652 + 7ca3497c89164b7cb82000f726117c8b1e0b7c03c348f7f30106497c83164b7c + 00bb00058b16527ca1507ce89200721db001e8ac0072168bfbb90b00bee67df3 + a6750a8d7f20b90b00f3a67418be9e7de85f0033c0cd165e1f8f048f4402cd19 + 585858ebe88b471a48488a1e0d7c32fff7e30306497c13164b7cbb0007b90300 + 505251e83a0072d8b001e85400595a5872bb05010083d200031e0b7ce2e28a2e + 157c8a16247c8b1e497ca14b7cea00007000ac0ac07429b40ebb0700cd10ebf2 + 3b16187c7319f736187cfec288164f7c33d2f7361a7c8816257ca34d7cf8c3f9 + c3b4028b164d7cb106d2e60a364f7c8bca86e98a16247c8a36257ccd13c30d0a + 4e6f6e2d53797374656d206469736b206f72206469736b206572726f720d0a52 + 65706c61636520616e6420707265737320616e79206b6579207768656e207265 + 6164790d0a00494f2020202020205359534d53444f53202020535953000055aa + </hexdata> + </sector> + <sector> + <offset>512</offset> + <hexdata> + f0ffff03400005600007800009a0000bc0000de0000f00011120011340011560 + 0117800119a0011bc0011de0011f000221200223400225600227800229a0022b + c0022de0022f000331200333400335600337800339a0033bc0033de0033f0004 + 41200443400445600447800449a0044bc0044de0044f000551f0ff5340055560 + 0557800559a0055bc0055de0055f000661200663400665600667800669a0066b + c0066de0066f000771200773400775600777800779a0077bc0077de0077f0008 + 81200883400885600887800889a0088bc0088de0088f00099120099340099560 + 0997800999a0099bc009ffef099f000aa1200aa3400aa5600aa7800aa9a00aab + c00aade00aaf000bb1200bb3400bb5600bb7800bb9a00bbbc00bbde00bbf000c + c1200cc3400cc5600cc7800cc9a00ccbc00ccde00ccf000dd1200dd3400dd560 + 0dd7800dd9a00ddbc00ddde00ddf000ee1200ee3400ee5600ee7800ee9a00eeb + c00eede00eef000ff1200ff3400ff5600ff7800ff9a00ffbc00ffde00fff0010 + 01211003411005611007f1ff09a1100bc1100de1100f01111121111341111561 + 1117811119a1111bc1111de1111f011221211223411225611227811229a1122b + c1122de1122f011331211333411335611337811339a1133bc1133de1133f0114 + 41211443411445611447811449a1144bc1144de1144f01155121155341155561 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.sun.da0.xml b/tools/regression/geom/Data/disk.sun.da0.xml new file mode 100644 index 0000000..826581f --- /dev/null +++ b/tools/regression/geom/Data/disk.sun.da0.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + A Solaris 8 disklabel + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <fwsectors>0</fwsectors> + <fwheads>0</fwheads> + <fwcylinders>0</fwcylinders> + <sector> + <offset>0</offset> + <hexdata> + 49424d2d444459532d5433363935304d2d533936482063796c20313439373020 + 616c742032206864203132207365632033393900000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000100000000000000000008000200000003000100050000000000000000 + 0000000000000000000000080000003f000000000000000000000000600ddeee + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000027103a7c00000000000000013a7a0002000c018f00000000000000dc + 002d96c000000000001012b0000000000445b1c8000000000000000000000000 + 00000000000000000000000000000000000000000000034c04080858dabe5ec8 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.sun.da1.xml b/tools/regression/geom/Data/disk.sun.da1.xml new file mode 100644 index 0000000..0aac8e5 --- /dev/null +++ b/tools/regression/geom/Data/disk.sun.da1.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + A Solaris 8 disklabel + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <fwsectors>0</fwsectors> + <fwheads>0</fwheads> + <fwcylinders>0</fwcylinders> + <sector> + <offset>0</offset> + <hexdata> + 53554e3138472063796c203735303620616c7420322068642031392073656320 + 3234380000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000170686b00000000000008000200000003000100050000000800010000 + 00000007000000040000000800000000000000000000000000000000600ddeee + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000001c201d5400000000000000011d520002001300f80000000000000000 + 0007d6480000006d0020113000000000021bad5000000b4e014b873800000000 + 000000000000022b00400ff8000005a600400ff80000092100280c48dabe971e + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/Data/disk.typo.ad0.xml b/tools/regression/geom/Data/disk.typo.ad0.xml new file mode 100644 index 0000000..56383ab --- /dev/null +++ b/tools/regression/geom/Data/disk.typo.ad0.xml @@ -0,0 +1,219 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <comment> + $FreeBSD$ + A multislice FreeBSD disk + </comment> + <sectorsize>512</sectorsize> + <mediasize>0</mediasize> + <sector> + <offset>0</offset> + <hexdata> + fc31c08ec08ed88ed0bc007cbd000a89efb108f3abfe45f252bb000689eeb802 + 02e82e015ae9008af686bbfd20750484d278048a96bafd885600e8fc0052bbc2 + 0731d2886ffc0fa396bbfd731c8a07bf0f08b103f2ae7411b10df2ae750481c7 + 0d008a0d01cfe8c1004280c31073d4582c7f3a067504720548740e30c004b088 + 86b8fdbfb207e8a100be0308e8ad008a96b9fd4ee8880030e4cd1a89d703bebc + fdb401cd16751330e4cd1a39fa72f28a86b9fdeb15b007e88e0030e4cd1688e0 + 3c1c74eb2c3b3c0477eb980fa3460c73e48886b9fdbe000a8a1489f33c049c74 + 0ac0e00405be0793c6078053f686bbfd407509bb0006b80103e856005e9d7507 + 8a96b8fd80ea30bb007cb80102e8420072a381bffe0155aa759be81c00ffe3b0 + 46e82400b03100d0eb170fab560cbe0008e8ebff89fee80300be0d08aca88075 + 05e80400ebf6247f53bb0700b40ecd105bc38a74018b4c025689e780feff7540 + 83f9ff753bf686bbfd8074345153bbaa5550b441cd1358720e81fb55aa7508f6 + c101740380cc405b59f6c4407412666a0066ff740806536a006a1089e6864402 + cd1389fc5ec39090909090909090909001014472697665200000808fb6008001 + 0100a5ef7f9f3f000000c1f95f00000041a0a5efffff00fa5f0050e29f0000ff + ffffa5efffff50dcff0050dcff000000000000000000000000000000000055aa + </hexdata> + </sector> + <sector> + <offset>512</offset> + <hexdata> + 2020a00a44656661756c743aa00d8a00050f010406070b0c0e6383a5a6a9b70e + 141312141d1c1b2124282e3439556e6b6e6f77ee444fd357696e646f7773204e + d457696e646f77f3554e49d84c696e75f8467265654253c44f70656e4253c44e + 65744253c44253442f4fd3000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>32768</offset> + <hexdata> + 5745568205000000616430733100000000000000000000000000000000000000 + 0000000000000000000200003f000000f0000000180a0000103b000080295402 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000005745568204c108000020000000200000002003003f00000000000000 + 0700000000a00f003f2003000000000001000000c1f95f003f00000000000000 + 000000000000000000000000000000000000000000a00f003fc0120000000000 + 07000000c1993d003f6022000000000007000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>64512</offset> + <hexdata> + 0000007c0000010002000400f8ff0000000400f8000000000000000000000004 + 0000004000000008000000000010007e00800000070000fe1f00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>104922112</offset> + <hexdata> + 3310f30d0350fbf66f44ebd906c9963d46b2bf609bb753131e7c24cf9ed194ce + a59117b612772b207ddcb753df72456f98d0cac567f60526c7b9308afd87e657 + dd45b3d1eb075b6820aa6ea5a0f10511f65a257f0d7d89d88e189bef43786ff5 + a0316511a7a07168f2ef001e71fbc56dd8ddc7866c4856dc979742be22f4badd + e1fcba7aebe4b5f4bb8b0c89e84de59f0ba48d7a8b00bb1797fc057e3d3d8058 + 4b1987ac49b74bed74cb4985850d5be64e8188d40ad0323165b355c512a91523 + 5d5211eeb021c754f552b160f9a73c4c5e59370163cf531ca0382cc462f9ac9d + 35612380f7a5d9d5e3bde129ef6fab02347088025d0937fb6c56dc68c283ce9d + 1cfc5b3c7ad1f52faeae05188386cb57cb88c5dccaa2db17a09420ae7d9f9d6e + 058370711f445cff4d4543ee9f0c3054400116304018f68d9c08d05b04680162 + 23172b8b1775157790fe5e5100c530e3377d383a0080468b0125e87e8d7dee5f + 46030a238dc8a0000cb4eafc6ad4735f2c16d1642e3834aefbb5bfc25fcc0062 + 3a89410ab88839e3ed151cd6bc2b5704c5db4c9fc39662bd3a41347212c664be + 04684e551c0a0362bb3139a460a7c8d178c349a47d724b7d456606b2f47a8d99 + d4af7998148ed93443a828ece96cdb7eb158a21189ed1527bdad7b18b74f168b + d01fcfde994977174e41ad8f6ea19fac8bb95e5d68643d0457d746cf32531639 + </hexdata> + </sector> + <sector> + <offset>629210112</offset> + <hexdata> + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>1153498112</offset> + <hexdata> + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>3220439552</offset> + <hexdata> + 5745568205000000616430733200000000000000000000000000000000000000 + 0000000000000000000200003f000000f0000000180a0000103b000080295402 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682fc1908000020000000200000000000000000000000000000 + 000000000000000000000000000000000000000050e29f0000fa5f0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>6440878080</offset> + <hexdata> + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a3c4120200a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a687265663d22687474703a2f2f777777 + 2e706c6179626f7973746f72652e636f6d2f70626c696e6b2e6367693f616666 + 696c696174653d4d4f3130303030303034353426736b753d4249303130362220 + 7461726765743d225f626c616e6b22206f6e6d6f7573656f7665723d22706172 + 656e742e77696e646f772e7374617475733d27506c6179626f792053746f7265 + 273b2072657475726e2074727565223e3c494d47207372633d22687474703a2f + 2f61313833322e672e616b2e706c6179626f792e636f6d2f372f313833322f32 + 332f3939303232313437302f7777772e706c6179626f792e636f6d2f6d616761 + 7a696e652f63757272656e742f696d782f636f7665725f696e6465782e6a7067 + 2220616c69676e3d72696768742077696474683d223135302220686569676874 + </hexdata> + </sector> + <sector> + <offset>8585257472</offset> + <hexdata> + 5745568205000000616430733300000000000000000000000000000000000000 + 0000000000000000000200003f000000f000000055040000103b000050dcff00 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682bcbd0800002000000020000000803e0050dcff0000040000 + 070816000000000000000000000000000000000050dcff0050dcff0000000000 + 00000000505cc100505c3e010010000007049f00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/GLib/Makefile b/tools/regression/geom/GLib/Makefile new file mode 100644 index 0000000..177dd5f --- /dev/null +++ b/tools/regression/geom/GLib/Makefile @@ -0,0 +1,23 @@ +# $FreeBSD$ + +LIB= G +SRCS= geom.c geom_bsd.c geom_simdev.c geom_dump.c geom_event.c geom_io.c \ + geom_kernsim.c geom_mbr.c geom_mbrext.c geom_simdisk.c \ + geom_simdisk_xml.c geom_slice.c geom_subr.c subr_sbuf.c \ + geom_sunlabel.c + + +CFLAGS+= -g -static -W -Wall +CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith +CFLAGS += -I/usr/local/include/xml -I/usr/src/sys +NOPIC = static +NOPROFILE = bingo +NOOBJ = youbet +WARNS = 2 +LDADD +=r -L/usr/local/lib -lexpat + +VPATH+= /sys/geom:..:/sys/kern + +.include <bsd.lib.mk> + +test: diff --git a/tools/regression/geom/Makefile b/tools/regression/geom/Makefile new file mode 100644 index 0000000..48182a0 --- /dev/null +++ b/tools/regression/geom/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +SUBDIR+= ConfCmp GLib Test + +.include <bsd.subdir.mk> + +test: all _SUBDIRUSE + +toflat: + scp *.c *.h *.sh Makefile root@flat:/sys/geom + +fromflat: + scp root@flat:/sys/geom/\* . + +publish: + $(MAKE) cleandir + tar --exclude CVS -czf - . | \ + ssh phk@phk "cd www/geom && cat > geom.tgz && rm -rf src && mkdir -p src && cd src && tar xzf ../geom.tgz" diff --git a/tools/regression/geom/Test/Makefile b/tools/regression/geom/Test/Makefile new file mode 100644 index 0000000..2be96e3 --- /dev/null +++ b/tools/regression/geom/Test/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +SUBDIR+= T000 T001 T002 T003 T004 T005 T006 T007 T008 T009 +SUBDIR+= T010 T011 T012 + +# SUBDIR+= T999 + +.include <bsd.subdir.mk> + +test: _SUBDIRUSE diff --git a/tools/regression/geom/Test/Makefile.inc b/tools/regression/geom/Test/Makefile.inc new file mode 100644 index 0000000..452efc5 --- /dev/null +++ b/tools/regression/geom/Test/Makefile.inc @@ -0,0 +1,35 @@ +# $FreeBSD$ + +PROG = testprg +NOMAN = no +NOOBJ = youbet +CFLAGS += -g -W -Wall -Wstrict-prototypes -Wmissing-prototypes +CFLAGS += -Wpointer-arith -static -I/usr/src/sys +LDADD += -L../../GLib -lG +LDADD += -L/usr/local/lib -lexpat +DPADD += ../../GLib/libG.a +CLEANFILES += _* *.core +WARNS= 2 + +foo: + echo ${SRCS} + echo ${OBJS} + +ttest: ${PROG} + ./${PROG} -t 2>&1 | tee _test + +tbtest: ${PROG} + ./${PROG} -t -b 2>&1 | tee _test + +test: ${PROG} + ./${PROG} +.if exists(ref.conf) + ../../ConfCmp/ConfCmp _1.conf ref.conf +.endif + echo "Passed ${.CURDIR}" + +mkref: + mv _1.conf ref.conf + +gdb: + gdb ${PROG} ${PROG}.core diff --git a/tools/regression/geom/Test/T000/Makefile b/tools/regression/geom/Test/T000/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T000/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T000/ref.conf b/tools/regression/geom/Test/T000/ref.conf new file mode 100644 index 0000000..a375ddf --- /dev/null +++ b/tools/regression/geom/Test/T000/ref.conf @@ -0,0 +1,23 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x805ba60</ref> + <name>DEV-method</name> + </method> + <method> + <ref>0x805b9a0</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x805ba40</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x805ba80</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x805b980</ref> + <name>SIMDISK-method</name> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T000/testprg.c b/tools/regression/geom/Test/T000/testprg.c new file mode 100644 index 0000000..fe28455 --- /dev/null +++ b/tools/regression/geom/Test/T000/testprg.c @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T001/Makefile b/tools/regression/geom/Test/T001/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T001/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T001/ref.conf b/tools/regression/geom/Test/T001/ref.conf new file mode 100644 index 0000000..80a643e --- /dev/null +++ b/tools/regression/geom/Test/T001/ref.conf @@ -0,0 +1,414 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071cc0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80c1580</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s3d</name> + <rank>4</rank> + <consumer> + <ref>0x80c1600</ref> + <geom><ref>0x80c1580</ref></geom> + <provider><ref>0x80bed00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80c1480</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s3c</name> + <rank>4</rank> + <consumer> + <ref>0x80c1500</ref> + <geom><ref>0x80c1480</ref></geom> + <provider><ref>0x80bec80</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80c1380</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s3a</name> + <rank>4</rank> + <consumer> + <ref>0x80c1400</ref> + <geom><ref>0x80c1380</ref></geom> + <provider><ref>0x80bec00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80c1280</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s2c</name> + <rank>4</rank> + <consumer> + <ref>0x80c1300</ref> + <geom><ref>0x80c1280</ref></geom> + <provider><ref>0x80be980</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80c1180</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x80c1200</ref> + <geom><ref>0x80c1180</ref></geom> + <provider><ref>0x80be700</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80c1080</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x80c1100</ref> + <geom><ref>0x80c1080</ref></geom> + <provider><ref>0x80be680</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bef80</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x80c1000</ref> + <geom><ref>0x80bef80</ref></geom> + <provider><ref>0x80be600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bee80</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x80bef00</ref> + <geom><ref>0x80bee80</ref></geom> + <provider><ref>0x80be580</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bed80</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x80bee00</ref> + <geom><ref>0x80bed80</ref></geom> + <provider><ref>0x80be500</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bea00</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <consumer> + <ref>0x80bea80</ref> + <geom><ref>0x80bea00</ref></geom> + <provider><ref>0x80be280</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80be780</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80be800</ref> + <geom><ref>0x80be780</ref></geom> + <provider><ref>0x80be200</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80be300</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80be380</ref> + <geom><ref>0x80be300</ref></geom> + <provider><ref>0x80be180</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80ba080</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80be080</ref> + <geom><ref>0x80ba080</ref></geom> + <provider><ref>0x80be000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071c00</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071ca0</ref> + <name>MBR-method</name> + <geom> + <ref>0x80ba0c0</ref> + <method><ref>0x8071ca0</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80be100</ref> + <geom><ref>0x80ba0c0</ref></geom> + <provider><ref>0x80be000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80be280</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>8585256960</offset> + <secoffset>16768080</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80be200</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>3220439040</offset> + <secoffset>6289920</secoffset> + <type>165</type> + </config> + </provider> + <provider> + <ref>0x80be180</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071ce0</ref> + <name>BSD-method</name> + <geom> + <ref>0x80beb00</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s3</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80beb80</ref> + <geom><ref>0x80beb00</ref></geom> + <provider><ref>0x80be280</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bed00</ref> + <geom><ref>0x80beb00</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3d</name> + <config> + <index>3</index> + <length>6488104960</length> + <seclength>12672080</seclength> + <offset>2097152000</offset> + <secoffset>4096000</secoffset> + </config> + </provider> + <provider> + <ref>0x80bec80</ref> + <geom><ref>0x80beb00</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3c</name> + <config> + <index>2</index> + <length>8585256960</length> + <seclength>16768080</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80bec00</ref> + <geom><ref>0x80beb00</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s3a</name> + <config> + <index>0</index> + <length>2097152000</length> + <seclength>4096000</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80be880</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80be900</ref> + <geom><ref>0x80be880</ref></geom> + <provider><ref>0x80be200</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80be980</ref> + <geom><ref>0x80be880</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2c</name> + <config> + <index>2</index> + <length>5364817920</length> + <seclength>10478160</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80be400</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80be480</ref> + <geom><ref>0x80be400</ref></geom> + <provider><ref>0x80be180</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80be700</ref> + <geom><ref>0x80be400</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>2066973184</length> + <seclength>4037057</seclength> + <offset>1153433600</offset> + <secoffset>2252800</secoffset> + </config> + </provider> + <provider> + <ref>0x80be680</ref> + <geom><ref>0x80be400</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>629145600</offset> + <secoffset>1228800</secoffset> + </config> + </provider> + <provider> + <ref>0x80be600</ref> + <geom><ref>0x80be400</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>3220406784</length> + <seclength>6289857</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80be580</ref> + <geom><ref>0x80be400</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>104857600</offset> + <secoffset>204800</secoffset> + </config> + </provider> + <provider> + <ref>0x80be500</ref> + <geom><ref>0x80be400</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>104857600</length> + <seclength>204800</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071be0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80ba040</ref> + <method><ref>0x8071be0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80be000</ref> + <geom><ref>0x80ba040</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T001/testprg.c b/tools/regression/geom/Test/T001/testprg.c new file mode 100644 index 0000000..1c7865a --- /dev/null +++ b/tools/regression/geom/Test/T001/testprg.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.typo.ad0.xml"); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T002/Makefile b/tools/regression/geom/Test/T002/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T002/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T002/ref.conf b/tools/regression/geom/Test/T002/ref.conf new file mode 100644 index 0000000..19c5200 --- /dev/null +++ b/tools/regression/geom/Test/T002/ref.conf @@ -0,0 +1,115 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071cc0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bb380</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80bb400</ref> + <geom><ref>0x80bb380</ref></geom> + <provider><ref>0x80bb200</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb280</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80bb300</ref> + <geom><ref>0x80bb280</ref></geom> + <provider><ref>0x80bb180</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80ba080</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80bb080</ref> + <geom><ref>0x80ba080</ref></geom> + <provider><ref>0x80bb000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071c00</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071ca0</ref> + <name>MBR-method</name> + <geom> + <ref>0x80ba0c0</ref> + <method><ref>0x8071ca0</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80bb100</ref> + <geom><ref>0x80ba0c0</ref></geom> + <provider><ref>0x80bb000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bb200</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>4564740096</length> + <seclength>8915508</seclength> + <offset>296884224</offset> + <secoffset>579852</secoffset> + <type>11</type> + </config> + </provider> + <provider> + <ref>0x80bb180</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>296821760</length> + <seclength>579730</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>160</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071ce0</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071be0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80ba040</ref> + <method><ref>0x8071be0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80bb000</ref> + <geom><ref>0x80ba040</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T002/testprg.c b/tools/regression/geom/Test/T002/testprg.c new file mode 100644 index 0000000..7ffcd68 --- /dev/null +++ b/tools/regression/geom/Test/T002/testprg.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.far.ad0.xml"); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T003/Makefile b/tools/regression/geom/Test/T003/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T003/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T003/ref.conf b/tools/regression/geom/Test/T003/ref.conf new file mode 100644 index 0000000..fedaa69 --- /dev/null +++ b/tools/regression/geom/Test/T003/ref.conf @@ -0,0 +1,729 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071cc0</ref> + <name>DEV-method</name> + <geom> + <ref>0x8124700</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s27</name> + <rank>4</rank> + <consumer> + <ref>0x8124780</ref> + <geom><ref>0x8124700</ref></geom> + <provider><ref>0x8101080</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8124600</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s26</name> + <rank>4</rank> + <consumer> + <ref>0x8124680</ref> + <geom><ref>0x8124600</ref></geom> + <provider><ref>0x8101000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8124500</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s25</name> + <rank>4</rank> + <consumer> + <ref>0x8124580</ref> + <geom><ref>0x8124500</ref></geom> + <provider><ref>0x80ccf80</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8124400</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s24</name> + <rank>4</rank> + <consumer> + <ref>0x8124480</ref> + <geom><ref>0x8124400</ref></geom> + <provider><ref>0x80ccf00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8124300</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s23</name> + <rank>4</rank> + <consumer> + <ref>0x8124380</ref> + <geom><ref>0x8124300</ref></geom> + <provider><ref>0x80cce80</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8124200</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s22</name> + <rank>4</rank> + <consumer> + <ref>0x8124280</ref> + <geom><ref>0x8124200</ref></geom> + <provider><ref>0x80cce00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8124100</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s21</name> + <rank>4</rank> + <consumer> + <ref>0x8124180</ref> + <geom><ref>0x8124100</ref></geom> + <provider><ref>0x80ccd80</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8124000</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s20</name> + <rank>4</rank> + <consumer> + <ref>0x8124080</ref> + <geom><ref>0x8124000</ref></geom> + <provider><ref>0x80ccd00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101f00</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s19</name> + <rank>4</rank> + <consumer> + <ref>0x8101f80</ref> + <geom><ref>0x8101f00</ref></geom> + <provider><ref>0x80ccc80</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101e00</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s18</name> + <rank>4</rank> + <consumer> + <ref>0x8101e80</ref> + <geom><ref>0x8101e00</ref></geom> + <provider><ref>0x80ccc00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101d00</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s17</name> + <rank>4</rank> + <consumer> + <ref>0x8101d80</ref> + <geom><ref>0x8101d00</ref></geom> + <provider><ref>0x80ccb80</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101c00</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s16</name> + <rank>4</rank> + <consumer> + <ref>0x8101c80</ref> + <geom><ref>0x8101c00</ref></geom> + <provider><ref>0x80ccb00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101b00</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s15</name> + <rank>4</rank> + <consumer> + <ref>0x8101b80</ref> + <geom><ref>0x8101b00</ref></geom> + <provider><ref>0x80cca80</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101a00</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s14</name> + <rank>4</rank> + <consumer> + <ref>0x8101a80</ref> + <geom><ref>0x8101a00</ref></geom> + <provider><ref>0x80cca00</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101900</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s13</name> + <rank>4</rank> + <consumer> + <ref>0x8101980</ref> + <geom><ref>0x8101900</ref></geom> + <provider><ref>0x80cc980</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101800</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s12</name> + <rank>4</rank> + <consumer> + <ref>0x8101880</ref> + <geom><ref>0x8101800</ref></geom> + <provider><ref>0x80cc900</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101700</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s11</name> + <rank>4</rank> + <consumer> + <ref>0x8101780</ref> + <geom><ref>0x8101700</ref></geom> + <provider><ref>0x80cc880</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101600</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s10</name> + <rank>4</rank> + <consumer> + <ref>0x8101680</ref> + <geom><ref>0x8101600</ref></geom> + <provider><ref>0x80cc800</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101500</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s9</name> + <rank>4</rank> + <consumer> + <ref>0x8101580</ref> + <geom><ref>0x8101500</ref></geom> + <provider><ref>0x80cc780</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101400</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s8</name> + <rank>4</rank> + <consumer> + <ref>0x8101480</ref> + <geom><ref>0x8101400</ref></geom> + <provider><ref>0x80cc700</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101300</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s7</name> + <rank>4</rank> + <consumer> + <ref>0x8101380</ref> + <geom><ref>0x8101300</ref></geom> + <provider><ref>0x80cc680</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101200</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s6</name> + <rank>4</rank> + <consumer> + <ref>0x8101280</ref> + <geom><ref>0x8101200</ref></geom> + <provider><ref>0x80cc600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x8101100</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s5</name> + <rank>4</rank> + <consumer> + <ref>0x8101180</ref> + <geom><ref>0x8101100</ref></geom> + <provider><ref>0x80cc580</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80cc380</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <consumer> + <ref>0x80cc400</ref> + <geom><ref>0x80cc380</ref></geom> + <provider><ref>0x80cc200</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80cc280</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80cc300</ref> + <geom><ref>0x80cc280</ref></geom> + <provider><ref>0x80cc180</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80ba080</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80cc080</ref> + <geom><ref>0x80ba080</ref></geom> + <provider><ref>0x80cc000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071c00</ref> + <name>MBREXT-method</name> + <geom> + <ref>0x80cc480</ref> + <method><ref>0x8071c00</ref></method> + <name>ad0s2</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80cc500</ref> + <geom><ref>0x80cc480</ref></geom> + <provider><ref>0x80cc200</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x8101080</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s27</name> + <config> + <index>22</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>180988416</offset> + <secoffset>353493</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x8101000</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s26</name> + <config> + <index>21</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>172763136</offset> + <secoffset>337428</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccf80</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s25</name> + <config> + <index>20</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>164537856</offset> + <secoffset>321363</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccf00</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s24</name> + <config> + <index>19</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>156312576</offset> + <secoffset>305298</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cce80</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s23</name> + <config> + <index>18</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>148087296</offset> + <secoffset>289233</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cce00</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s22</name> + <config> + <index>17</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>139862016</offset> + <secoffset>273168</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccd80</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s21</name> + <config> + <index>16</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>131636736</offset> + <secoffset>257103</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccd00</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s20</name> + <config> + <index>15</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>123411456</offset> + <secoffset>241038</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccc80</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s19</name> + <config> + <index>14</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>115186176</offset> + <secoffset>224973</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccc00</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s18</name> + <config> + <index>13</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>106960896</offset> + <secoffset>208908</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccb80</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s17</name> + <config> + <index>12</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>98735616</offset> + <secoffset>192843</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80ccb00</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s16</name> + <config> + <index>11</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>90510336</offset> + <secoffset>176778</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cca80</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s15</name> + <config> + <index>10</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>82285056</offset> + <secoffset>160713</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cca00</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s14</name> + <config> + <index>9</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>74059776</offset> + <secoffset>144648</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc980</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s13</name> + <config> + <index>8</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>65834496</offset> + <secoffset>128583</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc900</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s12</name> + <config> + <index>7</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>57609216</offset> + <secoffset>112518</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc880</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s11</name> + <config> + <index>6</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>49383936</offset> + <secoffset>96453</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc800</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s10</name> + <config> + <index>5</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>41158656</offset> + <secoffset>80388</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc780</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s9</name> + <config> + <index>4</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>32933376</offset> + <secoffset>64323</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc700</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s8</name> + <config> + <index>3</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>24708096</offset> + <secoffset>48258</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc680</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s7</name> + <config> + <index>2</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>16482816</offset> + <secoffset>32193</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc600</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s6</name> + <config> + <index>1</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>8257536</offset> + <secoffset>16128</secoffset> + <type>1</type> + </config> + </provider> + <provider> + <ref>0x80cc580</ref> + <geom><ref>0x80cc480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s5</name> + <config> + <index>0</index> + <length>8193024</length> + <seclength>16002</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>1</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071ca0</ref> + <name>MBR-method</name> + <geom> + <ref>0x80ba0c0</ref> + <method><ref>0x8071ca0</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80cc100</ref> + <geom><ref>0x80ba0c0</ref></geom> + <provider><ref>0x80cc000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80cc200</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s2</name> + <config> + <index>1</index> + <length>427714560</length> + <seclength>835380</seclength> + <offset>2146798080</offset> + <secoffset>4192965</secoffset> + <type>5</type> + </config> + </provider> + <provider> + <ref>0x80cc180</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>2146765824</length> + <seclength>4192902</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>6</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071ce0</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071be0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80ba040</ref> + <method><ref>0x8071be0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80cc000</ref> + <geom><ref>0x80ba040</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T003/testprg.c b/tools/regression/geom/Test/T003/testprg.c new file mode 100644 index 0000000..70631ef --- /dev/null +++ b/tools/regression/geom/Test/T003/testprg.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.msdos.ext.xml"); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T004/Makefile b/tools/regression/geom/Test/T004/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T004/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T004/ref.conf b/tools/regression/geom/Test/T004/ref.conf new file mode 100644 index 0000000..03e296e --- /dev/null +++ b/tools/regression/geom/Test/T004/ref.conf @@ -0,0 +1,305 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071ce0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bef00</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1h</name> + <rank>4</rank> + <consumer> + <ref>0x80bef80</ref> + <geom><ref>0x80bef00</ref></geom> + <provider><ref>0x80be780</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bee00</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1g</name> + <rank>4</rank> + <consumer> + <ref>0x80bee80</ref> + <geom><ref>0x80bee00</ref></geom> + <provider><ref>0x80be700</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bed00</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1f</name> + <rank>4</rank> + <consumer> + <ref>0x80bed80</ref> + <geom><ref>0x80bed00</ref></geom> + <provider><ref>0x80be680</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bec00</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1e</name> + <rank>4</rank> + <consumer> + <ref>0x80bec80</ref> + <geom><ref>0x80bec00</ref></geom> + <provider><ref>0x80be600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80beb00</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1d</name> + <rank>4</rank> + <consumer> + <ref>0x80beb80</ref> + <geom><ref>0x80beb00</ref></geom> + <provider><ref>0x80be580</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bea00</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1c</name> + <rank>4</rank> + <consumer> + <ref>0x80bea80</ref> + <geom><ref>0x80bea00</ref></geom> + <provider><ref>0x80be500</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80be900</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1b</name> + <rank>4</rank> + <consumer> + <ref>0x80be980</ref> + <geom><ref>0x80be900</ref></geom> + <provider><ref>0x80be480</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80be800</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1a</name> + <rank>4</rank> + <consumer> + <ref>0x80be880</ref> + <geom><ref>0x80be800</ref></geom> + <provider><ref>0x80be400</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80be200</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <consumer> + <ref>0x80be280</ref> + <geom><ref>0x80be200</ref></geom> + <provider><ref>0x80be180</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80ba080</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80be080</ref> + <geom><ref>0x80ba080</ref></geom> + <provider><ref>0x80be000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071c20</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071cc0</ref> + <name>MBR-method</name> + <geom> + <ref>0x80ba0c0</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80be100</ref> + <geom><ref>0x80ba0c0</ref></geom> + <provider><ref>0x80be000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80be180</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1</name> + <config> + <index>0</index> + <length>20003848704</length> + <seclength>39070017</seclength> + <offset>32256</offset> + <secoffset>63</secoffset> + <type>165</type> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071d00</ref> + <name>BSD-method</name> + <geom> + <ref>0x80be300</ref> + <method><ref>0x8071d00</ref></method> + <name>ad0s1</name> + <rank>3</rank> + <config> + </config> + <consumer> + <ref>0x80be380</ref> + <geom><ref>0x80be300</ref></geom> + <provider><ref>0x80be180</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80be780</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1h</name> + <config> + <index>7</index> + <length>5368709120</length> + <seclength>10485760</seclength> + <offset>10187964416</offset> + <secoffset>19898368</secoffset> + </config> + </provider> + <provider> + <ref>0x80be700</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1g</name> + <config> + <index>6</index> + <length>3221225472</length> + <seclength>6291456</seclength> + <offset>6966738944</offset> + <secoffset>13606912</secoffset> + </config> + </provider> + <provider> + <ref>0x80be680</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1f</name> + <config> + <index>5</index> + <length>4294967296</length> + <seclength>8388608</seclength> + <offset>2671771648</offset> + <secoffset>5218304</secoffset> + </config> + </provider> + <provider> + <ref>0x80be600</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1e</name> + <config> + <index>4</index> + <length>524288000</length> + <seclength>1024000</seclength> + <offset>2147483648</offset> + <secoffset>4194304</secoffset> + </config> + </provider> + <provider> + <ref>0x80be580</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1d</name> + <config> + <index>3</index> + <length>4447175168</length> + <seclength>8685889</seclength> + <offset>15556673536</offset> + <secoffset>30384128</secoffset> + </config> + </provider> + <provider> + <ref>0x80be500</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1c</name> + <config> + <index>2</index> + <length>20003848704</length> + <seclength>39070017</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80be480</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1b</name> + <config> + <index>1</index> + <length>1073741824</length> + <seclength>2097152</seclength> + <offset>1073741824</offset> + <secoffset>2097152</secoffset> + </config> + </provider> + <provider> + <ref>0x80be400</ref> + <geom><ref>0x80be300</ref></geom> + <mode>r0w0e0</mode> + <name>ad0s1a</name> + <config> + <index>0</index> + <length>1073741824</length> + <seclength>2097152</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071c00</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80ba040</ref> + <method><ref>0x8071c00</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80be000</ref> + <geom><ref>0x80ba040</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T004/testprg.c b/tools/regression/geom/Test/T004/testprg.c new file mode 100644 index 0000000..705f6ed --- /dev/null +++ b/tools/regression/geom/Test/T004/testprg.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.critter.ad0.xml"); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T005/Makefile b/tools/regression/geom/Test/T005/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T005/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T005/ref.conf b/tools/regression/geom/Test/T005/ref.conf new file mode 100644 index 0000000..9c56e70 --- /dev/null +++ b/tools/regression/geom/Test/T005/ref.conf @@ -0,0 +1,138 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071cc0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80bb500</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0c</name> + <rank>3</rank> + <consumer> + <ref>0x80bb580</ref> + <geom><ref>0x80bb500</ref></geom> + <provider><ref>0x80bb280</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb400</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0b</name> + <rank>3</rank> + <consumer> + <ref>0x80bb480</ref> + <geom><ref>0x80bb400</ref></geom> + <provider><ref>0x80bb200</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb300</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0a</name> + <rank>3</rank> + <consumer> + <ref>0x80bb380</ref> + <geom><ref>0x80bb300</ref></geom> + <provider><ref>0x80bb180</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80ba080</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80bb080</ref> + <geom><ref>0x80ba080</ref></geom> + <provider><ref>0x80bb000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071c00</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071ca0</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8071ce0</ref> + <name>BSD-method</name> + <geom> + <ref>0x80ba0c0</ref> + <method><ref>0x8071ce0</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80bb100</ref> + <geom><ref>0x80ba0c0</ref></geom> + <provider><ref>0x80bb000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80bb280</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0c</name> + <config> + <index>2</index> + <length>1474560</length> + <seclength>2880</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80bb200</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0b</name> + <config> + <index>1</index> + <length>1474560</length> + <seclength>2880</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80bb180</ref> + <geom><ref>0x80ba0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0a</name> + <config> + <index>0</index> + <length>1474560</length> + <seclength>2880</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8071be0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80ba040</ref> + <method><ref>0x8071be0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80bb000</ref> + <geom><ref>0x80ba040</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T005/testprg.c b/tools/regression/geom/Test/T005/testprg.c new file mode 100644 index 0000000..119b3ed --- /dev/null +++ b/tools/regression/geom/Test/T005/testprg.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.kern.flp.xml"); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T006/Makefile b/tools/regression/geom/Test/T006/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T006/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T006/ref.conf b/tools/regression/geom/Test/T006/ref.conf new file mode 100644 index 0000000..63fc049 --- /dev/null +++ b/tools/regression/geom/Test/T006/ref.conf @@ -0,0 +1,47 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071cc0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80ba080</ref> + <method><ref>0x8071cc0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80bb080</ref> + <geom><ref>0x80ba080</ref></geom> + <provider><ref>0x80bb000</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071c00</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071ca0</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8071ce0</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071be0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80ba040</ref> + <method><ref>0x8071be0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80bb000</ref> + <geom><ref>0x80ba040</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T006/testprg.c b/tools/regression/geom/Test/T006/testprg.c new file mode 100644 index 0000000..10296af --- /dev/null +++ b/tools/regression/geom/Test/T006/testprg.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.msdos.flp.xml"); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T007/Makefile b/tools/regression/geom/Test/T007/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T007/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T007/ref.conf b/tools/regression/geom/Test/T007/ref.conf new file mode 100644 index 0000000..69a8889 --- /dev/null +++ b/tools/regression/geom/Test/T007/ref.conf @@ -0,0 +1,23 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071d00</ref> + <name>DEV-method</name> + </method> + <method> + <ref>0x8071c40</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071ce0</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8071d20</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071c20</ref> + <name>SIMDISK-method</name> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T007/testprg.c b/tools/regression/geom/Test/T007/testprg.c new file mode 100644 index 0000000..e07f87e --- /dev/null +++ b/tools/regression/geom/Test/T007/testprg.c @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.typo.ad0.xml"); + rattle(); + sdumpf("2a"); + g_simdisk_destroy("ad0"); + rattle(); + conff("1"); + sdumpf("2b"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T008/Makefile b/tools/regression/geom/Test/T008/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T008/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T008/ref.conf b/tools/regression/geom/Test/T008/ref.conf new file mode 100644 index 0000000..69a8889 --- /dev/null +++ b/tools/regression/geom/Test/T008/ref.conf @@ -0,0 +1,23 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071d00</ref> + <name>DEV-method</name> + </method> + <method> + <ref>0x8071c40</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071ce0</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8071d20</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071c20</ref> + <name>SIMDISK-method</name> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T008/testprg.c b/tools/regression/geom/Test/T008/testprg.c new file mode 100644 index 0000000..21d960b --- /dev/null +++ b/tools/regression/geom/Test/T008/testprg.c @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + struct g_consumer *cp; + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.typo.ad0.xml"); + rattle(); + cp = g_dev_opendev("ad0s1a", 1, 0, 0); + sdumpf("2a"); + g_simdisk_destroy("ad0"); + rattle(); + conff("1"); + sdumpf("2b"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T009/Makefile b/tools/regression/geom/Test/T009/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T009/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T009/ref.conf b/tools/regression/geom/Test/T009/ref.conf new file mode 100644 index 0000000..9215bf4 --- /dev/null +++ b/tools/regression/geom/Test/T009/ref.conf @@ -0,0 +1,23 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071da0</ref> + <name>DEV-method</name> + </method> + <method> + <ref>0x8071ce0</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071d80</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8071dc0</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071cc0</ref> + <name>SIMDISK-method</name> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T009/testprg.c b/tools/regression/geom/Test/T009/testprg.c new file mode 100644 index 0000000..3b2bfaf --- /dev/null +++ b/tools/regression/geom/Test/T009/testprg.c @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + struct g_consumer *cp; + struct bio *bp; + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.typo.ad0.xml"); + rattle(); + cp = g_dev_opendev("ad0s1a", 1, 0, 0); + g_simdisk_stop("ad0"); + bp = g_new_bio(); + bp->bio_cmd = BIO_READ; + bp->bio_offset = 0; + bp->bio_length = 512; + bp->bio_data = g_malloc(512, M_WAITOK); + g_dev_request("ad0s1a", bp); + rattle(); + sdumpf("2a"); + g_simdisk_destroy("ad0"); + rattle(); + conff("1"); + sdumpf("2b"); + g_simdisk_restart("ad0"); + rattle(); + conff("1"); + sdumpf("2c"); + + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T010/Makefile b/tools/regression/geom/Test/T010/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T010/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T010/ref.conf b/tools/regression/geom/Test/T010/ref.conf new file mode 100644 index 0000000..4c3726e --- /dev/null +++ b/tools/regression/geom/Test/T010/ref.conf @@ -0,0 +1,88 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x80725a0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80ba200</ref> + <method><ref>0x80725a0</ref></method> + <name>ad0c</name> + <rank>3</rank> + <consumer> + <ref>0x80ba280</ref> + <geom><ref>0x80ba200</ref></geom> + <provider><ref>0x80ba180</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb080</ref> + <method><ref>0x80725a0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80ba080</ref> + <geom><ref>0x80bb080</ref></geom> + <provider><ref>0x80ba000</ref></provider> + <mode>r1w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x80724a0</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8072560</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x80725e0</ref> + <name>BSD-method</name> + <geom> + <ref>0x80bb0c0</ref> + <method><ref>0x80725e0</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80ba100</ref> + <geom><ref>0x80bb0c0</ref></geom> + <provider><ref>0x80ba000</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80ba180</ref> + <geom><ref>0x80bb0c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0c</name> + <config> + <index>2</index> + <length>1474560</length> + <seclength>2880</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x8072460</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80bb040</ref> + <method><ref>0x8072460</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80ba000</ref> + <geom><ref>0x80bb040</ref></geom> + <mode>r1w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T010/testprg.c b/tools/regression/geom/Test/T010/testprg.c new file mode 100644 index 0000000..0154f5e --- /dev/null +++ b/tools/regression/geom/Test/T010/testprg.c @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + struct g_consumer *cp; + struct g_geom *gp; + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.empty.flp.xml"); + rattle(); + cp = g_dev_opendev("ad0", 1, 0, 0); + g_topology_lock(); + gp = g_create_geomf("BSD-method", cp->provider, NULL); + g_topology_unlock(); + printf("gp = %p\n", gp); + rattle(); + conff("1"); + sdumpf("2"); +#if 0 + g_simdisk_stop("ad0"); + bp = g_new_bio(); + bp->bio_cmd = BIO_READ; + bp->bio_offset = 0; + bp->bio_length = 512; + bp->bio_data = g_malloc(512, M_WAITOK); + g_dev_request("ad0s1a", bp); + rattle(); + sdumpf("2a"); + g_simdisk_destroy("ad0"); + rattle(); + conff("1"); + sdumpf("2b"); + g_simdisk_restart("ad0"); + rattle(); + conff("1"); + sdumpf("2c"); + +#endif + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T011/Makefile b/tools/regression/geom/Test/T011/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T011/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T011/ref.conf b/tools/regression/geom/Test/T011/ref.conf new file mode 100644 index 0000000..0a0716c --- /dev/null +++ b/tools/regression/geom/Test/T011/ref.conf @@ -0,0 +1,47 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8071c40</ref> + <name>DEV-method</name> + <geom> + <ref>0x80b70c0</ref> + <method><ref>0x8071c40</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b7100</ref> + <geom><ref>0x80b70c0</ref></geom> + <provider><ref>0x80b7080</ref></provider> + <mode>r1w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x8071b40</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x8071c00</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8071c80</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x8071b00</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80b7040</ref> + <method><ref>0x8071b00</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b7080</ref> + <geom><ref>0x80b7040</ref></geom> + <mode>r1w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T011/testprg.c b/tools/regression/geom/Test/T011/testprg.c new file mode 100644 index 0000000..d9dea04 --- /dev/null +++ b/tools/regression/geom/Test/T011/testprg.c @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + struct g_consumer *cp; + struct g_geom *gp; + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.empty.flp.xml"); + rattle(); + cp = g_dev_opendev("ad0", 1, 0, 0); + g_topology_lock(); + gp = g_insert_geom("BSD-method", cp); + g_topology_unlock(); + printf("gp = %p\n", gp); + rattle(); + conff("1"); + sdumpf("2"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/Test/T012/Makefile b/tools/regression/geom/Test/T012/Makefile new file mode 100644 index 0000000..e944636 --- /dev/null +++ b/tools/regression/geom/Test/T012/Makefile @@ -0,0 +1,3 @@ +# $FreeBSD$ +.include "../Makefile.inc" +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T012/ref.conf b/tools/regression/geom/Test/T012/ref.conf new file mode 100644 index 0000000..640cafd --- /dev/null +++ b/tools/regression/geom/Test/T012/ref.conf @@ -0,0 +1,382 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <method> + <ref>0x8072160</ref> + <name>SUNLABEL-method</name> + <geom> + <ref>0x80b8480</ref> + <method><ref>0x8072160</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80b84c0</ref> + <geom><ref>0x80b8480</ref></geom> + <provider><ref>0x80b8440</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80b8680</ref> + <geom><ref>0x80b8480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0h</name> + <config> + <index>7</index> + <length>1343787008</length> + <seclength>2624584</seclength> + <offset>5638115328</offset> + <secoffset>11011944</secoffset> + </config> + </provider> + <provider> + <ref>0x80b8640</ref> + <geom><ref>0x80b8480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0g</name> + <config> + <index>6</index> + <length>2149576704</length> + <seclength>4198392</seclength> + <offset>3488538624</offset> + <secoffset>6813552</secoffset> + </config> + </provider> + <provider> + <ref>0x80b8600</ref> + <geom><ref>0x80b8480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0f</name> + <config> + <index>5</index> + <length>2149576704</length> + <seclength>4198392</seclength> + <offset>1338961920</offset> + <secoffset>2615160</secoffset> + </config> + </provider> + <provider> + <ref>0x80b85c0</ref> + <geom><ref>0x80b8480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0d</name> + <config> + <index>3</index> + <length>11124240384</length> + <seclength>21727032</seclength> + <offset>6981902336</offset> + <secoffset>13636528</secoffset> + </config> + </provider> + <provider> + <ref>0x80b8580</ref> + <geom><ref>0x80b8480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0c</name> + <config> + <index>2</index> + <length>18108555264</length> + <seclength>35368272</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80b8540</ref> + <geom><ref>0x80b8480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0b</name> + <config> + <index>1</index> + <length>1075994624</length> + <seclength>2101552</seclength> + <offset>262967296</offset> + <secoffset>513608</secoffset> + </config> + </provider> + <provider> + <ref>0x80b8500</ref> + <geom><ref>0x80b8480</ref></geom> + <mode>r0w0e0</mode> + <name>ad0a</name> + <config> + <index>0</index> + <length>262967296</length> + <seclength>513608</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + </geom> + <geom> + <ref>0x80b80c0</ref> + <method><ref>0x8072160</ref></method> + <name>ad0</name> + <rank>2</rank> + <config> + </config> + <consumer> + <ref>0x80b8100</ref> + <geom><ref>0x80b80c0</ref></geom> + <provider><ref>0x80b8080</ref></provider> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider> + <ref>0x80b8200</ref> + <geom><ref>0x80b80c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0h</name> + <config> + <index>7</index> + <length>34629267456</length> + <seclength>67635288</seclength> + <offset>2069028864</offset> + <secoffset>4041072</secoffset> + </config> + </provider> + <provider> + <ref>0x80b81c0</ref> + <geom><ref>0x80b80c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0c</name> + <config> + <index>2</index> + <length>36698296320</length> + <seclength>71676360</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80b8180</ref> + <geom><ref>0x80b80c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0b</name> + <config> + <index>1</index> + <length>539320320</length> + <seclength>1053360</seclength> + <offset>0</offset> + <secoffset>0</secoffset> + </config> + </provider> + <provider> + <ref>0x80b8140</ref> + <geom><ref>0x80b80c0</ref></geom> + <mode>r0w0e0</mode> + <name>ad0a</name> + <config> + <index>0</index> + <length>1529708544</length> + <seclength>2987712</seclength> + <offset>539320320</offset> + <secoffset>1053360</secoffset> + </config> + </provider> + </geom> + </method> + <method> + <ref>0x80722e0</ref> + <name>DEV-method</name> + <geom> + <ref>0x80c5100</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0h</name> + <rank>3</rank> + <consumer> + <ref>0x80b88c0</ref> + <geom><ref>0x80c5100</ref></geom> + <provider><ref>0x80b8680</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bbf80</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0g</name> + <rank>3</rank> + <consumer> + <ref>0x80b8880</ref> + <geom><ref>0x80bbf80</ref></geom> + <provider><ref>0x80b8640</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bbe00</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0f</name> + <rank>3</rank> + <consumer> + <ref>0x80b8840</ref> + <geom><ref>0x80bbe00</ref></geom> + <provider><ref>0x80b8600</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bbc80</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0d</name> + <rank>3</rank> + <consumer> + <ref>0x80b8800</ref> + <geom><ref>0x80bbc80</ref></geom> + <provider><ref>0x80b85c0</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bbb00</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0c</name> + <rank>3</rank> + <consumer> + <ref>0x80b87c0</ref> + <geom><ref>0x80bbb00</ref></geom> + <provider><ref>0x80b8580</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb980</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0b</name> + <rank>3</rank> + <consumer> + <ref>0x80b8780</ref> + <geom><ref>0x80bb980</ref></geom> + <provider><ref>0x80b8540</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb900</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0a</name> + <rank>3</rank> + <consumer> + <ref>0x80b8740</ref> + <geom><ref>0x80bb900</ref></geom> + <provider><ref>0x80b8500</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80b86c0</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b8700</ref> + <geom><ref>0x80b86c0</ref></geom> + <provider><ref>0x80b8440</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb580</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0h</name> + <rank>3</rank> + <consumer> + <ref>0x80b8380</ref> + <geom><ref>0x80bb580</ref></geom> + <provider><ref>0x80b8200</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb400</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0c</name> + <rank>3</rank> + <consumer> + <ref>0x80b8340</ref> + <geom><ref>0x80bb400</ref></geom> + <provider><ref>0x80b81c0</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb200</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0b</name> + <rank>3</rank> + <consumer> + <ref>0x80b8300</ref> + <geom><ref>0x80bb200</ref></geom> + <provider><ref>0x80b8180</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80bb180</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0a</name> + <rank>3</rank> + <consumer> + <ref>0x80b82c0</ref> + <geom><ref>0x80bb180</ref></geom> + <provider><ref>0x80b8140</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom> + <ref>0x80b8240</ref> + <method><ref>0x80722e0</ref></method> + <name>ad0</name> + <rank>2</rank> + <consumer> + <ref>0x80b8280</ref> + <geom><ref>0x80b8240</ref></geom> + <provider><ref>0x80b8080</ref></provider> + <mode>r0w0e0</mode> + </consumer> + </geom> + </method> + <method> + <ref>0x80721e0</ref> + <name>MBREXT-method</name> + </method> + <method> + <ref>0x80722a0</ref> + <name>MBR-method</name> + </method> + <method> + <ref>0x8072320</ref> + <name>BSD-method</name> + </method> + <method> + <ref>0x80721a0</ref> + <name>SIMDISK-method</name> + <geom> + <ref>0x80b8400</ref> + <method><ref>0x80721a0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b8440</ref> + <geom><ref>0x80b8400</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + <geom> + <ref>0x80b8040</ref> + <method><ref>0x80721a0</ref></method> + <name>ad0</name> + <rank>1</rank> + <provider> + <ref>0x80b8080</ref> + <geom><ref>0x80b8040</ref></geom> + <mode>r0w0e0</mode> + <name>ad0</name> + </provider> + </geom> + </method> +</mesh> diff --git a/tools/regression/geom/Test/T012/testprg.c b/tools/regression/geom/Test/T012/testprg.c new file mode 100644 index 0000000..0b9453d --- /dev/null +++ b/tools/regression/geom/Test/T012/testprg.c @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_bsd_init(); + g_mbr_init(); + g_mbrext_init(); + g_dev_init(NULL); + g_sunlabel_init(); + rattle(); + + g_simdisk_xml_load("ad0", "../../Data/disk.sun.da0.xml"); + rattle(); + g_simdisk_xml_load("ad0", "../../Data/disk.sun.da1.xml"); + rattle(); + conff("1"); + sdumpf("2"); + printf("Done\n"); + done(); + return (0); +} + diff --git a/tools/regression/geom/geom.c b/tools/regression/geom/geom.c new file mode 100644 index 0000000..065612b --- /dev/null +++ b/tools/regression/geom/geom.c @@ -0,0 +1,163 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +void +conff(char *file) +{ + FILE *f; + char *s; + struct sbuf *sb; + + printf(">> conf to %s\n", file); + asprintf(&s, "_%s.conf", file); + f = fopen(s, "w"); + if (f == NULL) + err(1, s); + sb = g_conf(); + fputs(sbuf_data(sb), f); + fclose(f); + free(s); +} + + + + +static int +thread_up(void *ptr) +{ + struct thread *tp = ptr; + + printf("Running %s\n", tp->name); + for (;;) { + g_io_schedule_up(tp); + tsleep(&g_wait_up, 0, "up", 0); + } +} + +static int +thread_down(void *ptr) +{ + struct thread *tp = ptr; + printf("Running %s\n", tp->name); + for (;;) { + g_io_schedule_down(tp); + tsleep(&g_wait_down, 0, "down", 0); + } +} + +static int +thread_event(void *ptr) +{ + struct thread *tp = ptr; + /* nice(5); */ + printf("Running %s\n", tp->name); + for (;;) { + usleep(100000); + g_run_events(tp); + tsleep(&g_wait_event, 0, "events", 0); + } +} + + +int +main(int argc __unused, char **argv __unused) +{ + int ch; + + while ((ch = getopt(argc, argv, "bt")) != -1) { + switch (ch) { + case 'b': + g_debugflags |= G_T_BIO; + break; + case 't': + g_debugflags |= G_T_TOPOLOGY; + break; + } + } + + + setbuf(stdout, NULL); + printf("Sizeof g_method = %d\n", sizeof(struct g_method)); + printf("Sizeof g_geom = %d\n", sizeof(struct g_geom)); + printf("Sizeof g_consumer = %d\n", sizeof(struct g_consumer)); + printf("Sizeof g_provider = %d\n", sizeof(struct g_provider)); + printf("Sizeof g_event = %d\n", sizeof(struct g_event)); + g_init(); + new_thread(thread_up, "UP"); + new_thread(thread_down, "DOWN"); + new_thread(thread_event, "EVENT"); + new_thread(thread_sim, "SIM"); + + while (1) { + sleep (1); + secrethandshake(); + } +} + +void +sdumpf(char *file) +{ + FILE *f; + char *s; + struct sbuf *sb; + + printf(">> dump to %s\n", file); + asprintf(&s, "_%s.dot", file); + f = fopen(s, "w"); + if (f == NULL) + err(1, s); + sb = g_confdot(); + fprintf(f, "%s", sbuf_data(sb)); + fclose(f); + free(s); + asprintf(&s, "dot -Tps _%s.dot > _%s.ps", file, file); + system(s); + free(s); +} + diff --git a/tools/regression/geom/geom_kernsim.c b/tools/regression/geom/geom_kernsim.c new file mode 100644 index 0000000..7ab0617 --- /dev/null +++ b/tools/regression/geom/geom_kernsim.c @@ -0,0 +1,339 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <sched.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <geom/geom.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <machine/atomic.h> + +#define NTHREAD 30 +static struct thread thr[NTHREAD]; + +static int weredone; +int g_debugflags; +int bootverbose = 1; + +void +done(void) +{ + weredone = 1; + exit(0); +} + +void +secrethandshake() +{ + int i; + + if (weredone) + exit(0); + for (i = 0; i < NTHREAD; i++) { + if (thr[i].pid == 0) + continue; + if (kill(thr[i].pid, 0)) { + printf("\n\nMissing process for thread %d (\"%s\")\n", + i, thr[i].name); + goto scram; + } + } + return; + +scram: + for (i = 0; i < NTHREAD; i++) { + if (thr[i].pid == 0) + continue; + if (thr[i].pid == getpid()) + continue; + kill(thr[i].pid, 9); + } + exit(9); +} + +static int sleeping; + +void +wakeup(void *chan) +{ + int i; + + secrethandshake(); + for (i = 0; i < NTHREAD; i++) + if (thr[i].wchan == chan) { + // printf("wakeup %s\n", thr[i].name); + atomic_clear_int(&sleeping, 1 << i); + write(thr[i].pipe[1], "\0", 1); + } +} + +int hz; + +int +tsleep(void *chan, int pri __unused, const char *wmesg, int timo) +{ + fd_set r,w,e; + int i, j, fd, pid; + struct timeval tv; + char buf[100]; + struct thread *tp; + + secrethandshake(); + pid = getpid(); + tp = NULL; + for (i = 0; i < NTHREAD; i++) { + if (pid != thr[i].pid) + continue; + tp = &thr[i]; + break; + } + + KASSERT(tp != NULL, ("Confused tp=%p has no name\n", tp)); + KASSERT(tp->name != NULL, ("Confused tp=%p has no name\n", tp)); + tp->wchan = chan; + tp->wmesg = wmesg; + fd = tp->pipe[0]; + // printf("tsleep %s %p %s\n", tp->name, chan, wmesg); + for (;;) { + if (timo > 0) { + tv.tv_sec = 1; + tv.tv_usec = 0; + } else { + tv.tv_sec = 10; + tv.tv_usec = 0; + } + FD_ZERO(&r); + FD_ZERO(&w); + FD_ZERO(&e); + FD_SET(fd, &r); + atomic_set_int(&sleeping, 1 << i); + j = select(fd + 1, &r, &w, &e, &tv); + secrethandshake(); + if (j) + break; + atomic_set_int(&sleeping, 1 << i); + } + i = read(fd, buf, sizeof(buf)); + tp->wchan = 0; + tp->wmesg = 0; + return(i); +} + +void +rattle() +{ + int i, j; + + for (;;) { + secrethandshake(); + usleep(100000); + secrethandshake(); + i = sleeping & 7; + if (i != 7) + continue; + usleep(20000); + j = sleeping & 7; + if (i != j) + continue; + printf("Rattle(%d) \"%s\" \"%s\" \"%s\"\n", i, thr[0].wmesg, thr[1].wmesg, thr[2].wmesg); + if (!thr[0].wmesg || strcmp(thr[0].wmesg, "up")) + continue; + if (!thr[1].wmesg || strcmp(thr[1].wmesg, "down")) + continue; + if (!thr[2].wmesg || strcmp(thr[2].wmesg, "events")) + continue; + break; + } +} + + +void +new_thread(int (*func)(void *arg), char *name) +{ + char *c; + struct thread *tp; + static int nextt; + + tp = thr + nextt++; + c = calloc(1, 65536); + tp->name = name; + pipe(tp->pipe); + tp->pid = rfork_thread(RFPROC|RFMEM, c + 65536 - 16, func, tp); + if (tp->pid <= 0) + err(1, "rfork_thread"); + printf("New Thread %d %s %p %d\n", tp - thr, name, tp, tp->pid); +} + +#define FASCIST 0 +int malloc_lock; + +void * +g_malloc(int size, int flags) +{ + void *p; + + secrethandshake(); + while (!atomic_cmpset_int(&malloc_lock, 0, 1)) + sched_yield(); +#if FASCIST + p = malloc(4096); + printf("Malloc %p \n", p); +#else + p = malloc(size); +#endif + malloc_lock = 0; + if (flags & M_ZERO) + memset(p, 0, size); + else + memset(p, 0xd0, size); + return (p); +} + +void +g_free(void *ptr) +{ + + secrethandshake(); + while (!atomic_cmpset_int(&malloc_lock, 0, 1)) + sched_yield(); +#if FASCIST + printf("Free %p \n", ptr); + munmap(ptr, 4096); +#else + free(ptr); +#endif + malloc_lock = 0; +} + + +void +g_init(void) +{ + + g_io_init(); + g_event_init(); +} + +static int topology_lock; + +void +g_topology_lock() +{ + int pid; + + pid = getpid(); + if (atomic_cmpset_int(&topology_lock, 0, pid)) + return; + KASSERT(pid != topology_lock, + ("Locking topology against myself pid %d\n", pid)); + while (!atomic_cmpset_int(&topology_lock, 0, pid)) { + printf("Waiting for topology lock mypid = %d held by %d\n", + pid, topology_lock); + sleep(1); + } +} + +void +g_topology_unlock() +{ + + KASSERT(topology_lock == getpid(), ("Didn't have topology_lock to release")); + topology_lock = 0; +} + +void +g_topology_assert() +{ + + if (topology_lock == getpid()) + return; + KASSERT(1 == 0, ("Lacking topology_lock")); +} + +void +mtx_lock_spin(struct mtx *mp) +{ + + while(!atomic_cmpset_int(&mp->mtx_lock, 0, 1)) { + printf("trying to get lock...\n"); + sched_yield(); + } +} + +void +mtx_unlock_spin(struct mtx *mp) +{ + + mp->mtx_lock = 0; +} + +void +mtx_init(struct mtx *mp, char *bla __unused, int foo __unused) +{ + mp->mtx_lock = 0; +} + +void +mtx_destroy(struct mtx *mp) +{ + mp->mtx_lock = 0; +} + +void +mtx_lock(struct mtx *mp) +{ + + mp->mtx_lock = 0; +} + +void +mtx_unlock(struct mtx *mp) +{ + + mp->mtx_lock = 0; +} + +struct mtx Giant; + diff --git a/tools/regression/geom/geom_sim.c b/tools/regression/geom/geom_sim.c new file mode 100644 index 0000000..cdb145f --- /dev/null +++ b/tools/regression/geom/geom_sim.c @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +int +thread_sim(void *ptr) +{ + struct thread *tp = ptr; + struct g_consumer *cp; + + printf("Running %s\n", tp->name); + rattle(); + g_topology_lock(); + printf("--- g_simdisk_init();\n"); + g_simdisk_init(); + printf("--- g_bsd_init();\n"); + g_bsd_init(); + printf("--- g_mbr_init();\n"); + g_mbr_init(); + g_mbrext_init(); + printf("--- g_dev_init();\n"); + g_dev_init(NULL); + g_topology_unlock(); + rattle(); + +#if 0 + g_simdisk_new("ad0", "/dev/ad0"); +#else + g_simdisk_xml_load("ad0", "Data/disk.typo.ad0.xml"); + // g_simdisk_xml_load("ad0", "Data/disk.msdos.ext.xml"); + // g_simdisk_xml_load("ad0", "Data/disk.far.ad0.xml"); +#endif + rattle(); + dumpf("1"); + conff("1"); + sdumpf("2"); + g_simdisk_xml_save("ad0", "_ad0"); + g_simdisk_destroy("ad0"); + rattle(); + dumpf("1"); + conff("1"); + sdumpf("2"); + + printf("Done\n"); + exit (0); + +#if 0 + printf("--- g_dev_finddev(\"ad0s1a\");\n"); + cp = g_dev_finddev("ad0s1a"); + if (cp == NULL) + errx(1, "argh!"); + printf("--- g_access_rel(cp, 1, 1, 1);\n"); + g_access_rel(cp, 1, 1, 1); + sleep(3); + dumpf("1"); + conff("1"); + sdumpf("2"); + + printf("--- g_access_rel(cp, -1, -1, -1);\n"); + g_access_rel(cp, -1, -1, -1); + sleep(3); + dumpf("1"); + conff("1"); + sdumpf("2"); + + printf("--- g_dev_finddev(\"ad0\");\n"); + cp = g_dev_finddev("ad0"); + if (cp == NULL) + errx(1, "argh!"); + printf("--- g_access_rel(cp, 1, 1, 1);\n"); + g_access_rel(cp, 1, 1, 1); + sleep(3); + dumpf("1"); + conff("1"); + sdumpf("2"); + + printf("--- g_access_rel(cp, -1, -1, -1);\n"); + g_access_rel(cp, -1, -1, -1); + + sleep (3); + dumpf("1"); + conff("1"); + sdumpf("2"); +#if 0 + printf("--- Simulation done...\n"); + for (;;) + sleep(1); + exit (0); +#endif + +#endif +#if 1 + g_simdisk_new("../Disks/typo.freebsd.dk:ad0", "ad1"); +#else + g_simdisk_xml_load("ad0", "disk.critter.ad0.xml"); +#endif + sleep (3); + dumpf("1"); + conff("1"); + sdumpf("2"); + g_simdisk_xml_save("ad1", "_ad1"); + +#if 1 + sleep (3); + g_simdisk_new("/home/phk/phk2001/msdos_6_2-1.flp", "fd0"); + sleep (3); + dumpf("1"); + conff("1"); + sdumpf("2"); + g_simdisk_xml_save("fd0", "_fd0"); + + sleep (3); + g_simdisk_new("/home/phk/phk2001/kern.flp", "fd1"); + sleep (3); + dumpf("1"); + conff("1"); + sdumpf("2"); + g_simdisk_xml_save("fd1", "_fd1"); + + sleep (3); + g_simdisk_new("../Disks/far:ad0", "ad2"); + sleep (3); + dumpf("1"); + conff("1"); + sdumpf("2"); + g_simdisk_xml_save("ad2", "_ad2"); + +#endif + sleep (3); + g_simdisk_destroy("ad1"); + sleep (5); + dumpf("1"); + conff("1"); + sdumpf("2"); + + printf("Simulation done...\n"); + + exit (0); +} + diff --git a/tools/regression/geom/geom_sim.h b/tools/regression/geom/geom_sim.h new file mode 100644 index 0000000..c0ed68a --- /dev/null +++ b/tools/regression/geom/geom_sim.h @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +/* bio.h */ + +struct bio { + enum { + BIO_INVALID = 0, + BIO_READ, + BIO_WRITE, + BIO_FREE, + BIO_DELETE, + BIO_FORMAT, + BIO_GETATTR, + BIO_SETATTR + } bio_cmd; + struct { int foo; } stats; + TAILQ_ENTRY(bio) bio_queue; + TAILQ_ENTRY(bio) bio_sort; + struct g_consumer *bio_from; + struct g_provider *bio_to; + void (*bio_done)(struct bio *); + + off_t bio_offset; + off_t bio_length; + off_t bio_completed; + void *bio_data; + char *bio_attribute; /* BIO_GETATTR/BIO_SETATTR */ + int bio_error; + + struct bio *bio_linkage; + int bio_flags; +#define BIO_DONE 0x1 +}; + +/* geom_dev.c */ +void g_dev_init(void *junk); +struct g_consumer *g_dev_opendev(char *name, int w, int r, int e); +int g_dev_request(char *name, struct bio *bp); + +/* geom_kernsim.c */ +struct thread { + char *name; + int pid; + void *wchan; + const char *wmesg; + int pipe[2]; +}; + +void done(void); +void rattle(void); +void secrethandshake(void); +void wakeup(void *chan); +int tsleep __P((void *chan, int pri, const char *wmesg, int timo)); +#define PPAUSE 0 +extern int hz; + +void new_thread(int (*func)(void *arg), char *name); + +extern int bootverbose; +#define KASSERT(cond, txt) do {if (!(cond)) {printf txt; conff("err"); abort();}} while(0) +#define M_WAITOK 0 +#define M_ZERO 1 + +extern struct mtx Giant; +void *g_malloc(int size, int flags); +void g_free(void *ptr); + +#define MTX_DEF 0 +#define MTX_SPIN 1 +void mtx_lock(struct mtx *); +void mtx_lock_spin(struct mtx *); +void mtx_unlock(struct mtx *); +void mtx_unlock_spin(struct mtx *); +void mtx_init(struct mtx *, char *, int); +void mtx_destroy(struct mtx *); + +#define MALLOC_DECLARE(foo) /* */ + +void g_topology_lock(void); +void g_topology_unlock(void); +void g_topology_assert(void); + + +/* geom_simdisk.c */ +void g_simdisk_init(void); +void g_simdisk_destroy(char *); +struct g_geom *g_simdisk_new(char *, char *); +struct g_geom * g_simdisk_xml_load(char *name, char *file); +void g_simdisk_xml_save(char *name, char *file); +void g_simdisk_stop(char *name); +void g_simdisk_restart(char *name); + +#define DECLARE_GEOM_METHOD(method, name) \ + void \ + name##_init(void) \ + { \ + g_add_method(&method); \ + } + +void g_sunlabel_init(void); +void g_bsd_init(void); +void g_mbr_init(void); +void g_mbrext_init(void); + +int thread_sim(void *ptr); + +void dumpf(char *file); +void conff(char *file); +void sdumpf(char *file); + +#define THR_MAIN 0 +#define THR_UP 1 +#define THR_DOWN 2 +#define THR_EVENT 3 + diff --git a/tools/regression/geom/geom_simdev.c b/tools/regression/geom/geom_simdev.c new file mode 100644 index 0000000..35134d5 --- /dev/null +++ b/tools/regression/geom/geom_simdev.c @@ -0,0 +1,159 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <sys/param.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <geom/geom.h> + + +static struct g_geom * +dev_taste(struct g_method *mp, struct g_provider *pp, struct thread *tp __unused, int insist __unused) +{ + struct g_geom *gp; + struct g_consumer *cp; + + g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name); + g_topology_assert(); + LIST_FOREACH(cp, &pp->consumers, consumers) { + if (cp->geom->method == mp) { + g_topology_unlock(); + return (NULL); + } + } + gp = g_new_geomf(mp, pp->name); + cp = g_new_consumer(gp); + g_attach(cp, pp); + return (gp); +} + + +static void +g_dev_orphan(struct g_consumer *cp, struct thread *tp __unused) +{ + struct g_geom *gp; + + gp = cp->geom; + gp->flags |= G_GEOM_WITHER; + g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, gp->name); + if (cp->biocount > 0) + return; + if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) + g_access_rel(cp, -cp->acr, -cp->acw, -cp->ace); + g_dettach(cp); + g_destroy_consumer(cp); + g_destroy_geom(gp); +} + + +static struct g_method dev_method = { + "DEV-method", + dev_taste, + NULL, + g_dev_orphan, + NULL, + G_METHOD_INITSTUFF +}; + +static struct g_geom * +g_dev_findg(char *name) +{ + struct g_geom *gp; + + LIST_FOREACH(gp, &dev_method.geom, geom) + if (!strcmp(gp->name, name)) + break; + return (gp); +} + +void +g_dev_init(void *junk __unused) +{ + + g_add_method(&dev_method); +} + + +struct g_consumer * +g_dev_opendev(char *name, int r, int w, int e) +{ + struct g_geom *gp; + struct g_consumer *cp; + int error; + + gp = g_dev_findg(name); + if (gp == NULL) + return (NULL); + g_topology_lock(); + cp = LIST_FIRST(&gp->consumer); + error = g_access_rel(cp, r, w, e); + g_topology_unlock(); + if (error) + return(NULL); + return(cp); +} + +static void +g_dev_done(struct bio *bp) +{ + + if (bp->bio_from->biocount > 0) + return; + g_topology_lock(); + g_dev_orphan(bp->bio_from, NULL); + g_topology_unlock(); +} + +int +g_dev_request(char *name, struct bio *bp) +{ + struct g_geom *gp; + + gp = g_dev_findg(name); + if (gp == NULL) + return (-1); + bp->bio_done = g_dev_done; + g_io_request(bp, LIST_FIRST(&gp->consumer)); + return (1); +} diff --git a/tools/regression/geom/geom_simdisk.c b/tools/regression/geom/geom_simdisk.c new file mode 100644 index 0000000..8c877c9 --- /dev/null +++ b/tools/regression/geom/geom_simdisk.c @@ -0,0 +1,261 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <fcntl.h> +#include <strings.h> +#include <err.h> +#include <sys/errno.h> +#include <geom/geom.h> + +#include "geom_simdisk.h" + +struct g_method g_simdisk_method = { + "SIMDISK-method", + NULL, + g_std_access, + NULL, + NULL, + G_METHOD_INITSTUFF +}; + +static void +g_simdisk_start(struct bio *bp) +{ + off_t ot, off; + unsigned nsec; + u_char *op; + int i; + struct g_geom *gp = bp->bio_to->geom; + struct simdisk_softc *sc = gp->softc; + struct sector *dsp; + + + printf("SIMDISK: OP%d %qd at %qd\n", + bp->bio_cmd, bp->bio_length, bp->bio_offset); + if (sc->stop) { + TAILQ_INSERT_TAIL(&sc->sort, bp, bio_sort); + return; + } + if (bp->bio_cmd == BIO_READ) { + off = bp->bio_offset; + nsec = bp->bio_length /= sc->sectorsize; + op = bp->bio_data; + while (nsec) { + dsp = g_simdisk_findsector(sc, off, 0); + if (dsp == NULL) { + dsp = g_simdisk_findsector(sc, off, 1); + ot = lseek(sc->fd, off, SEEK_SET); + if (ot != off) { + bp->bio_error = EIO; + g_io_deliver(bp); + return; + } + i = read(sc->fd, dsp->data, sc->sectorsize); + if (i < 0) { + bp->bio_error = errno; + g_io_deliver(bp); + return; + } + if (i == 0) + memset(dsp->data, 0, sc->sectorsize); + } + memcpy(op, dsp->data, sc->sectorsize); + bp->bio_completed += sc->sectorsize; + off += sc->sectorsize; + op += sc->sectorsize; + nsec--; + } + g_io_deliver(bp); + return; + } + if (bp->bio_cmd == BIO_GETATTR) { + if (g_haveattr_int(bp, "GEOM::sectorsize", sc->sectorsize)) + return; + if (g_haveattr_int(bp, "GEOM::fwsectors", sc->fwsectors)) + return; + if (g_haveattr_int(bp, "GEOM::fwheads", sc->fwheads)) + return; + if (g_haveattr_int(bp, "GEOM::fwcylinders", sc->fwcylinders)) + return; + if (g_haveattr_off_t(bp, "GEOM::mediasize", sc->mediasize)) + return; + } + bp->bio_error = EOPNOTSUPP; + g_io_deliver(bp); +} + +void +g_simdisk_init(void) +{ + g_add_method(&g_simdisk_method); +} + +struct g_geom * +g_simdisk_create(char *name, struct simdisk_softc *sc) +{ + struct g_geom *gp; + struct g_provider *pp; + static int unit; + + printf("g_simdisk_create(\"%s\", %p)\n", name, sc); + g_topology_lock(); + gp = g_new_geomf(&g_simdisk_method, "%s", name); + gp->start = g_simdisk_start; + gp->softc = sc; + + pp = g_new_providerf(gp, "%s", name); + g_error_provider(pp, 0); + unit++; + g_topology_unlock(); + return (gp); +} + +struct g_geom * +g_simdisk_new(char *name, char *path) +{ + struct simdisk_softc *sc; + + sc = calloc(1, sizeof *sc); + + sc->fd = open(path, O_RDONLY); + if (sc->fd < 0) + err(1, path); + sc->sectorsize = 512; + LIST_INIT(&sc->sectors); + TAILQ_INIT(&sc->sort); + return (g_simdisk_create(name, sc)); +} + +void +g_simdisk_destroy(char *name) +{ + struct g_geom *gp; + + LIST_FOREACH(gp, &g_simdisk_method.geom, geom) { + if (strcmp(name, gp->name)) + continue; + gp->flags |= G_GEOM_WITHER; + g_orphan_provider(LIST_FIRST(&gp->provider), ENXIO); + return; + } +} + +struct sector * +g_simdisk_findsector(struct simdisk_softc *sc, off_t off, int create) +{ + struct sector *dsp; + + LIST_FOREACH(dsp, &sc->sectors, sectors) { + if (dsp->offset < off) + continue; + if (dsp->offset == off) + return (dsp); + break; + } + if (!create) + return (NULL); + printf("Creating sector at offset %lld (%u)\n", + off, (unsigned)(off / sc->sectorsize)); + dsp = calloc(1, sizeof *dsp + sc->sectorsize); + dsp->data = (u_char *)(dsp + 1); + dsp->offset = off; + g_simdisk_insertsector(sc, dsp); + return (dsp); +} + +void +g_simdisk_insertsector(struct simdisk_softc *sc, struct sector *dsp) +{ + struct sector *dsp2, *dsp3; + + if (LIST_EMPTY(&sc->sectors)) { + LIST_INSERT_HEAD(&sc->sectors, dsp, sectors); + return; + } + dsp3 = NULL; + LIST_FOREACH(dsp2, &sc->sectors, sectors) { + dsp3 = dsp2; + if (dsp2->offset > dsp->offset) { + LIST_INSERT_BEFORE(dsp2, dsp, sectors); + return; + } + } + LIST_INSERT_AFTER(dsp3, dsp, sectors); +} + +void +g_simdisk_stop(char *name) +{ + struct g_geom *gp; + struct simdisk_softc *sc; + + g_trace(G_T_TOPOLOGY, "g_simdisk_stop(%s)", name); + LIST_FOREACH(gp, &g_simdisk_method.geom, geom) { + if (strcmp(name, gp->name)) + continue; + sc = gp->softc; + sc->stop = 1; + return; + } +} + +void +g_simdisk_restart(char *name) +{ + struct g_geom *gp; + struct simdisk_softc *sc; + struct bio *bp; + + g_trace(G_T_TOPOLOGY, "g_simdisk_restart(%s)", name); + LIST_FOREACH(gp, &g_simdisk_method.geom, geom) { + if (strcmp(name, gp->name)) + continue; + sc = gp->softc; + sc->stop = 0; + bp = TAILQ_FIRST(&sc->sort); + while (bp != NULL) { + TAILQ_REMOVE(&sc->sort, bp, bio_sort); + g_simdisk_start(bp); + bp = TAILQ_FIRST(&sc->sort); + } + return; + } +} diff --git a/tools/regression/geom/geom_simdisk.h b/tools/regression/geom/geom_simdisk.h new file mode 100644 index 0000000..b997b95 --- /dev/null +++ b/tools/regression/geom/geom_simdisk.h @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +struct sector { + LIST_ENTRY(sector) sectors; + off_t offset; + unsigned char *data; +}; + +struct simdisk_softc { + int fd; + int sectorsize; + off_t mediasize; + LIST_HEAD(,sector) sectors; + struct sbuf *sbuf; + struct sector *sp; + int stop; + u_int fwsectors; + u_int fwheads; + u_int fwcylinders; + TAILQ_HEAD(,bio) sort; +}; + +extern struct g_method g_simdisk_method; + +struct sector * g_simdisk_findsector(struct simdisk_softc *sc, off_t off, int create); +struct g_geom *g_simdisk_create(char *name, struct simdisk_softc *sc); + +void g_simdisk_insertsector(struct simdisk_softc *sc, struct sector *dsp); diff --git a/tools/regression/geom/geom_simdisk_xml.c b/tools/regression/geom/geom_simdisk_xml.c new file mode 100644 index 0000000..3037fdf --- /dev/null +++ b/tools/regression/geom/geom_simdisk_xml.c @@ -0,0 +1,239 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <fcntl.h> +#include <strings.h> +#include <err.h> +#include <md5.h> +#include <sys/errno.h> +#include <geom/geom.h> +#include <string.h> +#include <ctype.h> +#include "xmlparse.h" +#include <sys/stat.h> +#include <sys/mman.h> +#include <sys/queue.h> +#include <sys/sbuf.h> + +#include "geom_simdisk.h" + +void +g_simdisk_xml_save(char *name, char *file) +{ + struct g_geom *gp; + struct simdisk_softc *sc; + struct sector *dsp; + int i, j; + FILE *f; + u_char *p; + + LIST_FOREACH(gp, &g_simdisk_method.geom, geom) { + if (strcmp(name, gp->name)) + continue; + sc = gp->softc; + f = fopen(file, "w"); + if (f == NULL) + err(1, file); + fprintf(f, "<?xml version=\"1.0\"?>\n"); + fprintf(f, "<DISKIMAGE>\n"); +#if 0 + { + struct sbuf *sb; + sb = g_conf_specific(&g_simdisk_method, gp, NULL, NULL); + fprintf(f, " <config>%s</config>\n", sbuf_data(sb)); + } +#endif + fprintf(f, " <sectorsize>%u</sectorsize>\n", sc->sectorsize); + fprintf(f, " <mediasize>%llu</mediasize>\n", sc->mediasize); + fprintf(f, " <fwsectors>%u</fwsectors>\n", sc->fwsectors); + fprintf(f, " <fwheads>%u</fwheads>\n", sc->fwheads); + fprintf(f, " <fwcylinders>%u</fwcylinders>\n", sc->fwcylinders); + LIST_FOREACH(dsp, &sc->sectors, sectors) { + fprintf(f, " <sector>\n"); + fprintf(f, " <offset>%llu</offset>\n", dsp->offset); + fprintf(f, " <hexdata>\n"); + p = dsp->data; + for (j = 0 ; j < sc->sectorsize; j += 32) { + fprintf(f, "\t"); + for (i = 0; i < 32; i++) + fprintf(f, "%02x", *p++); + fprintf(f, "\n"); + } + fprintf(f, " </hexdata>\n"); + fprintf(f, " </sector>\n"); + } + fprintf(f, "</DISKIMAGE>\n"); + fclose(f); + } +} + +static void +startElement(void *userData, const char *name, const char **atts __unused) +{ + struct simdisk_softc *sc; + + sc = userData; + if (!strcasecmp(name, "sector")) { + sc->sp = calloc(1, sizeof(*sc->sp) + sc->sectorsize); + sc->sp->data = (u_char *)(sc->sp + 1); + } + sbuf_clear(sc->sbuf); +} + +static void +endElement(void *userData, const char *name) +{ + struct simdisk_softc *sc; + char *p; + u_char *q; + int i, j; + + sc = userData; + + if (!strcasecmp(name, "comment")) { + sbuf_clear(sc->sbuf); + return; + } + sbuf_finish(sc->sbuf); + if (!strcasecmp(name, "sectorsize")) { + sc->sectorsize = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on sectorsize"); + } else if (!strcasecmp(name, "mediasize")) { + sc->mediasize = strtoull(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on mediasize"); + } else if (!strcasecmp(name, "fwsectors")) { + sc->fwsectors = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on fwsectors"); + } else if (!strcasecmp(name, "fwheads")) { + sc->fwheads = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on fwheads"); + } else if (!strcasecmp(name, "fwcylinders")) { + sc->fwcylinders = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on fwcylinders"); + } else if (!strcasecmp(name, "offset")) { + sc->sp->offset= strtoull(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on offset"); + } else if (!strcasecmp(name, "fill")) { + j = strtoul(sbuf_data(sc->sbuf), NULL, 16); + memset(sc->sp->data, j, sc->sectorsize); + } else if (!strcasecmp(name, "hexdata")) { + q = sc->sp->data; + p = sbuf_data(sc->sbuf); + for (i = 0; i < sc->sectorsize; i++) { + if (!isxdigit(*p)) + errx(1, "I croaked on hexdata %d:(%02x)", i, *p); + if (isdigit(*p)) + j = (*p - '0') << 4; + else + j = (tolower(*p) - 'a' + 10) << 4; + p++; + if (!isxdigit(*p)) + errx(1, "I croaked on hexdata %d:(%02x)", i, *p); + if (isdigit(*p)) + j |= *p - '0'; + else + j |= tolower(*p) - 'a' + 10; + p++; + *q++ = j; + } + } else if (!strcasecmp(name, "sector")) { + g_simdisk_insertsector(sc, sc->sp); + sc->sp = NULL; + } else if (!strcasecmp(name, "diskimage")) { + } else { + printf("<%s>[[%s]]\n", name, sbuf_data(sc->sbuf)); + } + sbuf_clear(sc->sbuf); +} + +static void +characterData(void *userData, const XML_Char *s, int len) +{ + const char *b, *e; + struct simdisk_softc *sc; + + sc = userData; + b = s; + e = s + len - 1; + while (isspace(*b) && b < e) + b++; + while (isspace(*e) && e > b) + e--; + if (e != b || !isspace(*b)) + sbuf_bcat(sc->sbuf, b, e - b + 1); +} + +struct g_geom * +g_simdisk_xml_load(char *name, char *file) +{ + XML_Parser parser = XML_ParserCreate(NULL); + struct stat st; + char *p; + struct simdisk_softc *sc; + int fd, i; + + sc = calloc(1, sizeof *sc); + sc->fd = -1; + sc->sbuf = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + LIST_INIT(&sc->sectors); + TAILQ_INIT(&sc->sort); + XML_SetUserData(parser, sc); + XML_SetElementHandler(parser, startElement, endElement); + XML_SetCharacterDataHandler(parser, characterData); + + fd = open(file, O_RDONLY); + if (fd < 0) + err(1, file); + fstat(fd, &st); + p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); + i = XML_Parse(parser, p, st.st_size, 1); + if (i != 1) + errx(1, "XML_Parse complains: return %d", i); + munmap(p, st.st_size); + close(fd); + XML_ParserFree(parser); + return (g_simdisk_create(name, sc)); +} |