Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SteveOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen D
SteveOS
Commits
78e0e550
Commit
78e0e550
authored
6 years ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
Disk retry code fixed - untested
parent
ea1e957b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boot/bootsect.asm
+1
-7
1 addition, 7 deletions
boot/bootsect.asm
boot/disk.asm
+15
-9
15 additions, 9 deletions
boot/disk.asm
with
16 additions
and
16 deletions
boot/bootsect.asm
+
1
−
7
View file @
78e0e550
...
...
@@ -33,13 +33,7 @@ load_bootloader:
;mov dh, [SEC_COUNT]
;call print_hex
pusha
mov
es
,
[
CURRENT_REG_LOAD
]
mov
bx
,
0
;[CURRENT_MEM_LOAD] ; Read from disk and store into ax
mov
dh
,
[
HEAD_COUNT
]
; dh <- head number (0x0 .. 0xF) //Redundant?
mov
cl
,
al
mov
al
,
1
;Num sectors
mov
ch
,
[
CYL_COUNT
]
;Cylinder number
mov
dl
,
[
BOOT_DRIVE
]
call
di
sk_load
popa
mov
bx
,
SECTOR_LOADED
...
...
This diff is collapsed.
Click to expand it.
boot/disk.asm
+
15
−
9
View file @
78e0e550
disk_load:
pusha
; reading from disk requires setting specific values in all registers
retry:
mov
es
,
[
CURRENT_REG_LOAD
]
mov
bx
,
0
;[CURRENT_MEM_LOAD] ; Read from disk and store into ax
mov
dh
,
[
HEAD_COUNT
]
; dh <- head number (0x0 .. 0xF) //Redundant?
mov
cl
,
al
mov
al
,
1
;Num sectors
mov
ch
,
[
CYL_COUNT
]
;Cylinder number
mov
dl
,
[
BOOT_DRIVE
]
mov
ah
,
0x02
; ah <- int 0x13 function. 0x02 = 'read'
;mov cl, 0x02 ; cl <- sector (0x01 .. 0x11)
; 0x01 is our boot sector, 0x02 is the first 'available' sector
...
...
@@ -11,7 +18,6 @@ disk_load:
; [es:bx] <- pointer to buffer where the data will be stored
; caller sets it up for us, and it is actually the standard location for int 13h
retry:
int
0x13
; BIOS interrupt
jc
di
sk_error
; if error (stored in the carry bit)
...
...
@@ -22,13 +28,13 @@ retry:
disk_error:
mov
bx
,
DI
SK_ERROR
call
print
call
print_nl
mov
dh
,
ah
; ah = error code, dl = disk drive that dropped the error
call
print_hex
; check out the code at http://stanislavs.org/helppc/int_13-1.html
jmp
di
sk_loop
jmp
retry
;Try again. Forever.
mov
bx
,
DI
SK_ERROR
call
print
call
print_nl
mov
dh
,
ah
; ah = error code, dl = disk drive that dropped the error
call
print_hex
; check out the code at http://stanislavs.org/helppc/int_13-1.html
;
jmp disk_loop
jmp
retry
;Try again. Forever.
sectors_error:
mov
bx
,
SECTORS_ERROR
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment