Discussion:
Thinning out GENERIC
Sean Bruno
2017-02-12 14:59:21 UTC
Permalink
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci

I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?

sean
Warner Losh
2017-02-13 17:51:36 UTC
Permalink
[[ It isn't just GENERIC, it's in every single kernel ]]
Post by Sean Bruno
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci
I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?
You could make it dependent on vt or sc as well as pci, no?

Warner
John Baldwin
2017-02-13 18:33:26 UTC
Permalink
Post by Warner Losh
[[ It isn't just GENERIC, it's in every single kernel ]]
Post by Sean Bruno
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci
I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?
You could make it dependent on vt or sc as well as pci, no?
This is a fairly small driver:

6139 340 8 6487 0x1957 /usr/obj/usr/src/sys/GENERIC
/vga_pci.o

(From an 11.0-stable build)

device ppc and friends is a lot more for example:

text data bss dec hex filename
6238 0 0 6238 0x185e /usr/obj/usr/src/sys/GENERIC/ppb_1284.o
1675 28 0 1703 0x6a7 /usr/obj/usr/src/sys/GENERIC/ppb_base.o
2042 0 0 2042 0x7fa /usr/obj/usr/src/sys/GENERIC/ppb_msq.o
6025 296 8 6329 0x18b9 /usr/obj/usr/src/sys/GENERIC/ppbconf.o
0 168 0 168 0xa8 /usr/obj/usr/src/sys/GENERIC/ppbus_if.o
9099 36 0 9135 0x23af /usr/obj/usr/src/sys/GENERIC/ppc.o
495 256 0 751 0x2ef /usr/obj/usr/src/sys/GENERIC/ppc_acpi.o
1671 256 0 1927 0x787 /usr/obj/usr/src/sys/GENERIC/ppc_isa.o
1124 208 0 1332 0x534 /usr/obj/usr/src/sys/GENERIC/ppc_pci.o
451 208 0 659 0x293 /usr/obj/usr/src/sys/GENERIC/ppc_puc.o
2751 428 8 3187 0xc73 /usr/obj/usr/src/sys/GENERIC/ppi.o

It is needed for drm.
--
John Baldwin
Sean Bruno
2017-02-17 18:43:45 UTC
Permalink
Post by John Baldwin
Post by Warner Losh
[[ It isn't just GENERIC, it's in every single kernel ]]
Post by Sean Bruno
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci
I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?
You could make it dependent on vt or sc as well as pci, no?
6139 340 8 6487 0x1957 /usr/obj/usr/src/sys/GENERIC
/vga_pci.o
(From an 11.0-stable build)
text data bss dec hex filename
6238 0 0 6238 0x185e /usr/obj/usr/src/sys/GENERIC/ppb_1284.o
1675 28 0 1703 0x6a7 /usr/obj/usr/src/sys/GENERIC/ppb_base.o
2042 0 0 2042 0x7fa /usr/obj/usr/src/sys/GENERIC/ppb_msq.o
6025 296 8 6329 0x18b9 /usr/obj/usr/src/sys/GENERIC/ppbconf.o
0 168 0 168 0xa8 /usr/obj/usr/src/sys/GENERIC/ppbus_if.o
9099 36 0 9135 0x23af /usr/obj/usr/src/sys/GENERIC/ppc.o
495 256 0 751 0x2ef /usr/obj/usr/src/sys/GENERIC/ppc_acpi.o
1671 256 0 1927 0x787 /usr/obj/usr/src/sys/GENERIC/ppc_isa.o
1124 208 0 1332 0x534 /usr/obj/usr/src/sys/GENERIC/ppc_pci.o
451 208 0 659 0x293 /usr/obj/usr/src/sys/GENERIC/ppc_puc.o
2751 428 8 3187 0xc73 /usr/obj/usr/src/sys/GENERIC/ppi.o
It is needed for drm.
Ok, so ... make it dependant on drm, vt, sc and pci?

