diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile
index de96e1329b2f..a103d6fc329c 100644
--- a/stand/i386/loader/Makefile
+++ b/stand/i386/loader/Makefile
@@ -83,6 +83,10 @@ LDFLAGS+=	-Wl,-z,nostart-stop-gc
 LIBI386=	${BOOTOBJ}/i386/libi386/libi386.a
 CFLAGS+=	-I${BOOTSRC}/i386
 
+# USB support library
+LIBUSBBOOT=	${BOOTOBJ}/usb/libusbboot.a
+CFLAGS+=	-I${BOOTSRC}/usb
+
 # Debug me!
 #CFLAGS+=	-g
 #LDFLAGS+=	-g
@@ -122,8 +126,8 @@ FILESMODE_${LOADER}= ${BINMODE} -b
 # files.
 LDFLAGS+=	${BTXCRT}
 
-DPADD=	${LDR_INTERP32} ${LIBI386} ${LIBSA32}
-LDADD=	${LDR_INTERP32} ${LIBI386} ${LIBSA32}
+DPADD=	${LDR_INTERP32} ${LIBI386} ${LIBSA32} ${LIBUSBBOOT}
+LDADD=	${LDR_INTERP32} ${LIBI386} ${LIBSA32} ${LIBUSBBOOT}
 
 .if ${MACHINE_CPUARCH} == "amd64"
 CFLAGS+=	-DLOADER_PREFER_AMD64
diff --git a/stand/i386/loader/conf.c b/stand/i386/loader/conf.c
index 329bcd577fbe..6a2bfed93356 100644
--- a/stand/i386/loader/conf.c
+++ b/stand/i386/loader/conf.c
@@ -31,6 +31,7 @@
 #if defined(LOADER_ZFS_SUPPORT)
 #include "libzfs.h"
 #endif
+#include "storage/umass_common.h"
 
 /*
  * We could use linker sets for some or all of these, but
@@ -57,6 +58,7 @@ struct devsw *devsw[] = {
 #if defined(LOADER_ZFS_SUPPORT)
     &zfs_dev,
 #endif
+    &umass_disk,
     NULL
 };
 
diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c
index ac552d86603f..efc6d54a7748 100644
--- a/stand/kshim/bsd_kernel.c
+++ b/stand/kshim/bsd_kernel.c
@@ -1335,9 +1335,7 @@ static driver_t pci_driver = {
 	.methods = pci_methods,
 };
 
-static devclass_t pci_devclass;
-
-DRIVER_MODULE(pci, pci, pci_driver, pci_devclass, 0, 0);
+DRIVER_MODULE(pci, pci, pci_driver, 0, 0);
 
 static const char *usb_pci_devices[] = {
 	USB_PCI_PROBE_LIST
diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h
index 0608d32f21ec..40b6689b13d1 100644
--- a/stand/kshim/bsd_kernel.h
+++ b/stand/kshim/bsd_kernel.h
@@ -37,6 +37,8 @@
 #include <sys/queue.h>
 #include <sys/errno.h>
 
+#define MPASS(...)
+
 #define	offsetof(type, field) __builtin_offsetof(type, field)
 #define	howmany(x, y)	(((x)+((y)-1))/(y))
 #define	nitems(x)	(sizeof((x)) / sizeof((x)[0]))
@@ -87,11 +89,12 @@ struct sysctl_req {
 #define	MOD_UNLOAD 2
 #define	DEVMETHOD(what,func) { #what, (void *)&func }
 #define	DEVMETHOD_END {0,0}
-#define	EARLY_DRIVER_MODULE(a, b, c, d, e, f, g)	DRIVER_MODULE(a, b, c, d, e, f)
-#define	DRIVER_MODULE(name, busname, driver, devclass, evh, arg)	\
+#define	DECLARE_CLASS(...)
+#define	EARLY_DRIVER_MODULE(a, b, c, d, e, f)	DRIVER_MODULE(a, b, c, d, e)
+#define	DRIVER_MODULE(name, busname, driver, evh, arg)	\
   static struct module_data bsd_##name##_##busname##_driver_mod = {	\
 	evh, arg, #busname, #name, #busname "/" #name,			\
-	&driver, &devclass, { 0, 0 } };					\
+	&driver, NULL, { 0, 0 } };					\
 SYSINIT(bsd_##name##_##busname##_driver_mod, SI_SUB_DRIVERS,		\
   SI_ORDER_MIDDLE, module_register,					\
   &bsd_##name##_##busname##_driver_mod)
@@ -666,7 +669,7 @@ extern int (*ofw_bus_is_compatible_cb)(device_t dev, char *name);
 #endif
 
 /* Should be defined in user application since it is machine-dependent */
