Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SteveOS16
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
SteveOS16
Commits
1b42e951
Commit
1b42e951
authored
6 years ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
Enabled disk writes, SEDIT buffer saves
parent
dede5d05
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
boot.asm
+3
-5
3 additions, 5 deletions
boot.asm
disk.asm
+19
-7
19 additions, 7 deletions
disk.asm
textedit.asm
+13
-3
13 additions, 3 deletions
textedit.asm
with
35 additions
and
15 deletions
boot.asm
+
3
−
5
View file @
1b42e951
...
...
@@ -28,7 +28,7 @@
call
print
;; testing
;//mov ax, 0x
DE94
;//
/
mov ax, 0x
300
;//call print_hex
;; Load sectors 2 and 3(more OS)
...
...
@@ -36,15 +36,14 @@
mov
dh
,
0
;head
mov
al
,
2
;Num sectors
mov
bx
,
0x7E00
;RAM
call
lo
ad_sector
call
re
ad_sector
mov
al
,
'>'
;cmd line
call
print_char
mov
al
,
' '
call
print_char
loop:
loop:
mov
ah
,
0
int
0x16
;Reads a character to al
cmp
al
,
0x8
;Backspace
...
...
@@ -66,7 +65,6 @@ loop:
jmp
loop
%include "string.asm"
;//%include "textedit.asm"
%include "print.asm"
%include "disk.asm"
...
...
This diff is collapsed.
Click to expand it.
disk.asm
+
19
−
7
View file @
1b42e951
...
...
@@ -3,26 +3,39 @@
;; ch - cylinder number
;; dh - head number
;; es:bx - RAM location
load_sector:
read_sector:
push
ax
mov
ah
,
0x02
call
do_sector
pop
ax
ret
write_sector:
push
ax
mov
ah
,
0x03
call
do_sector
pop
ax
ret
do_sector:
pusha
;preserve registers
mov
[
di
sk_errors
],
byte
0
;Reset error count
mov
ah
,
0x02
mov
dl
,
0x00
;Floppy
loa
d_sector_int:
d
o
_sector_int:
pusha
;registers get changed by int
;; crash here
;; eip register garbage
int
0x13
jc
loa
d_sector_err
;CF set
jc
d
o
_sector_err
;CF set
popa
popa
ret
loa
d_sector_err:
d
o
_sector_err:
;; should count # of times errored
popa
add
[
di
sk_errors
],
byte
1
;Increment err count
cmp
[
di
sk_errors
],
byte
5
jle
loa
d_sector_int
jle
d
o
_sector_int
;; Handle error
shr
ax
,
8
;right binary shift
mov
ah
,
0
...
...
@@ -32,4 +45,3 @@ load_sector_err:
ret
disk_errors:
db
0
db
'X'
This diff is collapsed.
Click to expand it.
textedit.asm
+
13
−
3
View file @
1b42e951
...
...
@@ -2,6 +2,8 @@
sedit_init:
pusha
mov
[
SEDIT_CURSOR_POSITION
],
byte
0
mov
bx
,
SEDIT_INIT_MSG
;Init msg
call
print
...
...
@@ -49,8 +51,7 @@ sedit_enter:
mov
al
,
0xD
call
print_char
mov
al
,
0xA
call
print_char
;Print out the enter
call
print_char
;Print out the enter
jmp
sedit_loop
...
...
@@ -58,9 +59,18 @@ sedit_backspace:
sub
[
SEDIT_CURSOR_POSITION
],
byte
2
;; Backspace the teletype
jmp
sedit_loop
sedit_exit:
;; save buffer
mov
dh
,
0
mov
cx
,
14
;sect & cyl
mov
al
,
2
mov
bx
,
SEDIT_EDITOR_BUFFER
call
write_sector
;; print & exit
mov
bx
,
SEDIT_EXIT_MSG
call
print
popa
...
...
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