aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarvin Borner2020-07-28 22:00:26 +0200
committerMarvin Borner2020-07-28 22:00:26 +0200
commit44fa7a529656c1ec8a445cac4ee7b40351a7c753 (patch)
treea21dfcd91e2a2bc2913848bbd1bca264ce455d0e /src
parent7786aca4ebabc78048ca2442b6734e99ba631872 (diff)
Make the bin smaller so direct pointers are enough
This is not a final sollution but will work for the moment. I'm just too confused by assembly so I implemented some tricks to shrink the binary.
Diffstat (limited to 'src')
-rw-r--r--src/entry.asm10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/entry.asm b/src/entry.asm
index 4b8b247..5fdf4c2 100644
--- a/src/entry.asm
+++ b/src/entry.asm
@@ -311,8 +311,9 @@ kernel_load:
xor ax, ax ; Clear ax
mov dx, ax ; Clear dx
- cmp cx, EXT2_DIRECT_POINTER_COUNT ; Indirect pointer needed?
- jge .indirect ; Singly indirect pointer
+ ; TODO: Add singly pointer support (until ~12KiB)
+ ;cmp cx, EXT2_DIRECT_POINTER_COUNT ; Indirect pointer needed?
+ ;jge .indirect ; Singly indirect pointer
mov ax, [di] ; Set ax = block pointer
shl ax, 1 ; Multiply ax by 2
@@ -328,22 +329,23 @@ kernel_load:
xor ebx, ebx
+ ; Read singly indirect pointer
mov bx, EXT2_GET_ADDRESS(EXT2_KERNEL_INODE) ; First block
lea di, [bx + EXT2_IND_POINTER_OFFSET] ; Address of singly indirect pointer
mov bx, 0x3000 ; Arbitrary address
-
mov ax, [di] ; Set ax = block pointer
shl ax, 1 ; Multiply ax by 2
mov [lba], ax
mov [dest], bx
call disk_read
+ ; Read data
sub cx, EXT2_DIRECT_POINTER_COUNT
lea di, [ebx + 4 * ecx]
mov bx, 0x4000 ; Arbitrary address
-
mov ax, [di]
shl ax, 1
+ ;sub bx, 0x400
mov [lba], ax
mov [dest], bx
call disk_read