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
f9adcd73
authored
Sep 28, 2015
by
triazo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add assembly library to enable paging
parent
e64790c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
src/makefile
src/mem.h
src/paging.asm
src/makefile
View file @
f9adcd73
...
@@ -2,6 +2,7 @@ C=/home/adam/college/kernel/cross/bin/i686-elf-gcc
...
@@ -2,6 +2,7 @@ C=/home/adam/college/kernel/cross/bin/i686-elf-gcc
all
:
all
:
/usr/bin/nasm
-felf32
head.asm
-o
boot.o
/usr/bin/nasm
-felf32
head.asm
-o
boot.o
/usr/bin/nasm
-felf32
paging.asm
$C
*
.c
-std
=
gnu99
-ffreestanding
-O2
-Wall
-Wextra
-c
$C
*
.c
-std
=
gnu99
-ffreestanding
-O2
-Wall
-Wextra
-c
$C
-T
linker.ld
-o
myos.bin
-ffreestanding
-O2
-nostdlib
*
.o
-lgcc
$C
-T
linker.ld
-o
myos.bin
-ffreestanding
-O2
-nostdlib
*
.o
-lgcc
...
...
src/mem.h
View file @
f9adcd73
...
@@ -5,6 +5,10 @@
...
@@ -5,6 +5,10 @@
#pragma once
#pragma once
#include <stdint.h>
#include <stdint.h>
// These two are defined in the assembly file paging.asm
extern
void
loadPageDirectory
(
uint32_t
*
);
extern
void
enablePaging
();
// Defined in the file mem.c
// Defined in the file mem.c
uint32_t
*
initiate_directory
();
uint32_t
*
initiate_directory
();
void
initiate_page_table
(
uint32_t
*
page_dir
);
void
initiate_page_table
(
uint32_t
*
page_dir
);
src/paging.asm
0 → 100644
View file @
f9adcd73
section
.
text
global
loadPageDirectory
loadPageDirectory
:
push
ebp
mov
ebp
,
esp
mov
eax
,
[
esp
+
8
]
mov
cr3
,
eax
mov
esp
,
ebp
pop
ebp
ret
global
enablePaging
enablePaging
:
push
ebp
mov
ebp
,
esp
mov
eax
,
cr0
or
eax
,
0x80000000
mov
cr0
,
eax
mov
esp
,
ebp
pop
ebp
ret
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