about summary refs log tree commit diff stats
path: root/boot.subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-05-29 17:23:04 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-29 17:23:04 -0700
commit9516dfa0b04bcdcd1c9c38aa6278549ccdb5528c (patch)
treea701a0435d01d0a24a258c8ed06a7d9c836b2890 /boot.subx
parentd85529f3fac9044cfc52d395b1b64de4f4901cb9 (diff)
downloadmu-9516dfa0b04bcdcd1c9c38aa6278549ccdb5528c.tar.gz
shell: skeleton for scrolling
Diffstat (limited to 'boot.subx')
-rw-r--r--boot.subx14
1 files changed, 14 insertions, 0 deletions
diff --git a/boot.subx b/boot.subx
index 8ad3f2a8..7baf88e8 100644
--- a/boot.subx
+++ b/boot.subx
@@ -122,6 +122,20 @@
   cd/syscall 0x13/imm8/bios-disk-services
   0f 82/jump-if-carry disk_error/disp16
 
+  # load two more tracks of disk into addresses [0x46c00, 0x56800)
+  b4/copy-to-ah 2/imm8/read-drive
+  # dl comes conveniently initialized at boot time with the index of the device being booted
+  b5/copy-to-ch 0/imm8/cylinder
+  b6/copy-to-dh 6/imm8/head
+  b1/copy-to-cl 1/imm8/sector  # 1-based
+  b0/copy-to-al 0x7e/imm8/num-sectors  # 2*63 = 126
+  # address to write sectors to = es:bx = 0x46c00, contiguous with boot segment
+  bb/copy-to-bx 0x46c0/imm16
+  8e/->seg 3/mod/direct 3/rm32/bx 0/r32/es
+  bb/copy-to-bx 0/imm16
+  cd/syscall 0x13/imm8/bios-disk-services
+  0f 82/jump-if-carry disk_error/disp16
+
   # reset es
   bb/copy-to-bx 0/imm16
   8e/->seg 3/mod/direct 3/rm32/bx 0/r32/es