Skip to content

Commit

Permalink
Virtio console: Send bytes to the right queues
Browse files Browse the repository at this point in the history
  • Loading branch information
jmezzacappa authored and copy committed Mar 16, 2024
1 parent 2f24859 commit 2bcfa9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/virtio_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ function VirtioConsole(cpu, bus)
});

for (let port = 0; port < this.ports; ++port) {
let queue = port == 0 ? 0 : port * 2 + 2;
let queue_id = port == 0 ? 0 : port * 2 + 2;
this.bus.register("virtio-console" + port + "-input-bytes", function(data) {
let queue = this.virtio.queues[0];
let queue = this.virtio.queues[queue_id];
if (queue.has_request()) {
const bufchain = queue.pop_request();
this.Send(0, bufchain, new Uint8Array(data));
this.Send(queue_id, bufchain, new Uint8Array(data));
} else {
//TODO: Buffer
}
Expand Down

0 comments on commit 2bcfa9d

Please sign in to comment.