Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bootloader
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
Container Registry
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
redox-os
bootloader
Commits
73583446
Verified
Commit
73583446
authored
3 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Re-enable support for live kernel
parent
8c7bb57e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/os/uefi/arch/x86_64/mod.rs
+29
-1
29 additions, 1 deletion
src/os/uefi/arch/x86_64/mod.rs
with
29 additions
and
1 deletion
src/os/uefi/arch/x86_64/mod.rs
+
29
−
1
View file @
73583446
...
...
@@ -223,7 +223,35 @@ fn inner() -> Result<()> {
}
println!
(
"Loading Kernel..."
);
let
kernel
=
{
let
kernel
=
if
let
Ok
((
_i
,
mut
kernel_file
))
=
find
(
"
\\
redox_bootloader
\\
kernel"
)
{
let
info
=
kernel_file
.info
()
?
;
let
len
=
info
.FileSize
;
let
kernel
=
unsafe
{
let
ptr
=
allocate_zero_pages
((
len
as
usize
+
page_size
-
1
)
/
page_size
)
?
;
slice
::
from_raw_parts_mut
(
ptr
as
*
mut
u8
,
len
as
usize
)
};
let
mut
i
=
0
;
for
mut
chunk
in
kernel
.chunks_mut
(
4
*
MB
)
{
print!
(
"
\r
{}% - {} MB"
,
i
as
u64
*
100
/
len
,
i
/
MB
);
let
count
=
kernel_file
.read
(
&
mut
chunk
)
?
;
if
count
==
0
{
break
;
}
//TODO: return error instead of assert
assert_eq!
(
count
,
chunk
.len
());
i
+=
count
;
}
println!
(
"
\r
{}% - {} MB"
,
i
as
u64
*
100
/
len
,
i
/
MB
);
kernel
}
else
{
let
mut
fs
=
redoxfs
()
?
;
let
root
=
fs
.header
.1
.root
;
...
...
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