Remove the "run GEOM in userland harness" test stuff, it's been OBE.

This commit is contained in:
Poul-Henning Kamp 2003-04-13 09:11:47 +00:00
parent 22de4dc100
commit a9198bad37
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113434
60 changed files with 0 additions and 5805 deletions

View File

@ -1,25 +0,0 @@
# $FreeBSD$
LIB= G
SRCS= geom.c \
geom_aes.c geom_apple.c geom_bsd.c geom_simdev.c geom_dump.c \
geom_event.c \
geom_io.c \
geom_kernsim.c geom_mbr.c geom_simdisk.c geom_enc.c \
geom_simdisk_xml.c geom_slice.c geom_subr.c subr_sbuf.c \
geom_sunlabel.c geom_pc98.c
CFLAGS += -gstabs -static
CFLAGS += -I/usr/src/sys -I..
CFLAGS += -DKERNELSIM
NOPIC = static
NOPROFILE = bingo
NOOBJ = youbet
WARNS = 5
.PATH: /sys/geom .. /sys/kern
.include <bsd.lib.mk>
test:

View File

@ -1,19 +0,0 @@
# $FreeBSD$
SUBDIR+= ConfCmp GLib Test
.include <bsd.subdir.mk>
test: all _SUBDIR
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"

View File

@ -1,12 +0,0 @@
# $FreeBSD$
SUBDIR+= T000 T001 T002 T003 T004 T005 T006 T007 T008 T009
SUBDIR+= T011 T012 T013 T014 T015
# SUBDIR+= T999
.include <bsd.subdir.mk>
test: _SUBDIR
mkref: _SUBDIR

View File

@ -1,37 +0,0 @@
# $FreeBSD$
PROG = testprg
NOMAN = no
NOOBJ = youbet
CFLAGS += -gstabs -static
CFLAGS += -I/usr/src/sys -I../..
CFLAGS += -DKERNELSIM -pthread
LDADD += -L../../GLib -lG
LDADD += -lbsdxml
LDADD += -lmd
DPADD += ../../GLib/libG.a
CLEANFILES += _* *.core
WARNS= 5
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

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,18 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x806c100">
<name>DEV-class</name>
</class>
<class id="0x806c0e0">
<name>MBREXT</name>
</class>
<class id="0x806c0c0">
<name>MBR</name>
</class>
<class id="0x806c120">
<name>BSD</name>
</class>
<class id="0x806c020">
<name>SIMDISK-class</name>
</class>
</mesh>

View File

