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
64f3eeb7
authored
Oct 26, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Keyboard scancode support
parent
404da71e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
src/io.c
src/io.h
src/kern.c
src/io.c
0 → 100644
View file @
64f3eeb7
#include "io.h"
#include "pic.h"
#include "serial.h"
#include "idt.h"
void
kbd_irq
()
{
serial_hexword
(
inb
(
0x60
));
pic_command
(
0
,
PIC_OCW2_EOI
);
}
void
io_init
()
{
install_c_ir
(
33
,
kbd_irq
);
}
src/io.h
0 → 100644
View file @
64f3eeb7
#ifndef _IO_INC
#define _IO_INC
void
kbd_irq
();
void
io_init
();
#endif
src/kern.c
View file @
64f3eeb7
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
#include "multiboot.h"
#include "multiboot.h"
#include "pic.h"
#include "pic.h"
#include "pit.h"
#include "pit.h"
#include "io.h"
// The parameters passed here ultimately come through the bootloader
// The parameters passed here ultimately come through the bootloader
void
kernel_main
(
multiboot_info
*
mbt
,
uint32_t
magic
)
void
kernel_main
(
multiboot_info
*
mbt
,
uint32_t
magic
)
{
{
...
@@ -29,6 +31,7 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
...
@@ -29,6 +31,7 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
disable_int
();
disable_int
();
pic_init
(
0x20
,
0x28
);
pic_init
(
0x20
,
0x28
);
pit_init
();
pit_init
();
io_init
();
pit_start_counter
(
100
,
PIT_OCW_CONT_0
,
PIT_OCW_MODE_SQWVGEN
);
pit_start_counter
(
100
,
PIT_OCW_CONT_0
,
PIT_OCW_MODE_SQWVGEN
);
enable_int
();
enable_int
();
...
...
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