Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minimalOS
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
y2-shaffan
minimalOS
Commits
1c81f9f5
Commit
1c81f9f5
authored
1 year ago
by
y2-shaffan
Browse files
Options
Downloads
Patches
Plain Diff
Update file kernel.c
parent
bda66c09
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel.c
+17
-18
17 additions, 18 deletions
kernel.c
with
17 additions
and
18 deletions
kernel.c
+
17
−
18
View file @
1c81f9f5
...
@@ -80,12 +80,11 @@ void terminal_setcolor(uint8_t color) {
...
@@ -80,12 +80,11 @@ void terminal_setcolor(uint8_t color) {
}
}
void
terminal_putentryat
(
char
c
,
uint8_t
color
,
size_t
x
,
size_t
y
)
{
void
terminal_putentryat
(
char
c
,
uint8_t
color
,
size_t
x
,
size_t
y
)
{
// Check if the cursor is at the bottom of the screen
if
(
y
==
VGA_HEIGHT
)
{
if
(
y
==
VGA_HEIGHT
)
{
// Scroll the screen up one row
// Scroll the screen up one row
for
(
size_t
i
=
0
;
i
<
VGA_HEIGHT
-
1
;
i
++
)
{
for
(
size_t
i
=
1
;
i
<
VGA_HEIGHT
;
i
++
)
{
for
(
size_t
x
=
0
;
x
<
VGA_WIDTH
;
x
++
)
{
for
(
size_t
j
=
0
;
j
<
VGA_WIDTH
;
j
++
)
{
terminal_buffer
[
i
*
VGA_WIDTH
+
x
]
=
terminal_buffer
[
(
i
+
1
)
*
VGA_WIDTH
+
x
];
terminal_buffer
[
(
i
-
1
)
*
VGA_WIDTH
+
j
]
=
terminal_buffer
[
i
*
VGA_WIDTH
+
j
];
}
}
}
}
// Clear the last row
// Clear the last row
...
@@ -100,14 +99,14 @@ void terminal_putentryat(char c, uint8_t color, size_t x, size_t y) {
...
@@ -100,14 +99,14 @@ void terminal_putentryat(char c, uint8_t color, size_t x, size_t y) {
terminal_buffer
[
index
]
=
make_vgaentry
(
c
,
color
);
terminal_buffer
[
index
]
=
make_vgaentry
(
c
,
color
);
}
}
void
terminal_putchar
(
char
c
)
{
void
terminal_putchar
(
char
c
)
{
if
(
c
==
'\n'
)
{
if
(
c
==
'\n'
)
{
terminal_column
=
0
;
terminal_column
=
0
;
if
(
++
terminal_row
==
VGA_HEIGHT
)
{
if
(
++
terminal_row
==
VGA_HEIGHT
)
{
terminal_row
=
0
;
terminal_row
=
0
;
}
}
}
else
if
(
c
==
'\r'
)
{
terminal_column
=
0
;
}
else
{
}
else
{
terminal_putentryat
(
c
,
terminal_color
,
terminal_column
,
terminal_row
);
terminal_putentryat
(
c
,
terminal_color
,
terminal_column
,
terminal_row
);
if
(
++
terminal_column
==
VGA_WIDTH
)
{
if
(
++
terminal_column
==
VGA_WIDTH
)
{
...
...
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