]> Devi Nivas Git - cs3210-lab1.git/commit
Fix off-by-one error in the record count returned by do_e820
authorRohan Bafna <rbafna3@gatech.edu>
Tue, 26 Aug 2025 21:29:16 +0000 (17:29 -0400)
committerRohan Bafna <rbafna3@gatech.edu>
Tue, 26 Aug 2025 21:40:29 +0000 (17:40 -0400)
commit30eee293292080dcf72ed2a4ac48efc3e13d1f40
tree8684c8762273237001da4eb3d9d34dac55d8e9ba
parentec70eeb445cd67f1e61493bdda302f41c032a46d
Fix off-by-one error in the record count returned by do_e820

%ebx is set to 0 when the last e820 record is returned, which means
that %bp was not incremented for the last record; this change moves
the increment of %bp to earlier in the function, before %ebx is
tested, and after the magic number returned by e820 is checked, so
that %bp is incremented once for every entry.

Also move the test for %ecx=0 (meaning the entry should be skipped)
for correctness.  It doesn't look like qemu ever actually sets %ecx to
0 in practice though.
bootblock/e820.S