sean
John Baldwin
2017-02-17 19:49:24 UTC
Permalink
Post by Sean Bruno
Post by John Baldwin
Post by Warner Losh
[[ It isn't just GENERIC, it's in every single kernel ]]
Post by Sean Bruno
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci
I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?
You could make it dependent on vt or sc as well as pci, no?
6139 340 8 6487 0x1957 /usr/obj/usr/src/sys/GENERIC
/vga_pci.o
(From an 11.0-stable build)
text data bss dec hex filename
6238 0 0 6238 0x185e /usr/obj/usr/src/sys/GENERIC/ppb_1284.o
1675 28 0 1703 0x6a7 /usr/obj/usr/src/sys/GENERIC/ppb_base.o
2042 0 0 2042 0x7fa /usr/obj/usr/src/sys/GENERIC/ppb_msq.o
6025 296 8 6329 0x18b9 /usr/obj/usr/src/sys/GENERIC/ppbconf.o
0 168 0 168 0xa8 /usr/obj/usr/src/sys/GENERIC/ppbus_if.o
9099 36 0 9135 0x23af /usr/obj/usr/src/sys/GENERIC/ppc.o
495 256 0 751 0x2ef /usr/obj/usr/src/sys/GENERIC/ppc_acpi.o
1671 256 0 1927 0x787 /usr/obj/usr/src/sys/GENERIC/ppc_isa.o
1124 208 0 1332 0x534 /usr/obj/usr/src/sys/GENERIC/ppc_pci.o
451 208 0 659 0x293 /usr/obj/usr/src/sys/GENERIC/ppc_puc.o
2751 428 8 3187 0xc73 /usr/obj/usr/src/sys/GENERIC/ppi.o
It is needed for drm.
Ok, so ... make it dependant on drm, vt, sc and pci?
You can kldload drm at runtime, so a static dependency isn't sufficient.
It's not clear why removing this from GENERIC is that important. ppc is on far
fewer machines than vga_pci and takes up 10x more space.
--
John Baldwin
Sean Bruno
2017-02-17 19:54:29 UTC
Permalink
Post by John Baldwin
Post by Sean Bruno
Post by John Baldwin
Post by Warner Losh
[[ It isn't just GENERIC, it's in every single kernel ]]
Post by Sean Bruno
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci
I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?
You could make it dependent on vt or sc as well as pci, no?
6139 340 8 6487 0x1957 /usr/obj/usr/src/sys/GENERIC
/vga_pci.o
(From an 11.0-stable build)
text data bss dec hex filename
6238 0 0 6238 0x185e /usr/obj/usr/src/sys/GENERIC/ppb_1284.o
1675 28 0 1703 0x6a7 /usr/obj/usr/src/sys/GENERIC/ppb_base.o
2042 0 0 2042 0x7fa /usr/obj/usr/src/sys/GENERIC/ppb_msq.o
6025 296 8 6329 0x18b9 /usr/obj/usr/src/sys/GENERIC/ppbconf.o
0 168 0 168 0xa8 /usr/obj/usr/src/sys/GENERIC/ppbus_if.o
9099 36 0 9135 0x23af /usr/obj/usr/src/sys/GENERIC/ppc.o
495 256 0 751 0x2ef /usr/obj/usr/src/sys/GENERIC/ppc_acpi.o
1671 256 0 1927 0x787 /usr/obj/usr/src/sys/GENERIC/ppc_isa.o
1124 208 0 1332 0x534 /usr/obj/usr/src/sys/GENERIC/ppc_pci.o
451 208 0 659 0x293 /usr/obj/usr/src/sys/GENERIC/ppc_puc.o
2751 428 8 3187 0xc73 /usr/obj/usr/src/sys/GENERIC/ppi.o
It is needed for drm.
Ok, so ... make it dependant on drm, vt, sc and pci?
You can kldload drm at runtime, so a static dependency isn't sufficient.
It's not clear why removing this from GENERIC is that important. ppc is on far
fewer machines than vga_pci and takes up 10x more space.
I don't want to remove it from GENERIC. I want to add the capability to
remove it. Sorry if that wasn't clear from my subject line, because it
doesn't look clear now that I re-read it.

