Skip to content

Commit 9ad15b9

Browse files
committed
--usb and --pcspk arguments was added
1 parent a63228f commit 9ad15b9

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Arguments:
6161
"bridge", defaults to "user")
6262
--netdump Save network activity to a file
6363
--kvm Enable Linux KVM (much faster virtualization)
64+
--pcspk Enable PCSpeaker emulation (if you haven't native)
65+
--usb Enable usb (ehci) device emulation (for testing)
6466
--curses Use text-mode graphics
6567
--port Redirect TCP/UDP connections on the host port to the runtime.js
6668
--append Append string to runtime.js command line

bin/jsos.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ var runArgs = [{
7777
default: false,
7878
description: 'Enable Linux KVM (much faster virtualization)'
7979
},
80+
{
81+
name: 'usb',
82+
type: 'boolean',
83+
default: false,
84+
description: 'Enable usb (ehci) device emulation (for testing)'
85+
},
86+
{
87+
name: 'pcspk',
88+
type: 'boolean',
89+
default: false,
90+
description: 'Enable PCSpeaker emulation (if you haven\'t native)'
91+
},
8092
{
8193
name: 'curses',
8294
type: 'boolean',

command/jsos-run.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ module.exports = function(args, cb) {
4747
var qemuNetdump = !!args.netdump;
4848
var qemuCurses = !!args.curses;
4949
var qemuKVM = !!args.kvm;
50+
var qemuUSB = !!args.usb;
51+
var qemuPCSpk = !!args.pcspk;
5052
var qemuAppend = args.append || '';
5153
var qemuNographic = !!args.nographic;
5254
var qemuVirtioRng = !!args['virtio-rng'];
@@ -78,6 +80,8 @@ module.exports = function(args, cb) {
7880
netdump: qemuNetdump,
7981
curses: qemuCurses,
8082
kvm: qemuKVM,
83+
usb: qemuUSB,
84+
pcspk: qemuPCSpk,
8185
qemuCommandAppend: qemuCommandAppend,
8286
append: qemuAppend,
8387
dryRun: dryRun,

run/qemu.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ function getQemuArgs(opts) {
9696
a.push('-no-kvm-irqchip');
9797
}
9898

99+
if(opts.usb) {
100+
a.push('-usb -device usb-ehci,id=ehci -device usb-tablet,bus=usb-bus.0');
101+
}
102+
103+
if(opts.pcspk) {
104+
a.push('-soundhw pcspk');
105+
}
106+
99107
if (opts.qemuCommandAppend) {
100108
a.push(String(opts.qemuCommandAppend));
101109
}

0 commit comments

Comments
 (0)