diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-12-22 17:31:35 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-12-23 00:04:20 -0800 |
commit | 2e7798e39c4ff91f214877a4a4f4e85690504ca0 (patch) | |
tree | 778cb1aa3728da6163598f7a856639d41e80dc0d | |
parent | 2b61e5e0a02e6c4bd919c842ecf74ff3e089ec73 (diff) | |
download | mu-2e7798e39c4ff91f214877a4a4f4e85690504ca0.tar.gz |
7377
Ooh, look at that, the device number comes conveniently initialized in the right register. No need to hardcode it. https://wiki.osdev.org/MBR_(x86)
-rw-r--r-- | apps/boot.hex | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/boot.hex b/apps/boot.hex index 3157ce58..d403f457 100644 --- a/apps/boot.hex +++ b/apps/boot.hex @@ -50,7 +50,7 @@ # 0d: # load more sectors from disk b4 02 # ah <- 2 # read sectors from disk - b2 80 # dl <- 80 # hdd 0 + # dl comes conveniently initialized at boot time with the index of the device being booted b5 00 # ch <- 0 # cylinder 0 b6 00 # dh <- 0 # track 0 b1 02 # cl <- 2 # second sector, 1-based @@ -62,19 +62,19 @@ cd 13 # int 13h, BIOS disk service 0f 82 76 00 # jump-if-carry disk-error -# 28: +# 26: # switch to 32-bit mode 0f 01 16 # lgdt 00/mod/indirect 010/subop 110/rm32/TODO 80 7c # *gdt_descriptor -# 20: +# 2b: 0f 20 c0 # eax <- cr0 66 83 c8 01 # eax <- or 0x1 0f 22 c0 # cr0 <- eax ea c0 7c 08 00 # far jump to initialize_32bit_mode after setting cs to the record at offset 8 in the gdt (gdt_code) # padding -# 3c: - 00 00 00 00 +# 3a: + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |