From e08e3b301d33828b940eeeae9bcac2280135e7d8 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Wed, 5 Feb 2020 20:52:43 -0700
Subject: [PATCH] Remove unused sector count

---
 x86_64/partitions.asm     | 2 --
 x86_64/redoxfs.asm        | 3 ---
 x86_64/startup-common.asm | 1 -
 3 files changed, 6 deletions(-)

diff --git a/x86_64/partitions.asm b/x86_64/partitions.asm
index 4fbede1..1d9da35 100644
--- a/x86_64/partitions.asm
+++ b/x86_64/partitions.asm
@@ -11,7 +11,6 @@ endstruc
 ; The partition has to be one of the primary MBR partitions.
 ; OUT
 ;   eax - start_lba
-;   edx - sector count
 ; CLOBBER
 ;   ebx
 find_redoxfs_partition:
@@ -26,7 +25,6 @@ find_redoxfs_partition:
     jmp .notfound
 .found:
     mov eax, [partitions + mbr_partition_rec + mbr_partition_rec.lba_start]
-    mov edx, [partitions + mbr_partition_rec + mbr_partition_rec.sector_count]
     ret
 .notfound:
     mov si, .no_partition_found_msg
diff --git a/x86_64/redoxfs.asm b/x86_64/redoxfs.asm
index 4380949..3326bfd 100644
--- a/x86_64/redoxfs.asm
+++ b/x86_64/redoxfs.asm
@@ -41,10 +41,8 @@ endstruc
 
 ; IN
 ; eax - the first sector of the filesystem
-; edx - the amount of sectors in the filesystem
 redoxfs:
         mov [.first_sector], eax
-        mov [.sector_count], ebx
         call redoxfs.open
         test eax, eax
         jz .good_header
@@ -79,7 +77,6 @@ redoxfs:
         times BLOCK_SIZE db 0
 
     .first_sector: dd 0
-    .sector_count: dd 0
 
     .env:
         db "REDOXFS_BLOCK="
diff --git a/x86_64/startup-common.asm b/x86_64/startup-common.asm
index 147001d..787370e 100644
--- a/x86_64/startup-common.asm
+++ b/x86_64/startup-common.asm
@@ -28,7 +28,6 @@ startup:
 
         %ifdef FILESYSTEM
             mov eax, (filesystem - boot) / 512
-            mov ebx, (filesystem.end - filesystem) / 512
         %else
             call find_redoxfs_partition
         %endif
-- 
GitLab