Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c068d5cb
authored
Nov 09, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
cleaned up and beautified
parent
0ac748eb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
src/io.c
src/kern.c
src/term.h
src/io.c
View file @
c068d5cb
...
...
@@ -19,7 +19,7 @@ void terminal_writeint(int n)
terminal_writestring
(
f
);
}
void
io_process
(
char
*
s
)
void
io_process
(
char
*
s
,
int
ss
)
{
terminal_putchar
(
'\n'
);
if
(
strncmp
(
s
,
"echo "
,
5
)
==
0
)
...
...
@@ -35,7 +35,7 @@ void io_process(char* s)
}
else
if
(
strncmp
(
s
,
"hex "
,
4
)
==
0
)
{
terminal_hexstring
(
s
+
4
,
16
);
terminal_hexstring
(
s
+
4
,
ss
-
4
);
terminal_putchar
(
'\n'
);
}
else
if
(
strncmp
(
s
,
"push "
,
5
)
==
0
)
...
...
@@ -97,12 +97,13 @@ void kbd_irq()
char
in
=
scan_map
[
a
];
if
(
in
==
'\n'
)
//enter pressed
{
io_process
(
kb_buf
);
io_process
(
kb_buf
,
kb_buf_size
);
for
(
int
i
=
0
;
i
<
kb_buf_size
;
i
++
)
{
kb_buf
[
i
]
=
'\0'
;
}
kb_buf_size
=
0
;
terminal_writestring
(
"> "
);
}
else
if
(
in
==
'\b'
)
{
...
...
src/kern.c
View file @
c068d5cb
...
...
@@ -42,7 +42,7 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
serial_writestring
(
"Hello, kernel World!
\n
"
);
terminal_writestring
(
"Hello, kernel World!
\n
"
);
terminal_writestring
(
"> "
);
// Abort if magic is not correct.
if
(
magic
!=
0x2badb002
)
{
...
...
src/term.h
View file @
c068d5cb
...
...
@@ -38,3 +38,4 @@ void terminal_putchar(char c);
void
terminal_writestring
(
const
char
*
data
);
void
terminal_movecursor
(
size_t
x
,
size_t
y
);
void
terminal_adjustcursor
(
int
x
,
int
y
);
void
terminal_hexstring
(
void
*
s
,
uint32_t
n
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment