Skip to content

Commit

Permalink
optromloader.asm, Makefile: Make BIOS drive a parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalles committed Sep 24, 2021
1 parent f8129f1 commit e58cbf7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fasm = fasm
fasm_extraopts =
fasm_extraopts = -d bios_drive=0
#fasm_extraopts += -d target_segment=0xE000
readblock_retries = 7
hexdumpcmd = hexdump -C
Expand Down
4 changes: 2 additions & 2 deletions optromloader.asm
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ readblock: ;AX blockno, [ES:BX] dest, trashes AX (reserved, retval)
mov cl,ah ;CHS sector in LSB, cyl MSB (zero) in MSB
mov ah,02h ;BIOS 13h read CHS block
mov al,1 ;sectors to read 1..128
mov dl,0 ;drive 0=A 80h=hdd0
mov dl,bios_drive ;drive 0=A 80h=hdd0
mov di,readblock_tries ;how many read attempts before giving up
.retry:
push ax ;preserve AX for potential retries
Expand All @@ -220,7 +220,7 @@ readblock: ;AX blockno, [ES:BX] dest, trashes AX (reserved, retval)
mov al,ah ;status was returned in AH
call printhex8 ;status value
mov ah,0 ;reset command
mov dl,0 ;drive 0=A 80h=hdd0
mov dl,bios_drive ;drive 0=A 80h=hdd0
int 13h ;call BIOS function for disk operations
mov si,readblocks_str
call printstr ;reprint header in next line to preserve read error on screen
Expand Down

0 comments on commit e58cbf7

Please sign in to comment.