@ -1,66 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,409 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087380">
<name>DEV-class</name>
<geom id="0x80bde00">
<class ref="0x8087380"/>
<name>ad0s3d</name>
<rank>4</rank>
<consumer id="0x80b9c00">
<geom ref="0x80bde00"/>
<provider ref="0x80bd280"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bdc80">
<class ref="0x8087380"/>
<name>ad0s3c</name>
<rank>4</rank>
<consumer id="0x80b9bc0">
<geom ref="0x80bdc80"/>
<provider ref="0x80bd200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bdb00">
<class ref="0x8087380"/>
<name>ad0s3a</name>
<rank>4</rank>
<consumer id="0x80b9a80">
<geom ref="0x80bdb00"/>
<provider ref="0x80bd180"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd980">
<class ref="0x8087380"/>
<name>ad0s2c</name>
<rank>4</rank>
<consumer id="0x80b9940">
<geom ref="0x80bd980"/>
<provider ref="0x80b8e80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd800">
<class ref="0x8087380"/>
<name>ad0s1f</name>
<rank>4</rank>
<consumer id="0x80b9900">
<geom ref="0x80bd800"/>
<provider ref="0x80b8b80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd680">
<class ref="0x8087380"/>
<name>ad0s1e</name>
<rank>4</rank>
<consumer id="0x80b98c0">
<geom ref="0x80bd680"/>
<provider ref="0x80b8b00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd500">
<class ref="0x8087380"/>
<name>ad0s1c</name>
<rank>4</rank>
<consumer id="0x80b9880">
<geom ref="0x80bd500"/>
<provider ref="0x80b8a80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd380">
<class ref="0x8087380"/>
<name>ad0s1b</name>
<rank>4</rank>
<consumer id="0x80b9840">
<geom ref="0x80bd380"/>
<provider ref="0x80b8a00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd300">
<class ref="0x8087380"/>
<name>ad0s1a</name>
<rank>4</rank>
<consumer id="0x80b96c0">
<geom ref="0x80bd300"/>
<provider ref="0x80b8980"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8f00">
<class ref="0x8087380"/>
<name>ad0s3</name>
<rank>3</rank>
<consumer id="0x80b9680">
<geom ref="0x80b8f00"/>
<provider ref="0x80b8600"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8c00">
<class ref="0x8087380"/>
<name>ad0s2</name>
<rank>3</rank>
<consumer id="0x80b9640">
<geom ref="0x80b8c00"/>
<provider ref="0x80b8580"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8680">
<class ref="0x8087380"/>
<name>ad0s1</name>
<rank>3</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8680"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8280">
<class ref="0x8087380"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087360">
<name>MBREXT</name>
</class>
<class id="0x8087340">
<name>MBR</name>
<geom id="0x80b8300">
<class ref="0x8087340"/>
<name>ad0</name>
<rank>2</rank>
<config>
<frontstuff>0</frontstuff>
</config>
<consumer id="0x80b9600">
<geom ref="0x80b8300"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8600">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s3</name>
<mediasize>8585256960</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>8585256960</length>
<seclength>16768080</seclength>
<offset>8585256960</offset>
<secoffset>16768080</secoffset>
<type>165</type>
</config>
</provider>
<provider id="0x80b8580">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s2</name>
<mediasize>5364817920</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>5364817920</length>
<seclength>10478160</seclength>
<offset>3220439040</offset>
<secoffset>6289920</secoffset>
<type>165</type>
</config>
</provider>
<provider id="0x80b8500">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s1</name>
<mediasize>3220406784</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>3220406784</length>
<seclength>6289857</seclength>
<offset>32256</offset>
<secoffset>63</secoffset>
<type>165</type>
</config>
</provider>
</geom>
</class>
<class id="0x80873a0">
<name>BSD</name>
<geom id="0x80b8f80">
<class ref="0x80873a0"/>
<name>ad0s3</name>
<rank>3</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>512</labeloffset>
<rawoffset>16768080</rawoffset>
<mbroffset>8585256960</mbroffset>
</config>
<consumer id="0x80b9b80">
<geom ref="0x80b8f80"/>
<provider ref="0x80b8600"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80bd280">
<geom ref="0x80b8f80"/>
<mode>r0w0e0</mode>
<name>ad0s3d</name>
<mediasize>6488104960</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>3</index>
<length>6488104960</length>
<seclength>12672080</seclength>
<offset>2097152000</offset>
<secoffset>4096000</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80bd200">
<geom ref="0x80b8f80"/>
<mode>r0w0e0</mode>
<name>ad0s3c</name>
<mediasize>8585256960</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>8585256960</length>
<seclength>16768080</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
<provider id="0x80bd180">
<geom ref="0x80b8f80"/>
<mode>r0w0e0</mode>
<name>ad0s3a</name>
<mediasize>2097152000</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>2097152000</length>
<seclength>4096000</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>7</type>
</config>
</provider>
</geom>
<geom id="0x80b8c80">
<class ref="0x80873a0"/>
<name>ad0s2</name>
<rank>3</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>512</labeloffset>
<rawoffset>6289920</rawoffset>
<mbroffset>3220439040</mbroffset>
</config>
<consumer id="0x80b9a40">
<geom ref="0x80b8c80"/>
<provider ref="0x80b8580"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8e80">
<geom ref="0x80b8c80"/>
<mode>r0w0e0</mode>
<name>ad0s2c</name>
<mediasize>5364817920</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>5364817920</length>
<seclength>10478160</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
</geom>
<geom id="0x80b8700">
<class ref="0x80873a0"/>
<name>ad0s1</name>
<rank>3</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>512</labeloffset>
<rawoffset>63</rawoffset>
<mbroffset>32256</mbroffset>
</config>
<consumer id="0x80b9800">
<geom ref="0x80b8700"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8b80">
<geom ref="0x80b8700"/>
<mode>r0w0e0</mode>
<name>ad0s1f</name>
<mediasize>2066973184</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>5</index>
<length>2066973184</length>
<seclength>4037057</seclength>
<offset>1153433600</offset>
<secoffset>2252800</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8b00">
<geom ref="0x80b8700"/>
<mode>r0w0e0</mode>
<name>ad0s1e</name>
<mediasize>524288000</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>4</index>
<length>524288000</length>
<seclength>1024000</seclength>
<offset>629145600</offset>
<secoffset>1228800</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8a80">
<geom ref="0x80b8700"/>
<mode>r0w0e0</mode>
<name>ad0s1c</name>
<mediasize>3220406784</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>3220406784</length>
<seclength>6289857</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
<provider id="0x80b8a00">
<geom ref="0x80b8700"/>
<mode>r0w0e0</mode>
<name>ad0s1b</name>
<mediasize>524288000</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>524288000</length>
<seclength>1024000</seclength>
<offset>104857600</offset>
<secoffset>204800</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8980">
<geom ref="0x80b8700"/>
<mode>r0w0e0</mode>
<name>ad0s1a</name>
<mediasize>104857600</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>104857600</length>
<seclength>204800</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>7</type>
</config>
</provider>
</geom>
</class>
<class id="0x80872a0">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x80872a0"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,69 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,105 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087380">
<name>DEV-class</name>
<geom id="0x80b8680">
<class ref="0x8087380"/>
<name>ad0s2</name>
<rank>3</rank>
<consumer id="0x80b9640">
<geom ref="0x80b8680"/>
<provider ref="0x80b8580"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8600">
<class ref="0x8087380"/>
<name>ad0s1</name>
<rank>3</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8600"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8280">
<class ref="0x8087380"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087360">
<name>MBREXT</name>
</class>
<class id="0x8087340">
<name>MBR</name>
<geom id="0x80b8300">
<class ref="0x8087340"/>
<name>ad0</name>
<rank>2</rank>
<config>
<frontstuff>0</frontstuff>
</config>
<consumer id="0x80b9600">
<geom ref="0x80b8300"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8580">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s2</name>
<mediasize>4564740096</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>4564740096</length>
<seclength>8915508</seclength>
<offset>296884224</offset>
<secoffset>579852</secoffset>
<type>11</type>
</config>
</provider>
<provider id="0x80b8500">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s1</name>
<mediasize>296821760</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>296821760</length>
<seclength>579730</seclength>
<offset>32256</offset>
<secoffset>63</secoffset>
<type>160</type>
</config>
</provider>
</geom>
</class>
<class id="0x80873a0">
<name>BSD</name>
</class>
<class id="0x80872a0">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x80872a0"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,69 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,695 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087380">
<name>DEV-class</name>
<geom id="0x80cc680">
<class ref="0x8087380"/>
<name>ad0s27</name>
<rank>4</rank>
<consumer id="0x80b9d80">
<geom ref="0x80cc680"/>
<provider ref="0x80bc500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80cc500">
<class ref="0x8087380"/>
<name>ad0s26</name>
<rank>4</rank>
<consumer id="0x80b9d40">
<geom ref="0x80cc500"/>
<provider ref="0x80bc480"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80cc380">
<class ref="0x8087380"/>
<name>ad0s25</name>
<rank>4</rank>
<consumer id="0x80b9d00">
<geom ref="0x80cc380"/>
<provider ref="0x80bc400"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80cc200">
<class ref="0x8087380"/>
<name>ad0s24</name>
<rank>4</rank>
<consumer id="0x80b9cc0">
<geom ref="0x80cc200"/>
<provider ref="0x80bc380"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80cc080">
<class ref="0x8087380"/>
<name>ad0s23</name>
<rank>4</rank>
<consumer id="0x80b9c80">
<geom ref="0x80cc080"/>
<provider ref="0x80bc300"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0f00">
<class ref="0x8087380"/>
<name>ad0s22</name>
<rank>4</rank>
<consumer id="0x80b9c40">
<geom ref="0x80c0f00"/>
<provider ref="0x80bc280"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0d80">
<class ref="0x8087380"/>
<name>ad0s21</name>
<rank>4</rank>
<consumer id="0x80b9c00">
<geom ref="0x80c0d80"/>
<provider ref="0x80bc200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0c00">
<class ref="0x8087380"/>
<name>ad0s20</name>
<rank>4</rank>
<consumer id="0x80b9bc0">
<geom ref="0x80c0c00"/>
<provider ref="0x80bc180"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0a80">
<class ref="0x8087380"/>
<name>ad0s19</name>
<rank>4</rank>
<consumer id="0x80b9b80">
<geom ref="0x80c0a80"/>
<provider ref="0x80bc100"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0900">
<class ref="0x8087380"/>
<name>ad0s18</name>
<rank>4</rank>
<consumer id="0x80b9b40">
<geom ref="0x80c0900"/>
<provider ref="0x80bc080"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0780">
<class ref="0x8087380"/>
<name>ad0s17</name>
<rank>4</rank>
<consumer id="0x80b9b00">
<geom ref="0x80c0780"/>
<provider ref="0x80bc000"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0600">
<class ref="0x8087380"/>
<name>ad0s16</name>
<rank>4</rank>
<consumer id="0x80b9ac0">
<geom ref="0x80c0600"/>
<provider ref="0x80b8f80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0480">
<class ref="0x8087380"/>
<name>ad0s15</name>
<rank>4</rank>
<consumer id="0x80b9a80">
<geom ref="0x80c0480"/>
<provider ref="0x80b8f00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0300">
<class ref="0x8087380"/>
<name>ad0s14</name>
<rank>4</rank>
<consumer id="0x80b9a40">
<geom ref="0x80c0300"/>
<provider ref="0x80b8e80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0180">
<class ref="0x8087380"/>
<name>ad0s13</name>
<rank>4</rank>
<consumer id="0x80b9a00">
<geom ref="0x80c0180"/>
<provider ref="0x80b8e00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c0000">
<class ref="0x8087380"/>
<name>ad0s12</name>
<rank>4</rank>
<consumer id="0x80b99c0">
<geom ref="0x80c0000"/>
<provider ref="0x80b8d80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bce80">
<class ref="0x8087380"/>
<name>ad0s11</name>
<rank>4</rank>
<consumer id="0x80b9980">
<geom ref="0x80bce80"/>
<provider ref="0x80b8d00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bcd00">
<class ref="0x8087380"/>
<name>ad0s10</name>
<rank>4</rank>
<consumer id="0x80b9940">
<geom ref="0x80bcd00"/>
<provider ref="0x80b8c80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bcb80">
<class ref="0x8087380"/>
<name>ad0s9</name>
<rank>4</rank>
<consumer id="0x80b9900">
<geom ref="0x80bcb80"/>
<provider ref="0x80b8c00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bca00">
<class ref="0x8087380"/>
<name>ad0s8</name>
<rank>4</rank>
<consumer id="0x80b98c0">
<geom ref="0x80bca00"/>
<provider ref="0x80b8b80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bc880">
<class ref="0x8087380"/>
<name>ad0s7</name>
<rank>4</rank>
<consumer id="0x80b9880">
<geom ref="0x80bc880"/>
<provider ref="0x80b8b00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bc700">
<class ref="0x8087380"/>
<name>ad0s6</name>
<rank>4</rank>
<consumer id="0x80b9840">
<geom ref="0x80bc700"/>
<provider ref="0x80b8a80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bc580">
<class ref="0x8087380"/>
<name>ad0s5</name>
<rank>4</rank>
<consumer id="0x80b9680">
<geom ref="0x80bc580"/>
<provider ref="0x80b8a00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8680">
<class ref="0x8087380"/>
<name>ad0s2</name>
<rank>3</rank>
<consumer id="0x80b9640">
<geom ref="0x80b8680"/>
<provider ref="0x80b8580"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8600">
<class ref="0x8087380"/>
<name>ad0s1</name>
<rank>3</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8600"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8280">
<class ref="0x8087380"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087360">
<name>MBREXT</name>
<geom id="0x80b8880">
<class ref="0x8087360"/>
<name>ad0s2</name>
<rank>3</rank>
<config>
<frontstuff>0</frontstuff>
</config>
<consumer id="0x80b9800">
<geom ref="0x80b8880"/>
<provider ref="0x80b8580"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80bc500">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s27</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>22</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>180988416</offset>
<secoffset>353493</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc480">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s26</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>21</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>172763136</offset>
<secoffset>337428</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc400">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s25</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>20</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>164537856</offset>
<secoffset>321363</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc380">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s24</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>19</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>156312576</offset>
<secoffset>305298</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc300">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s23</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>18</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>148087296</offset>
<secoffset>289233</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc280">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s22</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>17</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>139862016</offset>
<secoffset>273168</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc200">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s21</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>16</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>131636736</offset>
<secoffset>257103</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc180">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s20</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>15</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>123411456</offset>
<secoffset>241038</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc100">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s19</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>14</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>115186176</offset>
<secoffset>224973</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc080">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s18</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>13</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>106960896</offset>
<secoffset>208908</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80bc000">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s17</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>12</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>98735616</offset>
<secoffset>192843</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8f80">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s16</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>11</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>90510336</offset>
<secoffset>176778</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8f00">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s15</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>10</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>82285056</offset>
<secoffset>160713</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8e80">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s14</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>9</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>74059776</offset>
<secoffset>144648</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8e00">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s13</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>8</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>65834496</offset>
<secoffset>128583</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8d80">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s12</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>7</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>57609216</offset>
<secoffset>112518</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8d00">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s11</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>6</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>49383936</offset>
<secoffset>96453</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8c80">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s10</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>5</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>41158656</offset>
<secoffset>80388</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8c00">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s9</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>4</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>32933376</offset>
<secoffset>64323</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8b80">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s8</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>3</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>24708096</offset>
<secoffset>48258</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8b00">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s7</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>16482816</offset>
<secoffset>32193</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8a80">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s6</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>8257536</offset>
<secoffset>16128</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8a00">
<geom ref="0x80b8880"/>
<mode>r0w0e0</mode>
<name>ad0s5</name>
<mediasize>8193024</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>8193024</length>
<seclength>16002</seclength>
<offset>32256</offset>
<secoffset>63</secoffset>
<type>1</type>
</config>
</provider>
</geom>
</class>
<class id="0x8087340">
<name>MBR</name>
<geom id="0x80b8300">
<class ref="0x8087340"/>
<name>ad0</name>
<rank>2</rank>
<config>
<frontstuff>0</frontstuff>
</config>
<consumer id="0x80b9600">
<geom ref="0x80b8300"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8580">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s2</name>
<mediasize>427714560</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>427714560</length>
<seclength>835380</seclength>
<offset>2146798080</offset>
<secoffset>4192965</secoffset>
<type>5</type>
</config>
</provider>
<provider id="0x80b8500">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s1</name>
<mediasize>2146765824</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>2146765824</length>
<seclength>4192902</seclength>
<offset>32256</offset>
<secoffset>63</secoffset>
<type>6</type>
</config>
</provider>
</geom>
</class>
<class id="0x80873a0">
<name>BSD</name>
</class>
<class id="0x80872a0">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x80872a0"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,69 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,298 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x80873c0">
<name>DEV-class</name>
<geom id="0x80bd600">
<class ref="0x80873c0"/>
<name>ad0s1h</name>
<rank>4</rank>
<consumer id="0x80b9940">
<geom ref="0x80bd600"/>
<provider ref="0x80b8c00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd480">
<class ref="0x80873c0"/>
<name>ad0s1g</name>
<rank>4</rank>
<consumer id="0x80b9900">
<geom ref="0x80bd480"/>
<provider ref="0x80b8b80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd300">
<class ref="0x80873c0"/>
<name>ad0s1f</name>
<rank>4</rank>
<consumer id="0x80b98c0">
<geom ref="0x80bd300"/>
<provider ref="0x80b8b00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd180">
<class ref="0x80873c0"/>
<name>ad0s1e</name>
<rank>4</rank>
<consumer id="0x80b9880">
<geom ref="0x80bd180"/>
<provider ref="0x80b8a80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bd000">
<class ref="0x80873c0"/>
<name>ad0s1d</name>
<rank>4</rank>
<consumer id="0x80b9840">
<geom ref="0x80bd000"/>
<provider ref="0x80b8a00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8e80">
<class ref="0x80873c0"/>
<name>ad0s1c</name>
<rank>4</rank>
<consumer id="0x80b9800">
<geom ref="0x80b8e80"/>
<provider ref="0x80b8980"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8d00">
<class ref="0x80873c0"/>
<name>ad0s1b</name>
<rank>4</rank>
<consumer id="0x80b97c0">
<geom ref="0x80b8d00"/>
<provider ref="0x80b8900"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8c80">
<class ref="0x80873c0"/>
<name>ad0s1a</name>
<rank>4</rank>
<consumer id="0x80b9640">
<geom ref="0x80b8c80"/>
<provider ref="0x80b8880"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8580">
<class ref="0x80873c0"/>
<name>ad0s1</name>
<rank>3</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8580"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8280">
<class ref="0x80873c0"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x80873a0">
<name>MBREXT</name>
</class>
<class id="0x8087380">
<name>MBR</name>
<geom id="0x80b8300">
<class ref="0x8087380"/>
<name>ad0</name>
<rank>2</rank>
<config>
<frontstuff>0</frontstuff>
</config>
<consumer id="0x80b9600">
<geom ref="0x80b8300"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8500">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0s1</name>
<mediasize>20003848704</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>20003848704</length>
<seclength>39070017</seclength>
<offset>32256</offset>
<secoffset>63</secoffset>
<type>165</type>
</config>
</provider>
</geom>
</class>
<class id="0x80873e0">
<name>BSD</name>
<geom id="0x80b8600">
<class ref="0x80873e0"/>
<name>ad0s1</name>
<rank>3</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>512</labeloffset>
<rawoffset>63</rawoffset>
<mbroffset>32256</mbroffset>
</config>
<consumer id="0x80b9780">
<geom ref="0x80b8600"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8c00">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1h</name>
<mediasize>5368709120</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>7</index>
<length>5368709120</length>
<seclength>10485760</seclength>
<offset>10187964416</offset>
<secoffset>19898368</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8b80">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1g</name>
<mediasize>3221225472</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>6</index>
<length>3221225472</length>
<seclength>6291456</seclength>
<offset>6966738944</offset>
<secoffset>13606912</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8b00">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1f</name>
<mediasize>4294967296</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>5</index>
<length>4294967296</length>
<seclength>8388608</seclength>
<offset>2671771648</offset>
<secoffset>5218304</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8a80">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1e</name>
<mediasize>524288000</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>4</index>
<length>524288000</length>
<seclength>1024000</seclength>
<offset>2147483648</offset>
<secoffset>4194304</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8a00">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1d</name>
<mediasize>4447175168</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>3</index>
<length>4447175168</length>
<seclength>8685889</seclength>
<offset>15556673536</offset>
<secoffset>30384128</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8980">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1c</name>
<mediasize>20003848704</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>20003848704</length>
<seclength>39070017</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
<provider id="0x80b8900">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1b</name>
<mediasize>1073741824</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>1073741824</length>
<seclength>2097152</seclength>
<offset>1073741824</offset>
<secoffset>2097152</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8880">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>ad0s1a</name>
<mediasize>1073741824</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>1073741824</length>
<seclength>2097152</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>7</type>
</config>
</provider>
</geom>
</class>
<class id="0x80872e0">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x80872e0"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,69 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,133 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087380">
<name>DEV-class</name>
<geom id="0x80b8880">
<class ref="0x8087380"/>
<name>ad0c</name>
<rank>3</rank>
<consumer id="0x80b96c0">
<geom ref="0x80b8880"/>
<provider ref="0x80b8600"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8700">
<class ref="0x8087380"/>
<name>ad0b</name>
<rank>3</rank>
<consumer id="0x80b9680">
<geom ref="0x80b8700"/>
<provider ref="0x80b8580"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8680">
<class ref="0x8087380"/>
<name>ad0a</name>
<rank>3</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8680"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8280">
<class ref="0x8087380"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087360">
<name>MBREXT</name>
</class>
<class id="0x8087340">
<name>MBR</name>
</class>
<class id="0x80873a0">
<name>BSD</name>
<geom id="0x80b8300">
<class ref="0x80873a0"/>
<name>ad0</name>
<rank>2</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>512</labeloffset>
<rawoffset>0</rawoffset>
<mbroffset>0</mbroffset>
</config>
<consumer id="0x80b9640">
<geom ref="0x80b8300"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8600">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0c</name>
<mediasize>1474560</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>1474560</length>
<seclength>2880</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8580">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0b</name>
<mediasize>1474560</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>1474560</length>
<seclength>2880</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
<provider id="0x80b8500">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>ad0a</name>
<mediasize>1474560</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>1474560</length>
<seclength>2880</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
</geom>
</class>
<class id="0x80872a0">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x80872a0"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,69 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,40 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087380">
<name>DEV-class</name>
<geom id="0x80b8280">
<class ref="0x8087380"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087360">
<name>MBREXT</name>
</class>
<class id="0x8087340">
<name>MBR</name>
</class>
<class id="0x80873a0">
<name>BSD</name>
</class>
<class id="0x80872a0">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x80872a0"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,69 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,18 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x80873a0">
<name>DEV-class</name>
</class>
<class id="0x8087380">
<name>MBREXT</name>
</class>
<class id="0x8087360">
<name>MBR</name>
</class>
<class id="0x80873c0">
<name>BSD</name>
</class>
<class id="0x80872c0">
<name>SIMDISK-class</name>
</class>
</mesh>

