Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
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
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
abinade2
kernel
Commits
9007f21b
Commit
9007f21b
authored
7 years ago
by
abinade2
Browse files
Options
Downloads
Patches
Plain Diff
control L partially working
parent
044635de
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
student-distrib/keyboard.c
+7
-5
7 additions, 5 deletions
student-distrib/keyboard.c
student-distrib/keyboard.h
+4
-4
4 additions, 4 deletions
student-distrib/keyboard.h
student-distrib/lib.c
+23
-1
23 additions, 1 deletion
student-distrib/lib.c
student-distrib/lib.h
+1
-0
1 addition, 0 deletions
student-distrib/lib.h
with
35 additions
and
10 deletions
student-distrib/keyboard.c
+
7
−
5
View file @
9007f21b
...
@@ -146,10 +146,10 @@ void KB_init(void) {
...
@@ -146,10 +146,10 @@ void KB_init(void) {
// initialize modifier flags
// initialize modifier flags
enter_flag
[
0
]
=
enter_flag
[
1
]
=
enter_flag
[
2
]
=
0
;
enter_flag
[
0
]
=
enter_flag
[
1
]
=
enter_flag
[
2
]
=
0
;
ctrl_flag
[
0
]
=
ctrl_flag
[
1
]
=
ctrl_flag
[
2
]
=
0
;
caps_flag
=
0
;
caps_flag
=
0
;
alt_flag
=
0
;
alt_flag
=
0
;
ctrl_flag
=
0
;
shift_flag
=
0
;
shift_flag
=
0
;
enable_irq
(
KB_IRQ
);
enable_irq
(
KB_IRQ
);
...
@@ -298,13 +298,13 @@ void KB_handler(void) {
...
@@ -298,13 +298,13 @@ void KB_handler(void) {
case
0x1D
:
//ctrl pressed
case
0x1D
:
//ctrl pressed
ctrl_flag
=
1
;
ctrl_flag
[
visible_terminal
]
=
1
;
send_eoi
(
KB_IRQ
);
send_eoi
(
KB_IRQ
);
return
;
return
;
case
0x9D
:
//ctrl released
case
0x9D
:
//ctrl released
ctrl_flag
=
0
;
ctrl_flag
[
visible_terminal
]
=
0
;
send_eoi
(
KB_IRQ
);
send_eoi
(
KB_IRQ
);
return
;
return
;
...
@@ -352,9 +352,10 @@ void KB_handler(void) {
...
@@ -352,9 +352,10 @@ void KB_handler(void) {
// 0x15 = scancode for L
// 0x15 = scancode for L
// check if ctrl-L is pressed
// check if ctrl-L is pressed
if
(
ctrl_flag
&&
!
shift_flag
&&
pressed_key
==
0x15
)
if
(
ctrl_flag
[
visible_terminal
]
/*
&& !shift_flag
*/
&&
pressed_key
==
0x15
)
{
{
clear
();
//clear();
clear_memory
();
reset_cursor
();
reset_cursor
();
send_eoi
(
KB_IRQ
);
send_eoi
(
KB_IRQ
);
return
;
return
;
...
@@ -384,6 +385,7 @@ void KB_handler(void) {
...
@@ -384,6 +385,7 @@ void KB_handler(void) {
}
}
page_table
[
0xB8
]
=
((
uint32_t
)
0xB8000
)
|
USER
|
READ_WRITE
|
PRESENT
;
page_table
[
0xB8
]
=
((
uint32_t
)
0xB8000
)
|
USER
|
READ_WRITE
|
PRESENT
;
flush_tlb
();
//memcpy( (void*)TERM_VID, (const void*) terminal[visible_terminal].vid_mem, _4_KB );
//memcpy( (void*)TERM_VID, (const void*) terminal[visible_terminal].vid_mem, _4_KB );
...
...
This diff is collapsed.
Click to expand it.
student-distrib/keyboard.h
+
4
−
4
View file @
9007f21b
...
@@ -16,10 +16,10 @@
...
@@ -16,10 +16,10 @@
#define ASCII_SIZE 51
#define ASCII_SIZE 51
// keyboard modifier flags
// keyboard modifier flags
uint8_t
caps_flag
;
uint8_t
caps_flag
;
uint8_t
ctrl
_flag
;
uint8_t
shift
_flag
;
uint8_t
shif
t_flag
;
uint8_t
al
t_flag
;
uint8_t
alt
_flag
;
uint8_t
ctrl
_flag
[
3
]
;
volatile
uint8_t
enter_flag
[
3
];
volatile
uint8_t
enter_flag
[
3
];
/************************ KB driver functions ************************/
/************************ KB driver functions ************************/
...
...
This diff is collapsed.
Click to expand it.
student-distrib/lib.c
+
23
−
1
View file @
9007f21b
...
@@ -17,9 +17,31 @@ static char* video_mem = (char *)VIDEO;
...
@@ -17,9 +17,31 @@ static char* video_mem = (char *)VIDEO;
* Function: Clears video memory */
* Function: Clears video memory */
void
clear
(
void
)
{
void
clear
(
void
)
{
int32_t
i
;
int32_t
i
;
for
(
i
=
0
;
i
<
NUM_ROWS
*
NUM_COLS
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_ROWS
*
NUM_COLS
;
i
++
)
{
*
(
uint8_t
*
)(
video_mem
+
(
i
<<
1
))
=
' '
;
*
(
uint8_t
*
)(
video_mem
+
(
i
<<
1
))
=
' '
;
*
(
uint8_t
*
)(
video_mem
+
(
i
<<
1
)
+
1
)
=
ATTRIB
;
*
(
uint8_t
*
)(
video_mem
+
(
i
<<
1
)
+
1
)
=
ATTRIB
;
}
}
void
clear_memory
(
void
)
{
int32_t
i
;
uint8_t
*
video_memory
;
if
(
running_terminal
==
running_terminal
)
video_memory
=
(
uint8_t
*
)
video_mem
;
else
video_memory
=
(
uint8_t
*
)
terminal
[
visible_terminal
].
vid_mem
;
for
(
i
=
0
;
i
<
NUM_ROWS
*
NUM_COLS
;
i
++
)
{
*
(
uint8_t
*
)(
video_memory
+
(
i
<<
1
))
=
' '
;
*
(
uint8_t
*
)(
video_memory
+
(
i
<<
1
)
+
1
)
=
ATTRIB
;
}
for
(
i
=
0
;
i
<
NUM_ROWS
*
NUM_COLS
;
i
++
)
{
*
(
uint8_t
*
)(
terminal
[
visible_terminal
].
vid_mem
+
(
i
<<
1
))
=
' '
;
*
(
uint8_t
*
)(
terminal
[
visible_terminal
].
vid_mem
+
(
i
<<
1
)
+
1
)
=
ATTRIB
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
student-distrib/lib.h
+
1
−
0
View file @
9007f21b
...
@@ -15,6 +15,7 @@ int8_t *itoa(uint32_t value, int8_t* buf, int32_t radix);
...
@@ -15,6 +15,7 @@ int8_t *itoa(uint32_t value, int8_t* buf, int32_t radix);
int8_t
*
strrev
(
int8_t
*
s
);
int8_t
*
strrev
(
int8_t
*
s
);
uint32_t
strlen
(
const
int8_t
*
s
);
uint32_t
strlen
(
const
int8_t
*
s
);
void
clear
(
void
);
void
clear
(
void
);
void
clear_memory
(
void
);
void
reset_cursor
(
void
);
void
reset_cursor
(
void
);
void
update_cursor
(
int32_t
term_id
);
void
update_cursor
(
int32_t
term_id
);
int32_t
get_screen_x
(
void
);
int32_t
get_screen_x
(
void
);
...
...
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