sean
Warner Losh
2017-02-17 19:56:44 UTC
Permalink
Post by Sean Bruno
Post by John Baldwin
Post by Sean Bruno
Post by John Baldwin
Post by Warner Losh
[[ It isn't just GENERIC, it's in every single kernel ]]
Post by Sean Bruno
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci
I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?
You could make it dependent on vt or sc as well as pci, no?
6139 340 8 6487 0x1957 /usr/obj/usr/src/sys/GENERIC
/vga_pci.o
(From an 11.0-stable build)
text data bss dec hex filename
6238 0 0 6238 0x185e /usr/obj/usr/src/sys/GENERIC/ppb_1284.o
1675 28 0 1703 0x6a7 /usr/obj/usr/src/sys/GENERIC/ppb_base.o
2042 0 0 2042 0x7fa /usr/obj/usr/src/sys/GENERIC/ppb_msq.o
6025 296 8 6329 0x18b9 /usr/obj/usr/src/sys/GENERIC/ppbconf.o
0 168 0 168 0xa8 /usr/obj/usr/src/sys/GENERIC/ppbus_if.o
9099 36 0 9135 0x23af /usr/obj/usr/src/sys/GENERIC/ppc.o
495 256 0 751 0x2ef /usr/obj/usr/src/sys/GENERIC/ppc_acpi.o
1671 256 0 1927 0x787 /usr/obj/usr/src/sys/GENERIC/ppc_isa.o
1124 208 0 1332 0x534 /usr/obj/usr/src/sys/GENERIC/ppc_pci.o
451 208 0 659 0x293 /usr/obj/usr/src/sys/GENERIC/ppc_puc.o
2751 428 8 3187 0xc73 /usr/obj/usr/src/sys/GENERIC/ppi.o
It is needed for drm.
Ok, so ... make it dependant on drm, vt, sc and pci?
You can kldload drm at runtime, so a static dependency isn't sufficient.
It's not clear why removing this from GENERIC is that important. ppc is on far
fewer machines than vga_pci and takes up 10x more space.
I don't want to remove it from GENERIC. I want to add the capability to
remove it. Sorry if that wasn't clear from my subject line, because it
doesn't look clear now that I re-read it.
He likely wants to remove a lot of other things too. He's not asking
about those because the are already easy to remove :)

You'd want to make it a module, then have drm depend on the module as
well as the static dependencies you outlines.

And yes, this does highlight some issues with our current build system...

