Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bootloader
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
Container Registry
Model registry
Operate
Environments
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
redox-os
bootloader
Commits
66a17439
Commit
66a17439
authored
8 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Allow x and y resolution to be saved
parent
cd242698
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
x86_64/bootsector.asm
+63
-0
63 additions, 0 deletions
x86_64/bootsector.asm
x86_64/config.asm
+18
-0
18 additions, 0 deletions
x86_64/config.asm
x86_64/startup-common.asm
+1
-0
1 addition, 0 deletions
x86_64/startup-common.asm
x86_64/vesa.asm
+18
-17
18 additions, 17 deletions
x86_64/vesa.asm
with
100 additions
and
17 deletions
x86_64/bootsector.asm
+
63
−
0
View file @
66a17439
...
@@ -96,6 +96,69 @@ load:
...
@@ -96,6 +96,69 @@ load:
jc
error
jc
error
ret
ret
; store some sectors to disk from a buffer in memory
; buffer has to be below 1MiB
; IN
; ax: start sector
; bx: offset of buffer
; cx: number of sectors (512 Bytes each)
; dx: segment of buffer
; CLOBBER
; ax, bx, cx, dx, si
; TODO rewrite to (eventually) move larger parts at once
; if that is done increase buffer_size_sectors in startup-common to that (max 0x80000 - startup_end)
store:
cmp
cx
,
128
jbe
.good_size
pusha
mov
cx
,
128
call
store
popa
add
ax
,
128
add
dx
,
128
*
512
/
16
sub
cx
,
128
jmp
store
.good_size:
mov
[
DAPACK.addr
],
eax
mov
[
DAPACK.buf
],
bx
mov
[
DAPACK.count
],
cx
mov
[
DAPACK.seg
],
dx
mov
bx
,
[
DAPACK.addr
+
2
]
call
print_num
mov
bx
,
[
DAPACK.addr
]
call
print_num
mov
al
,
'#'
call
print_char
mov
bx
,
[
DAPACK.count
]
call
print_num
mov
al
,
' '
call
print_char
mov
bx
,
[
DAPACK.seg
]
call
print_num
mov
al
,
':'
call
print_char
mov
bx
,
[
DAPACK.buf
]
call
print_num
call
print_line
mov
dl
,
[
di
sk
]
mov
si
,
DAPACK
mov
ah
,
0x43
int
0x13
jc
error
ret
error:
error:
mov
si
,
errored
mov
si
,
errored
call
print
call
print
...
...
This diff is collapsed.
Click to expand it.
x86_64/config.asm
0 → 100644
+
18
−
0
View file @
66a17439
SECTION
.text
USE16
align
512
,
db
0
config:
.xres:
dw
0
.yres:
dw
0
times
512
-
(
$
-
config
)
db
0
save_config:
mov
eax
,
(
config
-
boot
)
/
512
mov
bx
,
config
mov
cx
,
1
xor
dx
,
dx
call
store
ret
This diff is collapsed.
Click to expand it.
x86_64/startup-common.asm
+
1
−
0
View file @
66a17439
...
@@ -83,6 +83,7 @@ finished_loading:
...
@@ -83,6 +83,7 @@ finished_loading:
jmp
startup_arch
jmp
startup_arch
%include "config.asm"
%include "descriptor_flags.inc"
%include "descriptor_flags.inc"
%include "gdt_entry.inc"
%include "gdt_entry.inc"
%include "unreal.asm"
%include "unreal.asm"
...
...
This diff is collapsed.
Click to expand it.
x86_64/vesa.asm
+
18
−
17
View file @
66a17439
...
@@ -15,17 +15,13 @@ vesa:
...
@@ -15,17 +15,13 @@ vesa:
xor
cx
,
cx
xor
cx
,
cx
mov
[
.minx
],
cx
mov
[
.minx
],
cx
mov
[
.miny
],
cx
mov
[
.miny
],
cx
mov
[
.requiredx
],
cx
mov
[
config.xres
],
cx
mov
[
.requiredy
],
cx
mov
[
config.yres
],
cx
mov
[
.requiredmode
],
cx
.findmode:
.findmode:
mov
si
,
[
VBECardInfo.videomodeptr
]
mov
si
,
[
VBECardInfo.videomodeptr
]
mov
ax
,
[
VBECardInfo.videomodeptr
+
2
]
mov
ax
,
[
VBECardInfo.videomodeptr
+
2
]
mov
fs
,
ax
mov
fs
,
ax
sub
si
,
2
sub
si
,
2
mov
cx
,
[
.requiredmode
]
test
cx
,
cx
jnz
.getmodeinfo
.searchmodes:
.searchmodes:
add
si
,
2
add
si
,
2
mov
cx
,
[
fs
:
si
]
mov
cx
,
[
fs
:
si
]
...
@@ -51,9 +47,9 @@ vesa:
...
@@ -51,9 +47,9 @@ vesa:
jb
.searchmodes
jb
.searchmodes
.testx:
.testx:
mov
cx
,
[
VBEModeInfo.xresolution
]
mov
cx
,
[
VBEModeInfo.xresolution
]
cmp
word
[
.requiredx
],
0
cmp
word
[
config.xres
],
0
je
.notrequiredx
je
.notrequiredx
cmp
cx
,
[
.requiredx
]
cmp
cx
,
[
config.xres
]
je
.testy
je
.testy
jmp
.searchmodes
jmp
.searchmodes
.notrequiredx:
.notrequiredx:
...
@@ -61,11 +57,11 @@ vesa:
...
@@ -61,11 +57,11 @@ vesa:
jb
.searchmodes
jb
.searchmodes
.testy:
.testy:
mov
cx
,
[
VBEModeInfo.yresolution
]
mov
cx
,
[
VBEModeInfo.yresolution
]
cmp
word
[
.requiredy
],
0
cmp
word
[
config.yres
],
0
je
.notrequiredy
je
.notrequiredy
cmp
cx
,
[
.requiredy
]
cmp
cx
,
[
config.yres
]
jne
.searchmodes
;as if there weren't enough warnings, USE WITH CAUTION
jne
.searchmodes
;as if there weren't enough warnings, USE WITH CAUTION
cmp
word
[
.requiredx
],
0
cmp
word
[
config.xres
],
0
jnz
.setmode
jnz
.setmode
jmp
.testgood
jmp
.testgood
.notrequiredy:
.notrequiredy:
...
@@ -95,7 +91,16 @@ vesa:
...
@@ -95,7 +91,16 @@ vesa:
int
0x16
int
0x16
pop
esi
pop
esi
cmp
al
,
'y'
cmp
al
,
'y'
jne
.searchmodes
je
.setmode
cmp
al
,
's'
je
.savemode
jmp
.searchmodes
.savemode:
mov
cx
,
[
VBEModeInfo.xresolution
]
mov
[
config.xres
],
cx
mov
cx
,
[
VBEModeInfo.yresolution
]
mov
[
config.yres
],
cx
call
save_config
.setmode:
.setmode:
mov
bx
,
[
.currentmode
]
mov
bx
,
[
.currentmode
]
cmp
bx
,
0
cmp
bx
,
0
...
@@ -114,12 +119,8 @@ vesa:
...
@@ -114,12 +119,8 @@ vesa:
.minx
dw
640
.minx
dw
640
.miny
dw
480
.miny
dw
480
.required:
.requiredx
dw
1024
;USE THESE WITH CAUTION
.requiredy
dw
768
.requiredmode
dw
0
.modeok
db
"
:
Is
this
OK?
(
y
/
n
)
"
,
10
,
13
,
0
.modeok
db
"
:
Is
this
OK?
(
s
)
ave
/
(
y
)
es
/
(
n
)
o
"
,
10
,
13
,
0
.goodmode
dw
0
.goodmode
dw
0
.currentmode
dw
0
.currentmode
dw
0
...
...
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