aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-06-23 22:22:45 +0200
committerMarvin Borner2020-06-23 22:22:45 +0200
commit0be389b23505c73cf11bb0df51afe80ef927ec0a (patch)
treee2e52fd09cdf5430cb2b0e93cba12181b7a07786
parentbe9629821a5770af1cfefe6f8c67687f9d0ae8e0 (diff)
Added root directory verification
-rw-r--r--src/entry.asm7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/entry.asm b/src/entry.asm
index 1445596..afe004c 100644
--- a/src/entry.asm
+++ b/src/entry.asm
@@ -112,9 +112,14 @@ stage_two:
mov si, inode_table_msg
call print
- ; TODO: File crawling instead of fixed inode
+ ; Load root dir
xor bx, bx
+ mov ax, bx
mov bx, 0x1080 ; First block ((2 - 1) * 128 + dest)
+ mov ax, word [bx + 0] ; Filetype
+ and ax, 0x4000 ; Check if dir
+ cmp ax, 0x4000
+ jne disk_error
mov cx, [bx + 28] ; Number of sectors for inode
lea di, [bx + 40] ; Address of first block pointer