-extern int delay(unsigned int);
+extern void delay(int);
 
 /* BUS dma */
 #define	BUS_SPACE_MAXADDR_24BIT	0xFFFFFF
diff --git a/stand/usb/Makefile b/stand/usb/Makefile
index 0a1c9e0022ee..dad4ae90c2ee 100644
--- a/stand/usb/Makefile
+++ b/stand/usb/Makefile
@@ -38,6 +38,7 @@ CFLAGS+=	-ffunction-sections -fdata-sections
 CFLAGS+=	-Wformat -Wall
 CFLAGS+=	-g
 CFLAGS+=	-fno-pic
+CFLAGS+=	-Wno-unused-but-set-variable
 
 .if ${MACHINE_CPUARCH} == "amd64"
 CFLAGS+=	-m32
diff --git a/stand/usb/storage/umass_common.c b/stand/usb/storage/umass_common.c
index 639d70a7f7e6..b62412b13637 100644
--- a/stand/usb/storage/umass_common.c
+++ b/stand/usb/storage/umass_common.c
@@ -38,8 +38,6 @@ static device_probe_t umass_probe;
 static device_attach_t umass_attach;
 static device_detach_t umass_detach;
 
-static devclass_t umass_devclass;
-
 static device_method_t umass_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe, umass_probe),
@@ -54,7 +52,7 @@ static driver_t umass_driver = {
 	.methods = umass_methods,
 };
 
-DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, NULL, 0);
+DRIVER_MODULE(umass, uhub, umass_driver, NULL, 0);
 
 static int
 umass_probe(device_t dev)
diff --git a/stand/usb/storage/umass_loader.c b/stand/usb/storage/umass_loader.c
index 01f1e3602b6a..43c79718216d 100644
--- a/stand/usb/storage/umass_loader.c
+++ b/stand/usb/storage/umass_loader.c
@@ -29,6 +29,7 @@
  */
 
 #include <sys/param.h>
+#include <sys/disk.h>
 
 #include <bootstrap.h>
 #include <stdarg.h>
@@ -133,7 +134,7 @@ umass_disk_open(struct open_file *f,...)
 
 	if (umass_uaa.device == NULL)
 		return (ENXIO);
-	if (dev->d_unit != 0)
+	if (dev->dd.d_unit != 0)
 		return (EIO);
 	return (umass_disk_open_sub(dev));
 }
@@ -185,6 +186,7 @@ static int
 umass_disk_print(int verbose)
 {
 	struct disk_devdesc dev;
+	int ret;
 
 	printf("%s devices:", umass_disk.dv_name);
 	if (pager_output("\n") != 0)
@@ -195,8 +197,8 @@ umass_disk_print(int verbose)
 	ret = pager_output("    umass0   UMASS device\n");
 	if (ret != 0)
 		return (ret);
-	dev.d_dev = &umass_disk;
-	dev.d_unit = 0;
+	dev.dd.d_dev = &umass_disk;
+	dev.dd.d_unit = 0;
 	dev.d_slice = D_SLICENONE;
 	dev.d_partition = D_PARTNONE;
 
diff --git a/stand/usb/test/bsd_usbloader_test.c b/stand/usb/test/bsd_usbloader_test.c
index a92bdebfbebe..29c036d811e9 100644
--- a/stand/usb/test/bsd_usbloader_test.c
+++ b/stand/usb/test/bsd_usbloader_test.c
@@ -33,6 +33,9 @@ extern void callout_process(int);
 extern void usb_idle(void);
 extern void usb_init(void);
 extern void usb_uninit(void);
+void DELAY(unsigned int);
+void delay(unsigned int);
+int pause(const char *, int);
 
 #define	hz 1000
 
@@ -63,7 +66,7 @@ delay(unsigned int delay)
 }
 
 int
-pause(const char *what, int timeout)
+pause(const char *what __unused, int timeout)
 {
 	if (timeout == 0)
 		timeout = 1;
@@ -74,7 +77,7 @@ pause(const char *what, int timeout)
 }
 
 int
-main(int argc, char **argv)
+main(int argc __unused, char **argv __unused)
 {
 	uint32_t time;
 