Warner
John Baldwin
2017-02-17 21:23:01 UTC
Permalink
Post by Sean Bruno
Post by John Baldwin
Post by Sean Bruno
Post by John Baldwin
Post by Warner Losh
[[ It isn't just GENERIC, it's in every single kernel ]]
Post by Sean Bruno
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313683)
+++ sys/conf/files (working copy)
@@ -2419,7 +2419,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+#dev/pci/vga_pci.c optional pci
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fea.c optional fea eisa
dev/pdq/if_fpa.c optional fpa pci
I'm playing around with small x86 builds and wanted to come up with a
knob that disables the vga_pci driver. Obviously I still want pci(4) to
be enabled, but I definitely do not need the vga interfaces for
anything. Any suggestions?
You could make it dependent on vt or sc as well as pci, no?
6139 340 8 6487 0x1957 /usr/obj/usr/src/sys/GENERIC
/vga_pci.o
(From an 11.0-stable build)
text data bss dec hex filename
6238 0 0 6238 0x185e /usr/obj/usr/src/sys/GENERIC/ppb_1284.o
1675 28 0 1703 0x6a7 /usr/obj/usr/src/sys/GENERIC/ppb_base.o
2042 0 0 2042 0x7fa /usr/obj/usr/src/sys/GENERIC/ppb_msq.o
6025 296 8 6329 0x18b9 /usr/obj/usr/src/sys/GENERIC/ppbconf.o
0 168 0 168 0xa8 /usr/obj/usr/src/sys/GENERIC/ppbus_if.o
9099 36 0 9135 0x23af /usr/obj/usr/src/sys/GENERIC/ppc.o
495 256 0 751 0x2ef /usr/obj/usr/src/sys/GENERIC/ppc_acpi.o
1671 256 0 1927 0x787 /usr/obj/usr/src/sys/GENERIC/ppc_isa.o
1124 208 0 1332 0x534 /usr/obj/usr/src/sys/GENERIC/ppc_pci.o
451 208 0 659 0x293 /usr/obj/usr/src/sys/GENERIC/ppc_puc.o
2751 428 8 3187 0xc73 /usr/obj/usr/src/sys/GENERIC/ppi.o
It is needed for drm.
Ok, so ... make it dependant on drm, vt, sc and pci?
You can kldload drm at runtime, so a static dependency isn't sufficient.
It's not clear why removing this from GENERIC is that important. ppc is on far
fewer machines than vga_pci and takes up 10x more space.
I don't want to remove it from GENERIC. I want to add the capability to
remove it. Sorry if that wasn't clear from my subject line, because it
doesn't look clear now that I re-read it.
Why not make this conditional on 'vga'? GENERIC already contains 'device vga'
that the VGA-specific bits of 'vt', etc. are dependent on.
--
John Baldwin
Sean Bruno
2017-02-17 22:38:44 UTC
Permalink
Post by John Baldwin
Post by Sean Bruno
I don't want to remove it from GENERIC. I want to add the capability to
remove it. Sorry if that wasn't clear from my subject line, because it
doesn't look clear now that I re-read it.
Why not make this conditional on 'vga'? GENERIC already contains 'device vga'
that the VGA-specific bits of 'vt', etc. are dependent on.
A quick hack that seems to do what I want it to do, maybe I should just
fire this off?

Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313900)
+++ sys/conf/files (working copy)
@@ -2401,7 +2401,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+dev/pci/vga_pci.c optional pci vga
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fpa.c optional fpa pci
dev/pdq/pdq.c optional nowerror fpa pci
Justin Hibbits
2017-02-17 22:59:37 UTC
Permalink
Post by Sean Bruno
Post by John Baldwin
Post by Sean Bruno
I don't want to remove it from GENERIC. I want to add the capability to
remove it. Sorry if that wasn't clear from my subject line, because it
doesn't look clear now that I re-read it.
Why not make this conditional on 'vga'? GENERIC already contains 'device vga'
that the VGA-specific bits of 'vt', etc. are dependent on.
A quick hack that seems to do what I want it to do, maybe I should just
fire this off?
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313900)
+++ sys/conf/files (working copy)
@@ -2401,7 +2401,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+dev/pci/vga_pci.c optional pci vga
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fpa.c optional fpa pci
dev/pdq/pdq.c optional nowerror fpa pci
vga_pci.c is used by powerpc as well, which doesn't include device vga
in GENERIC*. Possibly other archs as well would need it.

- Justin
Sean Bruno
2017-02-17 23:04:43 UTC
Permalink
Post by Justin Hibbits
Post by Sean Bruno
Post by John Baldwin
Post by Sean Bruno
I don't want to remove it from GENERIC. I want to add the capability to
remove it. Sorry if that wasn't clear from my subject line, because it
doesn't look clear now that I re-read it.
Why not make this conditional on 'vga'? GENERIC already contains 'device vga'
that the VGA-specific bits of 'vt', etc. are dependent on.
A quick hack that seems to do what I want it to do, maybe I should just
fire this off?
Index: sys/conf/files
===================================================================
--- sys/conf/files (revision 313900)
+++ sys/conf/files (working copy)
@@ -2401,7 +2401,7 @@
dev/pci/pci_user.c optional pci
dev/pci/pcib_if.m standard
dev/pci/pcib_support.c standard
-dev/pci/vga_pci.c optional pci
+dev/pci/vga_pci.c optional pci vga
dev/pcn/if_pcn.c optional pcn pci
dev/pdq/if_fpa.c optional fpa pci
dev/pdq/pdq.c optional nowerror fpa pci
vga_pci.c is used by powerpc as well, which doesn't include device vga
in GENERIC*. Possibly other archs as well would need it.
- Justin
It uses vga_pci and doesn't use device vga? How does that work?

sean

Continue reading on narkive:
Loading...