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
c9ec8f7a
Verified
Commit
c9ec8f7a
authored
3 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
WIP: VGA
parent
ab2aaa9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib.rs
+56
-0
56 additions, 0 deletions
src/lib.rs
x86/startup-common.asm
+1
-1
1 addition, 1 deletion
x86/startup-common.asm
with
57 additions
and
1 deletion
src/lib.rs
+
56
−
0
View file @
c9ec8f7a
...
...
@@ -2,9 +2,65 @@
#![feature(lang_items)]
#![feature(llvm_asm)]
use
core
::
slice
;
mod
panic
;
#[repr(packed)]
pub
struct
VgaTextBlock
{
char
:
u8
,
color
:
u8
,
}
#[repr(u8)]
pub
enum
VgaTextColor
{
Black
=
0
,
Blue
=
1
,
Green
=
2
,
Cyan
=
3
,
Red
=
4
,
Purple
=
5
,
Brown
=
6
,
Gray
=
7
,
DarkGray
=
8
,
LightBlue
=
9
,
LightGreen
=
10
,
LightCyan
=
11
,
LightRed
=
12
,
LightPurple
=
13
,
Yellow
=
14
,
White
=
15
,
}
#[no_mangle]
pub
unsafe
extern
"C"
fn
kstart
()
->
!
{
let
vga
=
slice
::
from_raw_parts_mut
(
0xb8000
as
*
mut
VgaTextBlock
,
80
*
25
);
for
i
in
0
..
vga
.len
()
{
vga
[
i
]
.char
=
0
;
vga
[
i
]
.color
=
((
VgaTextColor
::
DarkGray
as
u8
)
<<
4
)
|
(
VgaTextColor
::
White
as
u8
);
}
let
draw_text
=
|
vga
:
&
mut
[
VgaTextBlock
],
x
:
usize
,
y
:
usize
,
text
:
&
str
|
{
let
mut
i
=
y
*
80
+
x
;
for
c
in
text
.chars
()
{
if
let
Some
(
block
)
=
vga
.get_mut
(
i
)
{
block
.char
=
c
as
u8
;
}
i
+=
1
;
}
};
draw_text
(
vga
,
10
,
1
,
"Arrow keys and space select mode, enter to continue"
);
loop
{}
}
This diff is collapsed.
Click to expand it.
x86/startup-common.asm
+
1
−
1
View file @
c9ec8f7a
...
...
@@ -46,7 +46,7 @@ startup:
call
memory_map
call
vesa
;TODO
call vesa
mov
si
,
init_fpu_msg
call
print
...
...
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