[PATCH] x86: Provide an option to enable legacy USB

1 view
Skip to first unread message

Barret Rhoden

unread,
Nov 24, 2015, 2:40:07 PM11/24/15
to aka...@googlegroups.com
If you want to use a USB keyboard, you'll need to enable this CONFIG.
It is disabled by default, since we usually use serial access and it is
a source of interference. Sometimes you want a keyboard for debugging.

Signed-off-by: Barret Rhoden <br...@cs.berkeley.edu>
---
kern/arch/x86/Kconfig | 10 ++++++++++
kern/arch/x86/init.c | 4 ++++
2 files changed, 14 insertions(+)

diff --git a/kern/arch/x86/Kconfig b/kern/arch/x86/Kconfig
index dbff2afcd4d9..e467b5409f67 100644
--- a/kern/arch/x86/Kconfig
+++ b/kern/arch/x86/Kconfig
@@ -72,4 +72,14 @@ config X86_DISABLE_KEYBOARD

Say 'y' if you have such a machine and do not need the keyboard.

+config ENABLE_LEGACY_USB
+ bool "Enable Legacy USB"
+ default n
+ help
+ Say 'y' if you want to use a USB keyboard. Given that we do not have a
+ USB stack, disabling legacy USB means USB keyboards will not work. We
+ disable legacy USB by default, since our primary console communication
+ is serial, and legacy USB support results in SMM interference that
+ affects all cores.
+
endmenu
diff --git a/kern/arch/x86/init.c b/kern/arch/x86/init.c
index 126d75b8a565..b724360f7333 100644
--- a/kern/arch/x86/init.c
+++ b/kern/arch/x86/init.c
@@ -91,6 +91,10 @@ void arch_init()
perfmon_init();
cons_irq_init();
intel_lpc_init();
+#ifdef CONFIG_ENABLE_LEGACY_USB
+ printk("Legacy USB support enabled, expect SMM interference!\n");
+#else
usb_disable_legacy();
+#endif
check_timing_stability();
}
--
2.6.0.rc2.230.g3dd15c0

Kevin Klues

unread,
Nov 24, 2015, 5:07:02 PM11/24/15
to aka...@googlegroups.com
Looks good to me.
> --
> You received this message because you are subscribed to the Google Groups "Akaros" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
> To post to this group, send email to aka...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
~Kevin

Barret Rhoden

unread,
Nov 25, 2015, 9:48:25 AM11/25/15
to aka...@googlegroups.com
On 2015-11-24 at 14:40 Barret Rhoden <br...@cs.berkeley.edu> wrote:
> If you want to use a USB keyboard, you'll need to enable this CONFIG.
> It is disabled by default, since we usually use serial access and it
> is a source of interference. Sometimes you want a keyboard for
> debugging.

Thanks, merged to master at 46f5b5aaacbc..22e5a17da08e (from, to]

You can see the entire diff with 'git diff' or at
https://github.com/brho/akaros/compare/46f5b5aaacbc...22e5a17da08e

ron minnich

unread,
Nov 25, 2015, 10:38:40 AM11/25/15
to aka...@googlegroups.com
I'd actually prefer that this be controlled by a command line option.

Each config variable multiplies the number of possible build configurations by 2 and in some sense add more complications should we ever wish to audit the code.

The command line option lets us ensure all the code still compiles.

If we have a problem we can test the legacy USB path control without a rebuild.

The path this controls -- early startup -- happens once and testing a variable is a trivial one-time cost.

Just my take.

ron



Davide Libenzi

unread,
Nov 25, 2015, 10:57:35 AM11/25/15
to Akaros
+1
For things which "are not much in the way" of normal code operation, cmdline config are nicer.

Reply all
Reply to author
Forward
0 new messages