Skip to content

Commit d705987

Browse files
author
Ian Seyler
committed
Change lun for QEMU to work correctly.
1 parent e4c849b commit d705987

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/drivers/nvs/virtio-scsi.asm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,13 @@ virtio_scsi_init_pop2:
234234
stosb ; Reserved
235235
stosb ; Reserved
236236
stosb ; Reserved
237-
mov eax, 512
237+
stosb ; Reserved
238+
stosb ; Reserved
239+
mov eax, 4096
238240
stosd
241+
mov al, 0x00
242+
stosb
243+
stosb
239244

240245
call virtio_scsi_cmd
241246

@@ -331,7 +336,7 @@ virtio_scsi_cmd:
331336
; Add data to Descriptor Entry 2
332337
mov rax, 0x610000 ; Address to store the data
333338
stosq
334-
mov eax, 512 ; TODO remote hardcoded length
339+
mov eax, 4096 ; TODO remote hardcoded length
335340
stosd
336341
mov ax, VIRTQ_DESC_F_WRITE
337342
stosw ; 16-bit Flags
@@ -514,7 +519,7 @@ req: ; 19 bytes
514519

515520
align 16
516521
cmd:
517-
cmd_lun: db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
522+
cmd_lun: db 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00
518523
cmd_tag: dq 0
519524
cmd_task_attr: db 0x00
520525
cmd_prio: db 0x00

0 commit comments

Comments
 (0)