Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
summeros
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
Container 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
Byron Lathi
summeros
Commits
aa0de544
Commit
aa0de544
authored
3 years ago
by
Byron Lathi
Browse files
Options
Downloads
Patches
Plain Diff
print input in terminal read, make kbd loop nicer
parent
200351a3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kernel/Devices/keyboard.c
+3
-1
3 additions, 1 deletion
kernel/Devices/keyboard.c
kernel/Devices/terminal.c
+1
-0
1 addition, 0 deletions
kernel/Devices/terminal.c
with
4 additions
and
1 deletion
kernel/Devices/keyboard.c
+
3
−
1
View file @
aa0de544
...
...
@@ -92,7 +92,9 @@ uint32_t keyboard_handle_irq()
uint8_t
keyboard_get_key
()
{
while
(
!
flag
);
while
(
!
flag
)
{
asm
volatile
(
"hlt"
);
}
flag
=
0
;
return
last_key
;
...
...
This diff is collapsed.
Click to expand it.
kernel/Devices/terminal.c
+
1
−
0
View file @
aa0de544
...
...
@@ -8,6 +8,7 @@ int32_t terminal_read(int32_t fd, void* buf, int32_t nbytes){
int
bytes_read
=
0
;
while
(
bytes_read
<
nbytes
)
{
uint8_t
key
=
keyboard_get_key
();
putc
(
key
);
if
(
key
==
'\n'
)
{
*
((
uint8_t
*
)
buf
+
bytes_read
)
=
'\0'
;
break
;
...
...
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