about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-12-20 23:52:21 -0800
committerKartik Agaram <vc@akkartik.com>2020-12-20 23:52:21 -0800
commit6ac16fd1ae275fb4042ab4aa85df3ccc86f3e615 (patch)
treeda0ba1415ac3a5d596d745cc0a7e1f8db125433f
parenta350fb4c687a3f65c26d7546b358292285faef91 (diff)
downloadmu-6ac16fd1ae275fb4042ab4aa85df3ccc86f3e615.tar.gz
7369 - read hard disk using BIOS
There were two problems:
  a) We have only 1 sector per track (spt=1), so 'second sector' is meaningless.
  b) Drives 0-127 are reserved for floppies.
-rw-r--r--apps/boot.bochsrc.floppy6
-rw-r--r--apps/boot.hex4
2 files changed, 2 insertions, 8 deletions
diff --git a/apps/boot.bochsrc.floppy b/apps/boot.bochsrc.floppy
deleted file mode 100644
index 07e40607..00000000
--- a/apps/boot.bochsrc.floppy
+++ /dev/null
@@ -1,6 +0,0 @@
-# Configuration for the Bochs x86 CPU emulator to run the output of apps/boot.hex
-# See apps/boot.hex for more details.
-
-floppya: 1_44=boot.bin, status=inserted
-boot: floppy
-log: -
diff --git a/apps/boot.hex b/apps/boot.hex
index fc80b442..a95c1de7 100644
--- a/apps/boot.hex
+++ b/apps/boot.hex
@@ -34,10 +34,10 @@
 # 00:
 # load_disk:
   b4 02  # ah <- 2  # read sectors from disk
-  b2 00  # dl <- 0  # drive 0
+  b2 80  # dl <- 80  # hdd 0
   b5 00  # ch <- 0  # cylinder 0
   b6 00  # dh <- 0  # track 0
-  b1 02  # cl <- 2  # sector 1 (second sector, 1-based)
+  b1 01  # cl <- 1  # sector 0 (first sector, 1-based)
   b0 01  # al <- 1  # number of sectors to read
   # address to write sectors to = es:bx = 0x7e00, contiguous with boot segment
   bb 00 00  # bx <- 0