View File

@ -1,73 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,18 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x80873e0">
<name>DEV-class</name>
</class>
<class id="0x80873c0">
<name>MBREXT</name>
</class>
<class id="0x80873a0">
<name>MBR</name>
</class>
<class id="0x8087400">
<name>BSD</name>
</class>
<class id="0x8087300">
<name>SIMDISK-class</name>
</class>
</mesh>

View File

@ -1,75 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,18 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087100">
<name>DEV-class</name>
</class>
<class id="0x80870e0">
<name>MBREXT</name>
</class>
<class id="0x80870c0">
<name>MBR</name>
</class>
<class id="0x8087120">
<name>BSD</name>
</class>
<class id="0x8087020">
<name>SIMDISK-class</name>
</class>
</mesh>

View File

@ -1,89 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,38 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8072460">
<name>DEV-class</name>
<geom id="0x80bb180">
<class ref="0x8072460"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b8040">
<geom ref="0x80bb180"/>
<provider ref="0x80bb100"/>
<mode>r1w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8072440">
<name>MBREXT</name>
</class>
<class id="0x8072420">
<name>MBR</name>
</class>
<class id="0x8072480">
<name>BSD</name>
</class>
<class id="0x8072380">
<name>SIMDISK-class</name>
<geom id="0x80bb080">
<class ref="0x8072380"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80bb100">
<geom ref="0x80bb080"/>
<mode>r1w0e0</mode>
<name>ad0</name>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,78 +0,0 @@
/*-
* 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 *
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-class", cp->provider, NULL);
g_topology_unlock();
printf("gp = %p\n", gp);
rattle();
conff("1");
sdumpf("2");
printf("Done\n");
done();
return (0);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,40 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087400">
<name>DEV-class</name>
<geom id="0x80b8300">
<class ref="0x8087400"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8300"/>
<provider ref="0x80b8280"/>
<mode>r1w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x80873e0">
<name>MBREXT</name>
</class>
<class id="0x80873c0">
<name>MBR</name>
</class>
<class id="0x8087420">
<name>BSD</name>
</class>
<class id="0x8087320">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x8087320"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8280">
<geom ref="0x80b8180"/>
<mode>r1w0e0</mode>
<name>ad0</name>
<mediasize>1474560</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,78 +0,0 @@
/*-
* 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 *
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-class", cp);
g_topology_unlock();
printf("gp = %p\n", gp);
rattle();
conff("1");
sdumpf("2");
printf("Done\n");
done();
return (0);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,359 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087020">
<name>SUN</name>
<geom id="0x80b8e80">
<class ref="0x8087020"/>
<name>ad0</name>
<rank>2</rank>
<config>
<frontstuff>8192</frontstuff>
</config>
<consumer id="0x80b9a40">
<geom ref="0x80b8e80"/>
<provider ref="0x80b8e00"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80c2200">
<geom ref="0x80b8e80"/>
<mode>r0w0e0</mode>
<name>ad0h</name>
<mediasize>1343787008</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>7</index>
<length>1343787008</length>
<seclength>2624584</seclength>
<offset>5638115328</offset>
<secoffset>11011944</secoffset>
</config>
</provider>
<provider id="0x80c2180">
<geom ref="0x80b8e80"/>
<mode>r0w0e0</mode>
<name>ad0g</name>
<mediasize>2149576704</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>6</index>
<length>2149576704</length>
<seclength>4198392</seclength>
<offset>3488538624</offset>
<secoffset>6813552</secoffset>
</config>
</provider>
<provider id="0x80c2100">
<geom ref="0x80b8e80"/>
<mode>r0w0e0</mode>
<name>ad0f</name>
<mediasize>2149576704</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>5</index>
<length>2149576704</length>
<seclength>4198392</seclength>
<offset>1338961920</offset>
<secoffset>2615160</secoffset>
</config>
</provider>
<provider id="0x80c2080">
<geom ref="0x80b8e80"/>
<mode>r0w0e0</mode>
<name>ad0d</name>
<mediasize>11124240384</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>3</index>
<length>11124240384</length>
<seclength>21727032</seclength>
<offset>6981902336</offset>
<secoffset>13636528</secoffset>
</config>
</provider>
<provider id="0x80c2000">
<geom ref="0x80b8e80"/>
<mode>r0w0e0</mode>
<name>ad0c</name>
<mediasize>18108555264</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>18108555264</length>
<seclength>35368272</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
</config>
</provider>
<provider id="0x80b8f80">
<geom ref="0x80b8e80"/>
<mode>r0w0e0</mode>
<name>ad0b</name>
<mediasize>1075994624</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>1075994624</length>
<seclength>2101552</seclength>
<offset>262967296</offset>
<secoffset>513608</secoffset>
</config>
</provider>
<provider id="0x80b8f00">
<geom ref="0x80b8e80"/>
<mode>r0w0e0</mode>
<name>ad0a</name>
<mediasize>262967296</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>262967296</length>
<seclength>513608</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
</config>
</provider>
</geom>
<geom id="0x80b8280">
<class ref="0x8087020"/>
<name>ad0</name>
<rank>2</rank>
<config>
<frontstuff>8192</frontstuff>
</config>
<consumer id="0x80b95c0">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8500">
<geom ref="0x80b8280"/>
<mode>r0w0e0</mode>
<name>ad0h</name>
<mediasize>34629267456</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>7</index>
<length>34629267456</length>
<seclength>67635288</seclength>
<offset>2069028864</offset>
<secoffset>4041072</secoffset>
</config>
</provider>
<provider id="0x80b8480">
<geom ref="0x80b8280"/>
<mode>r0w0e0</mode>
<name>ad0c</name>
<mediasize>36698296320</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>36698296320</length>
<seclength>71676360</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
</config>
</provider>
<provider id="0x80b8400">
<geom ref="0x80b8280"/>
<mode>r0w0e0</mode>
<name>ad0b</name>
<mediasize>539320320</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>539320320</length>
<seclength>1053360</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
</config>
</provider>
<provider id="0x80b8380">
<geom ref="0x80b8280"/>
<mode>r0w0e0</mode>
<name>ad0a</name>
<mediasize>1529708544</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>1529708544</length>
<seclength>2987712</seclength>
<offset>539320320</offset>
<secoffset>1053360</secoffset>
</config>
</provider>
</geom>
</class>
<class id="0x8087120">
<name>DEV-class</name>
<geom id="0x80c2c00">
<class ref="0x8087120"/>
<name>ad0h</name>
<rank>3</rank>
<consumer id="0x80b9bc0">
<geom ref="0x80c2c00"/>
<provider ref="0x80c2200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c2a80">
<class ref="0x8087120"/>
<name>ad0g</name>
<rank>3</rank>
<consumer id="0x80b9b80">
<geom ref="0x80c2a80"/>
<provider ref="0x80c2180"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c2900">
<class ref="0x8087120"/>
<name>ad0f</name>
<rank>3</rank>
<consumer id="0x80b9b40">
<geom ref="0x80c2900"/>
<provider ref="0x80c2100"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c2780">
<class ref="0x8087120"/>
<name>ad0d</name>
<rank>3</rank>
<consumer id="0x80b9b00">
<geom ref="0x80c2780"/>
<provider ref="0x80c2080"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c2600">
<class ref="0x8087120"/>
<name>ad0c</name>
<rank>3</rank>
<consumer id="0x80b9ac0">
<geom ref="0x80c2600"/>
<provider ref="0x80c2000"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c2480">
<class ref="0x8087120"/>
<name>ad0b</name>
<rank>3</rank>
<consumer id="0x80b9a80">
<geom ref="0x80c2480"/>
<provider ref="0x80b8f80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c2300">
<class ref="0x8087120"/>
<name>ad0a</name>
<rank>3</rank>
<consumer id="0x80b99c0">
<geom ref="0x80c2300"/>
<provider ref="0x80b8f00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c2280">
<class ref="0x8087120"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9c40">
<geom ref="0x80c2280"/>
<provider ref="0x80b8e00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8b00">
<class ref="0x8087120"/>
<name>ad0h</name>
<rank>3</rank>
<consumer id="0x80b9680">
<geom ref="0x80b8b00"/>
<provider ref="0x80b8500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8980">
<class ref="0x8087120"/>
<name>ad0c</name>
<rank>3</rank>
<consumer id="0x80b9640">
<geom ref="0x80b8980"/>
<provider ref="0x80b8480"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8780">
<class ref="0x8087120"/>
<name>ad0b</name>
<rank>3</rank>
<consumer id="0x80b9600">
<geom ref="0x80b8780"/>
<provider ref="0x80b8400"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8600">
<class ref="0x8087120"/>
<name>ad0a</name>
<rank>3</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8600"/>
<provider ref="0x80b8380"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8580">
<class ref="0x8087120"/>
<name>ad0</name>
<rank>2</rank>
<consumer id="0x80b9700">
<geom ref="0x80b8580"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087100">
<name>MBREXT</name>
</class>
<class id="0x80870e0">
<name>MBR</name>
</class>
<class id="0x8087140">
<name>BSD</name>
</class>
<class id="0x8087040">
<name>SIMDISK-class</name>
<geom id="0x80b8c80">
<class ref="0x8087040"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8e00">
<geom ref="0x80b8c80"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
<geom id="0x80b8180">
<class ref="0x8087040"/>
<name>ad0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>ad0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,73 +0,0 @@
/*-
* 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 *
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);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,413 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087420">
<name>DEV-class</name>
<geom id="0x80c1e80">
<class ref="0x8087420"/>
<name>da2c</name>
<rank>3</rank>
<consumer id="0x80b9b40">
<geom ref="0x80c1e80"/>
<provider ref="0x80c1000"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1d00">
<class ref="0x8087420"/>
<name>da2b</name>
<rank>3</rank>
<consumer id="0x80b9b00">
<geom ref="0x80c1d00"/>
<provider ref="0x80b8f80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1b80">
<class ref="0x8087420"/>
<name>da2a</name>
<rank>3</rank>
<consumer id="0x80b9a00">
<geom ref="0x80c1b80"/>
<provider ref="0x80b8f00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1a00">
<class ref="0x8087420"/>
<name>da1f</name>
<rank>3</rank>
<consumer id="0x80b99c0">
<geom ref="0x80c1a00"/>
<provider ref="0x80b8c80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1880">
<class ref="0x8087420"/>
<name>da1e</name>
<rank>3</rank>
<consumer id="0x80b9980">
<geom ref="0x80c1880"/>
<provider ref="0x80b8c00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1700">
<class ref="0x8087420"/>
<name>da1c</name>
<rank>3</rank>
<consumer id="0x80b9940">
<geom ref="0x80c1700"/>
<provider ref="0x80b8b80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1580">
<class ref="0x8087420"/>
<name>da1b</name>
<rank>3</rank>
<consumer id="0x80b9900">
<geom ref="0x80c1580"/>
<provider ref="0x80b8b00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1400">
<class ref="0x8087420"/>
<name>da1a</name>
<rank>3</rank>
<consumer id="0x80b9800">
<geom ref="0x80c1400"/>
<provider ref="0x80b8a80"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1280">
<class ref="0x8087420"/>
<name>da0c</name>
<rank>3</rank>
<consumer id="0x80b97c0">
<geom ref="0x80c1280"/>
<provider ref="0x80b8800"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1100">
<class ref="0x8087420"/>
<name>da0b</name>
<rank>3</rank>
<consumer id="0x80b9780">
<geom ref="0x80c1100"/>
<provider ref="0x80b8780"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80c1080">
<class ref="0x8087420"/>
<name>da0a</name>
<rank>3</rank>
<consumer id="0x80b9640">
<geom ref="0x80c1080"/>
<provider ref="0x80b8700"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8d00">
<class ref="0x8087420"/>
<name>da2</name>
<rank>2</rank>
<consumer id="0x80b95c0">
<geom ref="0x80b8d00"/>
<provider ref="0x80b8400"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8880">
<class ref="0x8087420"/>
<name>da1</name>
<rank>2</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8880"/>
<provider ref="0x80b8300"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8480">
<class ref="0x8087420"/>
<name>da0</name>
<rank>2</rank>
<consumer id="0x80b9680">
<geom ref="0x80b8480"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087400">
<name>MBREXT</name>
</class>
<class id="0x80873e0">
<name>MBR</name>
</class>
<class id="0x8087440">
<name>BSD</name>
<geom id="0x80b8d80">
<class ref="0x8087440"/>
<name>da2</name>
<rank>2</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>64</labeloffset>
<rawoffset>0</rawoffset>
<mbroffset>0</mbroffset>
</config>
<consumer id="0x80b9ac0">
<geom ref="0x80b8d80"/>
<provider ref="0x80b8400"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80c1000">
<geom ref="0x80b8d80"/>
<mode>r0w0e0</mode>
<name>da2c</name>
<mediasize>74027520</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>74027520</length>
<seclength>144585</seclength>
<offset>4211343360</offset>
<secoffset>8225280</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8f80">
<geom ref="0x80b8d80"/>
<mode>r0w0e0</mode>
<name>da2b</name>
<mediasize>4178442240</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>4178442240</length>
<seclength>8161020</seclength>
<offset>32901120</offset>
<secoffset>64260</secoffset>
<type>8</type>
</config>
</provider>
<provider id="0x80b8f00">
<geom ref="0x80b8d80"/>
<mode>r0w0e0</mode>
<name>da2a</name>
<mediasize>24675840</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>24675840</length>
<seclength>48195</seclength>
<offset>8225280</offset>
<secoffset>16065</secoffset>
<type>8</type>
</config>
</provider>
</geom>
<geom id="0x80b8900">
<class ref="0x8087440"/>
<name>da1</name>
<rank>2</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>64</labeloffset>
<rawoffset>0</rawoffset>
<mbroffset>0</mbroffset>
</config>
<consumer id="0x80b98c0">
<geom ref="0x80b8900"/>
<provider ref="0x80b8300"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8c80">
<geom ref="0x80b8900"/>
<mode>r0w0e0</mode>
<name>da1f</name>
<mediasize>16951073792</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>5</index>
<length>16951073792</length>
<seclength>33107566</seclength>
<offset>1358921728</offset>
<secoffset>2654144</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8c00">
<geom ref="0x80b8900"/>
<mode>r0w0e0</mode>
<name>da1e</name>
<mediasize>20971520</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>4</index>
<length>20971520</length>
<seclength>40960</seclength>
<offset>1337950208</offset>
<secoffset>2613184</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8b80">
<geom ref="0x80b8900"/>
<mode>r0w0e0</mode>
<name>da1c</name>
<mediasize>18309995520</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>18309995520</length>
<seclength>35761710</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
<provider id="0x80b8b00">
<geom ref="0x80b8900"/>
<mode>r0w0e0</mode>
<name>da1b</name>
<mediasize>1086291968</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>1086291968</length>
<seclength>2121664</seclength>
<offset>251658240</offset>
<secoffset>491520</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8a80">
<geom ref="0x80b8900"/>
<mode>r0w0e0</mode>
<name>da1a</name>
<mediasize>251658240</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>251658240</length>
<seclength>491520</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>7</type>
</config>
</provider>
</geom>
<geom id="0x80b8500">
<class ref="0x8087440"/>
<name>da0</name>
<rank>2</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>64</labeloffset>
<rawoffset>0</rawoffset>
<mbroffset>0</mbroffset>
</config>
<consumer id="0x80b9740">
<geom ref="0x80b8500"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8800">
<geom ref="0x80b8500"/>
<mode>r0w0e0</mode>
<name>da0c</name>
<mediasize>4335206400</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>4335206400</length>
<seclength>8467200</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
<provider id="0x80b8780">
<geom ref="0x80b8500"/>
<mode>r0w0e0</mode>
<name>da0b</name>
<mediasize>270925824</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>270925824</length>
<seclength>529152</seclength>
<offset>4064280576</offset>
<secoffset>7938048</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8700">
<geom ref="0x80b8500"/>
<mode>r0w0e0</mode>
<name>da0a</name>
<mediasize>4064280576</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>4064280576</length>
<seclength>7938048</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>7</type>
</config>
</provider>
</geom>
</class>
<class id="0x8087340">
<name>SIMDISK-class</name>
<geom id="0x80b8380">
<class ref="0x8087340"/>
<name>da2</name>
<rank>1</rank>
<provider id="0x80b8400">
<geom ref="0x80b8380"/>
<mode>r0w0e0</mode>
<name>da2</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
<geom id="0x80b8280">
<class ref="0x8087340"/>
<name>da1</name>
<rank>1</rank>
<provider id="0x80b8300">
<geom ref="0x80b8280"/>
<mode>r0w0e0</mode>
<name>da1</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
<geom id="0x80b8180">
<class ref="0x8087340"/>
<name>da0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>da0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,71 +0,0 @@
/*-
* 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 *
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("da0", "../../Data/disk.beast.da0.xml");
g_simdisk_xml_load("da1", "../../Data/disk.alpha.da0.xml");
g_simdisk_xml_load("da2", "../../Data/disk.alpha2.da0.xml");
rattle();
conff("1");
printf("Done\n");
done();
return (0);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,230 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087140">
<name>DEV-class</name>
<geom id="0x80b8f80">
<class ref="0x8087140"/>
<name>wd0s1f</name>
<rank>4</rank>
<consumer id="0x80b9900">
<geom ref="0x80b8f80"/>
<provider ref="0x80b8a00"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8e00">
<class ref="0x8087140"/>
<name>wd0s1e</name>
<rank>4</rank>
<consumer id="0x80b98c0">
<geom ref="0x80b8e00"/>
<provider ref="0x80b8980"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8c80">
<class ref="0x8087140"/>
<name>wd0s1c</name>
<rank>4</rank>
<consumer id="0x80b9880">
<geom ref="0x80b8c80"/>
<provider ref="0x80b8900"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8b00">
<class ref="0x8087140"/>
<name>wd0s1b</name>
<rank>4</rank>
<consumer id="0x80b9840">
<geom ref="0x80b8b00"/>
<provider ref="0x80b8880"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8a80">
<class ref="0x8087140"/>
<name>wd0s1a</name>
<rank>4</rank>
<consumer id="0x80b9640">
<geom ref="0x80b8a80"/>
<provider ref="0x80b8800"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8480">
<class ref="0x8087140"/>
<name>wd0s1</name>
<rank>3</rank>
<consumer id="0x80b9540">
<geom ref="0x80b8480"/>
<provider ref="0x80b8400"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80b8280">
<class ref="0x8087140"/>
<name>wd0</name>
<rank>2</rank>
<consumer id="0x80b9580">
<geom ref="0x80b8280"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087020">
<name>PC98</name>
<geom id="0x80b8300">
<class ref="0x8087020"/>
<name>wd0</name>
<rank>2</rank>
<config>
<frontstuff>8704</frontstuff>
</config>
<consumer id="0x80b9600">
<geom ref="0x80b8300"/>
<provider ref="0x80b8200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8400">
<geom ref="0x80b8300"/>
<mode>r0w0e0</mode>
<name>wd0s1</name>
<mediasize>1626603520</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>1626603520</length>
<seclength>3176960</seclength>
<offset>69632</offset>
<secoffset>136</secoffset>
<type>50324</type>
<sname>FreeBSD</sname>
</config>
</provider>
</geom>
</class>
<class id="0x8087040">
<name>SUN</name>
</class>
<class id="0x8087120">
<name>MBREXT</name>
</class>
<class id="0x8087100">
<name>MBR</name>
</class>
<class id="0x8087160">
<name>BSD</name>
<geom id="0x80b8600">
<class ref="0x8087160"/>
<name>wd0s1</name>
<rank>3</rank>
<config>
<frontstuff>8192</frontstuff>
<labeloffset>512</labeloffset>
<rawoffset>136</rawoffset>
<mbroffset>69632</mbroffset>
</config>
<consumer id="0x80b9800">
<geom ref="0x80b8600"/>
<provider ref="0x80b8400"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80b8a00">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>wd0s1f</name>
<mediasize>1390673920</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>5</index>
<length>1390673920</length>
<seclength>2716160</seclength>
<offset>235929600</offset>
<secoffset>460800</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8980">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>wd0s1e</name>
<mediasize>52428800</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>4</index>
<length>52428800</length>
<seclength>102400</seclength>
<offset>183500800</offset>
<secoffset>358400</secoffset>
<type>7</type>
</config>
</provider>
<provider id="0x80b8900">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>wd0s1c</name>
<mediasize>1626603520</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>1626603520</length>
<seclength>3176960</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>0</type>
</config>
</provider>
<provider id="0x80b8880">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>wd0s1b</name>
<mediasize>104857600</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>104857600</length>
<seclength>204800</seclength>
<offset>78643200</offset>
<secoffset>153600</secoffset>
<type>1</type>
</config>
</provider>
<provider id="0x80b8800">
<geom ref="0x80b8600"/>
<mode>r0w0e0</mode>
<name>wd0s1a</name>
<mediasize>78643200</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>78643200</length>
<seclength>153600</seclength>
<offset>0</offset>
<secoffset>0</secoffset>
<type>7</type>
</config>
</provider>
</geom>
</class>
<class id="0x8087060">
<name>SIMDISK-class</name>
<geom id="0x80b8180">
<class ref="0x8087060"/>
<name>wd0</name>
<rank>1</rank>
<provider id="0x80b8200">
<geom ref="0x80b8180"/>
<mode>r0w0e0</mode>
<name>wd0</name>
<mediasize>1099511627776</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,72 +0,0 @@
/*-
* 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 *
thread_sim(void *ptr __unused)
{
rattle();
g_simdisk_init();
g_bsd_init();
g_mbr_init();
g_mbrext_init();
g_sunlabel_init();
g_pc98_init();
g_dev_init(NULL);
rattle();
g_simdisk_xml_load("wd0", "../../Data/disk.pc98.wdc0.xml");
rattle();
conff("1");
sdumpf("2");
printf("Done\n");
done();
return (0);
}

View File

@ -1,2 +0,0 @@
# $FreeBSD$
.include <bsd.prog.mk>

View File

@ -1,121 +0,0 @@
<mesh>
<FreeBSD>$FreeBSD$</FreeBSD>
<class id="0x8087020">
<name>DEV-class</name>
<geom id="0x80bb680">
<class ref="0x8087020"/>
<name>da0p2</name>
<rank>3</rank>
<consumer id="0x80bc640">
<geom ref="0x80bb680"/>
<provider ref="0x80bb500"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bb600">
<class ref="0x8087020"/>
<name>da0p1</name>
<rank>3</rank>
<consumer id="0x80bc600">
<geom ref="0x80bb600"/>
<provider ref="0x80bb480"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bb580">
<class ref="0x8087020"/>
<name>da0p0</name>
<rank>3</rank>
<consumer id="0x80bc500">
<geom ref="0x80bb580"/>
<provider ref="0x80bb400"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
<geom id="0x80bb280">
<class ref="0x8087020"/>
<name>da0</name>
<rank>2</rank>
<consumer id="0x80bc540">
<geom ref="0x80bb280"/>
<provider ref="0x80bb200"/>
<mode>r0w0e0</mode>
</consumer>
</geom>
</class>
<class id="0x8087040">
<name>APPLE</name>
<geom id="0x80bb300">
<class ref="0x8087040"/>
<name>da0</name>
<rank>2</rank>
<config>
<frontstuff>8192</frontstuff>
</config>
<consumer id="0x80bc5c0">
<geom ref="0x80bb300"/>
<provider ref="0x80bb200"/>
<mode>r0w0e0</mode>
<config>
</config>
</consumer>
<provider id="0x80bb500">
<geom ref="0x80bb300"/>
<mode>r0w0e0</mode>
<name>da0p2</name>
<mediasize>16384</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>2</index>
<length>16384</length>
<seclength>32</seclength>
<offset>32768</offset>
<secoffset>64</secoffset>
</config>
</provider>
<provider id="0x80bb480">
<geom ref="0x80bb300"/>
<mode>r0w0e0</mode>
<name>da0p1</name>
<mediasize>32256</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>1</index>
<length>32256</length>
<seclength>63</seclength>
<offset>512</offset>
<secoffset>1</secoffset>
</config>
</provider>
<provider id="0x80bb400">
<geom ref="0x80bb300"/>
<mode>r0w0e0</mode>
<name>da0p0</name>
<mediasize>366481408</mediasize>
<sectorsize>512</sectorsize>
<config>
<index>0</index>
<length>366481408</length>
<seclength>715784</seclength>
<offset>49152</offset>
<secoffset>96</secoffset>
</config>
</provider>
</geom>
</class>
<class id="0x8087000">
<name>SIMDISK-class</name>
<geom id="0x80bb180">
<class ref="0x8087000"/>
<name>da0</name>
<rank>1</rank>
<provider id="0x80bb200">
<geom ref="0x80bb180"/>
<mode>r0w0e0</mode>
<name>da0</name>
<mediasize>366530560</mediasize>
<sectorsize>512</sectorsize>
</provider>
</geom>
</class>
</mesh>

View File

@ -1,67 +0,0 @@
/*-
* 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 *
thread_sim(void *ptr __unused)
{
rattle();
g_simdisk_init();
g_apple_init();
g_dev_init(NULL);
rattle();
g_simdisk_xml_load("da0", "../../Data/disk.apple.xml");
rattle();
conff("1");
printf("Done\n");
done();
return (0);
}

View File

@ -1,196 +0,0 @@
/*-
* 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>
#include <geom/geom_int.h>
void
conff(const 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 = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_clear(sb);
g_confxml(sb);
fputs(sbuf_data(sb), f);
fclose(f);
free(s);
}
static void *
thread_up(void *ptr)
{
struct thread *tp = ptr;
int error;
printf("Running %s\n", tp->name);
error = pthread_cond_init(&ptc_up, NULL);
if (error)
err(1, "pthread_cond_init(ptc_up)");
error = pthread_mutex_init(&ptm_up, NULL);
if (error)
err(1, "pthread_mutex_init(ptm_up)");
error = pthread_mutex_lock(&ptm_up);
if (error)
err(1, "pthread_mutex_init(ptm_up)");
for (;;) {
g_io_schedule_up(tp);
error = pthread_cond_wait(&ptc_up, &ptm_up);
}
}
static void *
thread_down(void *ptr)
{
struct thread *tp = ptr;
int error;
printf("Running %s\n", tp->name);
error = pthread_cond_init(&ptc_down, NULL);
if (error)
err(1, "pthread_cond_init(ptc_down)");
error = pthread_mutex_init(&ptm_down, NULL);
if (error)
err(1, "pthread_mutex_init(ptm_down)");
error = pthread_mutex_lock(&ptm_down);
if (error)
err(1, "pthread_mutex_init(ptm_down)");
for (;;) {
g_io_schedule_down(tp);
error = pthread_cond_wait(&ptc_down, &ptm_down);
}
}
static void *
thread_event(void *ptr)
{
struct thread *tp = ptr;
int error;
printf("Running %s\n", tp->name);
error = pthread_cond_init(&ptc_event, NULL);
if (error)
err(1, "pthread_cond_init(ptc_event)");
error = pthread_mutex_init(&ptm_event, NULL);
if (error)
err(1, "pthread_mutex_init(ptm_event)");
error = pthread_mutex_lock(&ptm_event);
if (error)
err(1, "pthread_mutex_init(ptm_event)");
for (;;) {
g_run_events();
error = pthread_cond_wait(&ptc_event, &ptm_event);
}
}
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_class = %d\n", sizeof(struct g_class));
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(const 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 = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_clear(sb);
g_confdot(sb);
fprintf(f, "%s", sbuf_data(sb));
fclose(f);
free(s);
asprintf(&s, "dot -Tps _%s.dot > _%s.ps", file, file);
system(s);
free(s);
}

View File

@ -1,288 +0,0 @@
/*-
* 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 <geom/geom_int.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <machine/atomic.h>
#include <pthread.h>
#define NTHREAD 30
static struct thread thr[NTHREAD];
static int weredone;
int g_debugflags;
int bootverbose = 1;
void
done(void)
{
rattle();
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);
}
void
biodone(struct bio *bp)
{
bp->bio_flags |= BIO_DONE;
if (bp->bio_done != NULL)
bp->bio_done(bp);
}
int
biowait(struct bio *bp, const char *wchan __unused)
{
while ((bp->bio_flags & BIO_DONE) == 0)
usleep(10000);
if (!(bp->bio_flags & BIO_ERROR))
return (0);
if (bp->bio_error)
return (bp->bio_error);
return (EIO);
}
void
wakeup(void *chan)
{
if (chan == &g_wait_event)
pthread_cond_signal(&ptc_event);
else if (chan == &g_wait_up)
pthread_cond_signal(&ptc_up);
else if (chan == &g_wait_down)
pthread_cond_signal(&ptc_down);
else
return;
}
int hz;
int
tsleep(void *chan __unused, int pri __unused, const char *wmesg __unused, int timo)
{
usleep(timo);
return (0);
}
void
rattle()
{
int i;
pthread_yield();
for (;;) {
i = pthread_mutex_trylock(&ptm_up);
if (i != EBUSY) {
i = pthread_mutex_trylock(&ptm_down);
if (i != EBUSY) {
i = pthread_mutex_trylock(&ptm_event);
if (i != EBUSY)
break;
pthread_mutex_unlock(&ptm_down);
}
pthread_mutex_unlock(&ptm_up);
}
usleep(100000);
}
pthread_mutex_unlock(&ptm_event);
pthread_mutex_unlock(&ptm_down);
pthread_mutex_unlock(&ptm_up);
return;
}
void
new_thread(void *(*func)(void *arg), const char *name)
{
struct thread *tp;
static int nextt;
int error;
tp = thr + nextt++;
error = pthread_create(&tp->tid, NULL, func, tp);
if (error)
err(1, "pthread_create(%s)", name);
tp->name = strdup(name);
printf("New Thread %d %s %p %d\n", tp - thr, name, tp, tp->pid);
}
#define FASCIST 0
void *
g_malloc(int size, int flags)
{
void *p;
#if FASCIST
p = malloc(4096);
printf("Malloc %p \n", p);
#else
p = malloc(size);
#endif
if (flags & M_ZERO)
memset(p, 0, size);
else
memset(p, 0xd0, size);
return (p);
}
void
g_free(void *ptr)
{
secrethandshake();
#if FASCIST
printf("Free %p \n", ptr);
munmap(ptr, 4096);
#else
free(ptr);
#endif
}
static pthread_mutex_t pt_topology;
void
g_init(void)
{
pthread_mutex_init(&pt_topology, NULL);
g_io_init();
g_event_init();
}
void
g_topology_lock()
{
pthread_mutex_lock(&pt_topology);
}
void
g_topology_unlock()
{
pthread_mutex_unlock(&pt_topology);
}
void
g_topology_assert()
{
#if 0
if (topology_lock == getpid())
return;
KASSERT(1 == 0, ("Lacking topology_lock"));
#endif
}
void
mtx_init(struct mtx *mp, const char *bla __unused, const char *yak __unused, int foo __unused)
{
pthread_mutex_init((pthread_mutex_t *)&mp->mtx_object, NULL);
}
void
mtx_destroy(struct mtx *mp)
{
pthread_mutex_destroy((pthread_mutex_t *)&mp->mtx_object);
}
void
mtx_lock(struct mtx *mp)
{
pthread_mutex_lock((pthread_mutex_t *)&mp->mtx_object);
}
void
mtx_unlock(struct mtx *mp)
{
pthread_mutex_unlock((pthread_mutex_t *)&mp->mtx_object);
}
struct mtx Giant;

View File

@ -1,185 +0,0 @@
/*-
* 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);
}

View File

@ -1,176 +0,0 @@
/*-
* 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 <pthread.h>
pthread_cond_t ptc_up, ptc_down, ptc_event;
pthread_mutex_t ptm_up, ptm_down, ptm_event;
#define CTASSERT(foo)
#define DROP_GIANT()
#define PICKUP_GIANT()
#define EDIRIOCTL -6
#define copyin(foo, bar, barf) 0
/* bio.h */
struct bio {
enum {
BIO_INVALID = 0,
BIO_READ = 1,
BIO_WRITE = 2,
BIO_DELETE = 4,
BIO_GETATTR = 8,
BIO_SETATTR = 16
} 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;
const char *bio_attribute; /* BIO_GETATTR/BIO_SETATTR */
int bio_error;
u_int bio_children; /* Number of spawned bios */
struct bio *bio_linkage;
int bio_flags;
#define BIO_DONE 0x1
#define BIO_ERROR 0x2
};
void biodone(struct bio *bp);
int biowait(struct bio *bp, const char *wchan);
/* geom_dev.c */
void g_dev_init(void *junk);
struct g_consumer *g_dev_opendev(const char *name, int w, int r, int e);
int g_dev_request(const char *name, struct bio *bp);
/* geom_kernsim.c */
struct thread {
char *name;
pthread_t tid;
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(void *(*func)(void *arg), const 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_NOWAIT 1
#define M_ZERO 2
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 *, const char *, const 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(const char *);
struct g_geom *g_simdisk_new(const char *, const char *);
struct g_geom * g_simdisk_xml_load(const char *name, const char *file);
void g_simdisk_xml_save(const char *name, const char *file);
void g_simdisk_stop(const char *name);
void g_simdisk_restart(const char *name);
#define DECLARE_GEOM_CLASS(class, name) \
void name##_init(void); \
void \
name##_init(void) \
{ \
g_add_class(&class); \
}
void g_aes_init(void);
void g_apple_init(void);
void g_bsd_init(void);
void g_mbr_init(void);
void g_mbrext_init(void);
void g_sunlabel_init(void);
void g_pc98_init(void);
void *thread_sim(void *ptr);
void dumpf(const char *file);
void conff(const char *file);
void sdumpf(const char *file);
#define THR_MAIN 0
#define THR_UP 1
#define THR_DOWN 2
#define THR_EVENT 3
#define EJUSTRETURN (-2)

View File

@ -1,159 +0,0 @@
/*-
* 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 g_orphan_t g_dev_orphan;
static struct g_geom *
dev_taste(struct g_class *mp, struct g_provider *pp, 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->class == mp) {
g_topology_unlock();
return (NULL);
}
}
gp = g_new_geomf(mp, pp->name);
gp->orphan = g_dev_orphan;
cp = g_new_consumer(gp);
g_attach(cp, pp);
return (gp);
}
static void
g_dev_orphan(struct g_consumer *cp)
{
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_detach(cp);
g_destroy_consumer(cp);
g_destroy_geom(gp);
}
static struct g_class dev_class = {
"DEV-class",
dev_taste,
NULL,
G_CLASS_INITIALIZER
};
static struct g_geom *
g_dev_findg(const char *name)
{
struct g_geom *gp;
LIST_FOREACH(gp, &dev_class.geom, geom)
if (!strcmp(gp->name, name))
break;
return (gp);
}
void
g_dev_init(void *junk __unused)
{
g_add_class(&dev_class);
}
struct g_consumer *
g_dev_opendev(const 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);
g_topology_unlock();
}
int
g_dev_request(const 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);
}

View File

@ -1,259 +0,0 @@
/*-
* 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 <string.h>
#include <err.h>
#include <sys/errno.h>
#include <sys/stat.h>
#include <geom/geom.h>
#include "geom_simdisk.h"
struct g_class g_simdisk_class = {
"SIMDISK-class",
NULL,
NULL,
G_CLASS_INITIALIZER
};
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) {
g_io_deliver(bp, EIO);
return;
}
i = read(sc->fd, dsp->data, sc->sectorsize);
if (i < 0) {
g_io_deliver(bp, errno);
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, 0);
return;
}
if (bp->bio_cmd == BIO_GETATTR) {
if (g_handleattr_int(bp, "GEOM::fwsectors", sc->fwsectors))
return;
if (g_handleattr_int(bp, "GEOM::fwheads", sc->fwheads))
return;
if (g_handleattr_int(bp, "GEOM::fwcylinders", sc->fwcylinders))
return;
}
g_io_deliver(bp, EOPNOTSUPP);
}
void
g_simdisk_init(void)
{
g_add_class(&g_simdisk_class);
}
struct g_geom *
g_simdisk_create(const 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_class, "%s", name);
gp->start = g_simdisk_start;
gp->softc = sc;
gp->access = g_std_access;
pp = g_new_providerf(gp, "%s", name);
pp->mediasize = sc->mediasize;
pp->sectorsize = sc->sectorsize;
g_error_provider(pp, 0);
unit++;
g_topology_unlock();
return (gp);
}
struct g_geom *
g_simdisk_new(const char *name, const char *path)
{
struct simdisk_softc *sc;
struct stat st;
sc = calloc(1, sizeof *sc);
sc->fd = open(path, O_RDONLY);
if (sc->fd < 0)
err(1, path);
fstat(sc->fd, &st);
sc->mediasize = st.st_size;
sc->sectorsize = 512;
LIST_INIT(&sc->sectors);
TAILQ_INIT(&sc->sort);
return (g_simdisk_create(name, sc));
}
void
g_simdisk_destroy(const char *name)
{
struct g_geom *gp;
LIST_FOREACH(gp, &g_simdisk_class.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(const 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_class.geom, geom) {
if (strcmp(name, gp->name))
continue;
sc = gp->softc;
sc->stop = 1;
return;
}
}
void
g_simdisk_restart(const 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_class.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;
}
}

View File

@ -1,64 +0,0 @@
/*-
* 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;
off_t lastsector;
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_class g_simdisk_class;
struct sector * g_simdisk_findsector(struct simdisk_softc *sc, off_t off, int create);
struct g_geom *g_simdisk_create(const char *name, struct simdisk_softc *sc);
void g_simdisk_insertsector(struct simdisk_softc *sc, struct sector *dsp);

View File

@ -1,244 +0,0 @@
/*-
* 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 <bsdxml.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(const char *name, const 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_class.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_class, 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;
off_t o;
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")) {
o = strtoull(sbuf_data(sc->sbuf), &p, 0);
if (*p != '\0')
errx(1, "strtoul croaked on mediasize");
if (o > 0)
sc->mediasize = o;
} 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 if (!strcasecmp(name, "FreeBSD")) {
} 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(const char *name, const 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);
sc->mediasize = 1024 * 1024 * 1024 * (off_t)1024;
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));
}