Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
summeros
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
Container 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Byron Lathi
summeros
Commits
d558228d
Commit
d558228d
authored
3 years ago
by
Byron Lathi
Browse files
Options
Downloads
Patches
Plain Diff
actually use variable fb address
turns out that last commit still used a constant lol
parent
dc073fbd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
kernel/Syscalls/syscalls.c
+4
-3
4 additions, 3 deletions
kernel/Syscalls/syscalls.c
kernel/paging.c
+12
-7
12 additions, 7 deletions
kernel/paging.c
kernel/paging.h
+1
-0
1 addition, 0 deletions
kernel/paging.h
with
17 additions
and
10 deletions
kernel/Syscalls/syscalls.c
+
4
−
3
View file @
d558228d
...
...
@@ -5,11 +5,12 @@
int32_t
sys_read
(
int32_t
fd
,
const
void
*
buf
,
int32_t
len
)
{
printf
(
"sysread
\n
"
);
return
-
1
;
}
int32_t
sys_write
(
int32_t
fd
,
const
void
*
buf
,
int32_t
len
)
{
printf
(
"syswrite"
);
return
0
;
printf
(
"syswrite
\n
"
);
return
-
1
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
kernel/paging.c
+
12
−
7
View file @
d558228d
...
...
@@ -55,18 +55,23 @@ void init_paging()
}
int32_t
map_large
(
uint32_t
v_addr
,
uint32_t
p_addr
)
int32_t
k
map_large
(
uint32_t
v_addr
,
uint32_t
p_addr
)
{
page_directory
[
0x3f4
].
present
=
1
;
page_directory
[
0x3f4
].
rw
=
1
;
page_directory
[
0x3f4
].
ps
=
1
;
page_directory
[
0x3f4
].
g
=
1
;
PDIR_SET_ADDR
(
0x3f4
,
0xFD000000
);
uint32_t
dir_index
=
(
uint32_t
)
v_addr
>>
DIR_BIT_OFF
;
if
(
dir_index
>
1023
)
return
-
1
;
page_directory
[
dir_index
].
present
=
1
;
page_directory
[
dir_index
].
rw
=
1
;
page_directory
[
dir_index
].
ps
=
1
;
page_directory
[
dir_index
].
g
=
1
;
PDIR_SET_ADDR
(
dir_index
,
p_addr
);
FLUSH_TLB
();
}
int32_t
map_
2
large
(
uint32_t
v_addr
,
uint32_t
p_addr
)
int32_t
map_large
(
uint32_t
v_addr
,
uint32_t
p_addr
)
{
uint32_t
dir_index
=
(
uint32_t
)
v_addr
>>
DIR_BIT_OFF
;
...
...
This diff is collapsed.
Click to expand it.
kernel/paging.h
+
1
−
0
View file @
d558228d
...
...
@@ -70,6 +70,7 @@ extern ptable_entry_t page_table[PT_SIZE];
/* Initialize Paging */
void
init_paging
(
void
);
int32_t
kmap_large
(
uint32_t
v_addr
,
uint32_t
p_addr
);
int32_t
map_large
(
uint32_t
v_addr
,
uint32_t
p_addr
);
int32_t
map_vmem
(
uint8_t
**
start
);
int32_t
unmap_small
(
uint32_t
*
v_addr
);
...
...
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