Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
my-kernel
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASE-2021
my-kernel
Commits
de9c88e3
Commit
de9c88e3
authored
4 years ago
by
Thierno souleymane Bah
Browse files
Options
Downloads
Patches
Plain Diff
feat(Numeric caracters and some symbols interpretation added)
parent
7f9c96c5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/keyboard.c
+27
-0
27 additions, 0 deletions
src/keyboard.c
src/main.c
+3
-6
3 additions, 6 deletions
src/main.c
with
30 additions
and
6 deletions
src/keyboard.c
+
27
−
0
View file @
de9c88e3
...
...
@@ -8,6 +8,7 @@ void init_keymapping()
shift_pressed
=
FALSE
;
// alphabetics letters and space
KEY_MAPPING
[
0x1E
]
=
(
key_t
){
'a'
,
'A'
};
KEY_MAPPING
[
0x30
]
=
(
key_t
){
'b'
,
'B'
};
KEY_MAPPING
[
0x2E
]
=
(
key_t
){
'c'
,
'C'
};
...
...
@@ -35,6 +36,32 @@ void init_keymapping()
KEY_MAPPING
[
0x15
]
=
(
key_t
){
'y'
,
'Y'
};
KEY_MAPPING
[
0x2C
]
=
(
key_t
){
'z'
,
'Z'
};
KEY_MAPPING
[
0x39
]
=
(
key_t
){
' '
,
' '
};
// Numeric row
KEY_MAPPING
[
0x02
]
=
(
key_t
){
'1'
,
'!'
};
KEY_MAPPING
[
0x03
]
=
(
key_t
){
'2'
,
'@'
};
KEY_MAPPING
[
0x04
]
=
(
key_t
){
'3'
,
'#'
};
KEY_MAPPING
[
0x05
]
=
(
key_t
){
'4'
,
0
};
KEY_MAPPING
[
0x06
]
=
(
key_t
){
'5'
,
0
};
KEY_MAPPING
[
0x07
]
=
(
key_t
){
'6'
,
0
};
KEY_MAPPING
[
0x08
]
=
(
key_t
){
'7'
,
'&'
};
KEY_MAPPING
[
0x09
]
=
(
key_t
){
'8'
,
0
};
KEY_MAPPING
[
0x0A
]
=
(
key_t
){
'9'
,
'('
};
KEY_MAPPING
[
0x0B
]
=
(
key_t
){
'0'
,
')'
};
KEY_MAPPING
[
0x0C
]
=
(
key_t
){
'-'
,
'_'
};
KEY_MAPPING
[
0x28
]
=
(
key_t
){
'\''
,
'"'
};
// KEY_MAPPING[0x2E] = (key_t){'e', '2'}; // é
// KEY_MAPPING[0x20] = (key_t){'"', '3'};
// KEY_MAPPING[0x12] = (key_t){'\'', '4'};
// KEY_MAPPING[0x21] = (key_t){'(', '5'};
// KEY_MAPPING[0x22] = (key_t){0, '6'}; // §
// KEY_MAPPING[0x23] = (key_t){'e', '7'}; // è
// KEY_MAPPING[0x17] = (key_t){'!', '8'};
// KEY_MAPPING[0x24] = (key_t){'c', '9'}; // ç
// KEY_MAPPING[0x32] = (key_t){'a', '0'}; // à
// KEY_MAPPING[0x25] = (key_t){')', 0}; // °
// KEY_MAPPING[0x26] = (key_t){'-', '_'};
}
char
keyboard_map
(
unsigned
char
code
)
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
3
−
6
View file @
de9c88e3
...
...
@@ -40,18 +40,15 @@ void main(unsigned int *mboot_info)
init_keymapping
();
while
(
1
)
{
// puthex(_inb(0x64));
if
(
_inb
(
0x64
)
==
(
0x1D
))
{
_outb
(
0x64
,
0x1C
);
char
c
=
keyboard_map
(
_inb
(
0x60
));
unsigned
char
s
=
_inb
(
0x60
);
char
c
=
keyboard_map
(
s
);
if
(
c
)
putc
(
c
);
// puthex(
_inb(0x60)
);
// puthex(
s
);
}
// puthex(_inb(0x60));
}
for
(;;)
...
...
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