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
b9a2b8b0
authored
Sep 28, 2015
by
triazo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add memory initilization to kernel main
parent
f9adcd73
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
src/kern.c
src/kern.c
View file @
b9a2b8b0
...
@@ -13,8 +13,11 @@
...
@@ -13,8 +13,11 @@
#error "This tutorial needs to be compiled with a ix86-elf compiler"
#error "This tutorial needs to be compiled with a ix86-elf compiler"
#endif
#endif
#include <stdint.h>
#include "serial.h"
#include "serial.h"
#include "term.h"
#include "term.h"
#include "mem.h"
#if defined(__cplusplus)
#if defined(__cplusplus)
extern
"C"
/* Use C linkage for kernel_main. */
extern
"C"
/* Use C linkage for kernel_main. */
...
@@ -31,4 +34,14 @@ void kernel_main() {
...
@@ -31,4 +34,14 @@ void kernel_main() {
serial_writestring
(
"First Serial Test!
\n
"
);
serial_writestring
(
"First Serial Test!
\n
"
);
terminal_writestring
(
"Hello, kernel World!
\n
"
);
terminal_writestring
(
"Hello, kernel World!
\n
"
);
serial_writestring
(
"Second Serial Test
\n
"
);
serial_writestring
(
"Second Serial Test
\n
"
);
// Enable paging of memory. For now there is only one virtual
// memory space defined by page_dir
uint32_t
*
page_dir
;
page_dir
=
initiate_directory
();
initiate_page_table
(
page_dir
);
loadPageDirectory
(
page_dir
);
enablePaging
();
serial_writestring
(
"Finished Initilizing memory
\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