From 0cf7cecedc463891c236e3c81a19cd24ce6efc70 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 24 Jan 2021 11:56:58 -0800 Subject: 7557 Oh, stupid mistake in segmented address calculation. Now Qemu's working again everywhere. Bochs is again broken everywhere. But I think we're getting closer. I think Bochs's BIOS implementation for reading sectors has two interacting constraints: - Can't write to more than 0x10000 bytes past segment register. - Can't write across segment alignment boundaries. Qemu only cares about the first. --- baremetal/boot.hex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'baremetal') diff --git a/baremetal/boot.hex b/baremetal/boot.hex index c05a3f19..491e3718 100644 --- a/baremetal/boot.hex +++ b/baremetal/boot.hex @@ -100,7 +100,7 @@ # "Addressing of Buffer should guarantee that the complete buffer is inside # the given segment, i.e. ( BX + size_of_buffer ) <= 10000h." # https://en.wikipedia.org/wiki/INT_13H#INT_13h_AH=02h:_Read_Sectors_From_Drive - bb 00 fa # bx <- 0xfa00 [label] + bb a0 0f # bx <- 0xfa0 8e c3 # es <- bx bb 00 00 # bx <- 0 cd 13 # int 13h, BIOS disk service -- cgit 1.4.1-2-gfad0