Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SkavOS
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
pigeonmoelleux
SkavOS
Commits
40e14d56
Verified
Commit
40e14d56
authored
1 year ago
by
pigeonmoelleux
💬
Browse files
Options
Downloads
Patches
Plain Diff
fix(fs): ext2 block group descriptor read
parent
d88e4550
No related branches found
No related tags found
1 merge request
!5
Draft: Resolve "Implement ext2 support"
Pipeline
#12861
failed with stages
in 1 minute and 29 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/fs/ext2/block.rs
+4
-3
4 additions, 3 deletions
src/fs/ext2/block.rs
src/fs/ext2/inode.rs
+0
-1
0 additions, 1 deletion
src/fs/ext2/inode.rs
src/fs/ext2/mod.rs
+0
-3
0 additions, 3 deletions
src/fs/ext2/mod.rs
src/main.rs
+1
-16
1 addition, 16 deletions
src/main.rs
with
5 additions
and
23 deletions
src/fs/ext2/block.rs
+
4
−
3
View file @
40e14d56
...
...
@@ -2,8 +2,6 @@
//!
//! See the [OSdev wiki](https://wiki.osdev.org/Ext2) for more informations
use
core
::
mem
;
use
anyhow
::{
anyhow
,
Result
};
use
bitflags
::
bitflags
;
use
log
::
error
;
...
...
@@ -19,6 +17,9 @@ const BLOCK_GROUP_DESCRIPTOR_TABLE_START_BYTE: usize = 2048;
/// Ext2 signature, used to help confirm the presence of an Ext2 volume
const
EXT2_SIGNATURE
:
u16
=
0xef53
;
/// Size in bytes of a group block descriptor
const
GROUP_BLOCK_DESCRIPTOR_SIZE
:
usize
=
32
;
/// Superblock of the Ext2 filesystem
///
/// This implementation contains also the extended fields described [here](https://wiki.osdev.org/Ext2#Extended_Superblock_Fields)
...
...
@@ -344,6 +345,6 @@ impl BlockGroupDescriptor {
/// Returns the `n`th block group descriptor
pub
fn
new
(
n
:
usize
)
->
Result
<
Self
>
{
// SAFETY: the given offset is coherent with the documentation
unsafe
{
read
::
<
Self
>
(
BLOCK_GROUP_DESCRIPTOR_TABLE_START_BYTE
+
n
*
mem
::
size_of
::
<
Self
>
()
)
}
unsafe
{
read
::
<
Self
>
(
BLOCK_GROUP_DESCRIPTOR_TABLE_START_BYTE
+
n
*
GROUP_BLOCK_DESCRIPTOR_SIZE
)
}
}
}
This diff is collapsed.
Click to expand it.
src/fs/ext2/inode.rs
+
0
−
1
View file @
40e14d56
...
...
@@ -7,7 +7,6 @@ use bitflags::bitflags;
use
super
::
block
::{
BlockGroupDescriptor
,
Superblock
};
use
super
::{
read
,
SUPERBLOCK
};
use
crate
::
println
;
/// Inode index of the root
///
...
...
This diff is collapsed.
Click to expand it.
src/fs/ext2/mod.rs
+
0
−
3
View file @
40e14d56
...
...
@@ -14,7 +14,6 @@ use self::block::Superblock;
use
self
::
inode
::{
Inode
,
ROOT_INODE_INDEX
};
use
crate
::
fs
::
ext2
::
entry
::
Directory
;
use
crate
::
kernel
::
device
::
storage
::
Device
;
use
crate
::
println
;
#[allow(clippy::same_name_method)]
mod
block
;
...
...
@@ -72,8 +71,6 @@ pub fn search(device: &Arc<Mutex<dyn Device + Send>>) -> Result<Arc<Mutex<dyn su
let
root
=
Directory
::
root
(
&
root_inode
)
?
;
// println!("{root:?}");
info!
(
"Found the root of the filesystem : {:?}"
,
root
);
Ok
(
Arc
::
new
(
Mutex
::
new
(
root
)))
...
...
This diff is collapsed.
Click to expand it.
src/main.rs
+
1
−
16
View file @
40e14d56
...
...
@@ -60,6 +60,7 @@
#![feature(error_in_core)]
#![feature(extend_one)]
#![feature(int_roundings)]
#![feature(iter_advance_by)]
#![feature(new_uninit)]
#![feature(no_coverage)]
#![feature(strict_provenance)]
...
...
@@ -98,12 +99,9 @@ use test::exit;
use
user
::
tty
::
print_key
;
#[cfg(not(test))]
use
x86_64
::
instructions
;
use
x86_64
::
structures
::
paging
::
PageTableFlags
;
use
self
::
syslog
::
SYS_LOGGER
;
use
crate
::
kernel
::
interrupt
::
cmos
::
CMOS
;
use
crate
::
kernel
::
interrupt
::
pit
::
sleep
;
use
crate
::
kernel
::
memory
::
vmm
::
VIRTUAL_MEMORY_MANAGER
;
/// Configuration of the bootloader
///
...
...
@@ -149,19 +147,6 @@ fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
let
rtc
=
CMOS
.rtc
();
println!
(
"It is currently : {:0>2}:{:0>2}:{:0>2} (UTC+0)"
,
rtc
.hour
,
rtc
.minute
,
rtc
.second
);
// let page = VIRTUAL_MEMORY_MANAGER
// .lock()
// .as_mut()
// .unwrap()
// .new_page(PageTableFlags::PRESENT | PageTableFlags::WRITABLE);
// println!("{:?}", page);
// loop {
// sleep(1000);
// let rtc = CMOS.rtc();
// println!("It is currently : {:0>2}:{:0>2}:{:0>2} (UTC+0)", rtc.hour, rtc.minute, rtc.second);
// }
let
mut
executor
=
Executor
::
new
();
executor
.spawn
(
Task
::
new
(
print_key
()));
executor
.run
();
...
...
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