I'm not sure what's going on with virtualbox but with bochs, I have a hint.
I started out by trying to call int 13h, cmd 0x42 to read from the disk, but that kept returning AH = 1, CF!
I eventually fell back to just trying to call command 0x41. Here's the output in bochs:
Code: Select all
(0) [0x000000007c1b] 0000:7c1b (unk. ctxt): int 0x13 ; cd13
<bochs:4> r
CPU0:
rax: 0x00000000_00004100 rcx: 0x00000000_00090000
rdx: 0x00000000_00000080 rbx: 0x00000000_000055aa
rsp: 0x00000000_00000c00 rbp: 0x00000000_00000000
rsi: 0x00000000_000e0000 rdi: 0x00000000_0000ffac
r8 : 0x00000000_00000000 r9 : 0x00000000_00000000
r10: 0x00000000_00000000 r11: 0x00000000_00000000
r12: 0x00000000_00000000 r13: 0x00000000_00000000
r14: 0x00000000_00000000 r15: 0x00000000_00000000
rip: 0x00000000_00007c1b
eflags 0x00000046: id vip vif ac vm rf nt IOPL=0 of df if tf sf ZF af PF cf
<bochs:5> c
(0) Breakpoint 2, 0x0000000000007c1d in ?? ()
Next at t=14043993
(0) [0x000000007c1d] 0000:7c1d (unk. ctxt): jmp far 0000:7c22 ; ea227c0000
<bochs:6> r
CPU0:
rax: 0x00000000_00000100 rcx: 0x00000000_00090000
rdx: 0x00000000_00000080 rbx: 0x00000000_000055aa
rsp: 0x00000000_00000c00 rbp: 0x00000000_00000000
rsi: 0x00000000_000e0000 rdi: 0x00000000_0000ffac
r8 : 0x00000000_00000000 r9 : 0x00000000_00000000
r10: 0x00000000_00000000 r11: 0x00000000_00000000
r12: 0x00000000_00000000 r13: 0x00000000_00000000
r14: 0x00000000_00000000 r15: 0x00000000_00000000
rip: 0x00000000_00007c1d
eflags 0x00000047: id vip vif ac vm rf nt IOPL=0 of df if tf sf ZF af PF CF
Code: Select all
//Configure the stack
mov $0xc00, %sp
//Configure the segments
xor %ax, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
mov %ax, %ss
//First, preserve drive letter.
mov %dl, DiskDrive
mov $0x4100, %ax
mov $0x00, %dl //Same response with 0x80, or the original dl (which is 0)
mov $0x55AA, %bx
int $0x13
If anyone is curious, here was the output for my CMD 0x42.
Here was the output:
Code: Select all
(0) [0x000000007d32] 0000:7d32 (unk. ctxt): int 0x13 ; cd13
<bochs:5> r
CPU0:
rax: 0x00000000_60004200 rcx: 0x00000000_00090000
rdx: 0x00000000_00000000 rbx: 0x00000000_00000000
rsp: 0x00000000_00000bc6 rbp: 0x00000000_00000000
rsi: 0x00000000_000e7d78 rdi: 0x00000000_00000000
r8 : 0x00000000_00000000 r9 : 0x00000000_00000000
r10: 0x00000000_00000000 r11: 0x00000000_00000000
r12: 0x00000000_00000000 r13: 0x00000000_00000000
r14: 0x00000000_00000000 r15: 0x00000000_00000000
rip: 0x00000000_00007d32
eflags 0x00000202: id vip vif ac vm rf nt IOPL=0 of df IF tf sf zf af pf cf
<bochs:6> c
(0) Breakpoint 3, 0x0000000000007d34 in ?? ()
Next at t=14044821
(0) [0x000000007d34] 0000:7d34 (unk. ctxt): add dl, bh ; 00fa
<bochs:7> r
CPU0:
rax: 0x00000000_60000100 rcx: 0x00000000_00090000
rdx: 0x00000000_00000000 rbx: 0x00000000_00000000
rsp: 0x00000000_00000bc6 rbp: 0x00000000_00000000
rsi: 0x00000000_000e7d78 rdi: 0x00000000_00000000
r8 : 0x00000000_00000000 r9 : 0x00000000_00000000
r10: 0x00000000_00000000 r11: 0x00000000_00000000
r12: 0x00000000_00000000 r13: 0x00000000_00000000
r14: 0x00000000_00000000 r15: 0x00000000_00000000
rip: 0x00000000_00007d34
Code: Select all
10 00 01 00 00 7e 00 00 00 00 00 00 00 00 00 00