about summary refs log tree commit diff stats
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
parentcfeb71c898f066197d55264dca9120b9ff9f60b6 (diff)
downloadmu-ce64fef18f4b0adc1e48a8d73f489fd410aea765.tar.gz
7835
-rw-r--r--baremetal/boot.hex19
-rwxr-xr-xtranslate_subx_baremetal2
-rwxr-xr-xtranslate_subx_baremetal_emulated2
3 files changed, 18 insertions, 5 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
diff --git a/translate_subx_baremetal b/translate_subx_baremetal
index f2d4274d..0a1f9dd2 100755
--- a/translate_subx_baremetal
+++ b/translate_subx_baremetal
@@ -39,7 +39,7 @@ apps/hex < baremetal/boot.hex  > boot.bin
 cat boot.bin a.bin > disk.bin
 dd if=disk.bin of=disk.img conv=notrunc
 
-if [ `stat --printf="%s" disk.bin` -ge 129024 ]  # 4 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
+if [ `stat --printf="%s" disk.bin` -ge 193536 ]  # 6 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
 then
   echo "disk.bin won't all be loaded on boot"
   exit 1
diff --git a/translate_subx_baremetal_emulated b/translate_subx_baremetal_emulated
index 881fcef1..63dd69dd 100755
--- a/translate_subx_baremetal_emulated
+++ b/translate_subx_baremetal_emulated
@@ -33,7 +33,7 @@ dd if=/dev/zero of=disk.img count=20160  # 512-byte sectors, so 10MB
 cat boot.bin a.bin > disk.bin
 dd if=disk.bin of=disk.img conv=notrunc
 
-if [ `stat --printf="%s" disk.bin` -ge 129024 ]  # 4 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
+if [ `stat --printf="%s" disk.bin` -ge 193536 ]  # 6 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.hex)
 then
   echo "disk.bin won't all be loaded on boot"
   exit 1
com> 2017-03-08 19:02:59 -0800 3764 - better colors for cross-links' href='/akkartik/mu/commit/update_html?h=hlt&id=4a39d12d4568f76ebf45b34cec722d8e0bcf1207'>4a39d12d ^
2564eb6f ^

8bf0c436 ^
2564eb6f ^



8bf0c436 ^









f5465e12 ^
ccae4585 ^





f5465e12 ^


ba6621b5 ^




f40b079c ^
ba6621b5 ^




201458e3 ^
ba6621b5 ^




9a7e1a0f ^
ba6621b5 ^






9a7e1a0f ^
ba6621b5 ^


608a7fa8 ^
ba6621b5 ^


25ad969f ^
c762564b ^
5a2cb154 ^
608a7fa8 ^



c762564b ^
9a7e1a0f ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101