Skip to content

Commit

Permalink
fix: ata disk enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
d0p1s4m4 committed Jul 22, 2024
1 parent 008c780 commit 29e5ba8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SRCS = kernel.asm \
.PHONY: all
all: $(KERNEL)

PHONY: const.inc
.PHONY: const.inc
const.inc: const.inc.in
sh $(TOOLSDIR)/version.sh $< $@

Expand Down
11 changes: 10 additions & 1 deletion kernel/bio.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,24 @@ bio_init:
rep stosb
ret

bio_get:
;; Function: bio_read
;;
bio_bread:
mov eax, uBIOLock
call lock_acquire

mov eax, uBIOLock
call lock_release
ret

;; Function: bio_brelse
;; Unbusy a buffer and release it to the free lists.
bio_brelse:
mov eax, uBIOLock
call lock_acquire

mov eax, uBIOLock
call lock_release
ret

uBIOLock dd 0
6 changes: 3 additions & 3 deletions kernel/dev/at/ata.inc
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ ata_probe:
jnz .skip

push ecx
cmp ecx, ATA_CHAN1_IO
cmp bx, ATA_CHAN1_IO
jne @f
add ecx, 2
jmp .drive_found
@@:
cmp ecx, ATA_CHAN2_IO
cmp bx, ATA_CHAN2_IO
jne @f
add ecx, 4
jmp .drive_found
@@:
cmp ecx, ATA_CHAN3_IO
cmp bx, ATA_CHAN3_IO
jne @f
add ecx, 8
jmp .drive_found
Expand Down

0 comments on commit 29e5ba8

Please sign in to comment.