about summary refs log tree commit diff stats
path: root/baremetal/boot.hex
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-03-01 22:41:13 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-03-01 22:41:13 -0800
commitce64fef18f4b0adc1e48a8d73f489fd410aea765 (patch)
tree91d5feb1b4cbeadbf10ec061a659ba7286f74c16 /baremetal/boot.hex
parentcfeb71c898f066197d55264dca9120b9ff9f60b6 (diff)
downloadmu-ce64fef18f4b0adc1e48a8d73f489fd410aea765.tar.gz
7835
Diffstat (limited to 'baremetal/boot.hex')
-rw-r--r--baremetal/boot.hex19
1 files changed, 16 insertions, 3 deletions
diff --git a/baremetal/boot.hex b/baremetal/boot.hex
index 6a14017d..6fa874c2 100644
--- a/baremetal/boot.hex
+++ b/baremetal/boot.hex
@@ -143,6 +143,20 @@
   cd 13  # int 13h, BIOS disk service
   0f 82 9b 00  # jump-if-carry disk_error [label]
 
+  # load two more tracks of disk into addresses [0x27400, 0x37000)
+  b4 02  # ah <- 2  # read sectors from disk
+  # dl comes conveniently initialized at boot time with the index of the device being booted
+  b5 00  # ch <- 0  # cylinder 0
+  b6 02  # dh <- 2  # track 0
+  b1 01  # cl <- 1  # first sector, 1-based
+  b0 7e  # al <- 126  # number of sectors to read = 2*63
+  # address to write sectors to = es:bx = 0x17800
+  bb 80 17  # bx <- 0x1780 [label]
+  8e c3  # es <- bx
+  bb 00 00  # bx <- 0
+  cd 13  # int 13h, BIOS disk service
+  0f 82 9b 00  # jump-if-carry disk_error [label]
+
   # reset es
   bb 00 00  # bx <- 0
   8e c3  # es <- bx
@@ -172,9 +186,8 @@
   ea 00 7d 08 00  # far jump to initialize_32bit_mode after setting cs to the record at offset 8 in the gdt (gdt_code) [label]
 
 # padding
-# 76:
-                  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
+# 8e:
+                                          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 00 00 00 00 00 00 00 00 00 00 00